aboutsummaryrefslogtreecommitdiffstats
path: root/templates/bug.html
blob: 01a2476af4decf3b7b06d775315449ad15586938 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{% extends "base.html" %}

{% block page_title %}
    Bug {{ bd.bug_shortname(bug) }} – {{ bug.summary }}
{% endblock %}

{% block script %}
    <script type="text/javascript">
        $(function() {
            $('#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-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');
        });
    </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">{{ bug.target }}</span><br />
        
        <span class="detail-field-header">Assigned to:</span>
        <span class="detail-field-contents">{{ bug.assigned|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 }}">{{ 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 }}">{{ assignee }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="buttons">
                <button type="submit">Save Changes</button>
                <button type="reset">Discard Changes</button>
            </div>
        </fieldset>
    </form>
    
    <h3>Summary</h3>
    <p>
        {{ bug.summary }}
    </p>
    
    <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">
                <label for="add-comment-body">Comment</label>
                <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">&#43; Add a comment</a></p>
{% endblock %}