diff --git a/sas/templates/sas/album.jinja b/sas/templates/sas/album.jinja
index ca68379b..4453f580 100644
--- a/sas/templates/sas/album.jinja
+++ b/sas/templates/sas/album.jinja
@@ -10,12 +10,7 @@
{% trans %}SAS{% endtrans %}
{% endblock %}
-{% macro print_path(file) %}
- {% if file and file.parent %}
- {{ print_path(file.parent) }}
- {{ file.get_display_name() }} /
- {% endif %}
-{% endmacro %}
+{% from "sas/macros.jinja" import display_album, print_path %}
{% block content %}
@@ -23,10 +18,10 @@
SAS / {{ print_path(album.parent) }} {{ album.get_display_name() }}
- {% set edit_mode = user.can_edit(album) %}
+ {% set is_sas_admin = user.can_edit(album) %}
{% set start = timezone.now() %}
- {% if edit_mode %}
+ {% if is_sas_admin %}
{% endif %}
diff --git a/sas/templates/sas/macros.jinja b/sas/templates/sas/macros.jinja
new file mode 100644
index 00000000..a7f48618
--- /dev/null
+++ b/sas/templates/sas/macros.jinja
@@ -0,0 +1,32 @@
+{% macro display_album(a, edit_mode) %}
+
+ {% if a.file %}
+ {% set img = a.get_download_url() %}
+ {% elif a.children.filter(is_folder=False, is_moderated=True).exists() %}
+ {% set img = a.children.filter(is_folder=False).first().as_picture.get_download_thumb_url() %}
+ {% else %}
+ {% set img = static('core/img/sas.jpg') %}
+ {% endif %}
+
+ {% if not a.is_moderated %}
+
+
{% trans %}To be moderated{% endtrans %}
+ {% else %}
+
{{ a.name }}
+ {% endif %}
+
+ {% if edit_mode %}
+
+ {% endif %}
+
+{% endmacro %}
+
+{% macro print_path(file) %}
+ {% if file and file.parent %}
+ {{ print_path(file.parent) }}
+ {{ file.get_display_name() }} /
+ {% endif %}
+{% endmacro %}
\ No newline at end of file
diff --git a/sas/templates/sas/main.jinja b/sas/templates/sas/main.jinja
index 8e37759f..ea704fa6 100644
--- a/sas/templates/sas/main.jinja
+++ b/sas/templates/sas/main.jinja
@@ -8,31 +8,9 @@
{% trans %}SAS{% endtrans %}
{% endblock %}
-{% set edit_mode = user.is_in_group(pk=settings.SITH_GROUP_SAS_ADMIN_ID) %}
+{% set is_sas_admin = user.is_root or user.is_in_group(pk=settings.SITH_GROUP_SAS_ADMIN_ID) %}
-{% macro display_album(a, checkbox) %}
-
- {% if a.file %}
- {% set img = a.get_download_url() %}
- {% elif a.children.filter(is_folder=False, is_moderated=True).exists() %}
- {% set img = a.children.filter(is_folder=False).first().as_picture.get_download_thumb_url() %}
- {% else %}
- {% set img = static('core/img/sas.jpg') %}
- {% endif %}
-
-
- {# {% if edit_mode and checkbox %}
-
- {% endif %} #}
-
-{% endmacro %}
+{% from "sas/macros.jinja" import display_album %}
{% block content %}
@@ -46,22 +24,18 @@
{% for a in latest %}
- {{ display_album(a) }}
+ {{ display_album(a, edit_mode=False) }}
{% endfor %}
- {% if edit_mode %}
+ {% if is_sas_admin %}
diff --git a/sas/templates/sas/picture.jinja b/sas/templates/sas/picture.jinja
index 7a2ddc77..977d4f04 100644
--- a/sas/templates/sas/picture.jinja
+++ b/sas/templates/sas/picture.jinja
@@ -8,12 +8,7 @@
{% trans %}SAS{% endtrans %}
{% endblock %}
-{% macro print_path(file) %}
- {% if file and file.parent %}
- {{ print_path(file.parent) }}
- {{ file.get_display_name() }} /
- {% endif %}
-{% endmacro %}
+{% from "sas/macros.jinja" import print_path %}
{% block content %}
@@ -125,11 +120,13 @@