Skip to content

Commit

Permalink
feat: update utility classnames
Browse files Browse the repository at this point in the history
  • Loading branch information
hellodeloo authored and vincentporte committed Sep 11, 2023
1 parent 4283aed commit 41bfbc4
Show file tree
Hide file tree
Showing 49 changed files with 358 additions and 360 deletions.
22 changes: 11 additions & 11 deletions lacommunaute/forum/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,27 @@ def test_has_liked(self):
self.client.force_login(self.user)
response = self.client.get(self.url)
# icon: solid heart
self.assertContains(response, '<i class="ri-heart-3-fill mr-1" aria-hidden="true"></i><span>1</span>')
self.assertContains(response, '<i class="ri-heart-3-fill me-1" aria-hidden="true"></i><span>1</span>')

def test_has_not_liked(self):
self.client.force_login(self.user)
response = self.client.get(self.url)
# icon: regular heart (outlined)
self.assertContains(response, '<i class="ri-heart-3-line mr-1" aria-hidden="true"></i><span>0</span>')
self.assertContains(response, '<i class="ri-heart-3-line me-1" aria-hidden="true"></i><span>0</span>')

def test_has_liked_TOPIC_ANNOUNCE(self):
TopicFactory(forum=self.forum, poster=self.user, with_post=True, with_like=True, type=Topic.TOPIC_ANNOUNCE)

self.client.force_login(self.user)
response = self.client.get(self.url)
self.assertContains(response, '<i class="ri-heart-3-fill mr-1" aria-hidden="true"></i><span>1</span>')
self.assertContains(response, '<i class="ri-heart-3-fill me-1" aria-hidden="true"></i><span>1</span>')

def test_has_not_liked_TOPIC_ANNOUNCE(self):
TopicFactory(forum=self.forum, poster=self.user, with_post=True, type=Topic.TOPIC_ANNOUNCE)

self.client.force_login(self.user)
response = self.client.get(self.url)
self.assertContains(response, '<i class="ri-heart-3-line mr-1" aria-hidden="true"></i><span>0</span>')
self.assertContains(response, '<i class="ri-heart-3-line me-1" aria-hidden="true"></i><span>0</span>')

def test_anonymous_like(self):
params = {"next_url": self.url}
Expand Down Expand Up @@ -342,7 +342,7 @@ def test_share_buttons(self):
response = self.client.get(url)
self.assertContains(
response,
'div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuSocialShare">',
'div class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuSocialShare">',
status_code=200,
)

Expand All @@ -357,7 +357,7 @@ def test_upvote_actions(self):
' rel="nofollow"'
' class="btn btn-sm btn-ico-only btn-link btn-secondary" data-toggle="tooltip" data-placement="top"'
' title="Connectez-vous pour sauvegarder">'
'\n <i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>0</span>'
'\n <i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>0</span>'
)
response = self.client.get(
reverse("forum_extension:forum", kwargs={"pk": child_forum.pk, "slug": child_forum.slug})
Expand All @@ -374,7 +374,7 @@ def test_upvote_actions(self):
'\n data-matomo-action="upvote"'
'\n data-matomo-option="post"'
"\n >"
'\n <i class="ri-bookmark-line mr-1" aria-hidden="true"></i>'
'\n <i class="ri-bookmark-line me-1" aria-hidden="true"></i>'
"<span>0</span>"
)
response = self.client.get(reverse("forum_extension:forum", kwargs={"pk": child_forum.pk, "slug": forum.slug}))
Expand All @@ -389,7 +389,7 @@ def test_upvote_actions(self):
'\n data-matomo-action="upvote"'
'\n data-matomo-option="post"'
"\n >"
'\n <i class="ri-bookmark-fill mr-1" aria-hidden="true"></i>'
'\n <i class="ri-bookmark-fill me-1" aria-hidden="true"></i>'
"<span>1</span>"
)
response = self.client.get(
Expand All @@ -405,7 +405,7 @@ def test_upvotes_count(self):
reverse("forum_extension:forum", kwargs={"pk": child_forum.pk, "slug": child_forum.slug})
)
self.assertContains(
response, '<i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>0</span>', status_code=200
response, '<i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>0</span>', status_code=200
)

child_forum.upvotes.create(voter=self.user)
Expand All @@ -414,7 +414,7 @@ def test_upvotes_count(self):
reverse("forum_extension:forum", kwargs={"pk": child_forum.pk, "slug": child_forum.slug})
)
self.assertContains(
response, '<i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>1</span>', status_code=200
response, '<i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>1</span>', status_code=200
)

