Skip to content

Commit

Permalink
used django-widget-tweaks to add css to configure form
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-yu committed Aug 15, 2017
1 parent a298e05 commit 0cff214
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Often times I do not have enough time to jot down the homework as I hurry to the

Front end: HTML/CSS

Back end: Python Django 1.11.3
Back end: Python 3.6.2 + Django 1.11.3
Packages: django-widget-tweaks 1.4.1
Binary file modified hwlog/db.sqlite3
Binary file not shown.
Binary file modified hwlog/hwlog/__pycache__/settings.cpython-36.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions hwlog/hwlog/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# Application definition

INSTALLED_APPS = [
'widget_tweaks',
'log.apps.LogConfig',
'django.contrib.admin',
'django.contrib.auth',
Expand Down
Binary file modified hwlog/log/__pycache__/views.cpython-36.pyc
Binary file not shown.
41 changes: 37 additions & 4 deletions hwlog/log/templates/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,43 @@
{% block title %}Settings{% endblock %}

{% block content %}
<h2>Select your classes</h2>

<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Submit</button>
<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" %}
</div>
<button type="submit" class="btn">Submit</button>
</div>
</div>
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion hwlog/log/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def signup(request): #signup page
raw_password = form.cleaned_data.get('password1')
user = authenticate(username=username, password=raw_password)
login(request, user)
return redirect('home')
return redirect('configure')
else:
form = UserCreationForm()
return render(request, 'signup.html', {'form': form})
Expand Down

0 comments on commit 0cff214

Please sign in to comment.