aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values2
-rw-r--r--.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/aea21508-69c2-4d6b-ada1-4fbadac14c56/body1
-rw-r--r--.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/aea21508-69c2-4d6b-ada1-4fbadac14c56/values28
-rw-r--r--.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/d5ffa1c4-f435-4a9a-99f3-2a7bc3072051/body1
-rw-r--r--.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/d5ffa1c4-f435-4a9a-99f3-2a7bc3072051/values21
-rw-r--r--.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/f1fd8249-ded3-4e3c-a6ef-967d0a0edcd9/body3
-rw-r--r--.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/f1fd8249-ded3-4e3c-a6ef-967d0a0edcd9/values21
-rwxr-xr-xcfbe.py29
-rw-r--r--static/style/cfbe.css8
-rw-r--r--templates/bug.html41
10 files changed, 150 insertions, 5 deletions
diff --git a/.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values b/.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values
index 7361121..19aafd2 100644
--- a/.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values
+++ b/.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values
@@ -22,7 +22,7 @@ severity=minor
-status=open
+status=closed
diff --git a/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/aea21508-69c2-4d6b-ada1-4fbadac14c56/body b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/aea21508-69c2-4d6b-ada1-4fbadac14c56/body
new file mode 100644
index 0000000..d13b1b7
--- /dev/null
+++ b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/aea21508-69c2-4d6b-ada1-4fbadac14c56/body
@@ -0,0 +1 @@
+I agree. (Test message).
diff --git a/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/aea21508-69c2-4d6b-ada1-4fbadac14c56/values b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/aea21508-69c2-4d6b-ada1-4fbadac14c56/values
new file mode 100644
index 0000000..4f055dd
--- /dev/null
+++ b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/aea21508-69c2-4d6b-ada1-4fbadac14c56/values
@@ -0,0 +1,28 @@
+
+
+
+Content-type=text/plain
+
+
+
+
+
+
+Date=Sat, 31 Jan 2009 06:31:12 +0000
+
+
+
+
+
+
+From=Steve Losh <steve@stevelosh.com>
+
+
+
+
+
+
+In-reply-to=d5ffa1c4-f435-4a9a-99f3-2a7bc3072051
+
+
+
diff --git a/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/d5ffa1c4-f435-4a9a-99f3-2a7bc3072051/body b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/d5ffa1c4-f435-4a9a-99f3-2a7bc3072051/body
new file mode 100644
index 0000000..8598e67
--- /dev/null
+++ b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/d5ffa1c4-f435-4a9a-99f3-2a7bc3072051/body
@@ -0,0 +1 @@
+This will not be incredibly easy. It will require reworking of the repository roots.
diff --git a/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/d5ffa1c4-f435-4a9a-99f3-2a7bc3072051/values b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/d5ffa1c4-f435-4a9a-99f3-2a7bc3072051/values
new file mode 100644
index 0000000..f541cad
--- /dev/null
+++ b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/d5ffa1c4-f435-4a9a-99f3-2a7bc3072051/values
@@ -0,0 +1,21 @@
+
+
+
+Content-type=text/plain
+
+
+
+
+
+
+Date=Sat, 31 Jan 2009 06:00:40 +0000
+
+
+
+
+
+
+From=Steve Losh <steve@stevelosh.com>
+
+
+
diff --git a/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/f1fd8249-ded3-4e3c-a6ef-967d0a0edcd9/body b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/f1fd8249-ded3-4e3c-a6ef-967d0a0edcd9/body
new file mode 100644
index 0000000..20dbfd2
--- /dev/null
+++ b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/f1fd8249-ded3-4e3c-a6ef-967d0a0edcd9/body
@@ -0,0 +1,3 @@
+This is a comment.
+
+With several lines.
diff --git a/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/f1fd8249-ded3-4e3c-a6ef-967d0a0edcd9/values b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/f1fd8249-ded3-4e3c-a6ef-967d0a0edcd9/values
new file mode 100644
index 0000000..759a973
--- /dev/null
+++ b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/comments/f1fd8249-ded3-4e3c-a6ef-967d0a0edcd9/values
@@ -0,0 +1,21 @@
+
+
+
+Content-type=text/plain
+
+
+
+
+
+
+Date=Sat, 31 Jan 2009 06:48:21 +0000
+
+
+
+
+
+
+From=Steve Losh <steve@stevelosh.com>
+
+
+
diff --git a/cfbe.py b/cfbe.py
index ee77999..8f0342f 100755
--- a/cfbe.py
+++ b/cfbe.py
@@ -3,10 +3,15 @@
import cherrypy
from libbe import bugdir
from jinja2 import Environment, FileSystemLoader
+from datetime import datetime
+def datetimeformat(value, format='%B %d, %Y at %I:%M %p'):
+ return datetime.fromtimestamp(value).strftime(format)
+
template_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/templates'
env = Environment(loader=FileSystemLoader(template_root))
+env.filters['datetimeformat'] = datetimeformat
class WebInterface:
"""The web interface to CFBE."""
@@ -17,7 +22,7 @@ class WebInterface:
self.bd = bugdir.BugDir(root=self.bug_root)
self.repository_name = self.bd.root.split('/')[-1]
- def get_common_information(self, assignee, target):
+ def get_common_information(self):
possible_assignees = list(set([bug.assigned for bug in self.bd if bug.assigned != None]))
possible_assignees.sort(key=unicode.lower)
@@ -25,7 +30,8 @@ class WebInterface:
possible_targets.sort(key=unicode.lower)
return {'possible_assignees': possible_assignees,
- 'possible_targets': possible_targets,}
+ 'possible_targets': possible_targets,
+ 'repository_name': self.repository_name,}
def filter_bugs(self, status, assignee, target):
"""Filter the list of bugs to return only those desired."""
@@ -60,12 +66,27 @@ class WebInterface:
template = env.get_template('list.html')
bugs = self.filter_bugs(status, assignee, target)
- common_info = self.get_common_information(assignee, target)
+ common_info = self.get_common_information()
return template.render(bugs=bugs, bd=self.bd, label=label,
assignees=common_info['possible_assignees'],
targets=common_info['possible_targets'],
- repository_name=self.repository_name)
+ repository_name=common_info['repository_name'])
+ @cherrypy.expose
+ def bug(self, id=''):
+ """The page for viewing a single bug."""
+
+ self.bd.load_all_bugs()
+
+ bug = self.bd.bug_from_shortname(id)
+
+ template = env.get_template('bug.html')
+ common_info = self.get_common_information()
+ return template.render(bug=bug, bd=self.bd,
+ assignees=common_info['possible_assignees'],
+ targets=common_info['possible_targets'],
+ repository_name=common_info['repository_name'])
+
config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config'
bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be'
diff --git a/static/style/cfbe.css b/static/style/cfbe.css
index ee699b4..987afdf 100644
--- a/static/style/cfbe.css
+++ b/static/style/cfbe.css
@@ -31,3 +31,11 @@ table { margin-bottom: 1.417em; }
tr.stripe { background-color: #f5e5f0; }
div#assignees, div#targets { display: none; }
+
+p.creation-info { color: #888; }
+span.detail-field-header { font-weight: 700; width: 7.5em; padding-right: 1em; display: inline-block; text-align: right; }
+
+div.bug-comment { margin-left: 2em;}
+p.bug-comment-body { white-space: pre; margin: 0em 0em 0em 0em; }
+p.bug-comment-footer { margin: 0em 0em; color: #888; }
+h4.bug-comment-header { margin: 1.5em 0em 0em; } \ No newline at end of file
diff --git a/templates/bug.html b/templates/bug.html
new file mode 100644
index 0000000..ee359f7
--- /dev/null
+++ b/templates/bug.html
@@ -0,0 +1,41 @@
+{% extends "base.html" %}
+
+{% block page_title %}
+ Bug {{ bd.bug_shortname(bug) }} &ndash; {{ bug.summary }}
+{% endblock %}
+
+{% block content %}
+ <p class="creation-info">Created on {{ bug.time|datetimeformat }} by {{ bug.creator|e }}</p>
+
+ <h3>Bug Details</h3>
+ <p>
+ <span class="detail-field-header">Status:</span>
+ <span class="detail-field-contents">{{ bug.status }}</span><br />
+
+ <span class="detail-field-header">Severity:</span>
+ <span class="detail-field-contents">{{ bug.severity }}</span><br />
+
+ <span class="detail-field-header">Scheduled for:</span>
+ <span class="detail-field-contents">{{ bug.target }}</span><br />
+
+ <span class="detail-field-header">Assigned to:</span>
+ <span class="detail-field-contents">{{ bug.assigned|e }}</span><br />
+
+ <span class="detail-field-header">Permanent ID:</span>
+ <span class="detail-field-contents">{{ bug.uuid }}</span><br />
+ </p>
+
+ <h3>Summary</h3>
+ <p>
+ {{ bug.summary }}
+ </p>
+
+ <h3>Comments</h3>
+ {% for comment in bug.comments() %}
+ <div class="bug-comment">
+ <h4 class="bug-comment-header">{{ comment.From|e }} said:</h4>
+ <p class="bug-comment-body">{{ comment.body|trim|e }}</p>
+ <p class="bug-comment-footer">on {{ comment.time|datetimeformat }}</p>
+ </div>
+ {% endfor %}
+{% endblock %} \ No newline at end of file