child_forum.upvotes.create(voter=UserFactory())
Expand All @@ -423,5 +423,5 @@ def test_upvotes_count(self):
reverse("forum_extension:forum", kwargs={"pk": child_forum.pk, "slug": child_forum.slug})
)
self.assertContains(
response, '<i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>2</span>', status_code=200
response, '<i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>2</span>', status_code=200
)
16 changes: 8 additions & 8 deletions lacommunaute/forum_conversation/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,13 @@ def test_has_liked(self):
self.client.force_login(self.poster)
response = self.client.get(self.url)
# icon: solid heart
self.assertContains(response, '<i class="ri-heart-3-fill mr-1" aria-hidden="true"></i><span>1</span>')
self.assertContains(response, '<i class="ri-heart-3-fill me-1" aria-hidden="true"></i><span>1</span>')

def test_has_not_liked(self):
self.client.force_login(self.poster)
response = self.client.get(self.url)
# icon: regular heart (outlined)
self.assertContains(response, '<i class="ri-heart-3-line mr-1" aria-hidden="true"></i><span>0</span>')
self.assertContains(response, '<i class="ri-heart-3-line me-1" aria-hidden="true"></i><span>0</span>')

def test_pluralized_likes(self):
self.topic.likers.add(UserFactory())
Expand All @@ -405,7 +405,7 @@ def test_pluralized_likes(self):
self.client.force_login(self.poster)
response = self.client.get(self.url)
# icon: regular heart (outlined)
self.assertContains(response, '<i class="ri-heart-3-line mr-1" aria-hidden="true"></i><span>2</span>')
self.assertContains(response, '<i class="ri-heart-3-line me-1" aria-hidden="true"></i><span>2</span>')

def test_anonymous_like(self):
assign_perm("can_read_forum", AnonymousUser(), self.topic.forum)
Expand All @@ -425,7 +425,7 @@ def test_post_has_no_upvote(self):

response = self.client.get(self.url)
self.assertContains(
response, '<i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>0</span>', status_code=200
response, '<i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>0</span>', status_code=200
)

def test_post_has_upvote_by_user(self):
Expand All @@ -435,7 +435,7 @@ def test_post_has_upvote_by_user(self):

response = self.client.get(self.url)
self.assertContains(
response, '<i class="ri-bookmark-fill mr-1" aria-hidden="true"></i><span>1</span>', status_code=200
response, '<i class="ri-bookmark-fill me-1" aria-hidden="true"></i><span>1</span>', status_code=200
)

def test_certified_post_is_highlighted(self):
Expand Down Expand Up @@ -525,7 +525,7 @@ def test_has_liked(self):
self.client.force_login(self.user)
response = self.client.get(self.url)
# icon: solid heart
self.assertContains(response, '<i class="ri-heart-3-fill mr-1" aria-hidden="true"></i><span>1</span>')
self.assertContains(response, '<i class="ri-heart-3-fill me-1" aria-hidden="true"></i><span>1</span>')

def test_queryset(self):
TopicFactory(with_post=True, forum=ForumFactory(kind=ForumKind.PRIVATE_FORUM, with_public_perms=True))
Expand Down Expand Up @@ -619,11 +619,11 @@ def test_showmoretopics_url_with_params(self):

def test_filter_dropdown_visibility(self):
response = self.client.get(self.url)
self.assertContains(response, '<div class="dropdown-menu dropdown-menu-right" id="filterTopicsDropdown">')
self.assertContains(response, '<div class="dropdown-menu dropdown-menu-end" id="filterTopicsDropdown">')
self.assertEqual(response.context_data["display_filter_dropdown"], True)

response = self.client.get(self.url + "?page=1")
self.assertNotContains(response, '<div class="dropdown-menu dropdown-menu-right" id="filterTopicsDropdown">')
self.assertNotContains(response, '<div class="dropdown-menu dropdown-menu-end" id="filterTopicsDropdown">')
self.assertEqual(response.context_data["display_filter_dropdown"], False)

def test_template_name(self):
Expand Down
10 changes: 5 additions & 5 deletions lacommunaute/forum_conversation/tests/tests_views_htmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ def test_post_like_unlike_topic(self):
response = self.client.post(self.url)
# icon: solid heart
self.assertContains(
response, '<i class="ri-heart-3-fill mr-1" aria-hidden="true"></i><span>1</span>', status_code=200
response, '<i class="ri-heart-3-fill me-1" aria-hidden="true"></i><span>1</span>', status_code=200
)

response = self.client.post(self.url)
# icon: regular heart (outlined)
self.assertContains(
response, '<i class="ri-heart-3-line mr-1" aria-hidden="true"></i><span>0</span>', status_code=200
response, '<i class="ri-heart-3-line me-1" aria-hidden="true"></i><span>0</span>', status_code=200
)

def test_post_topic_not_found(self):
Expand Down Expand Up @@ -341,15 +341,15 @@ def test_upvote_annotations(self):

response = view.get(request)
self.assertContains(
response, '<i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>0</span>', status_code=200
response, '<i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>0</span>', status_code=200
)

UpVoteFactory(content_object=post, voter=UserFactory())
UpVoteFactory(content_object=post, voter=self.user)

