]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: Fix editing the index page
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 May 2019 15:02:44 +0000 (16:02 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 May 2019 15:02:44 +0000 (16:02 +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

index bd3a4a535b31c8eda86ed7e777bea64164dc7564..c410a7a40cc358530b8f12dc13fce0eb8a97b169 100644 (file)
@@ -3,6 +3,8 @@
 {% block title %}{{ _("Page Not Found") }}{% end block %}
 
 {% block container %}
+    {% import os.path %}
+
     <section>
         <div class="container">
             <div class="row justify-content-center mt-5">
@@ -15,7 +17,7 @@
                         {{ _("This wiki page does not exist, yet.") }}
                     </p>
 
-                    <a class="btn btn-primary btn-block" href="{{ request.path }}/_edit">
+                    <a class="btn btn-primary btn-block" href="{{ os.path.join(request.path, "_edit") }}">
                         {{ _("Create Now") }}
                     </a>
                 </div>
index 8933b4008b37996fb18460ce76aad4c370c0711c..4969e3b817b7a0e4b0082edb66072a1788c778c4 100644 (file)
@@ -69,6 +69,8 @@
 {% end block %}
 
 {% block javascript %}
+       {% import os.path %}
+
        <script type="text/javascript">
                var update = null;
 
@@ -94,7 +96,7 @@
                                update = setTimeout(function() {
                                        var c = $("#preview-content");
 
-                                       $.post("{{ page.url }}/_render", { content : content },
+                                       $.post("{{ os.path.join(request.path, "_render") }}", { content : content },
                                                function(data) {
                                                        c.html(data);
 
index e962400d1097a3a8a68639a02ff11f22ec180d69..f6814c753167e44c4683751ec112f069bfa0bff4 100644 (file)
 {% end block %}
 
 {% block main %}
+       {% import os.path %}
+
        <div class="card mb-3">
                <div class="card-body wiki-content">
                        {% raw page.html %}
                </div>
        </div>
 
-       <a class="btn btn-primary btn-block mb-3" href="{{ request.path }}/_edit">
+       <a class="btn btn-primary btn-block mb-3" href="{{ os.path.join(request.path, "_edit") }}">
                <span class="fas fa-edit mr-2"></span> {{ _("Edit Page") }}
                {% if not current_user %}&dash; {{ _("Yes, you can edit!") }}{% end %}
        </a>
@@ -25,9 +27,9 @@
        <p class="small text-muted">
                {% if current_user %}
                        {% if page.is_watched_by(current_user) %}
-                               <a href="{{ page.url }}/_unwatch"><span class="fas fa-star" title="{{ _("Stop watching this page") }}"></span></a>
+                               <a href="{{ os.path.join(page.url, "_unwatch") }}"><span class="fas fa-star" title="{{ _("Stop watching this page") }}"></span></a>
                        {% else %}
-                               <a href="{{ page.url }}/_watch"><span class="far fa-star" title="{{ _("Watch this page") }}"></span></a>
+                               <a href="{{ os.path.join(page.url, "_watch") }}"><span class="far fa-star" title="{{ _("Watch this page") }}"></span></a>
                        {% end %} &bull;
                {% end %}