]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: Change URL type for edits
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 May 2019 10:50:26 +0000 (11:50 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 May 2019 10:50:26 +0000 (11:50 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/wiki/404.html
src/templates/wiki/edit.html
src/templates/wiki/page.html
src/web/__init__.py

index 9fc12c04858fb2691747e9861f53a4a9f738e431..bd3a4a535b31c8eda86ed7e777bea64164dc7564 100644 (file)
@@ -15,7 +15,7 @@
                         {{ _("This wiki page does not exist, yet.") }}
                     </p>
 
-                    <a class="btn btn-primary btn-block" href="/actions/edit/{{ request.path }}">
+                    <a class="btn btn-primary btn-block" href="{{ request.path }}/_edit">
                         {{ _("Create Now") }}
                     </a>
                 </div>
index e96588b3d8d3e2812067860408028763c2d71789..c5bec0ea9f4bff07cacc0dafb0731ea0cadc6c2d 100644 (file)
                                {% if page %}{{ _("Edit %s") % page.title }}{% else %}{{ _("Create A New Page") }}{% end %}
                        </h4>
 
-                       <form action="/actions/edit" method="POST">
+                       <form action="" method="POST">
                                {% raw xsrf_form_html() %}
 
-                               <input type="hidden" name="path" value="{{ request.path }}">
-
                                <div class="form-group">
                                        <textarea class="form-control" rows="16" name="content" placeholder="{{ _("Text") }}"
                                                >{% if page and page.markdown %}{{ page.markdown }}{% end %}</textarea>
index c6ba9e3fa52152025851ff8a6e5769c6d7dd751e..e9f99acc66ad3c1649a5b3497250e161f59fa87a 100644 (file)
@@ -17,7 +17,7 @@
                </div>
        </div>
 
-       <a class="btn btn-primary btn-block mb-3" href="/actions/edit{{ request.path }}">
+       <a class="btn btn-primary btn-block mb-3" href="{{ request.path }}/_edit">
                <span class="fas fa-edit mr-2"></span> {{ _("Edit Page") }}
                {% if not current_user %}&dash; {{ _("Yes, you can edit!") }}{% end %}
        </a>
index 7535e68629e4037a6846bb841aa031c1ef5af366..233debfeff6383cb9a99966399bfa885214af148 100644 (file)
@@ -289,7 +289,7 @@ class Application(tornado.web.Application):
                        authentication_handlers + [
 
                        # Actions
-                       (r"/actions/edit([A-Za-z0-9\-_\/]+)", wiki.ActionEditHandler),
+                       (r"([A-Za-z0-9\-_\/]+)?/_edit", wiki.ActionEditHandler),
                        (r"/action/(watch|unwatch)(.*)", wiki.ActionWatchHandler),
                        (r"/actions/upload", wiki.ActionUploadHandler),