response = view.get(request)
self.assertContains(
response, '<i class="ri-bookmark-fill mr-1" aria-hidden="true"></i><span>2</span>', status_code=200
response, '<i class="ri-bookmark-fill me-1" aria-hidden="true"></i><span>2</span>', status_code=200
)

def test_certified_post_highlight(self):
Expand Down Expand Up @@ -429,7 +429,7 @@ def test_create_post_as_authenticated_user(self, *args):
self.assertContains(response, self.content, status_code=200)
self.assertIsInstance(response.context["form"], PostForm)
self.assertEqual(1, ForumReadTrack.objects.count())
self.assertContains(response, '<i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>0</span>')
self.assertContains(response, '<i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>0</span>')
self.topic.refresh_from_db()
self.assertEqual(self.topic.posts.count(), 2)
self.assertEqual(
Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/forum_upvote/tests/test_forumupvoteview.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def test_upvote_downvote_with_permission(client, db):

# upvote
response = client.post(url, data=form_data)
assertContains(response, '<i class="ri-bookmark-fill mr-1" aria-hidden="true"></i><span>1</span>', status_code=200)
assertContains(response, '<i class="ri-bookmark-fill me-1" aria-hidden="true"></i><span>1</span>', status_code=200)
assert UpVote.objects.get()

# downvote
response = client.post(url, data=form_data)
assertContains(response, '<i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>0</span>', status_code=200)
assertContains(response, '<i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>0</span>', status_code=200)
assert not UpVote.objects.all()


Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/forum_upvote/tests/test_postupvoteview.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_upvote_with_permission(client, db):

# upvote
response = client.post(url, data=form_data)
assertContains(response, '<i class="ri-bookmark-fill mr-1" aria-hidden="true"></i><span>1</span>', status_code=200)
assertContains(response, '<i class="ri-bookmark-fill me-1" aria-hidden="true"></i><span>1</span>', status_code=200)
assert UpVote.objects.get(
voter_id=user.id,
object_id=topic.first_post.id,
Expand All @@ -44,7 +44,7 @@ def test_upvote_with_permission(client, db):

# downvote
response = client.post(url, data=form_data)
assertContains(response, '<i class="ri-bookmark-line mr-1" aria-hidden="true"></i><span>0</span>', status_code=200)
assertContains(response, '<i class="ri-bookmark-line me-1" aria-hidden="true"></i><span>0</span>', status_code=200)
assert not UpVote.objects.all()


Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/templates/event/event_calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h1 class="s-title-01__title h1"><strong>Les évènements à venir</strong></h1>
<div class="s-section__col col-12">
{% if user.is_authenticated %}
<a href="{% url 'event:create' %}"
role="button" class="btn btn-primary">
role="button" class="btn btn-primary">
{% trans "Post a new Public Event" %}
</a>
{% else %}
Expand Down
6 changes: 3 additions & 3 deletions lacommunaute/templates/event/event_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ <h1 class="s-title-01__title h1"><strong>{% trans "Post a new Public Event" %}</
<div class="form-actions form-row">
<div class="form-group col-auto">
<input type="submit" class="btn btn-primary matomo-event" value="{% trans "Submit" %}"
data-matomo-category="engagement"
data-matomo-action="contribute"
data-matomo-option="event">
data-matomo-category="engagement"
data-matomo-action="contribute"
data-matomo-option="event">
{% if event %}
<a href="{% url 'event:delete' pk=event.pk %}" role="button" class="btn btn-outline-danger" value="{% trans "Delete" %}">{% trans "Delete" %}</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/templates/event/event_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1 class="s-title-01__title h1"><strong>{% trans "Manage My Events" %}</strong>
<div class="s-title-01__row row">
<div class="col-12 col-md-auto">
<a href="{% url 'event:create' %}"
role="button" class="btn btn-primary">
role="button" class="btn btn-primary">
{% trans "Post a new Public Event" %}
</a>
</div>
Expand Down
10 changes: 5 additions & 5 deletions lacommunaute/templates/forum/category_forum_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ <h2 class="mt-3">Retrouver les ressources nécessaires pour améliorer ses diagn
</div>
{% endif %}
</div>
<div class="card-footer text-right">
<div class="card-footer text-end">
<a href="{% url 'forum_extension:forum' forum.slug forum.id %}"
class="btn btn-ico btn-link stretched-link matomo-event"
data-matomo-category="engagement"
data-matomo-action="show"
data-matomo-option="fichestechniques">
class="btn btn-ico btn-link stretched-link matomo-event"
data-matomo-category="engagement"
data-matomo-action="show"
data-matomo-option="fichestechniques">
<span>Consulter les fiches du thème</span>
<i class="ri-arrow-right-up-line ri-lg"></i>
</a>
Expand Down
Loading

0 comments on commit 41bfbc4

Please sign in to comment.