diff --git a/files/classes/user.py b/files/classes/user.py index f7997ef1d..a6b123c06 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -740,3 +740,8 @@ class User(Base): @lazy def lottery_stats(self): return { "winnings": self.total_lottery_winnings, "ticketsHeld": { "current": self.currently_held_lottery_tickets , "total": self.total_held_lottery_tickets } } + + @property + @lazy + def can_create_hole(self): + return self.admin_level >= HOLE_CREATE_JL_MIN diff --git a/files/helpers/const.py b/files/helpers/const.py index 12f250356..efb2d531d 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -140,6 +140,7 @@ AGENDAPOSTER_MSG_HTML = """

Hi {{sub.sidebar_html|safe}} {% endif %} {% if v %} - CREATE HOLE + {% if v.can_create_hole -%} + CREATE HOLE + {%- endif %} {% if v.mods(sub.name) %} HOLE SETTINGS {% endif %} @@ -29,7 +31,9 @@ HOLE FOLLOWERS HOLE BLOCKERS {% else %} - CREATE HOLE + {% if v and v.can_create_hole -%} + CREATE HOLE + {%- endif %} BROWSE HOLES

diff --git a/files/templates/sidebar_PCM.html b/files/templates/sidebar_PCM.html index efb736c4f..819a25107 100644 --- a/files/templates/sidebar_PCM.html +++ b/files/templates/sidebar_PCM.html @@ -19,7 +19,9 @@ HOLE BLOCKERS {% endif %} - CREATE HOLE + {% if v and v.can_create_hole -%} + CREATE HOLE + {%- endif %} BROWSE HOLES STREAM LIST BUGS/SUGGESTIONS MEGATHREAD diff --git a/files/templates/sidebar_WPD.html b/files/templates/sidebar_WPD.html index 56b4e6b34..9a9fb4f11 100644 --- a/files/templates/sidebar_WPD.html +++ b/files/templates/sidebar_WPD.html @@ -19,7 +19,9 @@
{{sub.sidebar_html|safe}}
{% endif %} {% if v %} - CREATE HOLE + {% if v.can_create_hole -%} + CREATE HOLE + {%- endif %} {% if v.mods(sub.name) %} HOLE SETTINGS {% endif %} diff --git a/files/templates/sidebar_rDrama.html b/files/templates/sidebar_rDrama.html index 2275da22b..df68ac4d7 100644 --- a/files/templates/sidebar_rDrama.html +++ b/files/templates/sidebar_rDrama.html @@ -63,7 +63,9 @@ set VISITORS_HERE_FLAVOR = [
{{sub.sidebar_html|safe}}
{% endif %} {% if v %} - CREATE HOLE + {% if v.can_create_hole -%} + CREATE HOLE + {%- endif %} {% if v.mods(sub.name) %} HOLE SETTINGS {% endif %} @@ -78,9 +80,9 @@ set VISITORS_HERE_FLAVOR = [ Submit Marseys & Art | Info Megathreads BROWSE HOLES - {% if v %} + {% if v and v.can_create_hole -%} CREATE HOLE - {% endif %} + {%- endif %}

Rules: