mirror of
https://github.com/ae-utbm/sith.git
synced 2025-01-04 22:21:19 +00:00
Replace old agenda of event with links to services and change permission to see birthdays
This commit is contained in:
parent
8406cbe7ad
commit
d1b1b07aeb
@ -8,37 +8,33 @@
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.news_column {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#news_admin {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
#right_column {
|
||||
flex: 20%;
|
||||
float: right;
|
||||
margin: 0.2em;
|
||||
margin: 3.2px;
|
||||
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#left_column {
|
||||
flex: 79%;
|
||||
margin: 0.2em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
background: $second-color;
|
||||
box-shadow: $shadow-color 1px 1px 1px;
|
||||
padding: 0.4em;
|
||||
margin: 0 0 0.5em 0;
|
||||
text-transform: uppercase;
|
||||
font-size: 1.1em;
|
||||
h3 {
|
||||
background: $second-color;
|
||||
box-shadow: $shadow-color 1px 1px 1px;
|
||||
padding: 0.4em;
|
||||
margin: 0 0 0.5em 0;
|
||||
text-transform: uppercase;
|
||||
font-size: 1.1em;
|
||||
|
||||
&:not(:first-of-type) {
|
||||
margin: 2em 0 1em 0;
|
||||
}
|
||||
&:not(:first-of-type) {
|
||||
margin: 2em 0 1em 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,8 +46,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* AGENDA/BIRTHDAYS */
|
||||
#agenda,
|
||||
/* LINKS/BIRTHDAYS */
|
||||
#links,
|
||||
#birthdays {
|
||||
display: block;
|
||||
width: 100%;
|
||||
@ -59,9 +55,7 @@
|
||||
font-size: 70%;
|
||||
margin-bottom: 1em;
|
||||
|
||||
#agenda_title,
|
||||
#birthdays_title {
|
||||
margin: 0;
|
||||
h3 {
|
||||
border-radius: 5px 5px 0 0;
|
||||
box-shadow: $shadow-color 1px 1px 1px;
|
||||
padding: 0.5em;
|
||||
@ -72,34 +66,27 @@
|
||||
background: $second-color;
|
||||
}
|
||||
|
||||
#agenda_content {
|
||||
#links_content {
|
||||
overflow: auto;
|
||||
box-shadow: $shadow-color 1px 1px 1px;
|
||||
height: 20em;
|
||||
}
|
||||
|
||||
#agenda_content,
|
||||
#birthdays_content {
|
||||
.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;
|
||||
}
|
||||
}
|
||||
h4 {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
i {
|
||||
width: 20px;
|
||||
margin: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#birthdays_content {
|
||||
ul.birthdays_year {
|
||||
margin: 0;
|
||||
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 {
|
||||
box-shadow: $shadow-color 1px 1px 1px;
|
||||
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 {
|
||||
display: list-item;
|
||||
list-style-type: square;
|
||||
@ -242,9 +229,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* END COMING SOON */
|
||||
/* END COMING SOON */
|
||||
|
||||
/* NOTICES */
|
||||
/* NOTICES */
|
||||
.news_notice {
|
||||
margin: 0 0 1em 1em;
|
||||
padding: 0.4em;
|
||||
@ -262,9 +249,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* END NOTICES */
|
||||
/* END NOTICES */
|
||||
|
||||
/* CALLS */
|
||||
/* CALLS */
|
||||
.news_call {
|
||||
margin: 0 0 1em 1em;
|
||||
padding: 0.4em;
|
||||
@ -286,7 +273,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* END CALLS */
|
||||
/* END CALLS */
|
||||
|
||||
.news_empty {
|
||||
margin-left: 1em;
|
||||
|
@ -99,35 +99,48 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div id="right_column" class="news_column">
|
||||
<div id="agenda">
|
||||
<div id="agenda_title">{% trans %}Agenda{% endtrans %}</div>
|
||||
<div id="agenda_content">
|
||||
{% for d in NewsDate.objects.filter(end_date__gte=timezone.now(),
|
||||
news__is_moderated=True, news__type__in=["WEEKLY",
|
||||
"EVENT"]).order_by('start_date', 'end_date') %}
|
||||
<div class="agenda_item">
|
||||
<div class="agenda_date">
|
||||
<strong>{{ d.start_date|localtime|date('D d M Y') }}</strong>
|
||||
</div>
|
||||
<div class="agenda_time">
|
||||
<span>{{ d.start_date|localtime|time(DATETIME_FORMAT) }}</span> -
|
||||
<span>{{ d.end_date|localtime|time(DATETIME_FORMAT) }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<strong><a href="{{ url('com:news_detail', news_id=d.news.id) }}">{{ d.news.title }}</a></strong>
|
||||
<a href="{{ d.news.club.get_absolute_url() }}">{{ d.news.club }}</a>
|
||||
</div>
|
||||
<div class="agenda_item_content">{{ d.news.summary|markdown }}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div id="right_column">
|
||||
<div id="links">
|
||||
<h3>{% trans %}Links{% endtrans %}</h3>
|
||||
<div id="links_content">
|
||||
<h4>{% trans %}Our services{% endtrans %}</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa-solid fa-graduation-cap fa-xl"></i>
|
||||
<a href="{{ url("pedagogy:guide") }}">{% trans %}UV Guide{% endtrans %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa-solid fa-magnifying-glass fa-xl"></i>
|
||||
<a href="{{ url("matmat:search_clear") }}">{% trans %}Matmatronch{% endtrans %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa-solid fa-check-to-slot fa-xl"></i>
|
||||
<a href="{{ url("election:list") }}">{% trans %}Elections{% endtrans %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<br>
|
||||
<h4>{% trans %}Social media{% endtrans %}</h4>
|
||||
<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 id="birthdays">
|
||||
<div id="birthdays_title">{% trans %}Birthdays{% endtrans %}</div>
|
||||
<h3>{% trans %}Birthdays{% endtrans %}</h3>
|
||||
<div id="birthdays_content">
|
||||
{%- if user.is_subscribed -%}
|
||||
{%- if user.was_subscribed -%}
|
||||
<ul class="birthdays_year">
|
||||
{%- for year, users in birthdays -%}
|
||||
<li>
|
||||
@ -141,7 +154,7 @@
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- 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 -%}
|
||||
</div>
|
||||
</div>
|
||||
|
17
com/tests.py
17
com/tests.py
@ -97,9 +97,7 @@ class TestCom(TestCase):
|
||||
response = self.client.get(reverse("core:index"))
|
||||
self.assertContains(
|
||||
response,
|
||||
text=html.escape(
|
||||
_("You need an up to date subscription to access this content")
|
||||
),
|
||||
text=html.escape(_("You need to subscribe to access this content")),
|
||||
)
|
||||
|
||||
def test_birthday_subscibed_user(self):
|
||||
@ -107,9 +105,16 @@ class TestCom(TestCase):
|
||||
|
||||
self.assertNotContains(
|
||||
response,
|
||||
text=html.escape(
|
||||
_("You need an up to date subscription to access this content")
|
||||
),
|
||||
text=html.escape(_("You need to subscribe 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")),
|
||||
)
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user