Commit 2aade1d3 authored by Rau Layug's avatar Rau Layug

Added Django templates and updated CalendarApp views

parent 6eea7d8d
...@@ -15,10 +15,16 @@ def index(request): ...@@ -15,10 +15,16 @@ def index(request):
target_date = event.target_date target_date = event.target_date
activity = event.activity activity = event.activity
estimated_hours = event.estimated_hours estimated_hours = event.estimated_hours
course_section = "{} {} {}".format(course.course_code, course.course_title, course.section) course_section = "{} {} {}".format(course.course_code,
course.course_title, course.section)
mode = location.get_mode_display() mode = location.get_mode_display()
venue = location.venue venue = location.venue
response += "Target Date: {}<br>Activity: {}<br>Estimated Hours: {}<br>Course/Section: {}<br>Mode: {}<br>Venue: {}<br><br>".format(target_date, activity, estimated_hours, course_section, mode, response += "Target Date: {}<br>Activity: {}<br>Estimated Hours: {}<br>Course/Section: {}<br>Mode: {}<br>Venue: {}<br><br>".format(
target_date, activity, estimated_hours, course_section, mode,
venue) venue)
return HttpResponse(response) return HttpResponse(response)
def index_view(request):
return render(request, 'index.html', {'name': Rau})
...@@ -123,7 +123,8 @@ USE_TZ = True ...@@ -123,7 +123,8 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.0/howto/static-files/ # https://docs.djangoproject.com/en/4.0/howto/static-files/
STATIC_URL = 'static/' STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'project/static')]
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{% block title %}BASE HTML{% endblock %}</title>
{% block styles %}{% endblock %}
</head>
<body>
<div id="content">
{% block content %}This is the base html{% endblock %}
</div>
{% block scripts %}{% endblock %}
</body>
</html>
\ No newline at end of file
{% extends 'base.html' %}
{% load static %}
{% block title %}Index Card{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{% static 'css/styles.css' %">
{% endblock %}
{% block content %}
<form action="/index_card" method="post">
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit">
</form>
\ No newline at end of file
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