Removed old REST implementation
authorAaron Bentley <abentley@panoramicfeedback.com>
Thu, 15 Dec 2005 21:10:20 +0000 (16:10 -0500)
committerAaron Bentley <abentley@panoramicfeedback.com>
Thu, 15 Dec 2005 21:10:20 +0000 (16:10 -0500)
beweb/beweb/controllers.py
beweb/beweb/templates/edit_bug.kid

index 8ba1595f1e323caf29d4aa28201c8361e9fe7254..2fe3d3ed1c099a9747c54c5ac40a6a48439dd059 100644 (file)
@@ -101,52 +101,3 @@ class Root(controllers.Root):
     @turbogears.expose()
     def index(self):
         raise cherrypy.HTTPRedirect(project_url()) 
-
-    @turbogears.expose()
-    def default(self, *args, **kwargs):
-        if len(args) == 1:
-            return self.bugs(args[0], **kwargs)
-        elif len(args) == 2:
-            return self.bug(*args, **kwargs)
-        else:
-            return repr(args)
-            
-
-    @turbogears.expose(html="beweb.templates.bugs")
-    def bugs(self, project_id, sort_by=None, show_closed=False):
-        if show_closed == "False":
-            show_closed = False
-        bug_tree = project_tree(project_id)
-        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)
-        return {"project_id"      : project_id,
-                "project_name"    : projects[project_id][0],
-                "bugs"            : bugs,
-                "show_closed"     : show_closed,
-               }
-
-    @turbogears.expose(html="beweb.templates.edit_bug")
-    def bug(self, project_id, bug_uuid, action=None, status=None, 
-            severity=None, summary=None):
-        bug_tree = project_tree(project_id)
-        if action == "New bug":
-            bug = bug_tree.new_bug()
-            bug.creator = names.creator()
-            bug.severity = "minor"
-            bug.status = "open"
-            bug.save()
-            raise cherrypy.HTTPRedirect(turbogears.url("/%s/%s/" % (project_id, bug.uuid))) 
-        else:
-            bug = bug_tree.get_bug(bug_uuid)
-        if action == "Update":
-            bug.status = status
-            bug.severity = severity
-            bug.summary = summary
-            bug.save()
-            raise cherrypy.HTTPRedirect(turbogears.url("/%s/" % project_id)) 
-            
-        return {"bug": bug, "project_id": project_id, "new":True}
index d55ab2ef7ce3f78cabe3f124b7e7074886cfcbff..b328d82939fdbaccea395144f13e97047fd43076 100644 (file)
@@ -2,6 +2,7 @@
 <?python
 from libbe.bugdir import severity_levels
 from libbe.utility import time_to_str 
+from beweb.controllers import bug_list_url
 def select_among(name, options, default):
     output = ['<select name="%s">' % name]
     for option in options:
@@ -39,6 +40,6 @@ def select_among(name, options, default):
 </div>
 <p><input type="submit" name="action" value="Update"/></p>
 </form>
-<a href="/${project_id}/">Bug List</a>
+<a href="${bug_list_url(project_id)}">Bug List</a>
 </body>
 </html>