Implemented bug adding.
authorSteve Losh <steve@stevelosh.com>
Sun, 1 Feb 2009 20:45:52 +0000 (15:45 -0500)
committerSteve Losh <steve@stevelosh.com>
Sun, 1 Feb 2009 20:45:52 +0000 (15:45 -0500)
.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values
cfbe.py
static/style/cfbe.css
templates/base.html

index 4f93cc7f3e052f0cc174bb2e224b3e40cf68bc24..94d96d70169dbb706dc09fc8a1654f67e3eccd8e 100644 (file)
@@ -22,7 +22,7 @@ severity=minor
 
 
 
-status=open
+status=closed
 
 
 
diff --git a/cfbe.py b/cfbe.py
index 8f0342f5697ce2d84c8a795532228c2025fb7d1d..b061d882b3dda6354033f5a21020fd833fa3fe7a 100755 (executable)
--- a/cfbe.py
+++ b/cfbe.py
@@ -29,8 +29,13 @@ class WebInterface:
         possible_targets = list(set([bug.target for bug in self.bd if bug.target != None]))
         possible_targets.sort(key=unicode.lower)
         
+        possible_statuses = [u'open', u'assigned', u'test', u'unconfirmed', 
+                             u'wishlist', u'closed', u'disabled', u'fixed', 
+                             u'wontfix']
+        
         return {'possible_assignees': possible_assignees,
                 'possible_targets': possible_targets,
+                'possible_statuses': possible_statuses,
                 'repository_name': self.repository_name,}
     
     def filter_bugs(self, status, assignee, target):
@@ -70,6 +75,7 @@ class WebInterface:
         return template.render(bugs=bugs, bd=self.bd, label=label, 
                                assignees=common_info['possible_assignees'],
                                targets=common_info['possible_targets'],
+                               statuses=common_info['possible_statuses'],
                                repository_name=common_info['repository_name'])
     
     @cherrypy.expose
@@ -85,9 +91,16 @@ class WebInterface:
         return template.render(bug=bug, bd=self.bd, 
                                assignees=common_info['possible_assignees'],
                                targets=common_info['possible_targets'],
+                               statuses=common_info['possible_statuses'],
                                repository_name=common_info['repository_name'])
-
+    
+    @cherrypy.expose
+    def create(self, summary):
+        """The view that handles the creation of a new bug."""
+        if summary.strip() != '':
+            self.bd.new_bug(summary=summary).save()
+        raise cherrypy.HTTPRedirect('/', status=302)
 
 config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config'
-bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be'
+bug_root = '/Users/sjl/Desktop/be/.be'
 cherrypy.quickstart(WebInterface(bug_root), '/', config)
index 987afdf985d20282a0ffe897373c0e39dbcd6b51..55bf6b2c0fdd463707c9eb8393695ed3ae71e554 100644 (file)
@@ -1,11 +1,11 @@
 /* @override http://localhost:8080/static/style/cfbe.css */
 
-body { background-image: url(/static/images/gradient-background.png); background-color: #bbbbbb; background-repeat: repeat-x;}
+body { background-image: url(/static/images/gradient-background.png); background-color: #bbbbbb; background-repeat: repeat-x; 
+       /*background-image: url(/static/images/stripe-rhythm.png); background-repeat: repeat;*/ }
 
-div#header    { background-image: url(/static/images/gradient-header.png); background-repeat: repeat-x; background-color: #770005; color: #fff; }
+div#header    { background-image: url(/static/images/gradient-header.png); background-repeat: repeat-x; 
+                background-color: #770005; color: #fff; margin-top: 1.5em; }
 div#header h1 { font-size: 4em; line-height: 1.5em; margin-bottom: 0em; }
-div#logo      { text-align: right; color: #d03; padding-top: 1.5em; }
-div#logo   h1 { margin-top: 0.65em; margin-bottom: 0.15em; }
 
 div.center-column { width: 55em; margin-left: 5em; }
 div#content-wrap { display: inline-block; vertical-align: top; }
@@ -24,9 +24,11 @@ a:link, a:visited, a:active { color: #d03; text-decoration: none; font-weight: b
 a:hover { color: #60b305; }
 
 
-table#bug-list { width: 100%; border-collapse: collapse; border: 1px solid #ccc; }
-table#bug-list td, table#bug-list th { border: 0em; border-bottom: 1px solid #ccc; text-align: left; }
-table tr td, table tr th { padding: 0px 5px; line-height: 2.916em; }
+table#bug-list { width: 100%; border-collapse: collapse; border: 0.084em solid #ccc; }
+table#bug-list td, table#bug-list th { border: 0em; border-bottom: 0.084em solid #ccc; text-align: left; }
+table tr td, table tr th { padding: 0px 5px; }
+table tr td { line-height: 2.832em; padding-bottom: 0.084em; }
+table tr th { line-height: 2.916em; }
 table { margin-bottom: 1.417em; }
 tr.stripe { background-color: #f5e5f0; }
 
@@ -38,4 +40,9 @@ span.detail-field-header { font-weight: 700; width: 7.5em; padding-right: 1em; d
 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
+h4.bug-comment-header { margin: 1.5em 0em 0em; }
+
+form#create-form { height: 3em; display: none; }
+form#create-form div.field { }
+form#create-form input#create-summary { width: 30em; font-weight: 700; }
+form#create-form button#create-button { }
\ No newline at end of file
index 58e824078ca6402568919d3d7b2fac582cd1adf2..40ec10f115c38000e77b7c401b224850a85f5b4b 100644 (file)
                     e.preventDefault();
                 });
                 
+                $('#create-bug').click(function(e) {
+                    $('#create-form').fadeIn('fast');
+                    e.preventDefault();
+                });
+                
                 $('table tr:odd').addClass('stripe');
             });
         </script>
     </head>
     
     <body>
-        <div id="logo"><h1>Cherry Flavored Bugs Everywhere!</h1></div>
         <div id="header">
             <div class="center-column">
                 <h1>{{ repository_name }}</h1>
                         <a href="" id="filter-target">Scheduled for...</a>
                     </span>
                     <span id="create">
-                        <a href="fixme">&#43; Create a new bug</a>
+                        <a href="" id="create-bug">&#43; Create a new bug</a>
                     </span>
                 </div>
+                <form id="create-form" action="/create" method="post">
+                    <fieldset>
+                        <div class="field">
+                            <input type="text" class="text" id="create-summary" name="summary" />
+                            <button id="create-button" type="submit">Create</button>
+                        </div>
+                    </fieldset>
+                </form>
                 <h2>{% block page_title %}&nbsp;{% endblock %}</h2>
                 {% block content %}{% endblock %}
             </div>