Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2020-02-27 10:23:17 +0300
committerGitHub <noreply@github.com>2020-02-27 10:23:17 +0300
commitf28c7fa6cb6c63c8f459206448c7dcb93568099e (patch)
tree55168edfd9c5e2802bf6c0ace2fed4584cb79f52 /plugins/GeoIp2/templates
parentbcbdf42154ff40af6ce8276234ffbae19e0370d4 (diff)
Removes GeoIp Legacy support (#15521)
* Removes GeoIp Legacy support * move rendering provider configuration to the provider, to allow other providers to define an own one * move related translations to GeoIp2 plugin * Adds some UI tests * Apply review feedback
Diffstat (limited to 'plugins/GeoIp2/templates')
-rw-r--r--plugins/GeoIp2/templates/_updaterManage.twig60
-rw-r--r--plugins/GeoIp2/templates/_updaterNextRunTime.twig9
-rw-r--r--plugins/GeoIp2/templates/configuration.twig48
-rw-r--r--plugins/GeoIp2/templates/setupguide.twig9
4 files changed, 126 insertions, 0 deletions
diff --git a/plugins/GeoIp2/templates/_updaterManage.twig b/plugins/GeoIp2/templates/_updaterManage.twig
new file mode 100644
index 0000000000..f110de26da
--- /dev/null
+++ b/plugins/GeoIp2/templates/_updaterManage.twig
@@ -0,0 +1,60 @@
+<div ng-show="locationUpdater.geoipDatabaseInstalled" id="geoipdb-update-info">
+ <p>
+ {{ 'GeoIp2_GeoIPUpdaterInstructions'|translate('<a href="http://www.maxmind.com/?rId=piwik">','</a>','<a rel="noreferrer noopener" href="https://db-ip.com/?refid=mtm">','</a>')|raw }}
+ <br/><br/>
+ {% if dbipLiteUrl|default is not empty %}{{ 'GeoIp2_GeoLiteCityLink'|translate('<a rel="noreferrer noopener" href="'~dbipLiteUrl|e('html_attr')~'">',dbipLiteUrl|e('html'),'</a>')|raw }}{% endif %}
+
+ <span ng-show="locationUpdater.geoipDatabaseInstalled">
+ <br/><br/>{{ 'GeoIp2_GeoIPUpdaterIntro'|translate }}:
+ </span>
+ </p>
+
+ <div piwik-field uicontrol="text" name="geoip-location-db"
+ ng-model="locationUpdater.locationDbUrl"
+ introduction="{{ 'GeoIp2_LocationDatabase'|translate|e('html_attr') }}"
+ data-title="{{ 'Actions_ColumnDownloadURL'|translate|e('html_attr') }}"
+ value="{{ geoIPLocUrl }}"
+ inline-help="{{ 'GeoIp2_LocationDatabaseHint'|translate|e('html_attr') }}">
+ </div>
+
+ <div piwik-field uicontrol="text" name="geoip-isp-db"
+ ng-model="locationUpdater.ispDbUrl"
+ introduction="{{ 'GeoIp2_ISPDatabase'|translate|e('html_attr') }}"
+ data-title="{{ 'Actions_ColumnDownloadURL'|translate|e('html_attr') }}"
+ value="{{ geoIPIspUrl }}">
+ </div>
+
+ <div id="locationProviderUpdatePeriodInlineHelp" class="inline-help-node">
+ {% if lastTimeUpdaterRun is defined and lastTimeUpdaterRun is not empty %}
+ {{ 'GeoIp2_UpdaterWasLastRun'|translate(lastTimeUpdaterRun)|raw }}
+ {% else %}
+ {{ 'GeoIp2_UpdaterHasNotBeenRun'|translate }}
+ {% endif %}
+ <br/><br/>
+ <div id="geoip-updater-next-run-time">
+ {% include "@GeoIp2/_updaterNextRunTime.twig" %}
+ </div>
+ </div>
+
+ <div piwik-field uicontrol="radio" name="geoip-update-period"
+ ng-model="locationUpdater.updatePeriod"
+ introduction="{{ 'GeoIp2_DownloadNewDatabasesEvery'|translate|e('html_attr') }}"
+ value="{{ geoIPUpdatePeriod }}"
+ options="{{ updatePeriodOptions|json_encode }}"
+ inline-help="#locationProviderUpdatePeriodInlineHelp">
+ </div>
+
+ <input type="button"
+ class="btn"
+ ng-click="locationUpdater.saveGeoIpLinks()"
+ ng-value="locationUpdater.buttonUpdateSaveText"/>
+
+ <div>
+ <div id="done-updating-updater"></div>
+ <div id="geoipdb-update-info-error"></div>
+ <div piwik-progressbar
+ progress="locationUpdater.progressUpdateDownload"
+ label="locationUpdater.progressUpdateLabel"
+ ng-show="locationUpdater.isUpdatingGeoIpDatabase"></div>
+ </div>
+</div>
diff --git a/plugins/GeoIp2/templates/_updaterNextRunTime.twig b/plugins/GeoIp2/templates/_updaterNextRunTime.twig
new file mode 100644
index 0000000000..ab5b273be6
--- /dev/null
+++ b/plugins/GeoIp2/templates/_updaterNextRunTime.twig
@@ -0,0 +1,9 @@
+{% if nextRunTime|default is not empty %}
+ {% if date(nextRunTime.getTimestamp()) <= date() %}
+ {{ 'GeoIp2_UpdaterScheduledForNextRun'|translate }}
+ {% else %}
+ {{ 'GeoIp2_UpdaterWillRunNext'|translate('<strong>' ~ nextRunTime.toString() ~ '</strong>')|raw }}
+ {% endif %}
+{% else %}
+ {{ 'GeoIp2_UpdaterIsNotScheduledToRun'|translate }}
+{% endif %} \ No newline at end of file
diff --git a/plugins/GeoIp2/templates/configuration.twig b/plugins/GeoIp2/templates/configuration.twig
new file mode 100644
index 0000000000..729e0f112d
--- /dev/null
+++ b/plugins/GeoIp2/templates/configuration.twig
@@ -0,0 +1,48 @@
+<div piwik-content-block
+ content-title="{% if not geoIPDatabasesInstalled %}{{ 'GeoIp2_GeoIPDatabases'|translate|e('html_attr') }}{% else %}{{ 'GeoIp2_SetupAutomaticUpdatesOfGeoIP'|translate|e('html_attr') }}{% endif %}"
+ id="geoip-db-mangement">
+
+ <div piwik-geoip2-updater
+ geoip-database-installed="{% if geoIPDatabasesInstalled %}1{% else %}0{% endif %}">
+
+ {% if showGeoIPUpdateSection %}
+ {% if not geoIPDatabasesInstalled %}
+ <div ng-show="!locationUpdater.geoipDatabaseInstalled">
+ <div ng-show="locationUpdater.showPiwikNotManagingInfo">
+ <h3>{{ 'GeoIp2_NotManagingGeoIPDBs'|translate|e('html_attr') }}</h3>
+ <div id="manage-geoip-dbs">
+ <div class="row" id="geoipdb-screen1">
+ <div class="geoipdb-column-1 col s6">
+ <p>{{ 'GeoIp2_IWantToDownloadFreeGeoIP'|translate|raw }}</p>
+ </div>
+ <div class="geoipdb-column-2 col s6">
+ <p>{{ 'GeoIp2_IPurchasedGeoIPDBs'|translate('<a rel="noreferrer noopener" href="http://www.maxmind.com/en/geolocation_landing?rId=piwik">','</a>','<a rel="noreferrer noopener" href="https://db-ip.com/db/?refid=mtm">','</a>')|raw }}</p>
+ </div>
+ <div class="geoipdb-column-1 col s6">
+ <input type="button" class="btn"
+ ng-click="locationUpdater.startDownloadFreeGeoIp()"
+ value="{{ 'General_GetStarted'|translate }}..."/>
+ </div>
+ <div class="geoipdb-column-2 col s6">
+ <input type="button" class="btn"
+ ng-click="locationUpdater.startAutomaticUpdateGeoIp()"
+ value="{{ 'General_GetStarted'|translate }}..." id="start-automatic-update-geoip"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="geoipdb-screen2-download" ng-show="locationUpdater.showFreeDownload">
+ <div piwik-progressbar
+ label="{{ ('GeoIp2_DownloadingDb'|translate('<a href="'~dbipLiteUrl~'">'~dbipLiteFilename~'</a>') ~ '...')|json_encode }}"
+ progress="locationUpdater.progressFreeDownload">
+ </div>
+ </div>
+ </div>
+ {% endif %}
+
+ {% include "@GeoIp2/_updaterManage.twig" %}
+ {% else %}
+ <p class="form-description">{{ 'GeoIp2_CannotSetupGeoIPAutoUpdating'|translate }}</p>
+ {% endif %}
+ </div>
+</div> \ No newline at end of file
diff --git a/plugins/GeoIp2/templates/setupguide.twig b/plugins/GeoIp2/templates/setupguide.twig
new file mode 100644
index 0000000000..737ec17fb1
--- /dev/null
+++ b/plugins/GeoIp2/templates/setupguide.twig
@@ -0,0 +1,9 @@
+<h3 style="margin-top:0;">{{ 'GeoIp2_HowToSetupGeoIP'|translate }}</h3>
+<p>{{ 'GeoIp2_HowToSetupGeoIPIntro'|translate }}</p>
+<ul style="list-style:disc !important;margin-left:2em;">
+ <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step1'|translate('<a rel="noreferrer noopener" href="'~dbipLiteUrl~'">','</a>','<a rel="noreferrer noopener" target="_blank" href="http://db-ip.com/?refid=mtm">','</a>')|raw }}</li>
+ <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step2'|translate("'"~dbipLiteFilename~"'",'<strong>','</strong>','<strong>'~dbipLiteDesiredFilename~'</strong>')|raw }}</li>
+ <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step3'|translate('<strong>','</strong>','<span style="color:green"><strong>','</strong></span>')|raw }}</li>
+ <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step4'|translate }}</li>
+</ul>
+<p>&nbsp;</p> \ No newline at end of file