From 35b7aaa33c1826d7b39dc8a0f32100f5c0c5788d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Nov 2008 07:57:57 -0500 Subject: Moved bug.new_bug code into bugdir.BugDir.new_bug. Also removed explicit comparisons from beweb/controllers.py, since they are now built into the Bug.__cmp__ method. --- Bugs-Everywhere-Web/beweb/controllers.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Bugs-Everywhere-Web') diff --git a/Bugs-Everywhere-Web/beweb/controllers.py b/Bugs-Everywhere-Web/beweb/controllers.py index e3d555b..6773aec 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, new_bug, new_comment, 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, -- cgit From 3697d561fef7f4ee15a6b4d9906a9a9114412965 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Nov 2008 08:05:17 -0500 Subject: Merged bug.new_comment into bug.Bug.new_comment. --- Bugs-Everywhere-Web/beweb/controllers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Bugs-Everywhere-Web') diff --git a/Bugs-Everywhere-Web/beweb/controllers.py b/Bugs-Everywhere-Web/beweb/controllers.py index 6773aec..393f105 100644 --- a/Bugs-Everywhere-Web/beweb/controllers.py +++ b/Bugs-Everywhere-Web/beweb/controllers.py @@ -4,7 +4,7 @@ import cherrypy import turbogears from turbogears import controllers, expose, validate, redirect, identity -from libbe.bugdir import tree_root, new_bug, new_comment, NoRootEntry +from libbe.bugdir import tree_root, new_comment, NoRootEntry from config import projects from prest import PrestHandler, provide_action @@ -103,7 +103,7 @@ 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)) -- cgit From 1ca9b73832c1ca685fdba85f2be354e855bc0b5c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Nov 2008 08:31:45 -0500 Subject: Updated Bugs-Everywhere-Web to work with new architecture. --- Bugs-Everywhere-Web/README.txt | 5 ++++- Bugs-Everywhere-Web/beweb/controllers.py | 2 +- Bugs-Everywhere-Web/beweb/templates/bugs.kid | 2 +- Bugs-Everywhere-Web/beweb/templates/edit_bug.kid | 6 +++--- Bugs-Everywhere-Web/beweb/templates/projects.kid | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) (limited to 'Bugs-Everywhere-Web') diff --git a/Bugs-Everywhere-Web/README.txt b/Bugs-Everywhere-Web/README.txt index efde8ff..dada74f 100644 --- a/Bugs-Everywhere-Web/README.txt +++ b/Bugs-Everywhere-Web/README.txt @@ -1,4 +1,7 @@ Bugs-Everywhere-Web +Configure by creating an appropriate beweb/config.py from +beweb/config.py.example. + 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. diff --git a/Bugs-Everywhere-Web/beweb/controllers.py b/Bugs-Everywhere-Web/beweb/controllers.py index 393f105..a64156f 100644 --- a/Bugs-Everywhere-Web/beweb/controllers.py +++ b/Bugs-Everywhere-Web/beweb/controllers.py @@ -4,7 +4,7 @@ import cherrypy import turbogears from turbogears import controllers, expose, validate, redirect, identity -from libbe.bugdir import tree_root, new_comment, NoRootEntry +from libbe.bugdir import tree_root, NoRootEntry from config import projects from prest import PrestHandler, provide_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 @@ - +
StatusSeverityAssigned ToSummary
${select_among("status", active_status+inactive_status, bug.status)}${select_among("severity", severity_levels, bug.severity)}
${select_among("status", status_values, bug.status)}${select_among("severity", severity_values, bug.severity)} ${select_among("assigned", people.keys()+[None], bug.assigned, people)}
- +
From${comment.From}
Date${time_to_str(comment.date)}
Date${time_to_str(comment.time)}
Edit 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 @@ ' % name] for option in options: -- cgit From 3b0bfcb7488132cd40733812da41772f890c99b2 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Nov 2008 11:12:43 -0500 Subject: Added BE-Web repo-access warning to Bugs-Everywhere-Web/README.txt. --- Bugs-Everywhere-Web/README.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Bugs-Everywhere-Web') diff --git a/Bugs-Everywhere-Web/README.txt b/Bugs-Everywhere-Web/README.txt index dada74f..b6b78cf 100644 --- a/Bugs-Everywhere-Web/README.txt +++ b/Bugs-Everywhere-Web/README.txt @@ -1,7 +1,10 @@ Bugs-Everywhere-Web Configure by creating an appropriate beweb/config.py from -beweb/config.py.example. +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. This is a TurboGears (http://www.turbogears.org) project. It can be started by running the start-beweb.py script. -- cgit From 5ee35ad5ae30efd17a4c99d3056232b57bd4529b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Nov 2008 11:55:40 -0500 Subject: Added identity discussion to BE-Web README.txt & require login to edit bugs. --- Bugs-Everywhere-Web/README.txt | 36 ++++++++++++++++++++++++++++++-- Bugs-Everywhere-Web/beweb/controllers.py | 1 + 2 files changed, 35 insertions(+), 2 deletions(-) (limited to 'Bugs-Everywhere-Web') diff --git a/Bugs-Everywhere-Web/README.txt b/Bugs-Everywhere-Web/README.txt index b6b78cf..10774df 100644 --- a/Bugs-Everywhere-Web/README.txt +++ b/Bugs-Everywhere-Web/README.txt @@ -1,10 +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. + 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. -This is a TurboGears (http://www.turbogears.org) project. It can be -started by running the start-beweb.py script. +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 a64156f..a0d0ff9 100644 --- a/Bugs-Everywhere-Web/beweb/controllers.py +++ b/Bugs-Everywhere-Web/beweb/controllers.py @@ -108,6 +108,7 @@ class Bug(PrestHandler): 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): -- cgit From 0e57e0c247f7499f5d54e135d116c2a30a74146e Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Nov 2008 12:02:23 -0500 Subject: Some more fixes to get BE-Web working with libbe changes. --- Bugs-Everywhere-Web/beweb/templates/edit_comment.kid | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Bugs-Everywhere-Web') 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 @@ @@ -17,7 +16,7 @@ from beweb.controllers import bug_list_url, bug_url
- +
From${comment.From}
Date${time_to_str(comment.date)}
Date${time_to_str(comment.time)}