Skip to content

Commit 9838986

Browse files
committed
updated to my c&s api, added view event button to take you to c&s website
1 parent 09a650a commit 9838986

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

mps_site/templates/components/home/upcoming_events.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ <h1>Upcoming Events</h1>
33
<h5><i>You won't want to miss them!</i></h5>
44
<div class="row justify-content-center">
55
<div class="col-md-12 custom-box shadow-lg p-3 mb-5 bg-body">
6+
{% if events.events.items|length == 0 %}
67
<h3 style="justify-content: center; padding-top: 10px;">No events at the
78
moment, check back later!</h3>
9+
{% else %}
810
<div class="container mt-4">
911
<div class="row">
1012

@@ -22,8 +24,12 @@ <h5><strong>Location:</strong> <a href="{{ event.location }}"
2224
<button type="button" class="btn btn-primary" data-toggle="modal"
2325
data-target="#moreInfoModal_{{ forloop.counter }}"
2426
style="background-color: #9791FF;">
25-
More Info
27+
Description
2628
</button>
29+
<a href="https://dcuclubsandsocs.ie/society/media-production#events" target="_blank"><button type="button" class="btn btn-primary"
30+
style="background-color: #9791FF;">
31+
View Event
32+
</button></a>
2733

2834
<div class="modal fade" id="moreInfoModal_{{ forloop.counter }}"
2935
tabindex="-1" role="dialog"
@@ -60,6 +66,7 @@ <h5><strong>Location:</strong> <a href="{{ event.location }}"
6066

6167
</div>
6268
</div>
69+
{% endif %}
6370
</div>
6471
</div>
6572
</div>

mps_site/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ 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")
1818
previous, current, next_show = get_date_time()
19-
#events = get_event_data()
19+
events = requests.get("https://clubsandsocs.jakefarrell.ie/dcuclubsandsocs.ie/society/media-production/events").json()
2020

2121
return render(request, 'index.html',
2222
{'stats_data': homepage_stats_data,
2323
'subgroups_data': homepage_subgroups,
2424
'merch': homepage_merch,
25-
#'events': events,
25+
'events': events,
2626
'page_name': 'Home',
2727
'latest_video_id' : video,
2828
'previous_show': previous,

0 commit comments

Comments
 (0)