diff options
Diffstat (limited to 'Bugs-Everywhere-Web')
-rw-r--r-- | Bugs-Everywhere-Web/README.txt | 40 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/controllers.py | 12 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/templates/bugs.kid | 2 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/templates/edit_bug.kid | 6 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/templates/edit_comment.kid | 3 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/templates/projects.kid | 2 |
6 files changed, 49 insertions, 16 deletions
diff --git a/Bugs-Everywhere-Web/README.txt b/Bugs-Everywhere-Web/README.txt index efde8ff..10774df 100644 --- a/Bugs-Everywhere-Web/README.txt +++ b/Bugs-Everywhere-Web/README.txt @@ -1,4 +1,42 @@ Bugs-Everywhere-Web This is a TurboGears (http://www.turbogears.org) project. It can be -started by running the start-beweb.py script.
\ No newline at end of file +started by running the start-beweb.py script. + +Configure by creating an appropriate beweb/config.py from +beweb/config.py.example. The server will edit the repositories that +it manages, so you should probably have it running on a seperate +branch than your working repository. You can then merge/push +as you require to keep the branches in sync. + +See + http://docs.turbogears.org/1.0/Configuration +For standard turbogears configuration information. + +Currently, you need to login for any methods with a +@identity.require() decorator. The only group in the current +implementation is 'editbugs'. Basically, anyone can browse around, +but only registered 'editbugs' members can change things. + +Anonymous actions: + * See project tree + * See buglist + * See comments +Editbugs required actions: + * Create new comments + * Reply to comments + * Update comment info + + +All login attempts will fail unless you have added some valid users. See + http://docs.turbogears.org/1.0/GettingStartedWithIdentity +For a good intro. For the impatient, try something like + Bugs-Everywhere-Web$ tg-admin toolbox + browse to 'CatWalk' -> 'User' -> 'Add User+' +or + Bugs-Everywhere-Web$ tg-admin sholl + >>> u = User(user_name=u'jdoe', email_address=u'jdoe@example.com', + display_name=u'Jane Doe', password=u'xxx') + >>> g = Group(group_name=u'editbugs', display_name=u'Edit Bugs') + >>> g.addUser(u) # BE-Web uses SQLObject +Exit the tg-admin shell with Ctrl-Z on MS Windows, Ctrl-D on other systems. diff --git a/Bugs-Everywhere-Web/beweb/controllers.py b/Bugs-Everywhere-Web/beweb/controllers.py index e3d555b..a0d0ff9 100644 --- a/Bugs-Everywhere-Web/beweb/controllers.py +++ b/Bugs-Everywhere-Web/beweb/controllers.py @@ -4,9 +4,7 @@ import cherrypy import turbogears from turbogears import controllers, expose, validate, redirect, identity -from libbe.bugdir import (tree_root, cmp_severity, new_bug, new_comment, - NoRootEntry) -from libbe import names +from libbe.bugdir import tree_root, NoRootEntry from config import projects from prest import PrestHandler, provide_action @@ -94,10 +92,7 @@ class Bug(PrestHandler): bug_tree = project_tree(project) bugs = list(bug_tree.list()) if sort_by is None: - def cmp_date(bug1, bug2): - return -cmp(bug1.time, bug2.time) - bugs.sort(cmp_date) - bugs.sort(cmp_severity) + bugs.sort() return {"project_id" : project, "project_name" : projects[project][0], "bugs" : bugs, @@ -108,11 +103,12 @@ class Bug(PrestHandler): @identity.require( identity.has_permission("editbugs")) @provide_action("action", "New bug") def new_bug(self, bug_data, bug, **kwargs): - bug = new_bug(project_tree(bug_data['project'])) + bug = project_tree(bug_data['project']).new_bug() bug.creator = identity.current.user.userId bug.save() raise cherrypy.HTTPRedirect(bug_url(bug_data['project'], bug.uuid)) + @identity.require( identity.has_permission("editbugs")) @provide_action("action", "Update") def update(self, bug_data, bug, status, severity, summary, assigned, action): diff --git a/Bugs-Everywhere-Web/beweb/templates/bugs.kid b/Bugs-Everywhere-Web/beweb/templates/bugs.kid index 376e77b..198aa94 100644 --- a/Bugs-Everywhere-Web/beweb/templates/bugs.kid +++ b/Bugs-Everywhere-Web/beweb/templates/bugs.kid @@ -1,6 +1,6 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?python -from libbe.cmdutil import unique_name +from libbe.names import unique_name from beweb.controllers import bug_url, project_url, bug_list_url from beweb.model import people_map people = people_map() diff --git a/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid b/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid index 34fcb99..276f610 100644 --- a/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid +++ b/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid @@ -1,6 +1,6 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?python -from libbe.bugdir import severity_levels, active_status, inactive_status, thread_comments +from libbe.bug import severity_values, status_values, thread_comments from libbe.utility import time_to_str from beweb.controllers import bug_list_url, comment_url from beweb.formatting import comment_body_xhtml, select_among @@ -20,14 +20,14 @@ people = people_map() <form method="post" action="."> <table> <tr><td>Status</td><td>Severity</td><td>Assigned To</td><td>Summary</td></tr> -<tr><td>${select_among("status", active_status+inactive_status, bug.status)}</td><td>${select_among("severity", severity_levels, bug.severity)}</td> +<tr><td>${select_among("status", status_values, bug.status)}</td><td>${select_among("severity", severity_values, bug.severity)}</td> <td>${select_among("assigned", people.keys()+[None], bug.assigned, people)}</td><td><input name="summary" value="${bug.summary}" size="80" /></td></tr> </table> <div py:def="show_comment(comment, children)" class="comment"> <insetbox> <table> <tr><td>From</td><td>${comment.From}</td></tr> - <tr><td>Date</td><td>${time_to_str(comment.date)}</td></tr> + <tr><td>Date</td><td>${time_to_str(comment.time)}</td></tr> </table> <div py:content="comment_body_xhtml(comment)" py:strip="True"></div> <a href="${comment_url(project_id, bug.uuid, comment.uuid)}">Edit</a> diff --git a/Bugs-Everywhere-Web/beweb/templates/edit_comment.kid b/Bugs-Everywhere-Web/beweb/templates/edit_comment.kid index 551db9d..2b522d4 100644 --- a/Bugs-Everywhere-Web/beweb/templates/edit_comment.kid +++ b/Bugs-Everywhere-Web/beweb/templates/edit_comment.kid @@ -1,6 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?python -from libbe.bugdir import severity_levels from libbe.utility import time_to_str from beweb.controllers import bug_list_url, bug_url ?> @@ -17,7 +16,7 @@ from beweb.controllers import bug_list_url, bug_url <form method="post"> <table> <tr><td>From</td><td>${comment.From}</td></tr> - <tr><td>Date</td><td>${time_to_str(comment.date)}</td></tr> + <tr><td>Date</td><td>${time_to_str(comment.time)}</td></tr> </table> <insetbox><textarea rows="15" cols="80" py:content="comment.body" name="comment_body" style="border-style: none"/></insetbox> <p><input type="submit" name="action" value="Update"/></p> diff --git a/Bugs-Everywhere-Web/beweb/templates/projects.kid b/Bugs-Everywhere-Web/beweb/templates/projects.kid index 09bde77..d5f9fd3 100644 --- a/Bugs-Everywhere-Web/beweb/templates/projects.kid +++ b/Bugs-Everywhere-Web/beweb/templates/projects.kid @@ -1,6 +1,6 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?python -from libbe.bugdir import severity_levels +from libbe.bug import severity_values def select_among(name, options, default): output = ['<select name="%s">' % name] for option in options: |