[open-ils-commits] r154 - in servres/trunk/conifer: static syrup templates (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 8 16:25:28 EDT 2009
Author: gfawcett
Date: 2009-03-08 16:25:24 -0400 (Sun, 08 Mar 2009)
New Revision: 154
Modified:
servres/trunk/conifer/static/main.css
servres/trunk/conifer/syrup/views.py
servres/trunk/conifer/templates/browse_courses.xhtml
servres/trunk/conifer/templates/my_courses.xhtml
servres/trunk/conifer/templates/welcome.xhtml
Log:
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.
Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css 2009-03-08 20:06:26 UTC (rev 153)
+++ servres/trunk/conifer/static/main.css 2009-03-08 20:25:24 UTC (rev 154)
@@ -56,7 +56,7 @@
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 @@
.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 @@
#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%; }
Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py 2009-03-08 20:06:26 UTC (rev 153)
+++ servres/trunk/conifer/syrup/views.py 2009-03-08 20:25:24 UTC (rev 154)
@@ -177,9 +177,10 @@
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
Modified: servres/trunk/conifer/templates/browse_courses.xhtml
===================================================================
--- servres/trunk/conifer/templates/browse_courses.xhtml 2009-03-08 20:06:26 UTC (rev 153)
+++ servres/trunk/conifer/templates/browse_courses.xhtml 2009-03-08 20:25:24 UTC (rev 154)
@@ -1,5 +1,5 @@
<?python
-title = _('Welcome to Syrup E-Reserves!')
+title = _('Browse the Reserves')
?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
@@ -9,9 +9,10 @@
<title>${title}</title>
</head>
<body>
- <h2>Browse</h2> (Note: some course materials may require you
+ <h1>${title}</h1>
+ (Note: some course materials may require you
to <a href="/accounts/login/?next=/syrup/">log in</a>)
- <h3>Choose from one of the options below:</h3>
+ <h2>Choose from one of the options below:</h2>
<ul>
<li><a href="instructors">Browse by Instructor</a></li>
<li><a href="departments">Browse by Department</a></li>
Modified: servres/trunk/conifer/templates/my_courses.xhtml
===================================================================
--- servres/trunk/conifer/templates/my_courses.xhtml 2009-03-08 20:06:26 UTC (rev 153)
+++ servres/trunk/conifer/templates/my_courses.xhtml 2009-03-08 20:25:24 UTC (rev 154)
@@ -1,5 +1,5 @@
<?python
-title = _('Welcome to Syrup E-Reserves!')
+title = _('My Courses')
?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
@@ -9,7 +9,7 @@
<title>${title}</title>
</head>
<body>
- <h2>My Courses</h2>
+ <h1>${title}</h1>
<?python
if user.is_authenticated():
my_courses = user.courses()
@@ -20,8 +20,10 @@
<p py:for="course in my_courses" style="font-size: large;">
<a href="${course.id}/">${course.list_display()}</a>
</p>
- <p><a href="new/">Add a new course</a></p>
+ <div class="gap"/>
+ <div class="itemadd">
+ <p py:if="user.has_perm('add_course')"><a href="new/">Create a new course site</a></p>
<p><a href="invitation/">Join a course using an Invitation Code</a></p>
- <div class="gap"/>
+ </div>
</body>
</html>
Modified: servres/trunk/conifer/templates/welcome.xhtml
===================================================================
--- servres/trunk/conifer/templates/welcome.xhtml 2009-03-08 20:06:26 UTC (rev 153)
+++ servres/trunk/conifer/templates/welcome.xhtml 2009-03-08 20:25:24 UTC (rev 154)
@@ -9,7 +9,8 @@
<title>${title}</title>
</head>
<body>
- <h1>News</h1>
+ <!-- !opting *not* to put a heading on the welcome page, so that the News items can be used to customize it. -->
+ <h1 style="visibility: hidden;">Welcome!</h1>
<div class="newsitem" py:for="news in models.NewsItem.objects.all().order_by('-published','-id')[0:5]">
<h2>${news.subject}</h2>
<div>${news.generated_body()}</div>
More information about the open-ils-commits
mailing list