diff options
author | Steve Losh <steve@stevelosh.com> | 2009-02-01 18:02:31 -0500 |
---|---|---|
committer | Steve Losh <steve@stevelosh.com> | 2009-02-01 18:02:31 -0500 |
commit | f0bd55c68d3e5fc7e117c43a00fcf24585021d10 (patch) | |
tree | 0b245fc992948972242757ef4e9da929deadfd94 | |
parent | f2e64e8c05e9255be619ae4ce47e9419088b5005 (diff) | |
download | bugseverywhere-f0bd55c68d3e5fc7e117c43a00fcf24585021d10.tar.gz |
Implemented bug editing.
-rw-r--r-- | .be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/comments/88d54d29-7312-4bb3-bc50-1970bdb2bb0e/body | 1 | ||||
-rw-r--r-- | .be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/comments/88d54d29-7312-4bb3-bc50-1970bdb2bb0e/values | 21 | ||||
-rw-r--r-- | .be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values | 6 | ||||
-rw-r--r-- | .be/bugs/d63d0bdd-e025-4f7c-9fcf-47a71de6d4d4/values | 49 | ||||
-rwxr-xr-x | cfbe.py | 8 | ||||
-rw-r--r-- | static/style/cfbe.css | 5 | ||||
-rw-r--r-- | templates/bug.html | 55 |
7 files changed, 127 insertions, 18 deletions
diff --git a/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/comments/88d54d29-7312-4bb3-bc50-1970bdb2bb0e/body b/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/comments/88d54d29-7312-4bb3-bc50-1970bdb2bb0e/body new file mode 100644 index 0000000..5becd48 --- /dev/null +++ b/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/comments/88d54d29-7312-4bb3-bc50-1970bdb2bb0e/body @@ -0,0 +1 @@ +Apparently the summary can only be one line. That makes the whitespace issue less relevant.
\ No newline at end of file diff --git a/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/comments/88d54d29-7312-4bb3-bc50-1970bdb2bb0e/values b/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/comments/88d54d29-7312-4bb3-bc50-1970bdb2bb0e/values new file mode 100644 index 0000000..41f53c6 --- /dev/null +++ b/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/comments/88d54d29-7312-4bb3-bc50-1970bdb2bb0e/values @@ -0,0 +1,21 @@ + + + +Content-type=text/plain + + + + + + +Date=Sun, 01 Feb 2009 22:49:29 +0000 + + + + + + +From=Steve Losh <steve@stevelosh.com> + + + diff --git a/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values b/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values index 8ed8ba9..ee7978b 100644 --- a/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values +++ b/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values @@ -1,7 +1,7 @@ -assigned=Steve Losh <steve@stevelosh.com> +assigned=Steve Losh @@ -22,14 +22,14 @@ severity=minor -status=open +status=closed -summary=Implement bug updating (not comments. +summary=Implement bug updating (not comments). Check on the whitespace of the summary field while you're at it. diff --git a/.be/bugs/d63d0bdd-e025-4f7c-9fcf-47a71de6d4d4/values b/.be/bugs/d63d0bdd-e025-4f7c-9fcf-47a71de6d4d4/values new file mode 100644 index 0000000..2d28890 --- /dev/null +++ b/.be/bugs/d63d0bdd-e025-4f7c-9fcf-47a71de6d4d4/values @@ -0,0 +1,49 @@ + + + +assigned=Steve Losh + + + + + + +creator=Steve Losh <steve@stevelosh.com> + + + + + + +severity=minor + + + + + + +status=closed + + + + + + +summary=Reset the state of the values when choosing "Discard Changes." + + + + + + +target=alpha + + + + + + +time=Sun, 01 Feb 2009 22:55:13 +0000 + + + @@ -123,12 +123,12 @@ class WebInterface: raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302) @cherrypy.expose - def edit(self, id, status, target, assignee, severity, summary=''): + def edit(self, id, status=None, target=None, assignee=None, severity=None, summary=None): """The view that handles editing bug details.""" bug = self.bd.bug_from_uuid(id) shortname = self.bd.bug_shortname(bug) - if summary.strip() != '': + if summary != None: bug.summary = summary else: bug.status = status if status != 'None' else None @@ -142,6 +142,6 @@ class WebInterface: config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config' -bug_root = '/Users/sjl/Desktop/be/.be' -# bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be' +# bug_root = '/Users/sjl/Desktop/be/.be' +bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be' cherrypy.quickstart(WebInterface(bug_root), '/', config) diff --git a/static/style/cfbe.css b/static/style/cfbe.css index 8c7cef9..34bac92 100644 --- a/static/style/cfbe.css +++ b/static/style/cfbe.css @@ -54,4 +54,7 @@ p#add-comment-link {margin-top: 1.5em; } form#bug-details-edit-form { display: none; } form#bug-details-edit-form label { font-weight: 700; width: 7.5em; margin-left: 0em; margin-right: 1em; text-align: right; } -form#bug-details-edit-form .field { padding-left: 0em;}
\ No newline at end of file +form#bug-details-edit-form .field { padding-left: 0em; } + +form#bug-summary-edit-form { display: none; } +input#bug-summary-edit-body { width: 100%; }
\ No newline at end of file diff --git a/templates/bug.html b/templates/bug.html index 01a2476..48571e9 100644 --- a/templates/bug.html +++ b/templates/bug.html @@ -1,12 +1,19 @@ {% extends "base.html" %} {% block page_title %} - Bug {{ bd.bug_shortname(bug) }} – {{ bug.summary }} + Bug {{ bd.bug_shortname(bug) }} – {{ bug.summary|truncate(50) }} {% endblock %} {% block script %} <script type="text/javascript"> $(function() { + function set_current_detail_default_values() { + $('#bug-details-edit-status option[value="{{ bug.status }}"]').attr('selected', 'yes'); + $('#bug-details-edit-target option[value="{{ bug.target|e }}"]').attr('selected', 'yes'); + $('#bug-details-edit-assignee option[value="{{ bug.assigned|striptags }}"]').attr('selected', 'yes'); + $('#bug-details-edit-severity option[value="{{ bug.severity }}"]').attr('selected', 'yes'); + } + $('#add-comment').click(function(e) { $('#add-comment-link').hide(); $('#add-comment-form').fadeIn('fast'); @@ -19,10 +26,23 @@ e.preventDefault(); }); - $('#bug-details-edit-status option[value="{{ bug.status }}"]').attr('selected', 'yes'); - $('#bug-details-edit-target option[value="{{ bug.target }}"]').attr('selected', 'yes'); - $('#bug-details-edit-assignee option[value="{{ bug.assigned }}"]').attr('selected', 'yes'); - $('#bug-details-edit-severity option[value="{{ bug.severity }}"]').attr('selected', 'yes'); + $('#bug-details-edit-form button[type="reset"]').click(function(e) { + $('#bug-details-edit-form').hide(); + $('#bug-details').fadeIn('fast', function() { set_current_detail_default_values(); } ); + }); + + $('#edit-bug-summary').click(function(e) { + $('#bug-summary').hide(); + $('#bug-summary-edit-form').fadeIn('fast'); + e.preventDefault(); + }); + + $('#bug-summary-edit-form button[type="reset"]').click(function(e) { + $('#bug-summary-edit-form').hide(); + $('#bug-summary').fadeIn('fast', function() { set_current_detail_default_values(); } ); + }); + + set_current_detail_default_values(); }); </script> {% endblock %} @@ -76,7 +96,7 @@ <select id="bug-details-edit-target" name="target"> <option value="None">Unscheduled</option> {% for target in targets %} - <option value="{{ target }}">{{ target }}</option> + <option value="{{ target|e }}">{{ target }}</option> {% endfor %} </select> </div> @@ -85,7 +105,7 @@ <select id="bug-details-edit-assignee" name="assignee"> <option value="None">Unassigned</option> {% for assignee in assignees %} - <option value="{{ assignee }}">{{ assignee }}</option> + <option value="{{ assignee|striptags }}">{{ assignee|striptags|e }}</option> {% endfor %} </select> </div> @@ -96,11 +116,27 @@ </fieldset> </form> - <h3>Summary</h3> - <p> + <h3 class="header-with-link">Summary</h3> + <span class="header-link"> + <a href="" id="edit-bug-summary">edit</a> + </span> + <p id="bug-summary"> {{ bug.summary }} </p> + <form id="bug-summary-edit-form" class="vertical" action="/edit" method="post"> + <fieldset> + <input type="hidden" name="id" value="{{ bug.uuid }}" /> + <div class="field"> + <input type="text" id="bug-summary-edit-body" name="summary" value="{{ bug.summary }}" /> + </div> + <div class="buttons"> + <button type="submit">Save Changes</button> + <button type="reset">Discard Changes</button> + </div> + </fieldset> + </form> + <h3>Comments</h3> {% for comment in bug.comments() %} <div class="bug-comment"> @@ -113,7 +149,6 @@ <fieldset> <input type="hidden" name="id" value="{{ bug.uuid }}" /> <div class="field"> - <label for="add-comment-body">Comment</label> <textarea cols="60" rows="6" id="add-comment-body" name="body"></textarea> </div> <div class="buttons"> |