aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Losh <steve@stevelosh.com>2009-02-01 15:45:52 -0500
committerSteve Losh <steve@stevelosh.com>2009-02-01 15:45:52 -0500
commit59c742611d77ce59414d073e98782014dfb70d8f (patch)
treef906b233d103cf54d15b425626f0eef2dc61bcfe
parentb11274dde06473582f3f6ecb87c034d57d3917f4 (diff)
downloadbugseverywhere-59c742611d77ce59414d073e98782014dfb70d8f.tar.gz
Implemented bug adding.
-rw-r--r--.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values2
-rwxr-xr-xcfbe.py17
-rw-r--r--static/style/cfbe.css23
-rw-r--r--templates/base.html16
4 files changed, 45 insertions, 13 deletions
diff --git a/.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values b/.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values
index 4f93cc7..94d96d7 100644
--- a/.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values
+++ b/.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values
@@ -22,7 +22,7 @@ severity=minor
-status=open
+status=closed
diff --git a/cfbe.py b/cfbe.py
index 8f0342f..b061d88 100755
--- 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)
diff --git a/static/style/cfbe.css b/static/style/cfbe.css
index 987afdf..55bf6b2 100644
--- a/static/style/cfbe.css
+++ b/static/style/cfbe.css
@@ -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
diff --git a/templates/base.html b/templates/base.html
index 58e8240..40ec10f 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -31,13 +31,17 @@
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>
@@ -54,9 +58,17 @@
<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>