Skip to content

Commit c68bec6

Browse files
committed
added ad package randomiser
1 parent 38a5fb8 commit c68bec6

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

mps_site/templates/ads.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{% extends 'base.html' %}
2+
{% load static %}
3+
{% block content %}
4+
5+
<div class="container">
6+
<h1 class="pt-4">Ad Package Randomiser</h1>
7+
<div class="row justify-content-center">
8+
<div class="col-md-7 custom-box shadow-lg bg-body">
9+
<div class="center-contents">
10+
<div class="p-3 px-4 text-left shadow-lg bg-body" style="background-color: #202E4E; border-radius: 25px;">
11+
<p id="random-number-display" class="text-center" style="font-size: 250px; font-weight: bold; margin: 20px 0;">1</p>
12+
</div>
13+
<div class="center-contents pt-3">
14+
<button onclick="generateRandomNumber()" class="btn btn-primary" style="background-color: #202E4E; border-radius: 25px; border-width: 4px; border-color: white;">
15+
Next Ad Package To Play
16+
</button>
17+
</div>
18+
</div>
19+
</div>
20+
</div>
21+
</div>
22+
23+
<script>
24+
function generateRandomNumber() {
25+
const randomNumber = Math.floor(Math.random() * 10) + 1;
26+
const displayElement = document.getElementById("random-number-display");
27+
displayElement.innerHTML = `${randomNumber}`;
28+
}
29+
</script>
30+
31+
{% endblock %}
32+
{% block footer %}
33+
34+
{% endblock %}

mps_site/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
path("memes", views.memes, name="memes"),
2424
path("dcufm", views.dcufm, name="dcufm"),
2525
path("loans", views.loans, name="loans"),
26+
path("ads", views.ads, name="ads"),
2627
path('robots.txt', TemplateView.as_view(template_name="robots.txt", content_type='text/plain')),
2728
path('favicon.ico', RedirectView.as_view(url=settings.STATIC_URL + 'assets/img/other/favicon.ico')),
2829
path('donate', RedirectView.as_view(url="https://www.idonate.ie/fundraiser/MediaProductionSociety12"), name="donate"),

mps_site/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ def tcv(request):
7676
'family_tree': tcv_family_tree,
7777
'editors': editors
7878
})
79+
80+
def ads(request):
81+
return render(request, 'ads.html', {'page_name': 'Ad Package Randomiser'})
82+
7983
def committee(request):
8084
committee_members = CommitteeMember.objects.all()
8185
return render(request, 'committee.html',

0 commit comments

Comments
 (0)