From dfd8fd004e88ffd64684fddfb18db43fce45011b Mon Sep 17 00:00:00 2001 From: Danny Yu Date: Tue, 15 Aug 2017 22:41:19 +0800 Subject: [PATCH] updated index page log graphics --- hwlog/db.sqlite3 | Bin 163840 -> 163840 bytes hwlog/log/__pycache__/views.cpython-36.pyc | Bin 2546 -> 2546 bytes hwlog/log/static/log/images/edit-icon.svg | 11 +++ hwlog/log/static/log/style.css | 43 +++++++---- hwlog/log/templates/configure.html | 77 ++++++++++---------- hwlog/log/templates/detail.html | 26 ++++--- hwlog/log/templates/index.html | 28 ++++++- hwlog/log/templates/registration/login.html | 2 +- hwlog/log/templates/signup.html | 3 +- hwlog/log/views.py | 2 +- imgs/edit-icon.svg | 9 +++ 11 files changed, 134 insertions(+), 67 deletions(-) create mode 100644 hwlog/log/static/log/images/edit-icon.svg create mode 100644 imgs/edit-icon.svg diff --git a/hwlog/db.sqlite3 b/hwlog/db.sqlite3 index 728d2af400761f26ac70808b859d37a5233d8cdd..8c1f865129f88a346494f3d29972df73237a579b 100644 GIT binary patch delta 453 zcmZo@;A&{#njpGNaTi#Wbz5tR$_}H_I#2-^JA=GTbl2Kg20JDk~}{Dl4!mvdS&T zFWk4>Hy6k@^2_oMiLCNT&Yc?Pyd28QOk1{S(TmI{W(R>qcA zMkacehNh;LW?T#m42=AD7=VatvtYsnepO{=Urs^+$Ge%a;J^H)3!3tRrU(CH&Mo!v2SC-l72P@0R{%XLz@*9cJReDSu?Wwwy-*;XC_*dRiu_A z86>5eD!%y`OINp79hoM))5A4ZXoX{n39$VQwUAmoPN|00SA3!T + + + + + diff --git a/hwlog/log/static/log/style.css b/hwlog/log/static/log/style.css index 86e343e..0bbfbdb 100644 --- a/hwlog/log/static/log/style.css +++ b/hwlog/log/static/log/style.css @@ -8,7 +8,7 @@ html { min-height: 100%; } body { - font-family: sans-serif; + font-family: "Helvetica", "Arial", sans-serif; } p { @@ -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; @@ -146,6 +151,9 @@ footer { justify-content: center; } +.content-heading{ + margin-bottom: 25px; +} .lgn-container{ display: flex; flex-direction: column; @@ -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) {} diff --git a/hwlog/log/templates/configure.html b/hwlog/log/templates/configure.html index ff9061c..ea65070 100644 --- a/hwlog/log/templates/configure.html +++ b/hwlog/log/templates/configure.html @@ -2,43 +2,46 @@ {% block title %}Settings{% endblock %} {% block content %} - -
-
-
-

Select your classes

- {% csrf_token %} - {% load widget_tweaks %} -
- - {% render_field form.course_1 id+="c1" %} -
-
- - {% render_field form.course_2 id+="c2" %} -
-
- - {% render_field form.course_3 id+="c3" %} -
-
- - {% render_field form.course_4 id+="c4" %} -
-
- - {% render_field form.course_5 id+="c5" %} -
-
- - {% render_field form.course_6 id+="c6" %} -
-
- - {% render_field form.course_7 id+="c7" %} + {% if user.is_authenticated %} + +
+
+

Select your classes

+ {% csrf_token %} + {% load widget_tweaks %} +
+ + {% render_field form.course_1 id+="c1" %} +
+
+ + {% render_field form.course_2 id+="c2" %} +
+
+ + {% render_field form.course_3 id+="c3" %} +
+
+ + {% render_field form.course_4 id+="c4" %} +
+
+ + {% render_field form.course_5 id+="c5" %} +
+
+ + {% render_field form.course_6 id+="c6" %} +
+
+ + {% render_field form.course_7 id+="c7" %} +
+
-
-
- + + {% else %} + Login before you can edit! + {% endif %} {% endblock %} diff --git a/hwlog/log/templates/detail.html b/hwlog/log/templates/detail.html index 48cb254..39ffffb 100644 --- a/hwlog/log/templates/detail.html +++ b/hwlog/log/templates/detail.html @@ -2,14 +2,20 @@ {% block title %}Edit HW{% endblock %} {% block content %} - {% if user.is_authenticated %} -

{{course.course_name}}

-
- {% csrf_token %} - {{ form.as_p }} - -
- {% else %} - Login before you can edit! - {% endif %} +
+
+ {% if user.is_authenticated %} +

{{course.course_name}}

+
+ {% csrf_token %} +
+ {{ form.hw }} +
+ +
+ {% else %} + Login before you can edit! + {% endif %} +
+
{% endblock %} diff --git a/hwlog/log/templates/index.html b/hwlog/log/templates/index.html index abcfcb5..46665ac 100644 --- a/hwlog/log/templates/index.html +++ b/hwlog/log/templates/index.html @@ -5,17 +5,37 @@
{% if user.is_authenticated %} {% if user.courses_joined.count > 0 %} + +
+ {% for course in user.courses_joined.all %} + {% if course.course_name == "None" %} + {% else %} +
+
{{course.course_name}} + + {% load static %} +
+
{{course.hw}}
+
+ {% endif %} + {% endfor %} +
{% else %} Please select your classes first! {% endif %} diff --git a/hwlog/log/templates/registration/login.html b/hwlog/log/templates/registration/login.html index 6f02ec8..71e9b53 100644 --- a/hwlog/log/templates/registration/login.html +++ b/hwlog/log/templates/registration/login.html @@ -5,7 +5,7 @@ {% block content %}
-

Login

+

Login

{% csrf_token %} diff --git a/hwlog/log/templates/signup.html b/hwlog/log/templates/signup.html index 86479d9..e28fe59 100644 --- a/hwlog/log/templates/signup.html +++ b/hwlog/log/templates/signup.html @@ -1,9 +1,10 @@ {% extends 'base.html' %} +{% block title %}Sign up{% endblock %} {% block content %}
-

Sign up

+

Sign up

{% csrf_token %} {{ form.as_p }} diff --git a/hwlog/log/views.py b/hwlog/log/views.py index ce3a142..6bec318 100644 --- a/hwlog/log/views.py +++ b/hwlog/log/views.py @@ -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) diff --git a/imgs/edit-icon.svg b/imgs/edit-icon.svg new file mode 100644 index 0000000..4218d23 --- /dev/null +++ b/imgs/edit-icon.svg @@ -0,0 +1,9 @@ + + + + + +