]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: Change watch/unwatch URL schema
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 May 2019 10:54:44 +0000 (11:54 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 May 2019 10:54:44 +0000 (11:54 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/wiki/page.html
src/web/__init__.py
src/web/wiki.py

index e9f99acc66ad3c1649a5b3497250e161f59fa87a..e962400d1097a3a8a68639a02ff11f22ec180d69 100644 (file)
@@ -25,9 +25,9 @@
        <p class="small text-muted">
                {% if current_user %}
                        {% if page.is_watched_by(current_user) %}
-                               <a href="/action/unwatch{{ page.url }}"><span class="fas fa-star" title="{{ _("Stop watching this page") }}"></span></a>
+                               <a href="{{ page.url }}/_unwatch"><span class="fas fa-star" title="{{ _("Stop watching this page") }}"></span></a>
                        {% else %}
-                               <a href="/action/watch{{ page.url }}"><span class="far fa-star" title="{{ _("Watch this page") }}"></span></a>
+                               <a href="{{ page.url }}/_watch"><span class="far fa-star" title="{{ _("Watch this page") }}"></span></a>
                        {% end %} &bull;
                {% end %}
 
index 233debfeff6383cb9a99966399bfa885214af148..d5e7022faa59cf12c149155ec2049723141374c8 100644 (file)
@@ -290,7 +290,7 @@ class Application(tornado.web.Application):
 
                        # Actions
                        (r"([A-Za-z0-9\-_\/]+)?/_edit", wiki.ActionEditHandler),
-                       (r"/action/(watch|unwatch)(.*)", wiki.ActionWatchHandler),
+                       (r"([A-Za-z0-9\-_\/]+)?/_(watch|unwatch)", wiki.ActionWatchHandler),
                        (r"/actions/upload", wiki.ActionUploadHandler),
 
                        # Handlers
index 55c0911a3ff1b678a51dbfd0463f92cfad4b473a..aca1f7b9e0a72066fdc1cb22ee6f231a6b2b9b6a 100644 (file)
@@ -86,7 +86,7 @@ class ActionUploadHandler(auth.CacheMixin, base.BaseHandler):
 
 class ActionWatchHandler(auth.CacheMixin, base.BaseHandler):
        @tornado.web.authenticated
-       def get(self, action, path):
+       def get(self, path, action):
                page = self.backend.wiki.get_page(path)
                if not page:
                        raise tornado.web.HTTPError(404, "Page does not exist: %s" % path)