Use the new forms tags and fix the styling.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Mon, 17 Jan 2011 02:53:11 +0530
changeset 435 1217d808d70f
parent 434 ebfe27c2af39
child 436 b5af2557fa6a
Use the new forms tags and fix the styling.
pytask/templates/profile/browse_notifications.html
pytask/templates/profile/edit.html
pytask/templates/registration/activation_complete.html
pytask/templates/registration/login.html
pytask/templates/task/approved_textbook.html
pytask/templates/task/browse.html
pytask/templates/task/browse_textbooks.html
pytask/templates/task/claim.html
pytask/templates/task/confirm_approval.html
pytask/templates/task/select_user.html
pytask/templates/task/submit_report.html
pytask/templates/task/view.html
pytask/templates/task/view_textbook.html
pytask/templates/templatetags/_as_div_form.html
--- a/pytask/templates/profile/browse_notifications.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/profile/browse_notifications.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,14 +1,27 @@
-{% extends 'base.html' %}
+{% extends "base.html" %}
+
 {% block content %}
-{% if not notifications %}
-You have no notifications.
-{% else %}
-Notifications: <br />
-{% for notification in notifications %}
-<a href="{% url view_notification notification.id %}">
-{% if not notification.is_read %} <b> {% endif %}
-{{notification.subject}}
-{% if not notification.is_read %} </b> {% endif %}</a><br />
-{% endfor %}
-{% endif %}
+  {% if not notifications %}
+    You have no notifications.
+  {% else %}
+
+    Notifications: <br />
+    {% for notification in notifications %}
+      <a href="{% url view_notification notification.id %}">
+
+        {% if not notification.is_read %}
+          <b>
+        {% endif %}
+  
+        {{ notification.subject }}
+  
+        {% if not notification.is_read %}
+          </b>
+        {% endif %}
+
+      </a>
+      <br />
+    {% endfor %}
+
+  {% endif %}
 {% endblock %}
--- a/pytask/templates/profile/edit.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/profile/edit.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,8 +1,7 @@
-{% extends 'base.html' %}
+{% extends "base.html" %}
+
+{% load form_helpers %}
+
 {% block content %}
-<form action='' method=post>
-{% csrf_token %}
-{{ form.as_p }}
-<input type=submit value=Update />
-</form>
+  {% as_div_form form "Edit Profile Form" csrf_token "Update" %}
 {% endblock %}
--- a/pytask/templates/registration/activation_complete.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/registration/activation_complete.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,5 +1,6 @@
-{% extends 'base.html' %}
+{% extends "base.html" %}
+
 {% block content %}
-Your account has been successfully activated.<br />
-Please proceed to login.
+  Your account has been successfully activated.<br />
+  Please proceed to login.
 {% endblock %}
--- a/pytask/templates/registration/login.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/registration/login.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,9 +1,9 @@
-{% extends 'base.html' %}
+{% extends "base.html" %}
+
+{% load form_helpers %}
+
 {% block content %}
-<form action="{% url auth_login %}" method="post">
-{% csrf_token %}
-{{ form.as_p }}
-<input type="submit" value="Login" />
-</form>
-<a href="{% url auth_password_reset %}">Forgot password?</a>
+  {% url auth_login as login_url %}
+  {% as_div_form form "Login Form" csrf_token "Login" login_url %}
+  <a href="{% url auth_password_reset %}">Forgot password?</a>
 {% endblock %}
--- a/pytask/templates/task/approved_textbook.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/approved_textbook.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,4 +1,5 @@
 {% extends "base.html" %}
+
 {% block content %}
 The textbook <a href="{% url view_textbook textbook.id %}">
 {{textbook.name}}</a> has been approved.
--- a/pytask/templates/task/browse.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/browse.html	Mon Jan 17 02:53:11 2011 +0530
@@ -2,39 +2,59 @@
 
 {% block content %}
 
-    {% if open_tasks %}
-    Tasks that are open for contribution<ul>
-    {% for task in open_tasks %}
-        <li><a href="{% url view_task task.id %}">{{ task.title }}</a></li>
-    {% endfor %}
-    </ul>
-    <br />
-    {% endif %}
-
-    {% if working_tasks %}
-    Tasks that are being worked on<ul>
-    {% for task in working_tasks %}
-        <li><a href="{% url view_task task.id %}">{{ task.title }}</a></li>
+  {% if open_tasks %}
+    Tasks that are open for contribution
+    <ul>
+      {% for task in open_tasks %}
+      <li>
+        <a href="{% url view_task task.id %}">
+          {{ task.title }}
+        </a>
+      </li>
     {% endfor %}
     </ul>
     <br />
-    {% endif %}
+  {% endif %}
 
-    {% if comp_tasks %}
-    Tasks that were completed recently<ul>
-    {% for task in comp_tasks %}
-        <li><a href="{% url view_task task.id %}">{{ task.title }}</a></li>
-    {% endfor %}
+  {% if working_tasks %}
+    Tasks that are being worked on
+    <ul>
+      {% for task in working_tasks %}
+        <li>
+          <a href="{% url view_task task.id %}">
+            {{ task.title }}
+          </a>
+        </li>
+      {% endfor %}
     </ul>
     <br />
-    {% endif %}
+  {% endif %}
 
-    {% if unpub_tasks %}
-    Tasks that need approval<ul>
-    {% for task in unpub_tasks %}
-        <li><a href="{% url view_task task.id %}">{{ task.title }}</a></li>
-    {% endfor %}
+  {% if comp_tasks %}
+    Tasks that were completed recently
+    <ul>
+      {% for task in comp_tasks %}
+        <li>
+          <a href="{% url view_task task.id %}">
+            {{ task.title }}
+          </a>
+        </li>
+      {% endfor %}
     </ul>
     <br />
-    {% endif %}
+  {% endif %}
+
+  {% if unpub_tasks %}
+    Tasks that need approval
+    <ul>
+      {% for task in unpub_tasks %}
+        <li>
+          <a href="{% url view_task task.id %}">
+            {{ task.title }}
+          </a>
+        </li>
+      {% endfor %}
+    </ul>
+    <br />
+  {% endif %}
 {% endblock %}
--- a/pytask/templates/task/browse_textbooks.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/browse_textbooks.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,30 +1,46 @@
 {% extends "base.html" %}
 
 {% block content %}
-    {% if comp_textbooks %}
-    Textbooks that were completed recently<ul>
-    {% for textbook in comp_textbooks %}
-        <li><a href="{% url view_textbook textbook.id %}">{{ textbook.name }}</a></li>
-    {% endfor %}
+  {% if comp_textbooks %}
+    Textbooks that were completed recently
+    <ul>
+      {% for textbook in comp_textbooks %}
+        <li>
+          <a href="{% url view_textbook textbook.id %}">
+            {{ textbook.name }}
+          </a>
+        </li>
+      {% endfor %}
     </ul>
     <br />
-    {% endif %}
+  {% endif %}
 
-    {% if open_textbooks %}
-    Textbooks that are open for contribution<ul>
-    {% for textbook in open_textbooks %}
-        <li><a href="{% url view_textbook textbook.id %}">{{ textbook.name }}</a></li>
-    {% endfor %}
+  {% if open_textbooks %}
+    Textbooks that are open for contribution
+    <ul>
+      {% for textbook in open_textbooks %}
+        <li>
+          <a href="{% url view_textbook textbook.id %}">
+            {{ textbook.name }}
+          </a>
+        </li>
+      {% endfor %}
     </ul>
     <br />
-    {% endif %}
+  {% endif %}
 
-    {% if unpub_textbooks %}
-    Textbooks that need approval<ul>
-    {% for textbook in unpub_textbooks %}
-        <li><a href="{% url view_textbook textbook.id %}">{{ textbook.name }}</a></li>
-    {% endfor %}
+  {% if unpub_textbooks %}
+    Textbooks that need approval
+    <ul>
+      {% for textbook in unpub_textbooks %}
+        <li>
+          <a href="{% url view_textbook textbook.id %}">
+            {{ textbook.name }}
+          </a>
+        </li>
+      {% endfor %}
     </ul>
-    <br />
-    {% endif %}
+  <br />
+  {% endif %}
+
 {% endblock %}
--- a/pytask/templates/task/claim.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/claim.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,5 +1,7 @@
 {% extends "base.html" %}
 
+{% load form_helpers %}
+
 {% block content %}
     {% if can_claim %}
     Propose a claim to work on this task.<br />
--- a/pytask/templates/task/confirm_approval.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/confirm_approval.html	Mon Jan 17 02:53:11 2011 +0530
@@ -7,6 +7,8 @@
   This action cannot be undone. Please confirm
   <br /><br />
 
+<!--  <button class="green" type="submit" onclick="location.href='{% url approve_task task.id %}'">Approve</button>-->
+
   <a href="{% url approve_task task.id %}">
     Yes, I approve the task
   </a>
@@ -17,4 +19,4 @@
   </a>
   <br />
 
-{% endblock %}
+{% endblock %}
\ No newline at end of file
--- a/pytask/templates/task/select_user.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/select_user.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,5 +1,7 @@
 {% extends "base.html" %}
 
+{% load form_helpers %}
+
 {% block content %}
   <a href="{% url claim_task task.id %}">
     Click here
--- a/pytask/templates/task/submit_report.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/submit_report.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,5 +1,7 @@
 {% extends "base.html" %}
 
+{% load form_helpers %}
+
 {% block title %}
   {{task.title}}
 {% endblock %}
--- a/pytask/templates/task/view.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/view.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,5 +1,7 @@
 {% extends "base.html" %}
 
+{% load form_helpers %}
+
 {% block title %}
   {{task.title}}
 {% endblock %}
@@ -16,7 +18,7 @@
   {% endif %}
 
   {% if can_close %}
-      <a href="{% url close_task task.id %}">Close task</a>
+    <a href="{% url close_task task.id %}">Close task</a>
   {% endif %}
 
   <hr />created by
--- a/pytask/templates/task/view_textbook.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/task/view_textbook.html	Mon Jan 17 02:53:11 2011 +0530
@@ -1,5 +1,7 @@
 {% extends "base.html" %}
 
+{% load form_helpers %}
+
 {% block title %}
     {{textbook.name}}
 {% endblock %}
--- a/pytask/templates/templatetags/_as_div_form.html	Mon Jan 17 02:52:42 2011 +0530
+++ b/pytask/templates/templatetags/_as_div_form.html	Mon Jan 17 02:53:11 2011 +0530
@@ -14,4 +14,3 @@
     <p class="submit"><button type="submit">{{ button_label }}</button></p>
   </div>
 </form>
-