forked from rDrama/rDrama
disable "GIVE AWARD" button on carp and pizzashill
parent
ce3d08c294
commit
95a0edf070
|
@ -1296,11 +1296,6 @@ nav
|
|||
.nav-link:hover, .nav-link:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
.disabled {
|
||||
color: #6c757d !important;
|
||||
pointer-events: none !important;
|
||||
cursor: default !important;
|
||||
}
|
||||
.nav-pills .nav-link {
|
||||
border-radius: 0.35rem;
|
||||
}
|
||||
|
@ -7233,3 +7228,9 @@ button, .btn {
|
|||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
[disabled], .disabled, button[disabled], .btn[disabled], button.disabled, .btn.disabled {
|
||||
color: #6c757d !important;
|
||||
pointer-events: none !important;
|
||||
cursor: default !important;
|
||||
}
|
||||
|
|
|
@ -666,6 +666,8 @@ TGTW_ID = 0
|
|||
IDIO_ID = 0
|
||||
SNALLY_ID = 0
|
||||
|
||||
IMMUNE_TO_AWARDS = {}
|
||||
|
||||
MODMAIL_ID = 2
|
||||
GIFT_NOTIF_ID = 5
|
||||
SIGNUP_FOLLOW_ID = 0
|
||||
|
@ -761,6 +763,8 @@ if SITE == 'rdrama.net':
|
|||
IDIO_ID = 30
|
||||
SNALLY_ID = 3336
|
||||
|
||||
IMMUNE_TO_AWARDS = {PIZZASHILL_ID, CARP_ID}
|
||||
|
||||
NOTIFIED_USERS = {
|
||||
'aevan': AEVANN_ID,
|
||||
'avean': AEVANN_ID,
|
||||
|
|
|
@ -177,7 +177,7 @@ def award_thing(v, thing_type, id):
|
|||
|
||||
safe_username = f"@{thing.author_name}"
|
||||
|
||||
if SITE == 'rdrama.net' and author.id in {PIZZASHILL_ID, CARP_ID}:
|
||||
if SITE == 'rdrama.net' and author.id in IMMUNE_TO_AWARDS:
|
||||
abort(403, f"{safe_username} is immune to awards!")
|
||||
|
||||
if kind == "benefactor" and author.id == v.id:
|
||||
|
|
|
@ -144,4 +144,5 @@ def inject_constants():
|
|||
"DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST, "BACKGROUND_CATEGORIES":BACKGROUND_CATEGORIES, "PAGE_SIZE":PAGE_SIZE, "TAGLINES":TAGLINES, "IS_FISTMAS":IS_FISTMAS, "get_alt_graph":get_alt_graph, "current_registered_users":current_registered_users,
|
||||
"git_head":git_head, "max_days":max_days,
|
||||
"BIO_FRIENDS_ENEMIES_LENGTH_LIMIT":BIO_FRIENDS_ENEMIES_LENGTH_LIMIT,
|
||||
"IMMUNE_TO_AWARDS": IMMUNE_TO_AWARDS,
|
||||
}
|
||||
|
|
|
@ -398,7 +398,7 @@
|
|||
<button type="button" class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="modal" data-bs-target="#reportCommentModal" data-nonce="{{g.nonce}}" data-onclick="report_commentModal('{{c.id}}','{{c.author_name}}',)"><i class="fas fa-flag fa-fw"></i>Report</button>
|
||||
|
||||
{% if FEATURES['AWARDS'] -%}
|
||||
<button type="button" class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}" data-nonce="{{g.nonce}}"><i class="fas fa-gift"></i>Give Award</button>
|
||||
<button type="button" class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}" data-nonce="{{g.nonce}}" {% if c.author_id in IMMUNE_TO_AWARDS %}disabled{% endif %}><i class="fas fa-gift"></i>Give Award</button>
|
||||
{%- endif %}
|
||||
|
||||
<button type="button" id="unsave-{{c.id}}" class="btn caction py-0 nobackground px-1 {% if c.id in v.saved_comment_idlist %}d-md-inline-block{% endif %} text-muted d-none" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unsave_comment/{{c.id}}','save-{{c.id}}','unsave-{{c.id}}','d-md-inline-block')"><i class="fas fa-save"></i>Unsave</button>
|
||||
|
@ -599,7 +599,7 @@
|
|||
<button type="button" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportCommentModal" data-nonce="{{g.nonce}}" data-onclick="report_commentModal('{{c.id}}','{{c.author_name}}')" class="list-group-item"><i class="fas fa-flag mr-2"></i>Report</button>
|
||||
|
||||
{% if FEATURES['AWARDS'] -%}
|
||||
<button type="button" class="list-group-item" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}" data-nonce="{{g.nonce}}"><i class="fas fa-gift mr-2"></i>Give Award</button>
|
||||
<button type="button" class="list-group-item" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}" data-nonce="{{g.nonce}}" {% if c.author_id in IMMUNE_TO_AWARDS %}disabled{% endif %}><i class="fas fa-gift mr-2"></i>Give Award</button>
|
||||
{%- endif %}
|
||||
|
||||
<button type="button" id="save2-{{c.id}}" class="list-group-item {% if c.id in v.saved_comment_idlist %}d-none{% endif %}" data-bs-dismiss="modal" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/save_comment/{{c.id}}','save2-{{c.id}}','unsave2-{{c.id}}','d-none')"><i class="fas fa-save mr-2"></i>Save</button>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if v and FEATURES['AWARDS'] %}
|
||||
<button type="button" class="list-inline-item text-muted d-none d-md-inline-block" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' data-nonce="{{g.nonce}}"><i class="fas fa-gift fa-fw"></i>Give Award</button>
|
||||
<button type="button" class="list-inline-item text-muted d-none d-md-inline-block" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' data-nonce="{{g.nonce}}" {% if p.author_id in IMMUNE_TO_AWARDS %}disabled{% endif %}><i class="fas fa-gift fa-fw"></i>Give Award</button>
|
||||
{% endif %}
|
||||
|
||||
<button type="button" class="list-inline-item copy-link" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://{{BAN_EVASION_DOMAIN}}{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportPostModal" data-nonce="{{g.nonce}}" data-onclick="report_postModal('{{p.id}}')"><i class="far fa-flag text-center text-muted mr-2"></i>Report</button>
|
||||
|
||||
{% if FEATURES['AWARDS'] -%}
|
||||
<button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' data-nonce="{{g.nonce}}"><i class="fas fa-gift text-center text-muted mr-2"></i>Give Award</button>
|
||||
<button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' data-nonce="{{g.nonce}}" {% if p.author_id in IMMUNE_TO_AWARDS %}disabled{% endif %}><i class="fas fa-gift text-center text-muted mr-2"></i>Give Award</button>
|
||||
{%- endif %}
|
||||
|
||||
<button type="button" id="subscribe2-{{p.id}}" class="{% if p.id in v.subscribed_idlist %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-muted" data-areyousure="postToastSwitch(this,'/subscribe/{{p.id}}','subscribe2-{{p.id}}','unsubscribe2-{{p.id}}','d-none')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-dismiss="modal"><i class="fas fa-eye text-center text-muted mr-2"></i>Subscribe</button>
|
||||
|
|
Loading…
Reference in New Issue