committing CRUD changes

Miriam Melnick [2011-11-02 14:42:43]
committing CRUD changes
Filename
halo_se_web/halo_admin/views.py
halo_se_web/halo_web/views.py
halo_se_web/templates/halo_admin/assignment_admin.html
halo_se_web/templates/halo_admin/course_admin.html
halo_se_web/templates/halo_web/index.html
diff --git a/halo_se_web/halo_admin/views.py b/halo_se_web/halo_admin/views.py
index 1d344dd..4410ce7 100644
--- a/halo_se_web/halo_admin/views.py
+++ b/halo_se_web/halo_admin/views.py
@@ -346,7 +346,7 @@ def student_list(request, course_id, focus_id = None):
     else:
         focus = None
         focus_data = None
-        focus_max = None
+        focus_max = 0
         focus_labels = None
     if (user.is_authenticated()):
         u_id = user.getUserId()
diff --git a/halo_se_web/halo_web/views.py b/halo_se_web/halo_web/views.py
index d8a7d8d..22a39f8 100644
--- a/halo_se_web/halo_web/views.py
+++ b/halo_se_web/halo_web/views.py
@@ -27,10 +27,10 @@ def home(request):
             course = Course.objects.get(id=enr.getCourseId())
             admin_courses.append(course)
         if (len(admin_courses)>0):
-            return HttpResponseRedirect('/admin')
+            return HttpResponseRedirect('/admin/')
         else:
-            return HttpResponseRedirect('/halo_web')
-    return HttpResponseRedirect('/login')
+            return HttpResponseRedirect('/halo_web/')
+    return HttpResponseRedirect('/login/')

 def leaderboard(request, course_id):
     this_course = Course.objects.get(id=course_id)
diff --git a/halo_se_web/templates/halo_admin/assignment_admin.html b/halo_se_web/templates/halo_admin/assignment_admin.html
index ea7b2a2..7042d71 100644
--- a/halo_se_web/templates/halo_admin/assignment_admin.html
+++ b/halo_se_web/templates/halo_admin/assignment_admin.html
@@ -1,21 +1,9 @@
-{% if admin_this_course %}
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-	<title>HALO SE Admin</title>
-	<link rel="stylesheet" href="{{ STATIC_URL }}css/dashboard.css" type="text/css" />
-	<link rel="stylesheet" href="{{ STATIC_URL }}css/course_admin.css" type="text/css">
-<!--	<link rel="stylesheet" href="../../halo_admin/static/css/dashboard.css" type="text/css">
-	<link rel="stylesheet" href="../../halo_admin/static/css/course_admin.css" type="text/css"> -->
+{% extends "base_admin.html" %}
+{% block content %}

+{% if admin_this_course %}

-</head>
-<body class="assignment-admin-wrapper">
-	<div class="header">
-		<div class="title">HALO SE Administration</div> <div class="welcome" >Welcome, {{ user }}. <a href="/logout">Logout</a></div>
-	</div>
-
+<div class="assignment-admin-wrapper">
 	<ul class="admin-course-list">
 		{% for course in admin_courses %}
 			<li> <a href="/admin/{{ course.id }}">{{ course.name }} </a></li>
@@ -29,10 +17,11 @@
 	</ul>


-</body>
+</div>
 </html>

 {% else %}
 Sorry, you do not have permission to see this page.

-{% endif %}
\ No newline at end of file
+{% endif %}
+{% endblock %}
\ No newline at end of file
diff --git a/halo_se_web/templates/halo_admin/course_admin.html b/halo_se_web/templates/halo_admin/course_admin.html
index 866eedf..e8121ce 100644
--- a/halo_se_web/templates/halo_admin/course_admin.html
+++ b/halo_se_web/templates/halo_admin/course_admin.html
@@ -1,20 +1,7 @@
+{% extends "base_admin.html" %}
+{% block content %}
 {% if admin_this_course %}
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-	<title>HALO SE Admin</title>
-	<link rel="stylesheet" href="{{ STATIC_URL }}css/dashboard.css" type="text/css" />
-	<link rel="stylesheet" href="{{ STATIC_URL }}css/course_admin.css" type="text/css">
-<!--	<link rel="stylesheet" href="../../halo_admin/static/css/dashboard.css" type="text/css">
-	<link rel="stylesheet" href="../../halo_admin/static/css/course_admin.css" type="text/css"> -->
-
-
-</head>
-<body class="admin-wrapper">
-	<div class="header">
-		<div class="title">HALO SE Administration</div> <div class="welcome" >Welcome, {{ user }}. <a href="/logout">Logout</a></div>
-	</div>
+<div class="admin-wrapper">
 	<ul class="admin-course-list">
 		{% for course in admin_courses %}
 			<li> <a href="/admin/{{ course.id }}">{{ course.name }} </a></li>
@@ -41,10 +28,11 @@
 		{% endaxis %}
 	{% endchart %}

-</body>
-</html>
+</div>

 {% else %}
 Sorry, you do not have permission to see this page. Please <a href="/login">log in</a> to administer a course.

-{% endif %}
\ No newline at end of file
+{% endif %}
+
+{% endblock %}
\ No newline at end of file
diff --git a/halo_se_web/templates/halo_web/index.html b/halo_se_web/templates/halo_web/index.html
index 201ace2..82cb76e 100644
--- a/halo_se_web/templates/halo_web/index.html
+++ b/halo_se_web/templates/halo_web/index.html
@@ -1,4 +1,6 @@
-{% if courses %}
+{% extends "base_generic.html" %}
+
+{% block content %}{% if courses %}
 	My Courses
 	<ul>
 	{% for course in courses %}
@@ -7,4 +9,4 @@
 	</ul>
 {% else %}
 	<p>You are not enrolled in any courses.</p>
-{% endif %}
\ No newline at end of file
+{% endif %} {% endblock %}
\ No newline at end of file