Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend #35

Merged
merged 89 commits into from
Aug 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
f74de38
Test
Aug 6, 2019
0843001
Merge branch 'frontend' of https://github.com/MissionBit/MB_Portal in…
Aug 6, 2019
2f1cdb4
Merge pull request #32 from MissionBit/master
tylerIams Aug 6, 2019
0325b58
Something
Aug 6, 2019
ece4f72
Merge pull request #33 from MissionBit/design
Ernesto2004 Aug 6, 2019
68ada5d
context processor
Aug 6, 2019
cb293ac
changes
Aug 6, 2019
83fc8dd
serving static assets, some temp junk
Aug 7, 2019
989e97c
pr19 attendance view fix
Aug 9, 2019
4c81821
new commit
Aug 9, 2019
5688a46
pr19 fix use session.date
Aug 9, 2019
f0f8c8f
username collision repair
Aug 9, 2019
11cd71b
UI_Update
Aug 10, 2019
9d8e08d
invalid form workflow, user creation fxns improved
Aug 10, 2019
3497db3
landing_pg done
Aug 10, 2019
fc9518c
Aug 9, Fri. 9:38 Push
Aug 10, 2019
045d1fa
Changes
Aug 10, 2019
30a61c1
Expandable Menu
Aug 10, 2019
866bec6
changes to home
Aug 10, 2019
3628e0f
merge conflicts resolved
Aug 10, 2019
8bfc655
register/login layouts finished
Aug 10, 2019
036c697
announcement form mui-formatted
Aug 10, 2019
1cc8037
Expandable MenuButtons Fix
Aug 10, 2019
9ff4cea
blabla
Aug 10, 2019
58b3ba9
change
Aug 10, 2019
60237b6
VERY-VERY-VERY small change
Aug 10, 2019
a80e549
mui form layouts
Aug 10, 2019
af50a08
adding mui-panels
Aug 11, 2019
ec00df3
changes
Aug 11, 2019
684bc24
mui-panels/tables/forms complete
Aug 11, 2019
3a47ccb
Instafeed Update
Aug 11, 2019
dd0a17a
instafeed update
Aug 11, 2019
a942daf
mui-panel in home/student
Aug 11, 2019
4015d2a
Merge branch 'frontend' of https://github.com/MissionBit/MB_Portal in…
Aug 11, 2019
e445eb1
reformatted for mui
Aug 11, 2019
94cf880
deleted file
Aug 11, 2019
15d8900
changed attendance
Aug 11, 2019
2523401
Merge pull request #34 from MissionBit/issue
tylerIams Aug 11, 2019
17a0c1a
insta security issue attempted resolution
Aug 12, 2019
f634f1b
font fallbacks
Aug 12, 2019
1d60278
reformatted w black
Aug 12, 2019
9ccbe38
Changes
Aug 12, 2019
30d9266
Changes
Aug 13, 2019
346342c
primarily addresses #24, also adds contact creation to registration p…
Aug 14, 2019
c85fc22
tests reformatted for #24 changes
Aug 14, 2019
4cb9597
removed docker items from requirements.txt
Aug 14, 2019
bee0fc6
something
Aug 14, 2019
4f7e62b
something
Aug 14, 2019
c230162
Issue Fixes|Instafeed Fix|UI update
Aug 14, 2019
01b1b47
templates rearranged, duplication reduction
Aug 14, 2019
51f6c71
--do not pay attention--
Aug 14, 2019
f983364
--do not pay attention--
Aug 14, 2019
9dcd3c2
png logo to svg
Aug 14, 2019
3213df9
elim registration redundancy, move base templates to html dir
Aug 15, 2019
d2292ea
fixed instagram bug/moved to html folder
Aug 15, 2019
ad16cb1
removed id attribute
Aug 15, 2019
c87091b
template location bug fixed
Aug 15, 2019
76a1aba
something
Aug 15, 2019
3bdfc4f
commit
Aug 15, 2019
66b87b0
Alert Close Fix
Aug 15, 2019
1d07bfb
Minor Changes
Aug 15, 2019
e9adc5f
rm id attrib
Aug 15, 2019
dcd6402
Small Changes
Aug 15, 2019
67fe482
stray #24
Aug 15, 2019
763f52f
removed print statement
Aug 15, 2019
c46b891
unnecessary enctype removed
Aug 15, 2019
eb52703
removed download form
Aug 15, 2019
89a10fe
css file formats fixed
Aug 15, 2019
0506415
database query issue, teacher views bug
Aug 15, 2019
5719d7d
using in tuple for presence filter
Aug 15, 2019
4eb2fcc
validate username fix
Aug 15, 2019
3ac8623
form to be signed update
Aug 15, 2019
31a5fc2
login with google text fix
Aug 15, 2019
6393209
'example.com' URLs fix
Aug 16, 2019
62c527b
'example.com' URLs fix
Aug 16, 2019
cd5aeda
Alert Messages Fix(2)
Aug 16, 2019
3bb9414
changes
Aug 16, 2019
495857a
link instead of form
Aug 16, 2019
5cbc2ff
merge conflicts fixed
Aug 16, 2019
6eb5cb9
links replacing forms, other small-scale fixes
Aug 19, 2019
7bb73e8
template redundancy/context processors
Aug 22, 2019
41c6436
NEW Instagram API Method | Copyright Date Fix
Aug 22, 2019
26c2b04
NEW Instagram API Method | Copyright Date Fix
Aug 23, 2019
b1c059e
beginning to simplify stylesheets
Aug 23, 2019
0db1d52
Merge branch 'frontend' of https://github.com/MissionBit/MB_Portal in…
Aug 23, 2019
ffbfdde
eliminated mui_assets_home
Aug 23, 2019
77724d3
tackles #36 and eliminates more template redundancy
Aug 24, 2019
304e2f2
form dismissal fixed
Aug 24, 2019
b5c6db7
reformatted
Aug 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
227 changes: 94 additions & 133 deletions attendance/templates/attendance.html
Original file line number Diff line number Diff line change
@@ -1,143 +1,104 @@
{% extends "home/home.html" %}
{% extends "base.html" %}

