changeset 4753:df36d7bd9a02

- Add more templates - Move page-header to a block of its own - Make the status message available to templates
author Pradip Caulagi <caulagi@gmail.com>
date Sun, 03 Feb 2013 11:58:25 +0530
parents 5350126b32ea
children 4e16bcd4405e
files roundup/cgi/engine_jinja2.py share/roundup/templates/jinja2/html/_generic.index.html share/roundup/templates/jinja2/html/file.item.html share/roundup/templates/jinja2/html/home.classlist.html share/roundup/templates/jinja2/html/issue.index.html share/roundup/templates/jinja2/html/issue.item.html share/roundup/templates/jinja2/html/keyword.item.html share/roundup/templates/jinja2/html/layout/page.html share/roundup/templates/jinja2/html/msg.index.html share/roundup/templates/jinja2/html/msg.item.html share/roundup/templates/jinja2/html/user.forgotten.html share/roundup/templates/jinja2/html/user.index.html share/roundup/templates/jinja2/html/user.item.html share/roundup/templates/jinja2/html/user.register.html share/roundup/templates/jinja2/html/user.rego_progress.html
diffstat 15 files changed, 223 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi/engine_jinja2.py	Sun Feb 03 00:08:54 2013 +0530
+++ b/roundup/cgi/engine_jinja2.py	Sun Feb 03 11:58:25 2013 +0530
@@ -82,8 +82,9 @@
     def render(self, client, classname, request, **options):
         # [ ] limit the information passed to the minimal necessary set
         c = context(client, self, classname, request)
-        '''c.update({'options': options})
+        c.update({'options': options})
 
+        '''
         def translate(msgid, domain=None, mapping=None, default=None):
             result = client.translator.translate(domain, msgid,
                          mapping=mapping, default=default)
--- a/share/roundup/templates/jinja2/html/_generic.index.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/_generic.index.html	Sun Feb 03 11:58:25 2013 +0530
@@ -1,9 +1,10 @@
 {% extends 'layout/page.html' %}
 
+{% block page_header %}
+  {{ context._classname.capitalize() }} editing
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>{{ context._classname.capitalize() }} editing</h1>
-  </div>
 
   {% include 'layout/permission.html' %}
 
--- a/share/roundup/templates/jinja2/html/file.item.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/file.item.html	Sun Feb 03 11:58:25 2013 +0530
@@ -1,9 +1,10 @@
 {% extends 'layout/page.html' %}
 
+{% block page_header %}
+  File display
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>File display</h1>
-  </div>
 
   {% include 'layout/permission.html' %}
 
--- a/share/roundup/templates/jinja2/html/home.classlist.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/home.classlist.html	Sun Feb 03 11:58:25 2013 +0530
@@ -1,9 +1,10 @@
 {% extends 'layout/page.html' %}
 
+{% block page_header %}
+  List of classes
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>List of classes</h1>
-  </div>
 
   <div class='row-fluid'>
     {% for cl in db.classes() %}
--- a/share/roundup/templates/jinja2/html/issue.index.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/issue.index.html	Sun Feb 03 11:58:25 2013 +0530
@@ -1,9 +1,10 @@
 {% extends 'layout/page.html' %}
 
+{% block page_header %}
+    List of issues
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>List of issues</h1>
-  </div>
 
   {% include 'layout/permission.html' %}
 
--- a/share/roundup/templates/jinja2/html/issue.item.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/issue.item.html	Sun Feb 03 11:58:25 2013 +0530
@@ -8,23 +8,17 @@
   {% endif %}
 {% endblock %}
 
+{% block page_header %}
+  {% if not (context.id or context.is_edit_ok()) %}
+    New Issue
+  {% elif not context.id and context.is_edit_ok() %}
+    New Issue Editing
+  {% else %}
+    Issue {{ context.id }}
+  {% endif %}
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>
-      {% if not (context.id or context.is_edit_ok()) %}
-        New Issue
-      {% elif not context.id and context.is_edit_ok() %}
-        New Issue Editing
-      {% else %}
-        Issue {{ context.id }}
-      {% endif %}
-    </h1>
-    {% if ok_message %}
-      <p class='alert alert-success'>{{ ok_message }}</p>
-    {% elif error_message %}
-      <p class='alert alert-error'>{{ error_message }}</p>
-    {% endif %}
-  </div>
 
   {% include 'layout/permission.html' %}
 
