diff options
Diffstat (limited to 'interfaces/web/templates')
-rw-r--r-- | interfaces/web/templates/base.html | 106 | ||||
-rw-r--r-- | interfaces/web/templates/bug.html | 160 | ||||
-rw-r--r-- | interfaces/web/templates/list.html | 27 |
3 files changed, 293 insertions, 0 deletions
diff --git a/interfaces/web/templates/base.html b/interfaces/web/templates/base.html new file mode 100644 index 0000000..8f22d73 --- /dev/null +++ b/interfaces/web/templates/base.html @@ -0,0 +1,106 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html> + <head> + <title>Cherry Flavored Bugs Everywhere!</title> + + <link rel="stylesheet" type="text/css" media="screen" + href="/static/style/aal.css" /> + <link rel="stylesheet" type="text/css" media="screen" + href="/static/style/cfbe.css" /> + + <script type="text/javascript" + src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"> + </script> + + <script type="text/javascript" + src="/static/scripts/jquery.corners.min.js"> + </script> + + <script type="text/javascript"> + $(function() { + $('#filter-assignee').click(function(e) { + $('#filter-pane').html($('#assignees').html()); + $('#filter-pane').fadeIn('fast'); + e.preventDefault(); + }); + + $('#filter-target').click(function(e) { + $('#filter-pane').html($('#targets').html()); + $('#filter-pane').fadeIn('fast'); + e.preventDefault(); + }); + + $('#create-bug').click(function(e) { + $('#create-bug').hide(); + $('#create-form').fadeIn('fast'); + e.preventDefault(); + }); + + $('table tr:odd').addClass('stripe'); + }); + </script> + + {% block script %}{% endblock %} + </head> + + <body> + <div id="main-pane"> + <div id="header" class="inside-main-pane"> + <h1>{{ repository_name }}</h1> + </div> + <div id="navigation" class="inside-main-pane"> + <span id="filters"> + <a href="/">Open</a> + <a href="/?status=closed">Closed</a> + <a href="" id="filter-assignee">Assigned to...</a> + <a href="" id="filter-target">Scheduled for...</a> + </span> + <span id="create"> + <a href="" id="create-bug">+ Create a new bug</a> + </span> + <span id="create-form"> + <form action="/create" method="post"> + <fieldset> + <input type="text" + id="create-summary" name="summary" /> + <button id="create-button" + type="submit">Create</button> + </fieldset> + </form> + </span> + </div> + <div id="filter-pane" class="inside-main-pane"></div> + <div id="content-pane" class="inside-main-pane"> + <h2>{% block page_title %} {% endblock %}</h2> + {% block content %}{% endblock %} + </div> + <div id="footer" class="inside-main-pane"> + <p> + <a href="">Cherry Flavored Bugs Everywhere</a> + was created by <a href="http://stevelosh.com">Steve Losh</a> and a very nice <a href="http://fecklessmind.com/2009/01/20/aardvark-css-framework/">aardvark</a> + using <a href="http://cherrypy.org">CherryPy</a>, + <a href="http://jinja.pocoo.org/2/">Jinja2</a>, + and <a href="http://jquery.com">jQuery</a>. + </p> + </div> + </div> + <div id="assignees"> + <ul class="filter-items"> + <li><a href="/?assignee=None">Unassigned</a></li> + {% for assignee in assignees %} + <li><a href="/?assignee={{ assignee|e }}">{{ assignee|e }}</a></li> + {% endfor %} + </ul> + </div> + <div id="targets"> + <ul class="filter-items"> + <li><a href="/?target=None">Unscheduled</a></li> + {% for target in targets %} + <li><a href="/?target={{ target }}">{{ target }}</a></li> + {% endfor %} + </ul> + </div> + </body> +</html> diff --git a/interfaces/web/templates/bug.html b/interfaces/web/templates/bug.html new file mode 100644 index 0000000..4d15536 --- /dev/null +++ b/interfaces/web/templates/bug.html @@ -0,0 +1,160 @@ +{% extends "base.html" %} + +{% block page_title %} + Bug {{ bd.bug_shortname(bug) }} – {{ bug.summary|truncate(70) }} +{% 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'); + e.preventDefault(); + }); + + $('#edit-bug-details').click(function(e) { + $('#bug-details').hide(); + $('#bug-details-edit-form').fadeIn('fast'); + e.preventDefault(); + }); + + $('#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 %} + +{% block content %} + <p class="creation-info">Created on {{ bug.time|datetimeformat }} by {{ bug.creator|e }}</p> + + <h3 class="header-with-link">Bug Details</h3> + <span class="header-link"> + <a href="" id="edit-bug-details">edit</a> + </span> + + <p id="bug-details"> + <span class="detail-field-header">Status:</span> + <span class="detail-field-contents">{{ bug.status }}</span><br /> + + <span class="detail-field-header">Severity:</span> + <span class="detail-field-contents">{{ bug.severity }}</span><br /> + + <span class="detail-field-header">Scheduled for:</span> + <span class="detail-field-contents">{{ target }}</span><br /> + + <span class="detail-field-header">Assigned to:</span> + <span class="detail-field-contents">{{ assignee|e }}</span><br /> + + <span class="detail-field-header">Permanent ID:</span> + <span class="detail-field-contents">{{ bug.uuid }}</span><br /> + </p> + + <form id="bug-details-edit-form" class="horizontal" action="/edit" method="post"> + <fieldset> + <input type="hidden" name="id" value="{{ bug.uuid }}" /> + <div class="field"> + <label for="bug-details-edit-status">Status:</label> + <select id="bug-details-edit-status" name="status"> + {% for status in statuses %} + <option value="{{ status }}">{{ status }}</option> + {% endfor %} + </select> + </div> + <div class="field"> + <label for="bug-details-edit-severity">Severity:</label> + <select id="bug-details-edit-severity" name="severity"> + {% for severity in severities %} + <option value="{{ severity }}">{{ severity }}</option> + {% endfor %} + </select> + </div> + <div class="field"> + <label for="bug-details-edit-target">Scheduled for:</label> + <select id="bug-details-edit-target" name="target"> + <option value="None">Unscheduled</option> + {% for target in targets %} + <option value="{{ target|e }}">{{ target }}</option> + {% endfor %} + </select> + </div> + <div class="field"> + <label for="bug-details-edit-assignee">Assigned to:</label> + <select id="bug-details-edit-assignee" name="assignee"> + <option value="None">Unassigned</option> + {% for assignee in assignees %} + <option value="{{ assignee|e }}">{{ assignee|e }}</option> + {% endfor %} + </select> + </div> + <div class="buttons"> + <button type="submit">Save Changes</button> + <button type="reset">Discard Changes</button> + </div> + </fieldset> + </form> + + <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" class="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"> + <h4 class="bug-comment-header">{{ comment.From|striptags|e }} said:</h4> + <p class="bug-comment-body">{{ comment.body|trim|e }}</p> + <p class="bug-comment-footer">on {{ comment.time|datetimeformat }}</p> + </div> + {% endfor %} + <form id="add-comment-form" class="vertical" action="/comment" method="post"> + <fieldset> + <input type="hidden" name="id" value="{{ bug.uuid }}" /> + <div class="field"> + <textarea cols="60" rows="6" id="add-comment-body" name="body"></textarea> + </div> + <div class="buttons"> + <button type="submit">Submit</button> + </div> + </fieldset> + </form> + <p id="add-comment-link"><a href="" id="add-comment">+ Add a comment</a></p> +{% endblock %}
\ No newline at end of file diff --git a/interfaces/web/templates/list.html b/interfaces/web/templates/list.html new file mode 100644 index 0000000..1d409f7 --- /dev/null +++ b/interfaces/web/templates/list.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} + +{% block page_title %} + {{ label }} +{% endblock %} + +{% block content %} + <table id="bug-list"> + <tr> + <th>ID</th> + <th>Summary</th> + <th>Status</th> + <th>Target</th> + <th>Assigned To</th> + </tr> + {% for bug in bugs %} + <tr> + <td>{{ bd.bug_shortname(bug) }}</td> + <td><a href="/bug?id={{ bd.bug_shortname(bug)}}"> + {{ bug.summary|e|truncate(70) }}</a></td> + <td>{{ bug.status }}</td> + <td>{{ bug.target }}</td> + <td>{{ bug.assigned|striptags }}</td> + </tr> + {% endfor %} + </table> +{% endblock %}
\ No newline at end of file |