{% block content %}

<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 75%;
}

td, th {
border: 1px solid #dddddd;
text-align: center;
padding: 8px;
}

tr:nth-child(even) {
background-color: cadetblue;
}

.button {
font-size: 10px;
font-family: "American Typewriter";
border-radius: 14px;
background-color: white;
color: #4CAF50;
border: 2px solid #000080;
}
.buttonSub {
font-size: 14px;
font-family: "American Typewriter";
border-radius: 18px;
background-color: white;
color: #4CAF50;
border: 2px solid #000080;
}
</style>

<div class="sidenav">
<li><a href="{% url 'home-home' %}">Home</a></li>
</div>

<div class="main-container">
{% if course %}
<h1 style="padding-bottom: 30px"> Attendance for {{ course }} </h1>
<table>
<tr>
<th>Date</th>
<th>Daily Attendance</th>
<th>Take Attendance</th>
<th>Send Absent Notifications</th>
</tr>
{% for date in dates %}
<tr>
<td>{{ date }}</td>
<td>{{ daily_attendance|get_item:date }}%</td>
<td>
<form action= "{% url 'take_attendance' %}" method="GET">
{% csrf_token %}
<input type="hidden" name="date" value="{{ date }}" />
<input type="hidden" name="course_id" value={{ course_id }} />
<input type="hidden" name="date_id" value={{ id }} />
<button class="button" type="submit">View/Take Attendance</button>
</form>
</td>
<td>
<form action= "{% url 'notify_absent_students' %}" method="GET">
{% csrf_token %}
<input type="hidden" name="date" value="{{ date }}" />
<input type="hidden" name="course_id" value={{ course_id }} />
<input type="hidden" name="date_id" value={{ id }} />
<button class="button" type="submit">Notify Absent Students</button>
</form>
</td>
</tr>
{% endfor %}
</table>
{% elif attendance_objects %}
<h1 style="padding-bottom: 30px"> {{ course_name }} {{ attendance_objects.first.date }} </h1>
<form action= "{% url 'attendance' %}" method="POST" style="width: 80%">
{% csrf_token %}
<table>
<tr>
<th>Date</th>
<th>Student</th>
<th>Status</th>
<th>Current Status</th>
</tr>
{% for attendance_object in attendance_objects %}
<tr>
<td>{{ attendance_object.date }}</td>
<td>{{ attendance_object.student.first_name }} {{ attendance_object.student.last_name }}</td>
<td>
<select name="{{ attendance_object.student.first_name }} {{ attendance_object.student.last_name }}">
<option value="{{ attendance_object.presence }}">-----------</option>
<option value="Present">Present</option>
<option value="Absent">Absent</option>
<option value="Late">Late</option>
<option value="Excused">Excused</option>
</select>
</td>
<td>
{{ attendance_object.presence }}
</td>
</tr>
<div style="text-align: center;">
<div style="width: 85%; display: inline-block" class="mui-panel">
{% if course %}
<h1 style="padding-bottom: 30px"> Attendance for {{ course }} </h1>
<table class="mui-table mui-table--bordered">
<tr>
<th style="text-align: center;">Date</th>
<th style="text-align: center;">Daily Attendance</th>
<th style="text-align: center;">Take Attendance</th>
<th style="text-align: center;">Send Absent Notifications</th>
</tr>
{% for date in dates %}
<tr>
<td>{{ date }}</td>
<td>{{ daily_attendance|get_item:date }}%</td>
<td>
<a href="{% url 'take_attendance' course_id=course_id date=date %}"
class="mui-btn mui-btn--primary mui-btn--small">View/Take</a>
</td>
<td>
<form action= "{% url 'notify_absent_students' %}" method="GET">
{% csrf_token %}
<input type="hidden" name="date" value="{{ date }}" />
<input type="hidden" name="course_id" value={{ course_id }} />
<input type="hidden" name="date_id" value={{ id }} />
<button class="mui-btn mui-btn--primary mui-btn--small" type="submit">Send</button>
</form>
</td>
</tr>
{% endfor %}
</table>
<input type="hidden" name="attendance_taken" value="true" />
<input type="hidden" name="date" value="{{ attendance_objects.first.date }}" />
<input type="hidden" name="course_id" value="{{ course_id }}" />
<div style="padding-top: 20px">
<button class="buttonSub" type="submit"> Submit </button>
</div>
</form>
{% else %}
<h1 style="padding-bottom: 30px"> Attendance Home </h1>
<table>
<tr>
<th>Course</th>
<th>Teacher</th>
<th>Overall Attendance</th>
<th>View Attendance</th>
</tr>
{% for classroom in classrooms %}
<tr>
<td>{{ classroom.course }}</td>
<td>{{ classroom.teacher }}</td>
<td>{{ attendance_averages|get_item:classroom.course }}%</td>
<td>
<form method="GET">
<button class="button" type="submit" name="course_id" value="{{ classroom.id }}">View Class Attendance</button>
</form>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% elif attendance_objects %}
<h1> {{ course_name }} {{ attendance_objects.first.date }} </h1>
<form action= "{% url 'attendance' %}" method="POST">
{% csrf_token %}
<table class="mui-table mui-table--bordered">
<tr>
<th style="text-align: center;">Date</th>
<th style="text-align: center;">Student</th>
<th style="text-align: center;">Status</th>
<th style="text-align: center;">Current Status</th>
</tr>
{% for attendance_object in attendance_objects %}
<tr>
<td>{{ attendance_object.date }}</td>
<td>{{ attendance_object.student.first_name }} {{ attendance_object.student.last_name }}</td>
<td>
<div class="mui-select">
<select name="{{ attendance_object.student.first_name }} {{ attendance_object.student.last_name }}">
<option value="{{ attendance_object.presence }}">-----------</option>
<option value="Present">Present</option>
<option value="Absent">Absent</option>
<option value="Late">Late</option>
<option value="Excused">Excused</option>
</select>
</div>
</td>
<td>
{{ attendance_object.presence }}
</td>
</tr>
{% endfor %}
</table>
<input type="hidden" name="attendance_taken" value="true" />
<input type="hidden" name="date" value="{{ attendance_objects.first.date }}" />
<input type="hidden" name="course_id" value="{{ course_id }}" />
<div style="padding-top: 20px">
<button class="mui-btn mui-btn--primary mui-btn--small" type="submit"> Submit </button>
</div>
</form>
{% else %}
<h1 style="padding-left: 10px"> Attendance Home </h1>
<table class="mui-table mui-table--bordered">
<tr>
<th style="text-align: center;">Course</th>
<th style="text-align: center;">Overall Attendance</th>
<th style="text-align: center;">View Attendance</th>
</tr>
{% for classroom in classrooms %}
<tr>
<td>{{ classroom.course }}</td>
<td>{{ attendance_averages|get_item:classroom.course }}%</td>
<td>
<form method="GET">
<button class="mui-btn mui-btn--primary mui-btn--small" type="submit" name="course_id" value="{{ classroom.id }}">View</button>
</form>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
</div>
</div>


