]> git.ipfire.org Git - ipfire.org.git/commitdiff
docs/modules/list: added a permission checker
authorRico Hoppe <rico.hoppe@ipfire.org>
Sat, 24 Feb 2024 14:01:16 +0000 (14:01 +0000)
committerRico Hoppe <rico.hoppe@ipfire.org>
Sat, 24 Feb 2024 14:01:16 +0000 (14:01 +0000)
src/templates/docs/modules/list.html

index bf635706fa03bdd1018136a12df968b5a7a40bc1..8fe2e2673f888ed4e38fca2cd7811152fdf5e8d4 100644 (file)
@@ -1,42 +1,44 @@
 {% for page in pages %}
-       <div class="block">
-               <p class="is-size-6">
-                       {% if show_breadcrumbs %}
-                               {% for url, title in page.breadcrumbs %}
-                                       <a href="{{ url }}" >{{ title }}</a> /
+       {% if page.check_acl(current_user) %}
+               <div class="block">
+                       <p class="is-size-6">
+                               {% if show_breadcrumbs %}
+                                       {% for url, title in page.breadcrumbs %}
+                                               <a href="{{ url }}" >{{ title }}</a> /
+                                       {% end %}
                                {% end %}
-                       {% end %}
 
-                       <a href="{{ page.url }}{% if link_revision %}?revision={{ page.timestamp.isoformat() }}{% end %}">{{ page.title }}</a>
-               </p>
+                               <a href="{{ page.url }}{% if link_revision %}?revision={{ page.timestamp.isoformat() }}{% end %}">{{ page.title }}</a>
+                       </p>
 
-               <p class="is-size-7">
-                       {% if show_author %}
-                               {{ _("Last edited %s") % locale.format_date(page.timestamp, shorter=True, relative=False) }}
+                       <p class="is-size-7">
+                               {% if show_author %}
+                                       {{ _("Last edited %s") % locale.format_date(page.timestamp, shorter=True, relative=False) }}
 
-                               {% if page.author %}
-                                       {{ _("by") }}
-                                       <a href="/users/{{ page.author.uid }}">{{ page.author }}</a>
+                                       {% if page.author %}
+                                               {{ _("by") }}
+                                               <a href="/users/{{ page.author.uid }}">{{ page.author }}</a>
+                                       {% end %}
                                {% end %}
-                       {% end %}
 
-                       {% if show_changes %}
-                               {% if page.changes %}
-                                       &bull; {{ page.changes }}
+                               {% if show_changes %}
+                                       {% if page.changes %}
+                                               &bull; {{ page.changes }}
+                                       {% end %}
+
+                                       {% if page.previous_revision %}
+                                               <a href="{{ page.url }}?action=diff&a={{ page.previous_revision.timestamp.isoformat() }}&b={{ page.timestamp.isoformat() }}">
+                                                       <span class="fas fa-exchange-alt ml-1"></span>
+                                               </a>
+                                       {% end %}
                                {% end %}
 
-                               {% if page.previous_revision %}
-                                       <a href="{{ page.url }}?action=diff&a={{ page.previous_revision.timestamp.isoformat() }}&b={{ page.timestamp.isoformat() }}">
-                                               <span class="fas fa-exchange-alt ml-1"></span>
+                               {% if not page.is_latest_revision() %}
+                                       <a href="{{ page.url }}?action=restore&revision={{ page.timestamp.isoformat() }}" title="{{ _("Restore") }}">
+                                               <span class="fas fa-undo ml-1"></span>
                                        </a>
                                {% end %}
-                       {% end %}
-
-                       {% if not page.is_latest_revision() %}
-                               <a href="{{ page.url }}?action=restore&revision={{ page.timestamp.isoformat() }}" title="{{ _("Restore") }}">
-                                       <span class="fas fa-undo ml-1"></span>
-                               </a>
-                       {% end %}
-               </p>
-       </div>
+                       </p>
+               </div>
+       {% end %}
 {% end %}