From 05b88132ec353329a904957b0afbafb35dfde6dd Mon Sep 17 00:00:00 2001
From: gfawcett
Date: Sun, 8 Mar 2009 20:25:24 +0000
Subject: [PATCH] style and heading-level changes. Add-new-course now requires
an extra perm.
I'm not sure how in practice we will give add-course permissions to
instructors. How do we know which ones are the instructors?
I think our backend for user-information is going to have to grow an
(optional) is_user_an_instructor() test. We can also add an
Instructors group in Django which will give the required permission.
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@154 6d9bc8c9-1ec2-4278-b937-99fde70a366f
---
conifer/static/main.css | 6 +++---
conifer/syrup/views.py | 3 ++-
conifer/templates/browse_courses.xhtml | 7 ++++---
conifer/templates/my_courses.xhtml | 10 ++++++----
conifer/templates/welcome.xhtml | 3 ++-
5 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/conifer/static/main.css b/conifer/static/main.css
index 83071f7..2f48e42 100644
--- a/conifer/static/main.css
+++ b/conifer/static/main.css
@@ -56,7 +56,7 @@ h2 { font-size: 135%; }
h3 { font-size: 120%; }
h1 { color: navy; }
-h2 { color: #338; }
+h2 { color: #336; }
h3, h4 { color: darkgreen; }
h1 a, h2 a { color: navy; }
@@ -123,7 +123,7 @@ padding-left: 25;
.itemtree .editlinks a { color: navy; }
.itemadd {
- margin-top: 30; font-size: smaller;
+ margin-top: 30; font-size: 90%;
padding: 10; background-color: #eef;
}
.itemadd a { color: navy; }
@@ -195,7 +195,7 @@ p.todo, div.todo { background-color: #fdd; padding: 6; margin: 12; border-left:
#coursebanner { background-color: #f2e4cc; margin: -12 -12 0 -12; padding: 8; }
-#coursebanner h1 { padding: 0; font-size: 110%; }
+#coursebanner h1 { padding: 0; font-size: 125%; }
#edit_course_link { margin: 8 0 8 0; font-size: 95%; }
diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py
index c59ac15..94c9cfc 100644
--- a/conifer/syrup/views.py
+++ b/conifer/syrup/views.py
@@ -177,9 +177,10 @@ if COURSE_CODE_LIST:
choices = choices)
NewCourseForm.base_fields['code'].empty_label = empty_label
-# todo, how do we decide who can create new course sites?
@login_required
def add_new_course(request):
+ if not request.user.has_perm('add_course'):
+ return HttpResponseForbidden('You are not allowed to create course sites.') # fixme, prettier msg.
return add_or_edit_course(request)
@instructors_only
diff --git a/conifer/templates/browse_courses.xhtml b/conifer/templates/browse_courses.xhtml
index 938b243..bcdfba4 100644
--- a/conifer/templates/browse_courses.xhtml
+++ b/conifer/templates/browse_courses.xhtml
@@ -1,5 +1,5 @@
${title}
- Browse
(Note: some course materials may require you
+ ${title}
+ (Note: some course materials may require you
to log in)
- Choose from one of the options below:
+ Choose from one of the options below:
- Add a new course
- Join a course using an Invitation Code
+
diff --git a/conifer/templates/welcome.xhtml b/conifer/templates/welcome.xhtml
index 7607d07..a224bbc 100644
--- a/conifer/templates/welcome.xhtml
+++ b/conifer/templates/welcome.xhtml
@@ -9,7 +9,8 @@ title = _('Welcome!')
${title}
- News
+
+ Welcome!
${news.subject}
${news.generated_body()}
--
2.11.0