Skip to content

Commit 6751978

Browse files
committed
awards history redesign, social icon list style updates, about us join button
1 parent aeec692 commit 6751978

File tree

6 files changed

+60
-20
lines changed

6 files changed

+60
-20
lines changed

mps_site/data/homepage.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@
117117
]
118118
}
119119

120-
homepage_awards = [
121-
{
120+
homepage_awards = {
122121
"title": "Awards",
123122
"subtitle": "Our Society has won many awards over the years!",
124123
"awards": [
@@ -242,5 +241,4 @@
242241
"award_image": "assets/images/awards/clubsandsocs.jpg"
243242
}
244243
]
245-
}
246-
]
244+
}

mps_site/templates/components/home/about_us.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ <h1>About Us</h1>
2020
</p>
2121
</div>
2222
</div>
23+
<div class="center-contents">
24+
<a class="btn btn-primary mt-4" style="background-color: #202E4E; border-radius: 25px; border-width: 4px; border-color: white;" href="https://dcuclubsandsocs.ie/society/media-production" target="_blank">What are you waiting for? Join MPS Now!</a>
25+
</div>
2326
</div>
27+
2428
</div>
2529
</div>
Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,58 @@
11
<h1>Awards History</h1>
22
<div class="container">
33
<div class="row justify-content-center">
4-
<div class="col-md-8 custom-box shadow-lg bg-body">
5-
<div class="awards">
6-
<div class="center-contents shadow-lg bg-body"
7-
style="background-color: #202E4E; border-radius: 15px; padding-top: 10px; padding-bottom: 10px;">
8-
<ul
9-
style="padding-left: 10px; padding-right: 10px; list-style: none; text-align: left;">
10-
{% for award in awards %}
11-
<li>{{ award.award_description }}</li>
12-
{% endfor %}
13-
<ul></ul>
4+
<div class="col-md-12 custom-box shadow-lg bg-body" id="stats">
5+
<div class="row gy-4 row-cols-2 row-cols-md-4" style="color: white;">
6+
{% for award in homepage_awards.awards %}
7+
<div class="col my-2 award-item {% if forloop.counter > 8 %}d-none{% endif %}">
8+
<!-- Hide awards after the first 8 initially -->
9+
<div class="hvr-grow text-center d-flex flex-column justify-content-center align-items-center py-3 shadow-lg bg-body"
10+
style="background-color: #202E4E; border-radius: 25px;">
11+
<div class="bs-icon-xl bs-icon-circle bs-icon-primary d-flex flex-shrink-0 justify-content-center align-items-center d-inline-block mb-2 bs-icon lg">
12+
<i class="{{ award.award_icon }}" style="font-size: 70px;"></i>
13+
</div>
14+
<div class="px-3" id="{{ award.award | lower }}">
15+
<h2 class="fw-bold tada animated mb-0">{{ award.year }}</h2>
16+
<p class="mb-0">{{ award.award }} - {{ award.sponsor }}</p>
17+
</div>
1418
</div>
1519
</div>
20+
{% endfor %}
21+
</div>
22+
<div class="text-center mt-3">
23+
<button id="viewMoreButton" class="btn btn-primary" style="background-color: #202E4E; border-radius: 25px; border-width: 4px; border-color: white;">View All Awards</button>
24+
<button id="hideButton" class="btn btn-secondary d-none" style="background-color: #202E4E; border-radius: 25px; border-width: 4px; border-color: white;">Hide Awards</button>
1625
</div>
1726
</div>
1827
</div>
19-
</div>
28+
</div>
29+
30+
<script>
31+
const viewMoreButton = document.getElementById('viewMoreButton');
32+
const hideButton = document.getElementById('hideButton');
33+
const awardItems = document.querySelectorAll('.award-item');
34+
35+
viewMoreButton.addEventListener('click', function () {
36+
// Show all hidden awards
37+
awardItems.forEach((item, index) => {
38+
if (index >= 8) {
39+
item.classList.remove('d-none');
40+
}
41+
});
42+
// Show the Hide button and hide the View More button
43+
viewMoreButton.classList.add('d-none');
44+
hideButton.classList.remove('d-none');
45+
});
46+
47+
hideButton.addEventListener('click', function () {
48+
// Hide awards after the first 8
49+
awardItems.forEach((item, index) => {
50+
if (index >= 8) {
51+
item.classList.add('d-none');
52+
}
53+
});
54+
// Show the View More button and hide the Hide button
55+
hideButton.classList.add('d-none');
56+
viewMoreButton.classList.remove('d-none');
57+
});
58+
</script>

mps_site/templates/components/home/socials.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ <h1>Follow Our Socials!</h1>
33
<h5><i>Keep updated with all things MPS!</h5></i>
44
<div class="row justify-content-center">
55
<div class="col-md-7 custom-box" style="text-align: center;">
6-
<div class="social-icons">
7-
<ul>
6+
<div class="social-icons" >
7+
<ul style="background-color: #202E4E; border-radius: 16px;" class="pb-4">
88
<li><a href="https://chat.whatsapp.com/EBupVbTpWX01uJvBp5r24D" target="_blank" aria-label="DCU MPS WhatsApp Group"><i class="fa-brands fa-whatsapp hvr-bounce-in"></i></a></li>
99
<li><a href="http://youtube.com/dcumps" target="_blank" aria-label="DCU MPS YouTube Channel"><i class="fa-brands fa-youtube hvr-bounce-in"></i></a></li>
1010
<li><a href="https://www.tiktok.com/@dcumps" target="_blank" aria-label="DCU MPS TikTok"><i class="fa-brands fa-tiktok hvr-bounce-in"></i></a></li>
@@ -16,7 +16,6 @@ <h5><i>Keep updated with all things MPS!</h5></i>
1616
</ul>
1717
</div>
1818
<div class="social-description">
19-
<li><u><a href="https://chat.whatsapp.com/EBupVbTpWX01uJvBp5r24D" target="_blank">MPS "Think Tank" WhatsApp Group</a></u></li>
2019
<li><u><a href="https://dcuclubsandsocs.ie/society/media-production" target="_blank">Become a member of MPS today</a></u></li>
2120
<li><u><a href="https://thecollegeview.ie" target="_blank">The College View - Our Online Newspaper</a></u></li>
2221
<li><u><a href="https://lounge.live/lounges/kr53i9b6" target="_blank">Lounge - A hub for all of our events</a></u></li>

mps_site/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
urlpatterns = [
1111
path('', views.index, name="index"),
12+
path('link', views.links, name="links"),
1213
path('links', views.links, name="links"),
1314
path('linktree', views.links, name="links"),
1415
path('linksdcutv', views.links_tv, name="links_tv"),

mps_site/views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
def index(request):
1616
video = get_latest_video_id("https://www.youtube.com/feeds/videos.xml?channel_id=UCEnLsvcq1eFkSFFAIqBDgUw")
1717
posts = tcv_posts("https://thecollegeview.ie/wp-json/wp/v2/posts?per_page=3&orderby=date&_fields=id,date,title,content,link,author,featured_media")
18-
awards = Award.objects.all()
1918
previous, current, next_show = get_date_time()
2019

2120
return render(request, 'index.html',
@@ -31,7 +30,7 @@ def index(request):
3130
'current_show': current,
3231
'next_show': next_show,
3332
'event_status': "No events at the moment, check back later!",
34-
'awards': awards,
33+
'homepage_awards': homepage_awards,
3534
'posts': posts,
3635
'homepage_carousel': homepage_carousel,})
3736

0 commit comments

Comments
 (0)