aboutsummaryrefslogtreecommitdiffstats
path: root/interfaces/web/templates/bug.html
blob: b6986a97f35c1a4ab728c158bfb07b2b9f0a888a (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{% extends "base.html" %}

{% block page_title %}
    Bug {{ bug.id.user() }} – {{ 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.author|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">&#43; Add a comment</a></p>
{% endblock %}