try to fix the wrong method error on giving awards

remotes/1693045480750635534/spooky-22
Aevann1 2022-09-08 21:21:41 +02:00
parent 66bf74b444
commit 23338e8172
5 changed files with 5 additions and 9 deletions

View File

@ -1,7 +1,3 @@
document.getElementById('awardModal').addEventListener('show.bs.modal', function (event) {
document.getElementById("awardTarget").action = event.relatedTarget.dataset.url;
});
// TODO: Refactor this ugly shit who wrote this lmao
function vote(type, id, dir) {
const upvotes = document.getElementsByClassName(type + '-' + id + '-up');

View File

@ -411,7 +411,7 @@
<button class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="modal" data-bs-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author_name}}',)"><i class="fas fa-flag fa-fw"></i>Report</button>
{% if FEATURES['AWARDS'] -%}
<button class="btn caction py-0 nobackground px-1 text-muted" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}"><i class="fas fa-gift" aria-hidden="true"></i>Give Award</button>
<button class="btn caction py-0 nobackground px-1 text-muted" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}" onclick="document.getElementById('awardTarget').action = this.dataset.url"><i class="fas fa-gift" aria-hidden="true"></i>Give Award</button>
{%- endif %}
<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" role="button" onclick="post_toast(this,'/unsave_comment/{{c.id}}','save-{{c.id}}','unsave-{{c.id}}','d-md-inline-block')"><i class="fas fa-save"></i>Unsave</button>
@ -624,7 +624,7 @@
<a role="button" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author_name}}')" class="list-group-item"><i class="fas fa-flag mr-2"></i>Report</a>
{% if FEATURES['AWARDS'] -%}
<a class="list-group-item" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}"><i class="fas fa-gift mr-2" aria-hidden="true"></i>Give Award</a>
<a class="list-group-item" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" data-url="/award/comment/{{c.id}}" onclick="document.getElementById('awardTarget').action = this.dataset.url"><i class="fas fa-gift mr-2" aria-hidden="true"></i>Give Award</a>
{%- endif %}
<a id="save2-{{c.id}}" class="list-group-item {% if c.id in v.saved_comment_idlist %}d-none{% endif %}" role="button" data-bs-dismiss="modal" onclick="post_toast(this,'/save_comment/{{c.id}}','save2-{{c.id}}','unsave2-{{c.id}}','d-none')"><i class="fas fa-save mr-2"></i>Save</a>

View File

@ -9,7 +9,7 @@
{% if v and ((not p.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a class="list-inline-item" href="/votes/{{p.fullname}}"><i class="fas fa-arrows-v"></i>Votes</a>{% endif %}
{% if v and FEATURES['AWARDS'] %}
<a class="list-inline-item text-muted d-none d-md-inline-block" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}'><i class="fas fa-gift fa-fw"></i>Give Award</a>
<a class="list-inline-item text-muted d-none d-md-inline-block" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' onclick="document.getElementById('awardTarget').action = this.dataset.url"><i class="fas fa-gift fa-fw"></i>Give Award</a>
{% endif %}
<a class="list-inline-item copy-link" role="button" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://rdrama.org{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</a>

View File

@ -13,7 +13,7 @@
<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" onclick="report_postModal('{{p.id}}')"><i class="far fa-flag text-center text-muted mr-2"></i>Report</button>
{% if FEATURES['AWARDS'] -%}
<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}}'><i class="fas fa-gift text-center text-muted mr-2"></i>Give Award</button>
<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}}' onclick="document.getElementById('awardTarget').action = this.dataset.url"><i class="fas fa-gift text-center text-muted mr-2"></i>Give Award</button>
{%- endif %}
<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" role="button" onclick="post_toast(this,'/subscribe/{{p.id}}','subscribe2-{{p.id}}','unsubscribe2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye text-center text-muted mr-2"></i>Subscribe</button>

View File

@ -15,7 +15,7 @@ set CACHE_VER = {
'css/tron.css': 4004,
'css/win98.css': 4004,
'js/award_modal.js': 4000,
'js/award_modal.js': 4001,
'js/bootstrap.js': 4002,
'js/category_modal.js': 4000,
'js/comments_admin.js': 4000,