This now will ignore any actions at the end of the URL
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
{% end %}
<li class="breadcrumb-item {% if not suffix %}active{% end %}">
{% end %}
<li class="breadcrumb-item {% if not suffix %}active{% end %}">
+ <a href="{{ page }}">{{ page_title }}</a>
class WikiNavbarModule(ui_modules.UIModule):
class WikiNavbarModule(ui_modules.UIModule):
+ @property
+ def path(self):
+ """
+ Returns the path of the page (without any actions)
+ """
+ path = self.request.path.split("/")
+
+ if path and path[-1].startswith("_"):
+ path.pop()
+
+ return "/".join(path)
+
def render(self, suffix=None):
_ = self.locale.translate
def render(self, suffix=None):
_ = self.locale.translate
- breadcrumbs = self.backend.wiki.make_breadcrumbs(self.request.path)
+ # Make the path
+ page = self.request.path.split("/")
- # Don't search for a title for the file manager
- if self.request.path.endswith("/files"):
- title = _("Files")
- else:
- title = self.backend.wiki.get_page_title(self.request.path)
+ # Drop the action bit
+ if page and page[-1].startswith("_"):
+ page.pop()
+
+ page = "/".join(page)
+
+ breadcrumbs = self.backend.wiki.make_breadcrumbs(page)
+ title = self.backend.wiki.get_page_title(page)
+
+ if self.request.path.endswith("/_edit"):
+ suffix = _("Edit")
+ elif self.request.path.endswith("/_files"):
+ suffix = _("Files")
return self.render_string("wiki/modules/navbar.html",
return self.render_string("wiki/modules/navbar.html",
- breadcrumbs=breadcrumbs, page_title=title, suffix=suffix)
+ breadcrumbs=breadcrumbs, page=page, page_title=title, suffix=suffix)