Skip to content

Commit

Permalink
fix: dsp form ui
Browse files Browse the repository at this point in the history
  • Loading branch information
hellodeloo authored and vincentporte committed Oct 31, 2023
1 parent 1893ffd commit 61d5ea3
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 110 deletions.
34 changes: 17 additions & 17 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 Down Expand Up @@ -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
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 @@ -5,12 +5,12 @@
{% with topic.likes as counter %}
{% if user.is_authenticated %}
<button hx-post="{% url 'forum_conversation_extension:like_topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" id="like-button{{topic.pk}}"
hx-target="#likesarea{{topic.pk}}"
hx-swap="outerHTML"
class="btn btn-ico btn-link btn-like px-0 text-nowrap matomo-event"
data-matomo-category="engagement"
data-matomo-action="like"
data-matomo-option="topic"
hx-target="#likesarea{{topic.pk}}"
hx-swap="outerHTML"
class="btn btn-ico btn-link btn-like px-0 text-nowrap matomo-event"
data-matomo-category="engagement"
data-matomo-action="like"
data-matomo-option="topic"
>
<i class="{% if topic.has_liked %}ri-heart-3-fill{% else %}ri-heart-3-line{% endif %} me-1" aria-hidden="true"></i><span>{{counter}}</span>
</button>
Expand Down
36 changes: 18 additions & 18 deletions lacommunaute/templates/forum_conversation/topic_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
<i class="{% if topic.is_sticky %}ri-lightbulb-flash-line{% elif topic.is_announce %}ri-information-line{% else %}ri-record-circle-line{% endif %} ri-xl aria-hidden="true""></i>
</span>
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="topic">
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="topic">
{{ topic.subject }} {% if topic.is_locked %}&nbsp;<i class="fas fa-times-circle locked-indicator" aria-label="{% trans 'This topic is locked' %}"></i>{% endif %}
</a>
</p>
Expand All @@ -56,13 +56,13 @@
{{ topic.first_post.content.rendered|urlizetrunc_target_blank:30|img_fluid|truncatechars_html:200 }}
{% if topic.first_post.content.rendered|length > 200 %}
<a hx-get="{% url 'forum_conversation_extension:showmore_topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
id="showmoretopic-button{{topic.pk}}"
hx-target="#showmoretopicsarea{{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="topic"
id="showmoretopic-button{{topic.pk}}"
hx-target="#showmoretopicsarea{{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="topic"
>
{% trans "+ show more" %}
</a>
Expand Down Expand Up @@ -121,13 +121,13 @@
<div id="loadmoretopicsarea{{ loadmoretopic_suffix }}" class="row mx-3 mt-md-5 justify-content-center">
<div class="col-12 col-md-auto">
<a hx-get="{% url_add_query loadmoretopic_url page=page_obj.next_page_number %}"
id="loadmoretopics-button"
hx-target="#loadmoretopicsarea{{ loadmoretopic_suffix }}"
hx-swap="outerHTML"
class="btn btn-link btn-ico btn-block justify-content-center matomo-event"
data-matomo-category="engagement"
data-matomo-action="loadmore"
data-matomo-option="topic">
id="loadmoretopics-button"
hx-target="#loadmoretopicsarea{{ loadmoretopic_suffix }}"
hx-swap="outerHTML"
class="btn btn-link btn-ico btn-block justify-content-center matomo-event"
data-matomo-category="engagement"
data-matomo-action="loadmore"
data-matomo-option="topic">
<i class="ri-loop-right-line" aria-hidden="true"></i>
<span>{% trans "load more topics" %}</span>
</a>
Expand Down
36 changes: 18 additions & 18 deletions lacommunaute/templates/forum_conversation/topic_list_newsfeed.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
</div>
<p class="h4 mb-0 flex-grow-1">
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="news">
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="news">
{{ topic.subject }} {% if topic.is_locked %}&nbsp;<i class="fas fa-times-circle locked-indicator" aria-label="{% trans 'This topic is locked' %}"></i>{% endif %}
</a>
</p>
Expand All @@ -45,13 +45,13 @@
{{ topic.first_post.content.rendered|urlizetrunc_target_blank:30|img_fluid|truncatechars_html:200 }}
{% if topic.first_post.content.rendered|length > 200 %}
<a hx-get="{% url 'forum_conversation_extension:showmore_topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
id="showmoretopic-button{{topic.pk}}"
hx-target="#showmoretopicsarea{{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="news"
id="showmoretopic-button{{topic.pk}}"
hx-target="#showmoretopicsarea{{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="news"
>
{% trans "+ show more" %}
</a>
Expand Down Expand Up @@ -84,13 +84,13 @@
<div id="loadmoretopicsarea{{ loadmoretopic_suffix }}" class="row mx-3 mt-md-5 justify-content-center">
<div class="col-12 col-md-auto">
<a hx-get="{% url_add_query loadmoretopic_url page=page_obj.next_page_number %}"
id="loadmoretopics-button"
hx-target="#loadmoretopicsarea{{ loadmoretopic_suffix }}"
hx-swap="outerHTML"
class="btn btn-link btn-ico btn-block justify-content-center matomo-event"
data-matomo-category="engagement"
data-matomo-action="loadmore"
data-matomo-option="topic">
id="loadmoretopics-button"
hx-target="#loadmoretopicsarea{{ loadmoretopic_suffix }}"
hx-swap="outerHTML"
class="btn btn-link btn-ico btn-block justify-content-center matomo-event"
data-matomo-category="engagement"
data-matomo-action="loadmore"
data-matomo-option="topic">
<i class="ri-loop-right-line" aria-hidden="true"></i>
<span>{% trans "load more topics" %}</span>
</a>
Expand Down
24 changes: 12 additions & 12 deletions lacommunaute/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ <h3 class="m-0">
{% for topic in topics_public %}
<li class="mb-3 position-relative">
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
class="matomo-event btn-link stretched-link"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="topic">
class="matomo-event btn-link stretched-link"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="topic">
{{ topic.subject }}
</a>
</li>
Expand All @@ -89,10 +89,10 @@ <h3 class="m-0">
{% for forum in forums_category %}
<li class="mb-3 position-relative">
<a href="{% url 'forum_extension:forum' forum.slug forum.pk %}"
class="matomo-event btn-link stretched-link"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
class="matomo-event btn-link stretched-link"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="forum">
[{{ forum.parent.name }}] {{ forum.name }}
</a>
</li>
Expand All @@ -114,10 +114,10 @@ <h3 class="m-0">
{% for topic in topics_newsfeed %}
<li class="mb-3 position-relative">
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
class="matomo-event btn-link stretched-link"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="news">
class="matomo-event btn-link stretched-link"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="news">
{{ topic.subject }}
</a>
</li>
Expand Down
38 changes: 24 additions & 14 deletions lacommunaute/templates/surveys/dsp_detail.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
{% extends 'board_base.html' %}
{% extends "layouts/base.html" %}
{% load i18n %}

{% block title %}Diagnostic Socio Professionnel{{ block.super }}{% endblock %}
{% block meta_description %}Recommandations{% endblock meta_description %}"

{% block content %}

<h1>Les recommandations suite à votre diagnostic</h1>

{% for label, recommendation in object.recommendations.items %}
<div class="row mt-3">
<div class="col-12">
<div class="card post-edit">
<div class="card-header">
<h3 class="m-0 h4 card-title">{{label}}</h3>
</div>
<div class="card-body">
{{ recommendation }}
</div>
<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1 class="s-title-01__title h1">Les recommandations suite à votre diagnostic</h1>
</div>
</div>
</div>
{% endfor %}
</section>

<section class="s-section">
<div class="s-section__container container">
<div class="s-section__row row">
<div class="s-section__col col-12 col-lg-8">
{% for label, recommendation in object.recommendations.items %}
<div>
<h2 class="h3">{{label}}</h2>
<div>
{{ recommendation }}
</div>
<hr class="mt-5">
</div>
{% endfor %}
</div>
</div>
</div>
</section>

{% endblock content %}
Loading

0 comments on commit 61d5ea3

Please sign in to comment.