Replace old agenda of event with links to services and change permission to see birthdays

This commit is contained in:
Antoine Bartuccio 2025-01-02 02:29:41 +01:00
parent e5fb875968
commit 169938e1da
5 changed files with 139 additions and 115 deletions

View File

@ -8,37 +8,33 @@
flex-direction: column; flex-direction: column;
} }
.news_column {
display: inline-block;
margin: 0;
vertical-align: top;
}
#news_admin { #news_admin {
margin-bottom: 1em; margin-bottom: 1em;
} }
#right_column { #right_column {
flex: 20%; flex: 20%;
float: right; margin: 3.2px;
margin: 0.2em;
display: inline-block;
vertical-align: top;
} }
#left_column { #left_column {
flex: 79%; flex: 79%;
margin: 0.2em; margin: 0.2em;
}
h3 { h3 {
background: $second-color; background: $second-color;
box-shadow: $shadow-color 1px 1px 1px; box-shadow: $shadow-color 1px 1px 1px;
padding: 0.4em; padding: 0.4em;
margin: 0 0 0.5em 0; margin: 0 0 0.5em 0;
text-transform: uppercase; text-transform: uppercase;
font-size: 1.1em; font-size: 1.1em;
&:not(:first-of-type) { &:not(:first-of-type) {
margin: 2em 0 1em 0; margin: 2em 0 1em 0;
}
} }
} }
@ -50,8 +46,8 @@
} }
} }
/* AGENDA/BIRTHDAYS */ /* LINKS/BIRTHDAYS */
#agenda, #links,
#birthdays { #birthdays {
display: block; display: block;
width: 100%; width: 100%;
@ -59,9 +55,7 @@
font-size: 70%; font-size: 70%;
margin-bottom: 1em; margin-bottom: 1em;
#agenda_title, h3 {
#birthdays_title {
margin: 0;
border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0;
box-shadow: $shadow-color 1px 1px 1px; box-shadow: $shadow-color 1px 1px 1px;
padding: 0.5em; padding: 0.5em;
@ -72,34 +66,27 @@
background: $second-color; background: $second-color;
} }
#agenda_content { #links_content {
overflow: auto; overflow: auto;
box-shadow: $shadow-color 1px 1px 1px; box-shadow: $shadow-color 1px 1px 1px;
height: 20em; height: 20em;
}
#agenda_content, h4 {
#birthdays_content { margin-left: 5px;
.agenda_item {
padding: 0.5em;
margin-bottom: 0.5em;
&:nth-of-type(even) {
background: $secondary-neutral-light-color;
}
.agenda_time {
font-size: 90%;
color: grey;
}
.agenda_item_content {
p {
margin-top: 0.2em;
}
}
} }
li {
margin: 10px;
}
i {
width: 20px;
margin: 5px;
}
}
#birthdays_content {
ul.birthdays_year { ul.birthdays_year {
margin: 0; margin: 0;
list-style-type: none; list-style-type: none;
@ -124,9 +111,9 @@
} }
} }
/* END AGENDA/BIRTHDAYS */ /* END AGENDA/BIRTHDAYS */
/* EVENTS TODAY AND NEXT FEW DAYS */ /* EVENTS TODAY AND NEXT FEW DAYS */
.news_events_group { .news_events_group {
box-shadow: $shadow-color 1px 1px 1px; box-shadow: $shadow-color 1px 1px 1px;
margin-left: 1em; margin-left: 1em;
@ -222,9 +209,9 @@
} }
} }
/* END EVENTS TODAY AND NEXT FEW DAYS */ /* END EVENTS TODAY AND NEXT FEW DAYS */
/* COMING SOON */ /* COMING SOON */
.news_coming_soon { .news_coming_soon {
display: list-item; display: list-item;
list-style-type: square; list-style-type: square;
@ -242,9 +229,9 @@
} }
} }
/* END COMING SOON */ /* END COMING SOON */
/* NOTICES */ /* NOTICES */
.news_notice { .news_notice {
margin: 0 0 1em 1em; margin: 0 0 1em 1em;
padding: 0.4em; padding: 0.4em;
@ -262,9 +249,9 @@
} }
} }
/* END NOTICES */ /* END NOTICES */
/* CALLS */ /* CALLS */
.news_call { .news_call {
margin: 0 0 1em 1em; margin: 0 0 1em 1em;
padding: 0.4em; padding: 0.4em;
@ -286,7 +273,7 @@
} }
} }
/* END CALLS */ /* END CALLS */
.news_empty { .news_empty {
margin-left: 1em; margin-left: 1em;

View File

@ -99,35 +99,48 @@
</div> </div>
<div id="right_column" class="news_column"> <div id="right_column">
<div id="agenda"> <div id="links">
<div id="agenda_title">{% trans %}Agenda{% endtrans %}</div> <h3>{% trans %}Links{% endtrans %}</h3>
<div id="agenda_content"> <div id="links_content">
{% for d in NewsDate.objects.filter(end_date__gte=timezone.now(), <h4>{% trans %}Our services{% endtrans %}</h4>
news__is_moderated=True, news__type__in=["WEEKLY", <ul>
"EVENT"]).order_by('start_date', 'end_date') %} <li>
<div class="agenda_item"> <i class="fa-solid fa-graduation-cap fa-xl"></i>
<div class="agenda_date"> <a href="{{ url("pedagogy:guide") }}">{% trans %}UV Guide{% endtrans %}</a>
<strong>{{ d.start_date|localtime|date('D d M Y') }}</strong> </li>
</div> <li>
<div class="agenda_time"> <i class="fa-solid fa-magnifying-glass fa-xl"></i>
<span>{{ d.start_date|localtime|time(DATETIME_FORMAT) }}</span> - <a href="{{ url("matmat:search_clear") }}">{% trans %}Matmatronch{% endtrans %}</a>
<span>{{ d.end_date|localtime|time(DATETIME_FORMAT) }}</span> </li>
</div> <li>
<div> <i class="fa-solid fa-check-to-slot fa-xl"></i>
<strong><a href="{{ url('com:news_detail', news_id=d.news.id) }}">{{ d.news.title }}</a></strong> <a href="{{ url("election:list") }}">{% trans %}Elections{% endtrans %}</a>
<a href="{{ d.news.club.get_absolute_url() }}">{{ d.news.club }}</a> </li>
</div> </ul>
<div class="agenda_item_content">{{ d.news.summary|markdown }}</div> <br>
</div> <h4>{% trans %}Social media{% endtrans %}</h4>
{% endfor %} <ul>
<li>
<i class="fa-brands fa-discord fa-xl"></i>
<a rel="nofollow" target="#" href="https://discord.gg/QvTm3XJrHR">{% trans %}Discord{% endtrans %}</a>
</li>
<li>
<i class="fa-brands fa-facebook fa-xl"></i>
<a rel="nofollow" target="#" href="https://www.facebook.com/@AEUTBM/">{% trans %}Facebook{% endtrans %}</a>
</li>
<li>
<i class="fa-brands fa-instagram fa-xl"></i>
<a rel="nofollow" target="#" href="https://www.instagram.com/ae_utbm">{% trans %}Instagram{% endtrans %}</a>
</li>
</ul>
</div> </div>
</div> </div>
<div id="birthdays"> <div id="birthdays">
<div id="birthdays_title">{% trans %}Birthdays{% endtrans %}</div> <h3>{% trans %}Birthdays{% endtrans %}</h3>
<div id="birthdays_content"> <div id="birthdays_content">
{%- if user.is_subscribed -%} {%- if user.was_subscribed -%}
<ul class="birthdays_year"> <ul class="birthdays_year">
{%- for year, users in birthdays -%} {%- for year, users in birthdays -%}
<li> <li>
@ -141,7 +154,7 @@
{%- endfor -%} {%- endfor -%}
</ul> </ul>
{%- else -%} {%- else -%}
<p>{% trans %}You need an up to date subscription to access this content{% endtrans %}</p> <p>{% trans %}You need to subscribe to access this content{% endtrans %}</p>
{%- endif -%} {%- endif -%}
</div> </div>
</div> </div>

View File

@ -97,9 +97,7 @@ class TestCom(TestCase):
response = self.client.get(reverse("core:index")) response = self.client.get(reverse("core:index"))
self.assertContains( self.assertContains(
response, response,
text=html.escape( text=html.escape(_("You need to subscribe to access this content")),
_("You need an up to date subscription to access this content")
),
) )
def test_birthday_subscibed_user(self): def test_birthday_subscibed_user(self):
@ -107,9 +105,16 @@ class TestCom(TestCase):
self.assertNotContains( self.assertNotContains(
response, response,
text=html.escape( text=html.escape(_("You need to subscribe to access this content")),
_("You need an up to date subscription to access this content") )
),
def test_birthday_old_subscibed_user(self):
self.client.force_login(User.objects.get(username="old_subscriber"))
response = self.client.get(reverse("core:index"))
self.assertNotContains(
response,
text=html.escape(_("You need to subscribe to access this content")),
) )

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-04 21:59+0100\n" "POT-Creation-Date: 2025-01-04 23:05+0100\n"
"PO-Revision-Date: 2016-07-18\n" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Maréchal <thomas.girod@utbm.fr\n" "Last-Translator: Maréchal <thomas.girod@utbm.fr\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@ -356,9 +356,8 @@ msgstr "Nouveau compte club"
#: com/templates/com/news_admin_list.jinja com/templates/com/poster_list.jinja #: com/templates/com/news_admin_list.jinja com/templates/com/poster_list.jinja
#: com/templates/com/screen_list.jinja com/templates/com/weekmail.jinja #: com/templates/com/screen_list.jinja com/templates/com/weekmail.jinja
#: core/templates/core/file.jinja core/templates/core/group_list.jinja #: core/templates/core/file.jinja core/templates/core/group_list.jinja
#: core/templates/core/page.jinja core/templates/core/poster_list.jinja #: core/templates/core/page.jinja core/templates/core/user_tools.jinja
#: core/templates/core/user_tools.jinja core/views/user.py #: core/views/user.py counter/templates/counter/cash_summary_list.jinja
#: counter/templates/counter/cash_summary_list.jinja
#: counter/templates/counter/counter_list.jinja #: counter/templates/counter/counter_list.jinja
#: election/templates/election/election_detail.jinja #: election/templates/election/election_detail.jinja
#: forum/templates/forum/macros.jinja #: forum/templates/forum/macros.jinja
@ -1140,7 +1139,7 @@ msgid "New Trombi"
msgstr "Nouveau Trombi" msgstr "Nouveau Trombi"
#: club/templates/club/club_tools.jinja com/templates/com/poster_list.jinja #: club/templates/club/club_tools.jinja com/templates/com/poster_list.jinja
#: core/templates/core/poster_list.jinja core/templates/core/user_tools.jinja #: core/templates/core/user_tools.jinja
msgid "Posters" msgid "Posters"
msgstr "Affiches" msgstr "Affiches"
@ -1558,17 +1557,46 @@ msgstr "Événements aujourd'hui et dans les prochains jours"
msgid "Nothing to come..." msgid "Nothing to come..."
msgstr "Rien à venir..." msgstr "Rien à venir..."
#: com/templates/com/news_list.jinja
msgid "Coming soon... don't miss!"
msgstr "Prochainement... à ne pas rater!"
#: com/templates/com/news_list.jinja #: com/templates/com/news_list.jinja
msgid "All coming events" msgid "All coming events"
msgstr "Tous les événements à venir" msgstr "Tous les événements à venir"
#: com/templates/com/news_list.jinja #: com/templates/com/news_list.jinja
msgid "Agenda" msgid "Links"
msgstr "Agenda" msgstr "Liens"
#: com/templates/com/news_list.jinja
msgid "Our services"
msgstr "Nos services"
#: com/templates/com/news_list.jinja pedagogy/templates/pedagogy/guide.jinja
msgid "UV Guide"
msgstr "Guide des UVs"
#: com/templates/com/news_list.jinja core/templates/core/base/navbar.jinja
msgid "Matmatronch"
msgstr "Matmatronch"
#: com/templates/com/news_list.jinja core/templates/core/base/navbar.jinja
#: core/templates/core/user_tools.jinja
msgid "Elections"
msgstr "Élections"
#: com/templates/com/news_list.jinja
msgid "Social media"
msgstr "Réseaux sociaux"
#: com/templates/com/news_list.jinja
msgid "Discord"
msgstr "Discord"
#: com/templates/com/news_list.jinja
msgid "Facebook"
msgstr "Facebook"
#: com/templates/com/news_list.jinja
msgid "Instagram"
msgstr "Instagram"
#: com/templates/com/news_list.jinja #: com/templates/com/news_list.jinja
msgid "Birthdays" msgid "Birthdays"
@ -1580,11 +1608,10 @@ msgid "%(age)s year old"
msgstr "%(age)s ans" msgstr "%(age)s ans"
#: com/templates/com/news_list.jinja com/tests.py #: com/templates/com/news_list.jinja com/tests.py
msgid "You need an up to date subscription to access this content" msgid "You need to subscribe to access this content"
msgstr "Votre cotisation doit être à jour pour accéder à cette section" msgstr "Vous devez cotiser pour accéder à ce contenu"
#: com/templates/com/poster_edit.jinja com/templates/com/poster_list.jinja #: com/templates/com/poster_edit.jinja com/templates/com/poster_list.jinja
#: core/templates/core/poster_list.jinja
msgid "Poster" msgid "Poster"
msgstr "Affiche" msgstr "Affiche"
@ -1598,15 +1625,15 @@ msgid "Posters - edit"
msgstr "Affiche - modifier" msgstr "Affiche - modifier"
#: com/templates/com/poster_list.jinja com/templates/com/screen_list.jinja #: com/templates/com/poster_list.jinja com/templates/com/screen_list.jinja
#: core/templates/core/poster_list.jinja sas/templates/sas/main.jinja #: sas/templates/sas/main.jinja
msgid "Create" msgid "Create"
msgstr "Créer" msgstr "Créer"
#: com/templates/com/poster_list.jinja core/templates/core/poster_list.jinja #: com/templates/com/poster_list.jinja
msgid "Moderation" msgid "Moderation"
msgstr "Modération" msgstr "Modération"
#: com/templates/com/poster_list.jinja core/templates/core/poster_list.jinja #: com/templates/com/poster_list.jinja
msgid "No posters" msgid "No posters"
msgstr "Aucune affiche" msgstr "Aucune affiche"
@ -2233,10 +2260,6 @@ msgstr "Les clubs de L'AE"
msgid "Others UTBM's Associations" msgid "Others UTBM's Associations"
msgstr "Les autres associations de l'UTBM" msgstr "Les autres associations de l'UTBM"
#: core/templates/core/base/navbar.jinja core/templates/core/user_tools.jinja
msgid "Elections"
msgstr "Élections"
#: core/templates/core/base/navbar.jinja #: core/templates/core/base/navbar.jinja
msgid "Big event" msgid "Big event"
msgstr "Grandes Activités" msgstr "Grandes Activités"
@ -2264,10 +2287,6 @@ msgstr "Eboutic"
msgid "Services" msgid "Services"
msgstr "Services" msgstr "Services"
#: core/templates/core/base/navbar.jinja
msgid "Matmatronch"
msgstr "Matmatronch"
#: core/templates/core/base/navbar.jinja launderette/models.py #: core/templates/core/base/navbar.jinja launderette/models.py
#: launderette/templates/launderette/launderette_book.jinja #: launderette/templates/launderette/launderette_book.jinja
#: launderette/templates/launderette/launderette_book_choose.jinja #: launderette/templates/launderette/launderette_book_choose.jinja
@ -4859,10 +4878,6 @@ msgstr "signalant"
msgid "reason" msgid "reason"
msgstr "raison" msgstr "raison"
#: pedagogy/templates/pedagogy/guide.jinja
msgid "UV Guide"
msgstr "Guide des UVs"
#: pedagogy/templates/pedagogy/guide.jinja #: pedagogy/templates/pedagogy/guide.jinja
#, python-format #, python-format
msgid "%(display_name)s" msgid "%(display_name)s"

View File

@ -7,7 +7,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-04 22:00+0100\n" "POT-Creation-Date: 2025-01-04 23:07+0100\n"
"PO-Revision-Date: 2024-09-17 11:54+0200\n" "PO-Revision-Date: 2024-09-17 11:54+0200\n"
"Last-Translator: Sli <antoine@bartuccio.fr>\n" "Last-Translator: Sli <antoine@bartuccio.fr>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@ -17,6 +17,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: com/static/bundled/com/components/ics-calendar-index.ts
msgid "More info"
msgstr "Plus d'informations"
#: core/static/bundled/core/components/ajax-select-base.ts #: core/static/bundled/core/components/ajax-select-base.ts
msgid "Remove" msgid "Remove"
msgstr "Retirer" msgstr "Retirer"