Skip to content

Commit

Permalink
user_profile: profile: Uniquely identify the form for visibility toggle
Browse files Browse the repository at this point in the history
Signed-off-by: Shashank Verma <[email protected]>
  • Loading branch information
shank03 committed Oct 12, 2023
1 parent d736872 commit 05fabf6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions user_profile/templates/user_profile/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ <h6 class="">
</form>
{% elif pr.state == pr.PENDING_VERIFICATION %}
<a class="btn btn-rounded btn-warning">{{ pr.get_state_display }}</a>
<button class="btn btn-primary btn-rounded mt-0" data-mdb-toggle="tooltip" id="frmbtn" onclick="showfrm()" type="button">
<button class="btn btn-primary btn-rounded mt-0" data-mdb-toggle="tooltip" id="frmbtn" onclick="showfrm('{{ pr.pk }}')" type="button">
Verify <i class="fas fa-caret-down"></i>
</button>
<form method="get" action="{% url 'judge_pr' pr.pk %}" id="frm">
<form method="get" action="{% url 'judge_pr' pr.pk %}" id="frm_{{ pr.pk }}" style="display: none;">
<a class="btn btn-primary btn-success" data-mdb-toggle="tooltip" title="Bonus Points">{{ judge_form.bonus }}</a>
<a class="btn btn-primary btn-danger" data-mdb-toggle="tooltip" title="Penalty Points">{{ judge_form.penalty }}</a>
<a class="btn btn-primary" data-mdb-toggle="tooltip" title="Remark">{{ judge_form.remark }}</a>
Expand Down Expand Up @@ -426,8 +426,8 @@ <h6 class="">

{% block javascript %}
<script>
function showfrm() {
const form = document.getElementById('frm');
function showfrm(pk) {
const form = document.getElementById('frm_'+pk);

if (form.style.display === 'none') {
form.style.display = 'block';
Expand Down

0 comments on commit 05fabf6

Please sign in to comment.