Skip to content
Browse files

Clearing out "Add" type menu options and updating "Schools" page

  • Loading branch information...
1 parent b1e2d2b commit a494902261bb5d9b32debfb45770de164edb2121 Dustin Chesterman committed Mar 22, 2012
View
22 rebootourschools/technologytracker/templates/base.html
@@ -13,26 +13,20 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
- <a class="brand" href="/">Technology Tracker</a>
+ <a class="brand" href="/home/">Technology Tracker</a>
<div class="nav-collapse">
<ul class="nav">
<li>
- <a href="/districtReporting/">District Reporting</a>
- </li>
- <li>
- <a href="/districts/">District List</a>
+ <a href="/home/">Home</a>
</li>
- <li>
- <a href="/schools/">School List</a>
- </li>
- <li>
- <a href="/addDistrict/">Add a District</a>
+ <li>
+ <a href="/districts/">Districts</a>
</li>
- <li>
- <a href="/addSchool/">Add a School</a>
+ <li>
+ <a href="/schools/">Schools</a>
</li>
- <li>
- <a href="/addComputer/">Add a Computer</a>
+ <li>
+ <a href="/districtReporting/">District Reporting</a>
</li>
</ul>
</div>
View
2 rebootourschools/technologytracker/templates/home.html
@@ -24,7 +24,7 @@
<br/>
<br/>
-<a id="addSchool" class="btn-primary btn-large" data-toggle="modal" href="#addSchoolModal">Add a School</a>
+<a id="addSchool" class="btn-primary btn-large" data-toggle="modal" data-target="#addSchoolModal" href="/addSchool/">Add a School</a>
<div class="modal hide" id="addSchoolModal">
<div class="modal-header">
View
57 rebootourschools/technologytracker/templates/schools.html
@@ -2,9 +2,56 @@
{% block content %}
<h2>Schools:</h2>
-{% for school in schools %}
+
+<ul>
+ {% for school in schools %}
<li>
- <a href="/home/">{{ school.full_name }} ({{ school.city }},{{ school.full_name}} )</a>
- </li>
-{% endfor %}
-{% endblock %}
+ <a href="/school/{{ school.id }}/">{{ school.full_name }} ({{ school.city }},{{ school.full_name}} )</a>
+ </li>
+ {% endfor %}
+</ul>
+
+<br/>
+<br/>
+
+<a id="addSchool" class="btn-primary btn-large" data-toggle="modal" data-target="#addSchoolModal" href="/addSchool/">Add a School</a>
+
+<div class="modal hide" id="addSchoolModal">
+ <div class="modal-header">
+ <a href="#" class="close" id="closeModal" data-dismiss="modal">&times;</a>
+ <h2>Add a new School:</h2>
+ </div>
+ <div class="modal-body">
+ <form action="/addSchool/" id="addSchoolForm" method="post">
+ {% csrf_token %}
+ <label for="schoolName">Full Name:</label><br/>
+ <input type="text" name="schoolName" id="schoolName" /><br/>
+ <br/>
+ <label for="schoolCode">School Code:</label><br/>
+ <input type="text" name="schoolCode" id="schoolCode" /><br/>
+ <br/>
+ </form>
+ </div>
+ <div class="modal-footer">
+ <input type="button" class="btn" id="closeButton" value="Cancel" />
+ <input type="button" class="btn btn-primary" id="addButton" value="Add" />
+ </div>
+</div>
+
+
+<script type="text/javascript">
+ $(document).ready( function(){
+
+ $("#closeButton").click(function() {
+ $('#addSchoolModal').modal('hide');
+ });
+
+ $("#addButton").click( function() {
+ $("#addSchoolForm").submit();
+ });
+
+ });
+</script>
+
+
+{% endblock %}
View
1 rebootourschools/technologytracker/views.py
@@ -25,7 +25,6 @@ def home(request):
schools = School.objects.filter(district=userDistrict)
schoolCount = School.objects.filter(district=userDistrict).count()
-
return render_to_response('home.html',
{'userDistrict': userDistrict, 'schools': schools, 'schoolCount':schoolCount},
context_instance=RequestContext(request))
View
2 rebootourschools/urls.py
@@ -4,8 +4,6 @@
admin.autodiscover()
urlpatterns = patterns('',
- # Examples:
- # url(r'^$', 'rebootourschools.views.home', name='home'),
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}),
url(r'^techtracker/', include('technologytracker.urls')),
url(r'^techtrackerapi/', include('technologytrackerapi.urls')),

0 comments on commit a494902

Please sign in to comment.
Something went wrong with that request. Please try again.