Skip to content

Commit

Permalink
added more courses to course list
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-yu committed Jan 30, 2018
1 parent 0901539 commit 7850750
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
Binary file added Course List.docx
Binary file not shown.
Binary file modified hwlog/db.sqlite3
Binary file not shown.
19 changes: 11 additions & 8 deletions hwlog/log/forms.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from django import forms
from .models import Course
from itertools import chain

class ClassEnrollForm(forms.Form): #form to edit course settings
course_1 = forms.ModelChoiceField(queryset=Course.objects.all(),empty_label=None)
course_2 = forms.ModelChoiceField(queryset=Course.objects.all(),empty_label=None)
course_3 = forms.ModelChoiceField(queryset=Course.objects.all(),empty_label=None)
course_4 = forms.ModelChoiceField(queryset=Course.objects.all(),empty_label=None)
course_5 = forms.ModelChoiceField(queryset=Course.objects.all(),empty_label=None)
course_6 = forms.ModelChoiceField(queryset=Course.objects.all(),empty_label=None)
course_7 = forms.ModelChoiceField(queryset=Course.objects.all(),empty_label=None)
courseList = Course.objects.order_by('course_name')

course_1 = forms.ModelChoiceField(queryset=courseList,empty_label=None)
course_2 = forms.ModelChoiceField(queryset=courseList,empty_label=None)
course_3 = forms.ModelChoiceField(queryset=courseList,empty_label=None)
course_4 = forms.ModelChoiceField(queryset=courseList,empty_label=None)
course_5 = forms.ModelChoiceField(queryset=courseList,empty_label=None)
course_6 = forms.ModelChoiceField(queryset=courseList,empty_label=None)
course_7 = forms.ModelChoiceField(queryset=courseList,empty_label=None)

class ChangeHWForm(forms.Form): #form to edit hw of a class
hw_text = forms.CharField(widget=forms.Textarea(attrs={'maxlength': '200'}))
hw_text = forms.CharField(widget=forms.Textarea(attrs={'maxlength': '180'}))
4 changes: 3 additions & 1 deletion hwlog/log/static/log/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ td {
}
.styled-select select{
width:200px;
height:100px;
overflow-y: scroll;
}
figure{
Expand Down Expand Up @@ -525,4 +524,7 @@ form input {
.lgn-container{
padding:35px;
}
.styled-select select{
height: 100px;
}
}
4 changes: 2 additions & 2 deletions hwlog/log/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% if user.courses_joined.count > 0 %}
<div class="log-container">
{% for course in user.courses_joined.all %}
{% if course.course_name == "None" %}
{% if course.course_name == "--None--" %}
{% else %}
<div class="log-container-row">
<div class="course-name-box">
Expand Down Expand Up @@ -71,7 +71,7 @@
Or in other cases, the student might have forgotten to entirely. <br>
Or perhaps the student is simply too lazy. <br><br>
Cue log(hw). <br><br>
log(hw) allows each students to personalize his/her own online homework log.
log(hw) allows each student to personalize his/her own online homework log.
Only one person needs to upload the homework, and everyone will be able to see it on their own homework logs.

</div>
Expand Down
2 changes: 1 addition & 1 deletion hwlog/log/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def configure(request): #settings page, might be lots of bugs
else:
user_courses = request.user.courses_joined.all()
user_class = [ ]
no_course = Course.objects.get(course_name='None')
no_course = Course.objects.get(course_name='--None--')

# try: #extremely inefficient i think
# user_class_1 = user_courses[0]
Expand Down
Binary file added ~$urse List.docx
Binary file not shown.

0 comments on commit 7850750

Please sign in to comment.