Skip to content

Commit

Permalink
fix: dsp form ui
Browse files Browse the repository at this point in the history
  • Loading branch information
hellodeloo committed Sep 19, 2023
1 parent c00e1aa commit 58768c0
Show file tree
Hide file tree
Showing 35 changed files with 334 additions and 297 deletions.
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
8 changes: 4 additions & 4 deletions lacommunaute/templates/forum/category_forum_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ <h2 class="mt-3">Retrouver les ressources nécessaires pour améliorer ses diagn
</div>
<div class="card-footer text-right">
<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
54 changes: 27 additions & 27 deletions lacommunaute/templates/forum/forum_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ <h2 class="mt-3">
</div>
<div class="col-12 col-lg-3">
<a href="{% url 'forum_extension:forum' parent_forum.slug parent_forum.id %}"
class="matomo-event h3 text-decoration-none d-inline-block"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
class="matomo-event h3 text-decoration-none d-inline-block"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
Les autres fiches du thème
</a>
<ul class="nav nav-tabs flex-column">
Expand Down Expand Up @@ -97,11 +97,11 @@ <h2 class="mt-3">
<div class="col-12 col-sm-auto forum-actions-block">
{% if user_can_add_topic %}
<a href="{% url 'forum_conversation:topic_create' forum.slug forum.pk %}"
rel="nofollow"
class="btn btn-primary btn-ico matomo-event"
data-matomo-category="engagement"
data-matomo-action="contribute"
data-matomo-option="new_topic">
rel="nofollow"
class="btn btn-primary btn-ico matomo-event"
data-matomo-category="engagement"
data-matomo-action="contribute"
data-matomo-option="new_topic">
<i class="ri-chat-new-line ri-lg"></i>
<span>{% if forum.kind == 'NEWS' %}{% trans "New news" %}{% else %}{% trans "New topic" %}{% endif %}</span>
</a>
Expand All @@ -112,10 +112,10 @@ <h2 class="mt-3">
</button>
<div class="dropdown-menu" aria-labelledby="id_dropdown_moderators_stats_button">
<a href="{% url 'members:forum_profiles' forum.slug forum.pk %}"
class="dropdown-item matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="directory">
class="dropdown-item matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="directory">
{% trans "Members" %}
</a>
</div>
Expand All @@ -135,22 +135,22 @@ <h2 class="mt-3">
<ul class="s-tabs-01__nav nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="topics-tab"
data-toggle="tab"
href="#topics"
role="tab"
aria-controls="topics"
aria-selected="true">
data-toggle="tab"
href="#topics"
role="tab"
aria-controls="topics"
aria-selected="true">
Sujets
</a>
</li>
{% if announces %}
<li class="nav-item" role="presentation">
<a class="nav-link" id="announces-tab"
data-toggle="tab"
href="#announces"
role="tab"
aria-controls="announces"
aria-selected="false">
data-toggle="tab"
href="#announces"
role="tab"
aria-controls="announces"
aria-selected="false">
Annonces
</a>
</li>
Expand All @@ -163,16 +163,16 @@ <h2 class="mt-3">
</ul>
<div class="tab-content topiclist">
<div class="tab-pane fade show active" id="topics"
role="tabpanel"
aria-labelledby="topics-tab">
role="tabpanel"
aria-labelledby="topics-tab">
{% with unread_topics=unread_topics %}
{% include "forum_conversation/topic_list.html" %} <!-- note vincentporte : to be optimized -->
{% endwith %}
</div>
{% if announces %}
<div class="tab-pane fade" id="announces"
role="tabpanel"
aria-labelledby="announces-tab">
role="tabpanel"
aria-labelledby="announces-tab">
{% with topics=announces hide_if_empty=True unread_topics=unread_topics loadmoretopic_url=None %}
{% include "forum_conversation/topic_list.html" %} <!-- note vincentporte : to be optimized -->
{% endwith %}
Expand Down
32 changes: 16 additions & 16 deletions lacommunaute/templates/forum/forum_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<div class="flex-grow-1">
<h3 class="h3 mb-0">
<a href="{% url 'forum_extension:forum' node.obj.slug node.obj.id %}"
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
{{ node.obj.name }}
</a>
</h3>
Expand All @@ -50,10 +50,10 @@ <h3 class="h3 mb-0">
<li class="list-group-item list-group-item-action d-flex flex-column flex-md-row justify-content-md-between">
<div class="flex-grow-1">
<a href="{% url 'forum_extension:forum' child.obj.slug child.obj.id %}"
class="h5 d-block mb-0 matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
class="h5 d-block mb-0 matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
{{ child.obj.name }}
</a>
<small class="text-muted">
Expand Down Expand Up @@ -83,10 +83,10 @@ <h3 class="h3 mb-0">
</div>
<div class="card-footer text-right">
<a href="{% url 'forum_extension:forum' node.obj.slug node.obj.id %}"
class="btn btn-ico btn-link stretched-link matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="fiches_techniques">
class="btn btn-ico btn-link stretched-link matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="fiches_techniques">
<span>Consulter la fiche</span>
<i class="ri-arrow-right-up-line ri-lg"></i>
</a>
Expand All @@ -101,10 +101,10 @@ <h3 class="h3 mb-0">
<li class="list-group-item list-group-item-action d-flex flex-column flex-md-row justify-content-md-between">
<div class="flex-grow-1">
<a href="{% url 'forum_extension:forum' node.obj.slug node.obj.id %}"
class="matomo-event h4 d-block mb-0"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
class="matomo-event h4 d-block mb-0"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
{{ node.obj.name }}
</a>
<small class="text-muted">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
{% elif can_be_completed and has_been_completed and not change_vote_action %}
<div class="form-actions">
<a href="{% url 'forum_conversation:topic' poll.topic.forum.slug poll.topic.forum.pk poll.topic.slug poll.topic.pk %}?change_vote=true"
class="btn btn-sm btn-link pl-0 matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="topic">
class="btn btn-sm btn-link pl-0 matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="topic">
{% trans "Change your vote" %}
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% load i18n %}

