diff options
author | Fabian Becker <halfdan@xnorfz.de> | 2013-04-07 05:56:57 +0400 |
---|---|---|
committer | Fabian Becker <halfdan@xnorfz.de> | 2013-04-07 05:56:57 +0400 |
commit | 862984d6f1104eb99916c6d090acc66c84510788 (patch) | |
tree | 634fe1bca147ee49791cf4b85adf8e04cc97336a /plugins/UserCountry/templates | |
parent | 8936e78da2dd3bc4385c7b0b01c08d83d012dcae (diff) |
Converted rest of UserCountry plugin in Twig
Diffstat (limited to 'plugins/UserCountry/templates')
-rwxr-xr-x | plugins/UserCountry/templates/adminIndex.tpl | 131 | ||||
-rwxr-xr-x | plugins/UserCountry/templates/adminIndex.twig | 134 | ||||
-rwxr-xr-x | plugins/UserCountry/templates/updaterSetup.tpl | 65 | ||||
-rwxr-xr-x | plugins/UserCountry/templates/updaterSetup.twig | 66 |
4 files changed, 200 insertions, 196 deletions
diff --git a/plugins/UserCountry/templates/adminIndex.tpl b/plugins/UserCountry/templates/adminIndex.tpl deleted file mode 100755 index 2a40f652c0..0000000000 --- a/plugins/UserCountry/templates/adminIndex.tpl +++ /dev/null @@ -1,131 +0,0 @@ -{loadJavascriptTranslations plugins='UserCountry'} -{include file="CoreAdminHome/templates/header.tpl"} - -<h2 id="location-providers">{'UserCountry_Geolocation'|translate}</h2> - -<div style="width:900px"> - - <p>{'UserCountry_GeolocationPageDesc'|translate}</p> - - {if !$isThereWorkingProvider} - <h3 style="margin-top:0">{'UserCountry_HowToSetupGeoIP'|translate}</h3> - <p>{'UserCountry_HowToSetupGeoIPIntro'|translate}</p> - <ul style="list-style:disc;margin-left:2em"> - <li>{'UserCountry_HowToSetupGeoIP_Step1'|translate:'<a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz">':'</a>':'<a target="_blank" href="http://www.maxmind.com/?rId=piwik">':'</a>'}</li> - <li>{'UserCountry_HowToSetupGeoIP_Step2'|translate:"'GeoLiteCity.dat'":'<strong>':'</strong>'}</li> - <li>{'UserCountry_HowToSetupGeoIP_Step3'|translate:'<strong>':'</strong>':'<span style="color:green"><strong>':'</strong></span>'}</li> - <li>{'UserCountry_HowToSetupGeoIP_Step4'|translate}</li> - </ul> - <p> </p> - {/if} - - <table class="adminTable locationProviderTable"> - <tr> - <th>{'UserCountry_LocationProvider'|translate}</th> - <th>{'General_Description'|translate}</th> - <th>{'General_InfoFor'|translate:$thisIP}</th> - </tr> - {foreach from=$locationProviders key=id item=provider} - <tr> - <td width="140"> - <p> - <input class="location-provider" name="location-provider" value="{$id}" type="radio" {if $currentProviderId eq $id}checked="checked"{/if} - id="provider_input_{$id}" {if $provider.status neq 1}disabled="disabled"{/if}/> - <label for="provider_input_{$id}">{$provider.title|translate}</label><br/> - <span class='loadingPiwik' style='display:none'><img src='./themes/default/images/loading-blue.gif'/></span> - <span class="ajaxSuccess" style='display:none'>{'General_Done'|translate}</span> - </p> - - <p class="loc-provider-status"> - <strong><em> - {if $provider.status eq 0} - <span class="is-not-installed">{'General_NotInstalled'|translate}</span> - {elseif $provider.status eq 1} - <span class="is-installed">{'General_Installed'|translate}</span> - {elseif $provider.status eq 2} - <span class="is-broken">{'General_Broken'|translate}</span> - {/if} - </em></strong> - </p> - </td> - <td> - <p>{$provider.description|translate}</p> - {if $provider.status neq 1 && isset($provider.install_docs)} - <p>{$provider.install_docs}</p> - {/if} - </td> - <td width="164"> - {if $provider.status eq 1} - {capture assign=currentLocation} - {if $thisIP neq '127.0.0.1'} - {'UserCountry_CurrentLocationIntro'|translate}: - <div style="text-align:left;"> - <br/> - <span class='loadingPiwik' style='display:none;position:absolute'><img - src='./themes/default/images/loading-blue.gif'/> {'General_Loading_js'|translate}</span> - <span class='location'><strong><em>{$provider.location}</em></strong></span> - </div> - <div style="text-align:right;"> - <a href="#" class="refresh-loc" data-impl-id="{$id}"><em>{'Dashboard_Refresh_js'|translate}</em></a> - </div> - {else} - {'UserCountry_CannotLocalizeLocalIP'|translate:$thisIP} - {/if} - {/capture} - {$currentLocation|inlineHelp} - {/if} - {if isset($provider.statusMessage) && $provider.statusMessage} - {capture assign=brokenReason} - {if $provider.status eq 2}<strong><em>{'General_Error'|translate}:</strong></em> {/if}{$provider.statusMessage} - {/capture} - {$brokenReason|inlineHelp} - {/if} - {if isset($provider.extra_message) && $provider.extra_message} - {capture assign=extraMessage} - {$provider.extra_message} - {/capture} - <br/> - {$extraMessage|inlineHelp} - {/if} - </td> - {/foreach} - </table> - -</div> - -{if !$geoIPDatabasesInstalled} - <h2 id="geoip-db-mangement">{'UserCountry_GeoIPDatabases'|translate}</h2> -{else} - <h2 id="geoip-db-mangement">{'UserCountry_SetupAutomaticUpdatesOfGeoIP_js'|translate}</h2> -{/if} - -{if $showGeoIPUpdateSection} - <div id="manage-geoip-dbs" style="width:900px" class="adminTable"> - - {if !$geoIPDatabasesInstalled} - <div id="geoipdb-screen1"> - <p>{'UserCountry_PiwikNotManagingGeoIPDBs'|translate}</p> - - <div class="geoipdb-column-1"> - <p>{'UserCountry_IWantToDownloadFreeGeoIP'|translate}</p> - <input type="button" class="submit" value="{'General_GetStarted'|translate}..." id="start-download-free-geoip"/> - </div> - <div class="geoipdb-column-2"> - <p>{'UserCountry_IPurchasedGeoIPDBs'|translate:'<a href="http://www.maxmind.com/en/geolocation_landing?rId=piwik">':'</a>'}</p> - <input type="button" class="submit" value="{'General_GetStarted'|translate}..." id="start-automatic-update-geoip"/> - </div> - </div> - <div id="geoipdb-screen2-download" style="display:none"> - <p class='loadingPiwik'><img src='./themes/default/images/loading-blue.gif'/> - {'UserCountry_DownloadingDb'|translate:"<a href=\"$geoLiteUrl\">GeoLiteCity.dat</a>"}...</p> - <div id="geoip-download-progress"></div> -</div> -{/if} -{include file="UserCountry/templates/updaterSetup.tpl"} -{else} -<p style="width:900px" class="form-description">{'UserCountry_CannotSetupGeoIPAutoUpdating'|translate}</p> -{/if} -</div> - -{include file="CoreAdminHome/templates/footer.tpl"} - diff --git a/plugins/UserCountry/templates/adminIndex.twig b/plugins/UserCountry/templates/adminIndex.twig new file mode 100755 index 0000000000..daa5ee1afa --- /dev/null +++ b/plugins/UserCountry/templates/adminIndex.twig @@ -0,0 +1,134 @@ +{% extends 'admin.twig' %} + +{% block content %} +{% import 'macros.twig' as piwik %} +{{ loadJavascriptTranslations(['UserCountry'])|raw }} + +<h2 id="location-providers">{{ 'UserCountry_Geolocation'|translate }}</h2> + +<div style="width:900px"> + + <p>{{ 'UserCountry_GeolocationPageDesc'|translate }}</p> + + {% if not isThereWorkingProvider %} + <h3 style="margin-top:0">{{ 'UserCountry_HowToSetupGeoIP'|translate }}</h3> + <p>{{ 'UserCountry_HowToSetupGeoIPIntro'|translate }}</p> + <ul style="list-style:disc;margin-left:2em"> + <li>{{ 'UserCountry_HowToSetupGeoIP_Step1'|translate('<a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz">','</a>','<a target="_blank" href="http://www.maxmind.com/?rId=piwik">','</a>')|raw }}</li> + <li>{{ 'UserCountry_HowToSetupGeoIP_Step2'|translate("'GeoLiteCity.dat'",'<strong>','</strong>')|raw }}</li> + <li>{{ 'UserCountry_HowToSetupGeoIP_Step3'|translate('<strong>','</strong>','<span style="color:green"><strong>','</strong></span>')|raw }}</li> + <li>{{ 'UserCountry_HowToSetupGeoIP_Step4'|translate }}</li> + </ul> + <p> </p> + {% endif %} + + <table class="adminTable locationProviderTable"> + <tr> + <th>{{ 'UserCountry_LocationProvider'|translate }}</th> + <th>{{ 'General_Description'|translate }}</th> + <th>{{ 'General_InfoFor'|translate(thisIP) }}</th> + </tr> + {% for id,provider in locationProviders %} + <tr> + <td width="140"> + <p> + <input class="location-provider" name="location-provider" value="{$id}" type="radio" {% if currentProviderId == id %}checked="checked"{% endif %} + id="provider_input_{$id}" {% if provider.status != 1}disabled="disabled"{% endif %}/> + <label for="provider_input_{$id}">{{ provider.title|translate }}</label><br/> + <span class='loadingPiwik' style='display:none'><img src='./themes/default/images/loading-blue.gif'/></span> + <span class="ajaxSuccess" style='display:none'>{{ 'General_Done'|translate }}</span> + </p> + + <p class="loc-provider-status"> + <strong><em> + {% if provider.status == 0 %} + <span class="is-not-installed">{{ 'General_NotInstalled'|translate}}</span> + {% elseif provider.status == 1 %} + <span class="is-installed">{{ 'General_Installed'|translate }}</span> + {% elseif provider.status == 2 %} + <span class="is-broken">{{ 'General_Broken'|translate }}</span> + {% endif %} + </em></strong> + </p> + </td> + <td> + <p>{{ provider.description|translate }}</p> + {% if provider.status != 1 and provider.install_docs is defined %} + <p>{{ provider.install_docs }}</p> + {% endif %} + </td> + <td width="164"> + {% if provider.status == 1 %} + {% set currentLocation %} + {% if thisIP != '127.0.0.1' %} + {{ 'UserCountry_CurrentLocationIntro'|translate }}: + <div style="text-align:left;"> + <br/> + <span class='loadingPiwik' style='display:none;position:absolute'><img + src='./themes/default/images/loading-blue.gif'/> {{ 'General_Loading_js'|translate }}</span> + <span class='location'><strong><em>{{ provider.location }}</em></strong></span> + </div> + <div style="text-align:right;"> + <a href="#" class="refresh-loc" data-impl-id="{$id}"><em>{{ 'Dashboard_Refresh_js'|translate }}</em></a> + </div> + {% else %} + {{ 'UserCountry_CannotLocalizeLocalIP'|translate(thisIP) }} + {% endif %} + {% endset %}} + {{ piwik.inlineHelp(currentLocation) }} + {% endif %} + {% if provider.statusMessage is defined and provider.statusMessage %} + {% set brokenReason %} + {% if provider.status == 2 %}<strong><em>{{ 'General_Error'|translate }}:</strong></em> {% endif %}{{ provider.statusMessage }} + {% endset %} + {{ piwik.inlineHelp(brokenReason) }} + {/if} + {% if provider.extra_message is defined and provider.extra_message %} + {% set extraMessage %} + {{ provider.extra_message }} + {% endset %} + <br/> + {{ piwik.inlineHelp(extraMessage) }} + {% endif %} + </td> + {% endfor %} + </table> + +</div> + +{% if not geoIPDatabasesInstalled %} + <h2 id="geoip-db-mangement">{{ 'UserCountry_GeoIPDatabases'|translate }}</h2> +{% else %} + <h2 id="geoip-db-mangement">{{ 'UserCountry_SetupAutomaticUpdatesOfGeoIP_js'|translate }}</h2> +{% endif %} + +{% if showGeoIPUpdateSection %} + <div id="manage-geoip-dbs" style="width:900px" class="adminTable"> + + {% if not geoIPDatabasesInstalled %} + <div id="geoipdb-screen1"> + <p>{{ 'UserCountry_PiwikNotManagingGeoIPDBs'|translate }}</p> + + <div class="geoipdb-column-1"> + <p>{{ 'UserCountry_IWantToDownloadFreeGeoIP'|translate }}</p> + <input type="button" class="submit" value="{{ 'General_GetStarted'|translate }}..." id="start-download-free-geoip"/> + </div> + <div class="geoipdb-column-2"> + <p>{{ 'UserCountry_IPurchasedGeoIPDBs'|translate('<a href="http://www.maxmind.com/en/geolocation_landing?rId=piwik">','</a>') }}</p> + <input type="button" class="submit" value="{{ 'General_GetStarted'|translate }}..." id="start-automatic-update-geoip"/> + </div> + </div> + <div id="geoipdb-screen2-download" style="display:none"> + <p class='loadingPiwik'><img src='./themes/default/images/loading-blue.gif'/> + {{ 'UserCountry_DownloadingDb'|translate('<a href="'+geoLiteUrl+'">GeoLiteCity.dat</a>') }}...</p> + <div id="geoip-download-progress"></div> + </div> + {% endif %} + {% include "@UserCountry/updaterSetup.twig" %} +{% else %} +<p style="width:900px" class="form-description">{{ 'UserCountry_CannotSetupGeoIPAutoUpdating'|translate }}</p> +{% endif %} +</div> + +{% endblock %} + diff --git a/plugins/UserCountry/templates/updaterSetup.tpl b/plugins/UserCountry/templates/updaterSetup.tpl deleted file mode 100755 index 7f29616de5..0000000000 --- a/plugins/UserCountry/templates/updaterSetup.tpl +++ /dev/null @@ -1,65 +0,0 @@ -<div id="geoipdb-update-info" {if !$geoIPDatabasesInstalled}style="display:none"{/if}> - <p>{'UserCountry_GeoIPUpdaterInstructions'|translate:'<a href="http://www.maxmind.com/en/download_files?rId=piwik" _target="blank">':'</a>':'<a href="http://www.maxmind.com/?rId=piwik">':'</a>'} - <br/><br/> -{'UserCountry_GeoLiteCityLink'|translate:"<a href=\"$geoLiteUrl\">":$geoLiteUrl:'</a>'} - {if $geoIPDatabasesInstalled} - <br/><br/>{'UserCountry_GeoIPUpdaterIntro'|translate}: - {/if} - </p> - <table class="adminTable" style="width:900px"> - <tr> - <th>{'Live_GoalType'|translate}</th> - <th>{'Actions_ColumnDownloadURL'|translate}</th> - <th></th> - </tr> - <tr> - <td width="140">{'UserCountry_LocationDatabase'|translate}</td> - <td><input type="text" id="geoip-location-db" value="{$geoIPLocUrl}"/></td> - <td width="164"> - {capture assign=locationHint} - {'UserCountry_LocationDatabaseHint'|translate} - {/capture} - {$locationHint|inlineHelp} - </td> - </tr> - <tr> - <td width="140">{'UserCountry_ISPDatabase'|translate}</td> - <td><input type="text" id="geoip-isp-db" value="{$geoIPIspUrl}"/></td> - </tr> - <tr> - <td width="140">{'UserCountry_OrgDatabase'|translate}</td> - <td><input type="text" id="geoip-org-db" value="{$geoIPOrgUrl}"/></td> - </tr> - <tr> - <td width="140">{'UserCountry_DownloadNewDatabasesEvery'|translate}</td> - <td id="geoip-update-period-cell"> - <input type="radio" name="geoip-update-period" value="month" id="geoip-update-period-month" {if $geoIPUpdatePeriod eq 'month'}checked="checked"{/if}/> - <label for="geoip-update-period-month">{'CoreHome_PeriodMonth'|translate}</label> - - <input type="radio" name="geoip-update-period" value="week" id="geoip-update-period-week" {if $geoIPUpdatePeriod eq 'week'}checked="checked"{/if}/> - <label for="geoip-update-period-week">{'CoreHome_PeriodWeek'|translate}</label> - </td> - <td width="164"> - {capture assign=lastTimeRunNote} - {if !empty($lastTimeUpdaterRun)} - {'UserCountry_UpdaterWasLastRun'|translate:$lastTimeUpdaterRun} - {else} - {'UserCountry_UpdaterHasNotBeenRun'|translate} - {/if} - {/capture} - {$lastTimeRunNote|inlineHelp} - </td> - </tr> - </table> - <p style="display:inline-block;vertical-align:top"> - <input type="button" class="submit" value="{if !$geoIPDatabasesInstalled}{'General_Continue'|translate}{else}{'General_Save'|translate}{/if}" id="update-geoip-links"/> - </p> - <div style="display:inline-block;width:700px"> - <span style="display:none" class="ajaxSuccess" id="done-updating-updater">{'General_Done'|translate}!</span> - <span id="geoipdb-update-info-error" style="display:none" class="error"></span> - <div id="geoip-progressbar-container" style="display:none"> - <div id="geoip-updater-progressbar"></div> - <span id="geoip-updater-progressbar-label"></span> - </div> - </div> -</div> diff --git a/plugins/UserCountry/templates/updaterSetup.twig b/plugins/UserCountry/templates/updaterSetup.twig new file mode 100755 index 0000000000..810fefe146 --- /dev/null +++ b/plugins/UserCountry/templates/updaterSetup.twig @@ -0,0 +1,66 @@ +<div id="geoipdb-update-info" {% if not geoIPDatabasesInstalled %}style="display:none"{% endif %}> + <p>{{ 'UserCountry_GeoIPUpdaterInstructions'|translate('<a href="http://www.maxmind.com/en/download_files?rId=piwik" _target="blank">','</a>','<a href="http://www.maxmind.com/?rId=piwik">','</a>') }} + <br/><br/> +{{ 'UserCountry_GeoLiteCityLink'|translate("<a href='"+geoLiteUrl+"'>",geoLiteUrl,'</a>') }} + {% if geoIPDatabasesInstalled %} + <br/><br/>{{ 'UserCountry_GeoIPUpdaterIntro'|translate }}: + {% endif %} + </p> + <table class="adminTable" style="width:900px"> + <tr> + <th>{{ 'Live_GoalType'|translate }}</th> + <th>{{ 'Actions_ColumnDownloadURL'|translate }}</th> + <th></th> + </tr> + <tr> + <td width="140">{{ 'UserCountry_LocationDatabase'|translate }}</td> + <td><input type="text" id="geoip-location-db" value="{{ geoIPLocUrl }}"/></td> + <td width="164"> + {% set locationHint %} + {{ 'UserCountry_LocationDatabaseHint'|translate }} + {% endset %} + {% import 'macros.twig' as piwik %} + {{ piwik.inlineHelp(locationHint) }} + </td> + </tr> + <tr> + <td width="140">{{ 'UserCountry_ISPDatabase'|translate }}</td> + <td><input type="text" id="geoip-isp-db" value="{{ geoIPIspUrl }}"/></td> + </tr> + <tr> + <td width="140">{{ 'UserCountry_OrgDatabase'|translate }}</td> + <td><input type="text" id="geoip-org-db" value="{{ geoIPOrgUrl }}"/></td> + </tr> + <tr> + <td width="140">{{ 'UserCountry_DownloadNewDatabasesEvery'|translate }}</td> + <td id="geoip-update-period-cell"> + <input type="radio" name="geoip-update-period" value="month" id="geoip-update-period-month" {% if geoIPUpdatePeriod == 'month' %}checked="checked"{% endif %} /> + <label for="geoip-update-period-month">{{ 'CoreHome_PeriodMonth'|translate }}</label> + + <input type="radio" name="geoip-update-period" value="week" id="geoip-update-period-week" {% if geoIPUpdatePeriod == 'week' %}checked="checked"{% endif %}/> + <label for="geoip-update-period-week">{{ 'CoreHome_PeriodWeek'|translate }}</label> + </td> + <td width="164"> + {% set lastTimeRunNote %} + {% if lastTimeUpdaterRun is not empty %} + {{ 'UserCountry_UpdaterWasLastRun'|translate(lastTimeUpdaterRun) }} + {% else %} + {{ 'UserCountry_UpdaterHasNotBeenRun'|translate }} + {% endif %} + {% endset %} + {{ piwik.inlineHelp(lastTimeRunNote) }} + </td> + </tr> + </table> + <p style="display:inline-block;vertical-align:top"> + <input type="button" class="submit" value="{% if not geoIPDatabasesInstalled %}{{ 'General_Continue'|translate }}{% else %}{{ 'General_Save'|translate }}{% endif %}" id="update-geoip-links"/> + </p> + <div style="display:inline-block;width:700px"> + <span style="display:none" class="ajaxSuccess" id="done-updating-updater">{{ 'General_Done'|translate }}!</span> + <span id="geoipdb-update-info-error" style="display:none" class="error"></span> + <div id="geoip-progressbar-container" style="display:none"> + <div id="geoip-updater-progressbar"></div> + <span id="geoip-updater-progressbar-label"></span> + </div> + </div> +</div> |