--- a/share/roundup/templates/jinja2/html/keyword.item.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/keyword.item.html	Sun Feb 03 11:58:25 2013 +0530
@@ -1,9 +1,10 @@
 {% extends 'layout/page.html' %}
 
+{% block page_header %}
+  Keyword editing
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>Keyword editing</h1>
-  </div>
 
   <h4>Existing Keywords</h4>
   <p class='text-warning'>
--- a/share/roundup/templates/jinja2/html/layout/page.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/layout/page.html	Sun Feb 03 11:58:25 2013 +0530
@@ -24,7 +24,17 @@
       </div>
 
       <div class='span8 offset1'>
-        {% block content %} {% endblock %}
+          <div class='page-header'>
+            <h1> {% block page_header %} {% endblock %} </h1>
+            {% if options.error_message %}
+              <div class='alert alert-error'>{{ options.error_message }}</div>
+            {% endif %}
+            {% if options.ok_message %}
+              <div class='alert alert-success'>{{ options.ok_message }}</div>
+            {% endif %}
+          </div>
+        {% block content %}
+        {% endblock %}
       </div>
     </div>
 
--- a/share/roundup/templates/jinja2/html/msg.index.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/msg.index.html	Sun Feb 03 11:58:25 2013 +0530
@@ -1,9 +1,10 @@
 {% extends 'layout/page.html' %}
 
+{% block page_header %}
+  List of messages
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>List of messages</h1>
-  </div>
 
   {% for msg in context.list() %}
     <div class='row-fluid'>
--- a/share/roundup/templates/jinja2/html/msg.item.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/msg.item.html	Sun Feb 03 11:58:25 2013 +0530
@@ -8,20 +8,19 @@
   {% endif %}
 {% endblock %}
 
+{% block page_header %}
+  {% if not (context.id or context.is_edit_ok()) %}
+    New Message
+  {% elif not context.id and context.is_edit_ok() %}
+    New Message Editing
+  {% elif context.id and not context.is_edit_ok() %}
+    Message{{ context.id }}
+  {% elif context.id and context.is_edit_ok() %}
+    Message{{ context.id }} editing
+  {% endif %}
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>
-      {% if not (context.id or context.is_edit_ok()) %}
-        New Message
-      {% elif not context.id and context.is_edit_ok() %}
-        New Message Editing
-      {% elif context.id and not context.is_edit_ok() %}
-        Message{{ context.id }}
-      {% elif context.id and context.is_edit_ok() %}
-        Message{{ context.id }} editing
-      {% endif %}
-    </h1>
-  </div>
 
   {% include 'layout/permission.html' %}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/roundup/templates/jinja2/html/user.forgotten.html	Sun Feb 03 11:58:25 2013 +0530
@@ -0,0 +1,41 @@
+{% extends 'layout/page.html' %}
+
+{% block head_title %}
+  Password reset request - {{ config.TRACKER_NAME }}
+{% endblock %}
+
+{% block page_header %}
+  Password reset request
+{% endblock %}
+
+{% block content %}
+
+  <p>
+    If you know the email address you registered with, enter it below.
+  </p>
+
+  <form method="POST" action='{{ context.designator() }}'>
+    <div class='row-fluid'>
+      <label>Email Address:</label>
+      <input type='text' name="address">
+      <input type="hidden" name="@action" value="passrst">
+      <input type="hidden" name="@template" value="forgotten">
+      <input type="submit" value="Password reset" class='btn btn-primary'>
+    </div>
+
+    <div class='row-fluid vspace-two'> 
+      <p>Or, if you know your username, then enter it below.</p>
+      <label>Username:</label>
+      <input type='text' name="username">
+      <input type="submit" value="Password reset" class='btn btn-info'>
+    </div>
+  </form>
+
+  <div class='row-fluid vspace-two'>
+    <p>
+      A confirmation email will be sent to you -
+      please follow the instructions within it to complete the reset process.
+    </p>
+  </div>
+
+{% endblock %}
--- a/share/roundup/templates/jinja2/html/user.index.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/user.index.html	Sun Feb 03 11:58:25 2013 +0530
@@ -4,10 +4,11 @@
   User listing - {{ config.TRACKER_NAME }}
 {% endblock %}
 
+{% block page_header %}
+  User listing
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>User listing</h1>
-  </div>
 
   {% include 'layout/permission.html' %}
 
