diff --git a/tests-qa/acceptance/230_Moves/190_short_url.robot b/tests-qa/acceptance/230_Moves/190_short_url.robot new file mode 100644 index 0000000000..7b85ca8d77 --- /dev/null +++ b/tests-qa/acceptance/230_Moves/190_short_url.robot @@ -0,0 +1,16 @@ +*** Settings *** +Library RequestsLibrary +Resource ../ressources/vars/Urls.robot +Variables ../ressources/vars/geokrety.yml +Suite Setup Suite Setup + +*** Test Cases *** + +Should Redirect To Form Url + Go To Url url=${GK_URL}/m/${GEOKRETY_1.tc} redirect=${PAGE_MOVES_URL}\\?tracking_code=${GEOKRETY_1.tc} + +*** Keywords *** + +Suite Setup + Clear Database And Seed ${1} users + Seed ${1} geokrety owned by ${1} diff --git a/website/app-templates/smarty/forms/geokret_label.tpl b/website/app-templates/smarty/forms/geokret_label.tpl index 4eafbf86ff..5ffcb8c78c 100644 --- a/website/app-templates/smarty/forms/geokret_label.tpl +++ b/website/app-templates/smarty/forms/geokret_label.tpl @@ -76,6 +76,11 @@ +{if isset($geokret)} + +{/if}

{t}Sample GeoKret label preview{/t}

diff --git a/website/app-templates/smarty/help-pages/en/help.html b/website/app-templates/smarty/help-pages/en/help.html index 2120470f10..ca3e499e7d 100644 --- a/website/app-templates/smarty/help-pages/en/help.html +++ b/website/app-templates/smarty/help-pages/en/help.html @@ -354,7 +354,7 @@

Jigsaw part

- hibernate + hibernate Hibernation / archiving
@@ -559,7 +559,7 @@

The easiest and recommended way is to use our GeoKrety Toolbox (GKT)

Install (GKT)

-
+
@@ -736,7 +736,7 @@
how to edit and delete your log, upload a photo etc
Reference Number and Tracking Code
-
+
diff --git a/website/app/GeoKrety/Controller/Pages/MoveCreate.php b/website/app/GeoKrety/Controller/Pages/MoveCreate.php index 20eae5e6ba..11e86a7c77 100644 --- a/website/app/GeoKrety/Controller/Pages/MoveCreate.php +++ b/website/app/GeoKrety/Controller/Pages/MoveCreate.php @@ -73,6 +73,13 @@ public function get(\Base $f3) { Smarty::render('pages/geokret_move.tpl'); } + // https://geokrety.org/m/XXXXX + public function get_short(\Base $f3) { + $params = $f3->get('GET'); + $params['tracking_code'] = $f3->get('PARAMS.tracking_code'); + $f3->reroute(sprintf('@move_create?%s', http_build_query($params))); + } + public function post(\Base $f3) { $move_data = MovesService::postToArray($f3); diff --git a/website/app/authorizations.ini b/website/app/authorizations.ini index 2b8c3ab741..20d14aeb1a 100644 --- a/website/app/authorizations.ini +++ b/website/app/authorizations.ini @@ -62,6 +62,7 @@ allow @geokrety_legacy_mission = * allow @photo_gallery = * allow @photo_gallery_paginate = * allow @move_create = * +allow @move_create_short = * allow @validate_tracking_code = * allow @validate_waypoint = * allow @validate_waypoint_name = * diff --git a/website/app/config.ini b/website/app/config.ini index 097649de69..28c4d39e64 100644 --- a/website/app/config.ini +++ b/website/app/config.ini @@ -3,7 +3,7 @@ AUTOLOAD = app/ LOCALES = ./app/dict/ [MULTILANG] -global = /app-version, /cli, /cron, /admin, /assets, /auth, /auth-return, /api, /gkt, help_api, health, metrics, reset_database, /devel, s3_file_uploaded, picture_upload_drop_s3_signature, geokrety_labels_pdf, /statistics +global = /app-version, /cli, /cron, /admin, /assets, /auth, /auth-return, /api, /gkt, help_api, health, metrics, reset_database, /devel, s3_file_uploaded, picture_upload_drop_s3_signature, geokrety_labels_pdf, /statistics, move_create_short [MULTILANG.languages] en = en-GB, en-US, en diff --git a/website/app/routes.ini b/website/app/routes.ini index ecdc1d30d8..b815fcf3d3 100644 --- a/website/app/routes.ini +++ b/website/app/routes.ini @@ -137,6 +137,7 @@ POST @geokret_unwatch: /geokrety/@gkid/unwatch = \GeoKrety\Controller\GeokretUn ; Geokret actions GET @geokrety_move_select_from_inventory: /moves/select-from-inventory = \GeoKrety\Controller\GeokretSelectFromInventory->get GET @move_create: /moves = \GeoKrety\Controller\MoveCreate->get +GET @move_create_short: /m/@tracking_code = \GeoKrety\Controller\MoveCreate->get_short POST @move_create: /moves = \GeoKrety\Controller\MoveCreate->post GET @geokrety_move_edit: /moves/@moveid/edit = \GeoKrety\Controller\MoveCreate->get POST @geokrety_move_edit: /moves/@moveid/edit = \GeoKrety\Controller\MoveCreate->post