+ {% trans -%}
+ In this page, you can generate short links for any indico URL.
+ Tip: you can also generate short links by using the quick-links in various places within indico!
+ {%- endtrans %}
+
+
+
+
+
+
+{%- endblock %}
diff --git a/ursh/indico_ursh/util.py b/ursh/indico_ursh/util.py
index b9e3a10..105e13a 100644
--- a/ursh/indico_ursh/util.py
+++ b/ursh/indico_ursh/util.py
@@ -16,9 +16,10 @@
from __future__ import unicode_literals
-import requests
from werkzeug.exceptions import ServiceUnavailable
+import requests
+
def request_short_url(original_url):
from indico_ursh.plugin import UrshPlugin
diff --git a/ursh/indico_ursh/views.py b/ursh/indico_ursh/views.py
new file mode 100644
index 0000000..7287625
--- /dev/null
+++ b/ursh/indico_ursh/views.py
@@ -0,0 +1,25 @@
+# This file is part of Indico.
+# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
+#
+# Indico is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+#
+# Indico is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Indico; if not, see .
+
+from __future__ import unicode_literals
+
+from indico.core.plugins import WPJinjaMixinPlugin
+from indico.web.views import WPDecorated
+
+
+class WPShortenURLPage(WPJinjaMixinPlugin, WPDecorated):
+ def _getBody(self, params):
+ return self._getPageContent(params)