--- a/share/roundup/templates/jinja2/html/user.item.html	Sun Feb 03 00:08:54 2013 +0530
+++ b/share/roundup/templates/jinja2/html/user.item.html	Sun Feb 03 11:58:25 2013 +0530
@@ -8,20 +8,19 @@
   {% endif %}
 {% endblock %}
 
+{% block page_header %}
+  {% if not (context.id or context.is_edit_ok()) %}
+    New User
+  {% elif not context.id and context.is_edit_ok() %}
+    New User Editing
+  {% elif context.id and not context.is_edit_ok() %}
+    User{{ context.id }}
+  {% elif context.id and context.is_edit_ok() %}
+    User{{ context.id }} editing
+  {% endif %}
+{% endblock %}
+
 {% block content %}
-  <div class='page-header'>
-    <h1>
-      {% if not (context.id or context.is_edit_ok()) %}
-        New User
-      {% elif not context.id and context.is_edit_ok() %}
-        New User Editing
-      {% elif context.id and not context.is_edit_ok() %}
-        User{{ context.id }}
-      {% elif context.id and context.is_edit_ok() %}
-        User{{ context.id }} editing
-      {% endif %}
-    </h1>
-  </div>
 
   {% include 'layout/permission.html' %}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/roundup/templates/jinja2/html/user.register.html	Sun Feb 03 11:58:25 2013 +0530
@@ -0,0 +1,90 @@
+{% extends 'layout/page.html' %}
+
+{% block head_title %}
+  Registration - {{ config.TRACKER_NAME }}
+{% endblock %}
+
+{% block page_header %}
+  Registration - {{ config.TRACKER_NAME }}
+{% endblock %}
+
+{% block content %}
+
+  <form method="POST"
+        name ="itemSynopsis"
+        enctype ="multipart/form-data"
+        action ='{{  context.designator() }}'>
+    <table>
+      <tr>
+        <th>Name</th>
+        <td>
+          <input type='text' name="realname">
+        </td>
+      </tr>
+      <tr>
+        <th>Login Name</th>
+        <td>
+          <input type='text' name='username' required>
+        </td>
+      </tr>
+      <tr>
+        <th>Login Password</th>
+        <td>
+          <input type='password' name='password' required>
+        </td>
+      </tr>
+      <tr>
+        <th>Confirm Password</th>
+        <td>
+          <input type='password' name='@confirm@password'>
+        </td>
+      </tr>
+      {% if request.user.hasPermission('Web Roles') %}
+        <tr>
+          <th>Roles <br>(comma separated)</th>
+          <td>
+            <input type='text' name='roles' value='{{ context.roles }}'>
+          </td>
+        </tr>
+      {% endif %}
+      <tr>
+        <th>Phone</th>
+        <td>
+          <input type='text' name='phone'>
+        </td>
+      </tr>
+      <tr>
+        <th>Organisation</th>
+        <td>
+          <input type='text' name='organisation'>
+        </td>
+      </tr>
+      <tr>
+        <th>Timezone</th>
+        <td>
+          <input type='text' name='timezone'>
+        </td>
+      </tr>
+      <tr>
+        <th>Email</th>
+        <td>
+          <input type='text' name='address' required>
+        </td>
+      </tr>
+      <tr>
+        <th>Alternate email address <br>One address per line</th>
+        <td>
+          {{ context.alternate_addresses.multiline() }}
+        </td>
+      </tr>
+      <tr class='form-actions'>
+        <td>
+        <input type="hidden" name="@template" value="register">
+        <input type="hidden" name="@action" value="register">
+        <input type="submit" name="submit" value="Register">
+        </td>
+      </tr>
+    </table>
+  </form>
+
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/roundup/templates/jinja2/html/user.rego_progress.html	Sun Feb 03 11:58:25 2013 +0530
@@ -0,0 +1,17 @@
+{% extends 'layout/page.html' %}
+
+{% block head_title %}
+  Registration in progress - {{ config.TRACKER_NAME }}
+{% endblock %}
+
+{% block page_header %}
+  Registration in progress...
+{% endblock %}
+
+{% block content %}
+  <p>
+    You will shortly receive an email to confirm your
+    registration. To complete the registration process,
+    visit the link indicated in the email.
+  </p>
+{% endblock %}

Roundup Issue Tracker: http://roundup-tracker.org/