<form method="post"
action=""
hx-post="{% url 'forum_polls_extension:topic_poll_vote' poll.topic.forum.slug poll.topic.forum.pk poll.pk %}"
id="poll-form{{poll.pk}}"
hx-target="#pollarea{{poll.pk}}"
hx-swap="outerHTML"
novalidate>
action=""
hx-post="{% url 'forum_polls_extension:topic_poll_vote' poll.topic.forum.slug poll.topic.forum.pk poll.pk %}"
id="poll-form{{poll.pk}}"
hx-target="#pollarea{{poll.pk}}"
hx-swap="outerHTML"
novalidate>
{% csrf_token %}

<ul class="list-unstyled mb-3">
Expand All @@ -28,9 +28,9 @@
</ul>
<div class="form-actions">
<input type="submit" class="btn btn-sm btn-secondary matomo-event"
value="{% trans "Submit" %}"
data-matomo-category="engagement"
data-matomo-action="vote"
data-matomo-option="poll"/>
value="{% trans "Submit" %}"
data-matomo-category="engagement"
data-matomo-action="vote"
data-matomo-option="poll"/>
</div>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
{{ post.content.rendered|urlizetrunc_target_blank:30|img_fluid|truncatechars_html:200 }}
{% if post.content.rendered|length > 200 %}
<a hx-get="{% url 'forum_conversation_extension:showmore_certified' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
id="showmorecertified-button{{topic.pk}}"
hx-target="#showmorecertifiedpostsarea{{topic.pk}}"
hx-swap="outerHTML"
class="btn btn-link p-0 mh-auto matomo-event"
data-matomo-category="engagement"
data-matomo-action="showmore"
data-matomo-option="certified"
id="showmorecertified-button{{topic.pk}}"
hx-target="#showmorecertifiedpostsarea{{topic.pk}}"
hx-swap="outerHTML"
class="btn btn-link p-0 mh-auto matomo-event"
data-matomo-category="engagement"
data-matomo-action="showmore"
data-matomo-option="certified"
>
{% trans "+ show more" %}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
{% if not topic.is_certified or post.is_certified %}
- <i class="ri-award-line small" aria-hidden="true"></i>
<form hx-post="{% url 'forum_conversation_extension:certify' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
id="certifiedpost-button{{post.pk}}"
class="d-inline-block"
hx-target="#showmorepostsarea{{topic.pk}}"
hx-confirm="Êtes-vous sûr de vouloir {% if post.is_certified %}retirer la certification de{% else %}certifier{% endif %} cette réponse ?"
hx-swap="outerHTML">
id="certifiedpost-button{{post.pk}}"
class="d-inline-block"
hx-target="#showmorepostsarea{{topic.pk}}"
hx-confirm="Êtes-vous sûr de vouloir {% if post.is_certified %}retirer la certification de{% else %}certifier{% endif %} cette réponse ?"
hx-swap="outerHTML">
<input type='hidden' name='post_pk' value="{{post.pk}}"/>
<button type="submit"
class="btn-poster small text-muted text-nowrap text-decoration-underline matomo-event"
data-matomo-category="engagement"
data-matomo-action="certify"
data-matomo-option="post"
class="btn-poster small text-muted text-nowrap text-decoration-underline matomo-event"
data-matomo-category="engagement"
data-matomo-action="certify"
data-matomo-option="post"
>
{% if post.is_certified %}
Retirer la certification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<div class="row">
<div class="col-12 post-content-wrapper">
<form hx-post="{% url 'forum_conversation_extension:post_create' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
hx-target="#postinfeedarea{{topic.pk}}"
hx-swap="outerHTML"
class="majorpoints matomo-event"
data-matomo-category="engagement"
data-matomo-action="contribute"
data-matomo-option="post">
hx-target="#postinfeedarea{{topic.pk}}"
hx-swap="outerHTML"
class="majorpoints matomo-event"
data-matomo-category="engagement"
data-matomo-action="contribute"
data-matomo-option="post">
{% csrf_token %}

{% if post_form.non_field_errors %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
{% blocktrans trimmed with poster_url=poster_url poster=post.poster_display_name creation_date=post.created %}
By:
<a href="{{ poster_url }}"
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="member">
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="member">
{{ poster }}
</a>,
{% endblocktrans %}
Expand Down
Loading

0 comments on commit 58768c0

Please sign in to comment.