{% endblock content %}




40 changes: 40 additions & 0 deletions attendance/templates/attendance_base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="//cdn.muicss.com/mui-0.9.43/css/mui.min.css" rel="stylesheet" type="text/css" />
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'>
<link rel="stylesheet" href="{% static 'css/mui_assets.css' %}"/>
<link rel="icon" href="{% static "missionbit-icon.png" %}"> <!-- LOGO ON THE TAB BAR -->
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<script src="//cdn.muicss.com/mui-0.9.43/js/mui.min.js"></script>
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<title>Mission Bit</title>
{% include "manipulation_js.html" %}
</head>

<body class="hide-sidedrawer">

{% include 'header.html' %}

{% include 'instafeed.html' %}

{% include 'left_side_panel.html' %}

<div id="content-wrapper">
<div class="mui--appbar-height"></div>
<div class="mui-container-fluid">
<br>
{% block content %}

{% endblock %}
</div>
</div>

{% include 'footer.html' %}

</body>
</html>
12 changes: 10 additions & 2 deletions attendance/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

urlpatterns = [
path("", views.attendance, name="attendance"),
path("take_attendance/", views.take_attendance, name="take_attendance"),
path("notify_absent_students/", views.notify_absent_students, name="notify_absent_students")
path(
"take_attendance/<course_id>/<date>/",
views.take_attendance,
name="take_attendance",
),
path(
"notify_absent_students/",
views.notify_absent_students,
name="notify_absent_students",
),
]
Loading