Updated templates to match project specifications

parent b9f2ee58
......@@ -19,14 +19,19 @@ class Location(models.Model):
class Event(models.Model):
target_datetime = models.DateTimeField()
activity = models.CharField(max_length=100)
target_datetime = models.DateTimeField()
estimated_hours = models.FloatField()
location = models.ForeignKey(
Location,
on_delete=models.CASCADE
)
course = models.ForeignKey(Course, related_name='event', on_delete=models.CASCADE, null=True)
course = models.ForeignKey(
Course,
related_name='event',
on_delete=models.CASCADE,
null=True
)
def __str__(self):
return '{} on {}'.format(self.activity, self.target_datetime)
......
......@@ -3,7 +3,9 @@
{% load static %}
{% block content %}
<h1>Add Event</h1>
<title>Add Activity</title>
Add a new activity:
<form method="post">
......@@ -12,7 +14,7 @@
<a href="/Events/{{Event.pk}}/details">
<button type="submit">Add Event</button>
<button type="submit">Save New Activity</button>
</a>
......
......@@ -3,17 +3,17 @@
{% load static %}
{% block content %}
<title>Event</title>
<title>{{object.activity}}</title>
<br><br>
<h2>{{object.activity}}</h2>
<h3>Date and Time: {{object.target_datetime}}</h3>
<h3>Estimated Hours: {{object.estimated_hours}}</h3>
<h3>{{course}}</h3>
<h3>Mode: {{location.mode}}</h3>
<h3>Venue: {{location.venue}}</h3>
<br>Date and Time: {{object.target_datetime|date:"m/d/y, h:i A"}}<br>
<br>Estimated Hours: {{object.estimated_hours}}<br>
<br>{{object.course.code}} {{object.course.title}} - {{object.course.section}}<br>
<br>Mode: {{object.location.mode}}<br>
<br>Venue: {{object.location.venue}}<br>
<br><br>
<a href="edit">
<input type="button" value="Edit Event">
</a>"
<input type="button" value="Edit Activity">
</a>
{% endblock content %}
\ No newline at end of file
......@@ -3,13 +3,16 @@
{% load static %}
{% block content %}
<h1>Edit Event</h1>
<title>Edit Activity</title>
Edit Activity:<br>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Edit Event" />
<input type="submit" value="Save New Activity" />
</a>
</form>
{% endblock content %}
\ No newline at end of file
......@@ -6,7 +6,10 @@ from django.urls import reverse
def index(request):
html_string = 'robo_mommy’s Calendar of Activities<br><ul>'
html_string = '''
<title>robo_mommy’s Calendar of Activities</title>
<h2>robo_mommy’s Calendar of Activities</h2><ul>
'''
for eventItem in Event.objects.all():
eventId = str(eventItem.pk)
href = '<a href="widget_Calendar/Events/'+eventId+'/details">'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment