Add view to show all bugs.

portnov [2008-06-07 16:32:58]
Add view to show all bugs.
Filename
mgmt/templatetags/__init__.py
mgmt/templatetags/prj_filters.py
templates/all_bugs.html
diff --git a/mgmt/templatetags/__init__.py b/mgmt/templatetags/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/mgmt/templatetags/prj_filters.py b/mgmt/templatetags/prj_filters.py
new file mode 100644
index 0000000..f215fdb
--- /dev/null
+++ b/mgmt/templatetags/prj_filters.py
@@ -0,0 +1,6 @@
+from django import template
+register = template.Library()
+
+@register.filter('link')
+def link(obj,type='projects'):
+  return "<a href='/%s/%s/'>%s</a>" % (type,obj.id,obj.name)
diff --git a/templates/all_bugs.html b/templates/all_bugs.html
new file mode 100644
index 0000000..c6fed34
--- /dev/null
+++ b/templates/all_bugs.html
@@ -0,0 +1,20 @@
+{% extends "base.html" %}
+{% load prj_filters %}
+
+{% block title %}Все баги{% endblock %}
+
+{% block main %}
+
+<h2>Все баги</h2>
+
+<div class='bugs'>
+{% for bug in bugs %}
+    <div class='bug bug-state-{{bug.status}}'>
+      <p><strong>{{bug.name}}</strong></p>
+      <div class='project-link'>{{bug.project|link|safe}}</div>
+      <p>{{bug.text}}</p>
+    </div>
+{% endfor %}
+</div>
+
+{% endblock %}
ViewGit