Permalink
Browse files

adding another list route

  • Loading branch information...
sethwoodworth committed Apr 10, 2012
1 parent 720cc41 commit b05a91fcb6b73e0644f81cae6f98256bcd6c1aea
Showing with 46 additions and 23 deletions.
  1. +2 −0 KNotes/templates/index.html
  2. +18 −12 KNotes/templates/notes.html
  3. +19 −9 README.md
  4. +7 −2 notes/views.py
@@ -115,6 +115,8 @@
</table>
</div> <!-- /container -->
{% endblock %}
+{% block stuff %}
+{% endblock %}
<!-- Also allow form file selection?
<input class="btn" id="fileupload" type="file" name="files[]" multiple>
@@ -1,16 +1,22 @@
{% extends 'index.html' %}
{% block content %}
-<ul>
- {% for school in schools %}
- <h4>{{ school.name }}</h5>
- {% for course in courses %}
- <h5>{{ course.title }}</h5>
- <ul>
- {% for note in notes %}
- <li>{# TODO: add a link here to html #}{{ note.title }}</li>
- {% endfor %} {# end note #}
- </ul>
- {% endfor %} {# end course #}
- {% endfor %} {# end school #}
+{{schools}}
+<h2>foo bar baf:</h2>
+<br/>
+<div style='width:500px;text-align:left'>
+<ul style='align:left'>
+{% for school, courses in schools.items %}
+ <li> University: {{ school }} :</li>
+ {% for course, notes in courses.items %}
+ Course: {{ course.title }}
+ <ul>
+ {% for note in notes %}
+ <li>Note: {# TODO: add a link here to html #}{{ note.title }}</li>
+ {% endfor %} {# end note #}
+ </ul>
+ {% endfor %} {# end course #}
+{% endfor %} {# end school #}
+</ul>
+</div>
{% endblock %}
View
@@ -7,23 +7,33 @@ What must be accomplished this weekend
models.py:
- + notes schema
+ + notes schema DONE
+ user\_profile hooked up (add to settings.py)
- + schools and courses need to be fkey'd correctly
+ + schools and courses need to be fkey'd correctly DONE
* Optional: karma and karma\_actions
views.py:
- + splashpage
- + view all notes by school and course
+ + splashpage DONE
+ + view all notes by school and course 1/2
./templates:
- + simple base.html template for header
- + index.html for splashpage with current KN logo frontpage as-is
- + new notes.html template for rendering a list of notes
- + new note.html template for rendering a note and it's metadata
+ + simple base.html template for header DONE
+ + index.html for splashpage with current KN logo frontpage as-is DONE
+ + new notes.html template for rendering a list of notes DONE
+ + new note.html template for rendering a note and it's metadata 1/2
users:
- + login
+ + login 1/2
+
+
+Priorities for Tuesday
+======================
+1. tags DONE
+2. prettier, design
+3. users
+4. profile page and
+
+add 10 things tomorrow, 100 things friday
View
@@ -40,10 +40,15 @@ def notesOfSchool(request, school_pk):
return HttpResponse(json.dumps(response_json), mimetype="application/json")
def all_notes(request):
+ print "using the all_notes view"
response = {}
+ response['schools'] = {}
for school in School.objects.all():
- response[school.name] = {}
+ print school
+ response['schools'][school.name] = {}
for course in Course.objects.filter(school = school).all():
+ print course
notes = Note.objects.filter(course = course).all()
- response[school.name][course.title] = notes
+ response['schools'][school.name][course.title] = notes
+ print response
return render_to_response('notes.html', response)

0 comments on commit b05a91f

Please sign in to comment.