Skip to content

Commit

Permalink
use login_url template tag for upvotes
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Dec 3, 2024
1 parent 65868f3 commit c0fea8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
14 changes: 7 additions & 7 deletions lacommunaute/forum/tests/__snapshots__/tests_views.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
<div class="d-inline-block" id="upvotesarea10000">


<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/pro_connect/authorize?next=%2Fforum%2Ftest-forum-10000%2F%2310000" rel="nofollow" title="Connectez-vous pour sauvegarder">
<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/users/login/?next=%2Fforum%2Ftest-forum-10000%2F%2310000" title="Connectez-vous pour sauvegarder">
<i aria-hidden="true" class="ri-bookmark-line me-1"></i><span>0</span>
</a>

Expand Down Expand Up @@ -486,7 +486,7 @@
<div class="d-inline-block" id="upvotesarea10000">


<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/pro_connect/authorize?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" rel="nofollow" title="Connectez-vous pour sauvegarder">
<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/users/login/?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" title="Connectez-vous pour sauvegarder">
<i aria-hidden="true" class="ri-bookmark-line me-1"></i><span>0</span>
</a>

Expand All @@ -499,7 +499,7 @@
<div class="d-inline-block" id="upvotesarea10000">


<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/pro_connect/authorize?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" rel="nofollow" title="Connectez-vous pour sauvegarder">
<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/users/login/?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" title="Connectez-vous pour sauvegarder">
<i aria-hidden="true" class="ri-bookmark-line me-1"></i><span>0</span>
</a>

Expand Down Expand Up @@ -528,7 +528,7 @@
<div class="d-inline-block" id="upvotesarea10000">


<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/pro_connect/authorize?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" rel="nofollow" title="Connectez-vous pour sauvegarder">
<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/users/login/?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" title="Connectez-vous pour sauvegarder">
<i aria-hidden="true" class="ri-bookmark-line me-1"></i><span>1</span>
</a>

Expand All @@ -541,7 +541,7 @@
<div class="d-inline-block" id="upvotesarea10000">


<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/pro_connect/authorize?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" rel="nofollow" title="Connectez-vous pour sauvegarder">
<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/users/login/?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" title="Connectez-vous pour sauvegarder">
<i aria-hidden="true" class="ri-bookmark-line me-1"></i><span>1</span>
</a>

Expand Down Expand Up @@ -570,7 +570,7 @@
<div class="d-inline-block" id="upvotesarea10000">


<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/pro_connect/authorize?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" rel="nofollow" title="Connectez-vous pour sauvegarder">
<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/users/login/?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" title="Connectez-vous pour sauvegarder">
<i aria-hidden="true" class="ri-bookmark-line me-1"></i><span>2</span>
</a>

Expand All @@ -583,7 +583,7 @@
<div class="d-inline-block" id="upvotesarea10000">


<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/pro_connect/authorize?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" rel="nofollow" title="Connectez-vous pour sauvegarder">
<a class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-placement="top" data-bs-toggle="tooltip" href="/users/login/?next=%2Fforum%2Ftest-forum-forum-[PK of Forum]%2F%23[PK of Forum]" title="Connectez-vous pour sauvegarder">
<i aria-hidden="true" class="ri-bookmark-line me-1"></i><span>2</span>
</a>

Expand Down
7 changes: 1 addition & 6 deletions lacommunaute/templates/partials/upvotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@
</button>
</form>
{% else %}
<a href="{% openid_connect_url next_url obj.id %}"
rel="nofollow"
class="btn btn-sm btn-ico btn-link btn-secondary px-2"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Connectez-vous pour sauvegarder">
<a href="{% login_url next_url obj.id %}" class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-toggle="tooltip" data-bs-placement="top" title="Connectez-vous pour sauvegarder">
<i class="{% if obj.has_upvoted %}ri-bookmark-fill{% else %}ri-bookmark-line{% endif %} me-1" aria-hidden="true"></i><span>{{ counter }}</span>
</a>
{% endif %}
Expand Down

0 comments on commit c0fea8e

Please sign in to comment.