-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add/reject events by admin implemented
- Loading branch information
Showing
5 changed files
with
468 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
221 changes: 221 additions & 0 deletions
221
Django/communicado/pages/templates/pages/eventaction.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
{% load static %} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Edit Event - {{ event.name }}</title> | ||
<style> | ||
/* CSS for screen view */ | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #0c0808; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
h1, h2 { | ||
color: #fff; | ||
text-align: center; | ||
margin-bottom: 20px; | ||
font-size: 24px; | ||
} | ||
|
||
.container { | ||
margin: 20px auto; | ||
padding: 20px; | ||
background-color: #0e0101; | ||
border-radius: 5px; | ||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); | ||
width: 80%; | ||
} | ||
|
||
.event-container { | ||
margin-bottom: 20px; | ||
padding: 10px; | ||
border: 1px solid #ddd; /* Add border to separate events */ | ||
border-radius: 5px; /* Add rounded corners */ | ||
} | ||
|
||
.event { | ||
display: flex; /* Use flexbox */ | ||
align-items: center; /* Center align items vertically */ | ||
margin-bottom: 20px; | ||
} | ||
|
||
.event-details { | ||
flex: 1; /* Take up remaining space */ | ||
padding: 20px; | ||
color: #fff; | ||
} | ||
|
||
.event-details > * { | ||
margin-bottom: 10px; /* Add spacing between elements */ | ||
color: #fff; | ||
} | ||
|
||
.event-image { | ||
margin-left: 20px; /* Add margin to separate image from text */ | ||
width: 800px; /* Set a fixed width for the image */ | ||
margin-bottom: 10px; | ||
margin-top: 20px; | ||
height: 500px; | ||
} | ||
|
||
.event-image img { | ||
width: 100%; /* Make the image fill its container */ | ||
border-radius: 5px; /* Add rounded corners */ | ||
} | ||
|
||
.btn { | ||
display: inline-block; | ||
padding: 10px 20px; | ||
font-size: 18px; | ||
background-color: transparent; | ||
color: #fff; | ||
text-decoration: none; | ||
border: 2px solid #fff; | ||
border-radius: 5px; | ||
margin-top: 20px; | ||
transition: background-color 0.3s, border-color 0.3s, color 0.3s; | ||
text-align: center; | ||
} | ||
|
||
.btn:hover { | ||
background-color: #fff; | ||
border-color: #fff; | ||
color: #000; | ||
} | ||
|
||
h1 { | ||
text-align: center; /* Center-align the title */ | ||
color: #fff; | ||
} | ||
|
||
.event-name { | ||
text-align: left; /* Center-align the event name */ | ||
font-weight: bold; | ||
font-size: medium; | ||
color: #fff; | ||
} | ||
|
||
header { | ||
background-color: rgba(0, 0, 0, 0.7); | ||
color: #fff; | ||
padding: 10px; | ||
text-align: right; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
z-index: 1000; | ||
} | ||
|
||
header a { | ||
color: #fff; | ||
margin: 0 10px; | ||
text-decoration: none; | ||
} | ||
|
||
header a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
/* CSS for print view */ | ||
@media print { | ||
body { | ||
background-color: #fff; /* Change background color for print */ | ||
} | ||
|
||
.container { | ||
width: 100%; /* Ensure full width for print */ | ||
margin: 0; /* Remove margin for print */ | ||
padding: 0; /* Remove padding for print */ | ||
} | ||
|
||
.btn { | ||
display: none; /* Hide buttons for print */ | ||
} | ||
|
||
header { | ||
display: none; /* Hide header for print */ | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<header> | ||
<a href="{% url 'login' %}">Login</a> | ||
<a href="{% url 'signup' %}">Signup</a> | ||
<a href="#">View Cart</a> | ||
</header> | ||
<div class="container"> | ||
<h1>Update Event</h1> | ||
|
||
<div class="event-container"> | ||
<h2>{{ event.name }} Details</h2> | ||
<div class="event-details"> | ||
{% if event.imageURL %} | ||
<div class="event-image"> | ||
<img src="{% static event.imageURL %}" alt="Event Image"> | ||
</div>{% endif %} | ||
<div class="event-info"> | ||
<span class="label">Name:</span> | ||
<span class="value">{{ event.name }}</span> | ||
</div> | ||
<div class="event-info"> | ||
<span class="label">Date and Time:</span> | ||
<span class="value">{{ event.eventDateTime }}</span> | ||
</div> | ||
<div class="event-info"> | ||
<span class="label">Location:</span> | ||
<span class="value">{{ event.location }}</span> | ||
</div> | ||
<div class="event-info"> | ||
<span class="label">Capacity:</span> | ||
<span class="value">{{ event.capacity }}</span> | ||
</div> | ||
<div class="event-info"> | ||
<span class="label">Category:</span> | ||
<span class="value">{{ event.category }}</span> | ||
</div> | ||
<div class="event-info"> | ||
<span class="label">Artist:</span> | ||
<span class="value">{{ event.artist }}</span> | ||
</div> | ||
<div class="event-info"> | ||
<span class="label">Price:</span> | ||
<span class="value">{{ event.price }}</span> | ||
</div> | ||
<div class="event-id"> | ||
<span class="label">Event ID:</span> | ||
<span class="value">{{ event.eventID }}</span> | ||
</div> | ||
|
||
<div> | ||
<button class="btn" onclick="confirmApproval('{{ event.eventID }}')">Approve Event</button> | ||
<button class="btn" onclick="confirmRejection('{{ event.eventID }}')">Reject Event</button> | ||
</div> | ||
|
||
|
||
|
||
</div> | ||
</div> | ||
</div> | ||
<script> | ||
function confirmApproval(eventId) { | ||
var confirmation = confirm("Are you sure you want to approve this event?"); | ||
if (confirmation) { | ||
window.location.href = "{% url 'approve_event' event_ID=event.eventID %}"; | ||
} | ||
} | ||
|
||
function confirmRejection(eventId) { | ||
var confirmation = confirm("Are you sure you want to reject this event?"); | ||
if (confirmation) { | ||
window.location.href = "{% url 'reject_event' event_ID=event.eventID%}"; | ||
} | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.