[open-ils-commits] r153 - in servres/trunk/conifer: static syrup templates (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 8 16:06:30 EDT 2009
Author: gfawcett
Date: 2009-03-08 16:06:26 -0400 (Sun, 08 Mar 2009)
New Revision: 153
Added:
servres/trunk/conifer/static/edit_course.js
servres/trunk/conifer/templates/edit_course.xhtml
Removed:
servres/trunk/conifer/static/add_new_course.js
servres/trunk/conifer/templates/add_new_course.xhtml
Modified:
servres/trunk/conifer/syrup/views.py
Log:
renamed add_new_course* files to edit_course*
they were really add/edit forms after all.
Deleted: servres/trunk/conifer/static/add_new_course.js
===================================================================
--- servres/trunk/conifer/static/add_new_course.js 2009-03-08 20:01:46 UTC (rev 152)
+++ servres/trunk/conifer/static/add_new_course.js 2009-03-08 20:06:26 UTC (rev 153)
@@ -1,16 +0,0 @@
-function do_init() {
- if ($('#id_code')[0].tagName == 'SELECT') {
- // code is a SELECT, so we add a callback to lookup titles.
- $('#id_code').change(function() {
- $('#id_title')[0].disabled=true;
- $.getJSON('/syrup/course/new/ajax_title', {course_code: $(this).val()},
- function(resp) {
- $('#id_title').val(resp.title)
- $('#id_title')[0].disabled=false;
-
- });
- });
- }
-}
-
-$(do_init);
Copied: servres/trunk/conifer/static/edit_course.js (from rev 152, servres/trunk/conifer/static/add_new_course.js)
===================================================================
--- servres/trunk/conifer/static/edit_course.js (rev 0)
+++ servres/trunk/conifer/static/edit_course.js 2009-03-08 20:06:26 UTC (rev 153)
@@ -0,0 +1,16 @@
+function do_init() {
+ if ($('#id_code')[0].tagName == 'SELECT') {
+ // code is a SELECT, so we add a callback to lookup titles.
+ $('#id_code').change(function() {
+ $('#id_title')[0].disabled=true;
+ $.getJSON('/syrup/course/new/ajax_title', {course_code: $(this).val()},
+ function(resp) {
+ $('#id_title').val(resp.title)
+ $('#id_title')[0].disabled=false;
+
+ });
+ });
+ }
+}
+
+$(do_init);
Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py 2009-03-08 20:01:46 UTC (rev 152)
+++ servres/trunk/conifer/syrup/views.py 2009-03-08 20:06:26 UTC (rev 153)
@@ -195,11 +195,11 @@
example = models.course_codes.course_code_example
if request.method != 'POST':
form = NewCourseForm(instance=instance)
- return g.render('add_new_course.xhtml', **locals())
+ return g.render('edit_course.xhtml', **locals())
else:
form = NewCourseForm(request.POST, instance=instance)
if not form.is_valid():
- return g.render('add_new_course.xhtml', **locals())
+ return g.render('edit_course.xhtml', **locals())
else:
form.save()
course = form.instance
Deleted: servres/trunk/conifer/templates/add_new_course.xhtml
===================================================================
--- servres/trunk/conifer/templates/add_new_course.xhtml 2009-03-08 20:01:46 UTC (rev 152)
+++ servres/trunk/conifer/templates/add_new_course.xhtml 2009-03-08 20:06:26 UTC (rev 153)
@@ -1,52 +0,0 @@
-<?python
-if instance.id:
- title = _('Edit course details')
-else:
- title = _('Add a new course site')
-?>
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- xmlns:py="http://genshi.edgewall.org/">
-<xi:include href="master.xhtml"/>
-<xi:include href="components/course.xhtml"/>
-<head>
- <title>${title}</title>
- <script type="text/javascript" src="/static/add_new_course.js"/>
-</head>
-<body>
- <div py:if="instance.id">${course_banner(instance)}</div>
- <h1>${title}</h1>
- <p py:if="instance.id"><a href="permission/">Edit course permissions</a> • <a href="${instance.course_url()}">Return to course page</a></p>
- <form action="." method="POST">
- <tr py:def="field_row(field, example=None)">
- <th>${field.label}</th>
- <td>
- <ul py:if="field.errors" class="errorlist">
- <li py:for="err in field.errors">${err}</li>
- </ul>
- ${Markup(field)}
- </td>
- <td class="example" py:if="example">e.g., ${example}</td>
- </tr>
- <h2>General description</h2>
- <table class="formtable">
- ${field_row(form.code, example)}
- ${field_row(form.title)}
- ${field_row(form.term)}
- ${field_row(form.department)}
- <!-- <tr><th>Department</th><td>${Markup(form.department)} ${errorlist(form.department)}</td></tr> -->
- </table>
- <p><input type="submit" value="Continue"/></p>
- </form>
- <div class="gap"/>
- <div py:if="instance.id">
- <h2>Delete this course</h2>
- <form action="delete/" method="POST">
- <p><input type="checkbox" name="confirm_delete" id="confirm_delete"/>
- <label for="confirm_delete">Yes, I want to delete this course site and all of its contents.</label>
- </p>
- <p><input type="submit" value="Delete this course"/></p>
- </form>
- </div>
-</body>
-</html>
Copied: servres/trunk/conifer/templates/edit_course.xhtml (from rev 152, servres/trunk/conifer/templates/add_new_course.xhtml)
===================================================================
--- servres/trunk/conifer/templates/edit_course.xhtml (rev 0)
+++ servres/trunk/conifer/templates/edit_course.xhtml 2009-03-08 20:06:26 UTC (rev 153)
@@ -0,0 +1,52 @@
+<?python
+if instance.id:
+ title = _('Edit course details')
+else:
+ title = _('Add a new course site')
+?>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:py="http://genshi.edgewall.org/">
+<xi:include href="master.xhtml"/>
+<xi:include href="components/course.xhtml"/>
+<head>
+ <title>${title}</title>
+ <script type="text/javascript" src="/static/edit_course.js"/>
+</head>
+<body>
+ <div py:if="instance.id">${course_banner(instance)}</div>
+ <h1>${title}</h1>
+ <p py:if="instance.id"><a href="permission/">Edit course permissions</a> • <a href="${instance.course_url()}">Return to course page</a></p>
+ <form action="." method="POST">
+ <tr py:def="field_row(field, example=None)">
+ <th>${field.label}</th>
+ <td>
+ <ul py:if="field.errors" class="errorlist">
+ <li py:for="err in field.errors">${err}</li>
+ </ul>
+ ${Markup(field)}
+ </td>
+ <td class="example" py:if="example">e.g., ${example}</td>
+ </tr>
+ <h2>General description</h2>
+ <table class="formtable">
+ ${field_row(form.code, example)}
+ ${field_row(form.title)}
+ ${field_row(form.term)}
+ ${field_row(form.department)}
+ <!-- <tr><th>Department</th><td>${Markup(form.department)} ${errorlist(form.department)}</td></tr> -->
+ </table>
+ <p><input type="submit" value="Continue"/></p>
+ </form>
+ <div class="gap"/>
+ <div py:if="instance.id">
+ <h2>Delete this course</h2>
+ <form action="delete/" method="POST">
+ <p><input type="checkbox" name="confirm_delete" id="confirm_delete"/>
+ <label for="confirm_delete">Yes, I want to delete this course site and all of its contents.</label>
+ </p>
+ <p><input type="submit" value="Delete this course"/></p>
+ </form>
+ </div>
+</body>
+</html>
More information about the open-ils-commits
mailing list