Skip to content

Commit

Permalink
updated index page log graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-yu committed Aug 15, 2017
1 parent 0cff214 commit dfd8fd0
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 67 deletions.
Binary file modified hwlog/db.sqlite3
Binary file not shown.
Binary file modified hwlog/log/__pycache__/views.cpython-36.pyc
Binary file not shown.
11 changes: 11 additions & 0 deletions hwlog/log/static/log/images/edit-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 30 additions & 13 deletions hwlog/log/static/log/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ html {
min-height: 100%;
}
body {
font-family: sans-serif;
font-family: "Helvetica", "Arial", sans-serif;
}

p {
Expand Down Expand Up @@ -40,28 +40,33 @@ footer {
color: #d6d6d6
}

.hw-table{
.log-container{
width: 900px;
border: 4px solid black;
border-collapse: collapse;
}
.log-container-row{
display:flex;
flex-direction: row;
width:100%;
height: 100px;
margin-bottom: 5px;
}
.course-name-box{
width: 30%;
width: 35%;
padding: 15px;
display: flex;
position: relative;
justify-content: center;
text-align: center;
vertical-align: center;
align-items: center;
color: white;
background-color: #515151;
}
.hw-box{
vertical-align: top;
}
.course-name-box,.hw-box{
border: 3px solid black;
border-collapse: collapse;
height: 100px;
width: inherit;
display: flex;
padding: 15px;
background-color: #e8e8e8;
}

.menu-container {
display: flex;
width: 900px;
Expand Down Expand Up @@ -146,6 +151,9 @@ footer {
justify-content: center;

}
.content-heading{
margin-bottom: 25px;
}
.lgn-container{
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -189,6 +197,15 @@ td {
background-color: lightgrey;
border: 2px solid black;
}
.edit-icon{
position: absolute;
bottom: 10px;
right: 10px;
width: 8%;
}
.icon-flex{
display:flex;
}
@media only screen and (max-width: 400px) {}


Expand Down
77 changes: 40 additions & 37 deletions hwlog/log/templates/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,46 @@
{% block title %}Settings{% endblock %}

{% block content %}

<form method="post">
<div class="content-container">
<div class="lgn-container">
<h1 style="margin-bottom: 25px;">Select your classes</h2>
{% csrf_token %}
{% load widget_tweaks %}
<div class="form-row">
<label for='c1'>Class 1:</label>
{% render_field form.course_1 id+="c1" %}
</div>
<div class="form-row">
<label for='c2'>Class 2:</label>
{% render_field form.course_2 id+="c2" %}
</div>
<div class="form-row">
<label for='c3'>Class 3:</label>
{% render_field form.course_3 id+="c3" %}
</div>
<div class="form-row">
<label for='c4'>Class 4:</label>
{% render_field form.course_4 id+="c4" %}
</div>
<div class="form-row">
<label for='c3'>Class 5:</label>
{% render_field form.course_5 id+="c5" %}
</div>
<div class="form-row">
<label for='c3'>Class 6:</label>
{% render_field form.course_6 id+="c6" %}
</div>
<div class="form-row">
<label for='c3'>Class 7:</label>
{% render_field form.course_7 id+="c7" %}
{% if user.is_authenticated %}
<form method="post">
<div class="content-container">
<div class="lgn-container">
<h1 class="content-heading">Select your classes</h2>
{% csrf_token %}
{% load widget_tweaks %}
<div class="form-row">
<label for='c1'>Class 1:</label>
{% render_field form.course_1 id+="c1" %}
</div>
<div class="form-row">
<label for='c2'>Class 2:</label>
{% render_field form.course_2 id+="c2" %}
</div>
<div class="form-row">
<label for='c3'>Class 3:</label>
{% render_field form.course_3 id+="c3" %}
</div>
<div class="form-row">
<label for='c4'>Class 4:</label>
{% render_field form.course_4 id+="c4" %}
</div>
<div class="form-row">
<label for='c3'>Class 5:</label>
{% render_field form.course_5 id+="c5" %}
</div>
<div class="form-row">
<label for='c3'>Class 6:</label>
{% render_field form.course_6 id+="c6" %}
</div>
<div class="form-row">
<label for='c3'>Class 7:</label>
{% render_field form.course_7 id+="c7" %}
</div>
<button type="submit" class="btn">Submit</button>
</div>
<button type="submit" class="btn">Submit</button>
</div>
</div>
</form>
</form>
{% else %}
<a href="{% url 'login' %}">Login before you can edit! </a>
{% endif %}
{% endblock %}
26 changes: 16 additions & 10 deletions hwlog/log/templates/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
{% block title %}Edit HW{% endblock %}

{% block content %}
{% if user.is_authenticated %}
<h2>{{course.course_name}}</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Save changes</button>
</form>
{% else %}
<a href="{% url 'login' %}">Login before you can edit! </a>
{% endif %}
<div class="content-container">
<div class="lgn-container">
{% if user.is_authenticated %}
<h1 class="content-heading">{{course.course_name}}</h2>
<form method="post">
{% csrf_token %}
<div class="form-row">
{{ form.hw }}
</div>
<button type="submit" class="btn">Save changes</button>
</form>
{% else %}
<a href="{% url 'login' %}">Login before you can edit! </a>
{% endif %}
</div>
</div>
{% endblock %}
28 changes: 24 additions & 4 deletions hwlog/log/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,37 @@
<div class="index-main">
{% if user.is_authenticated %}
{% if user.courses_joined.count > 0 %}
<!--
<table class="hw-table">
{% for course in user.courses_joined.all %}
{% if course.course_name == "None" %}
{% else %}
<tr>
<td class="course-name-box"><a href="{% url 'log:detail' course.id %}" > {{course.course_name}} <a></td>
<td class="hw-box"> {{course.hw}} </td>
</tr>
<tr>
<td class="course-name-box"> {{course.course_name}}
<div class="icon-flex">
<a href="{% url 'log:detail' course.id %}">{% load static %}<img src="{% static 'log/images/edit-icon.svg' %}" class='edit-icon'/></a>
</div>
</td>
<td class="hw-box"> {{course.hw}} </td>
</tr>
{% endif %}
{% endfor %}
</table>
-->
<div class="log-container">
{% for course in user.courses_joined.all %}
{% if course.course_name == "None" %}
{% else %}
<div class="log-container-row">
<div class="course-name-box"> {{course.course_name}}
<a href="{% url 'log:detail' course.id %}">
{% load static %}<img src="{% static 'log/images/edit-icon.svg' %}" class="edit-icon"/></a>
</div>
<div class="hw-box"> {{course.hw}}</div>
</div>
{% endif %}
{% endfor %}
</div>
{% else %}
<a href = "{% url 'configure' %}">Please select your classes first!</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion hwlog/log/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% block content %}
<div class="content-container">
<div class="lgn-container col-lg-8">
<h1 style="margin-bottom: 25px;"> Login </h1>
<h1 class="content-heading"> Login </h1>
<form id="login-form" method="post">
{% csrf_token %}
<table class="table">
Expand Down
3 changes: 2 additions & 1 deletion hwlog/log/templates/signup.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{% extends 'base.html' %}
{% block title %}Sign up{% endblock %}

{% block content %}
<div class="content-container">
<div class = "lgn-container">
<h1 style="margin-bottom:25px;">Sign up</h1>
<h1 class="content-heading">Sign up</h1>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
Expand Down
2 changes: 1 addition & 1 deletion hwlog/log/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def signup(request): #signup page
if request.method == 'POST':
form = UserCreationForm(request.POST)
if form.is_valid():
form.save()
form.save() #what does this do
username = form.cleaned_data.get('username')
raw_password = form.cleaned_data.get('password1')
user = authenticate(username=username, password=raw_password)
Expand Down
9 changes: 9 additions & 0 deletions imgs/edit-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dfd8fd0

Please sign in to comment.