diff --git a/lang/de.json b/lang/de.json index 50d314cd..c52e8f57 100644 --- a/lang/de.json +++ b/lang/de.json @@ -12,6 +12,7 @@ "main:options": "Optionen", "more": "mehr", "more_categories": "Mehr Kategorien", + "more_categories_gitea": "Erstelle und verbessere Kategorien hier!", "open": "geƶffnet", "options:data_lang": "Datensprache", "options:data_lang:local": "Lokale Sprache", diff --git a/lang/en.json b/lang/en.json index 08e8bf46..8bb7dfe5 100644 --- a/lang/en.json +++ b/lang/en.json @@ -12,6 +12,7 @@ "main:options": "Options", "more": "more", "more_categories": "More categories", + "more_categories_gitea": "Create & improve categories yourself!", "open": "open", "options:data_lang": "Data language", "options:data_lang:desc": "Many map features have their name (and other tags) translated to different languages (e.g. with 'name:en', 'name:de'). Specify which language should be used for displaying, or 'Local language' so that always the untranslated value (e.g. 'name') will be used", diff --git a/src/addCategories.js b/src/addCategories.js index f478005f..261351a6 100644 --- a/src/addCategories.js +++ b/src/addCategories.js @@ -54,6 +54,14 @@ function addCategoriesShow (repo) { h.innerHTML = lang('more_categories') content.appendChild(h) + if (typeof repositoriesGitea === 'object' && repositoriesGitea.url) { + var a = document.createElement('a') + a.href = repositoriesGitea.url + a.target = '_blank' + a.innerHTML = lang('more_categories_gitea') + content.appendChild(a) + } + list = weightSort(repoData, { key: 'timestamp', reverse: true diff --git a/src/repositories.php b/src/repositories.php index 07a47532..b14b12f4 100644 --- a/src/repositories.php +++ b/src/repositories.php @@ -57,3 +57,14 @@ function getRepo ($repoId, $repoData) { return $repo; } + +register_hook('init', function () { + global $repositoriesGitea; + + if (isset($repositoriesGitea) && array_key_exists('url', $repositoriesGitea)) { + $d = array('repositoriesGitea' => array( + 'url' => $repositoriesGitea['url'], + )); + html_export_var($d); + } +});