Subversion Repositories DevTools

Rev

Rev 1295 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1293 dpurdie 1
[%# Display a list of comments #%]
2
 
3
[% USE AutomagicLinks %]
4
[% USE FormatWhitespace tabwidth = tabwidth %]
5
 
6
[% PROCESS viewtopicheader.html.tmpl version = version
7
   help = "x602.html" topicview = 0 topicproperties = 0 topiccomments = 1
8
   topicinfo = 0 closehead = 1 %]
9
 
10
<SCRIPT type="text/javascript">
11
<!-- This function handles the three filter select boxes at the top of the table.
12
function SelectFilter(post)
13
{
14
    var url = '';
15
 
16
    var userSelectionIndex = document.form.filter_comments_author.options.selectedIndex;    
17
    if (userSelectionIndex > 0)
18
    {
19
	var userSelection = document.form.filter_comments_author.options[userSelectionIndex].value;
20
    	url = url + '&sauthor=' + userSelection;
21
    }
22
 
23
    var contextIndex = document.form.show_context_in_comments.options.selectedIndex;
24
    var contextSelection = document.form.show_context_in_comments.options[contextIndex].value;
25
 
26
    url = url + '&scontext=' + contextSelection;
27
 
28
    // Try to piece together the current values of the metric dropdown boxes.
29
    var metricIndex;
30
    var metricSelection;
31
    [% FOREACH metric = metrics %]
32
 
33
      metricIndex = document.form.comment_state_metric_[% metric.name %].options.selectedIndex;
34
      metricSelection = document.form.comment_state_metric_[% metric.name %].options[metricIndex].value;
35
      url = url + '&comment_state_metric_[% metric.name %]=' + metricSelection;
36
 
37
    [% END %]
38
 
39
    // The filtering url parameters have been build, now a "get" back to the web server
40
    // with the updated filter paramters, the ListComments.pm script will refilter then.
41
    if (post == 0)
42
    {
43
    	window.location='[% view_comments_url %]' + url;
44
    }
45
    return true;
46
}
47
 
48
// -->
49
</SCRIPT>
50
 
51
<FORM METHOD="post" ENCTYPE="multipart/form-data" name="form">
52
<INPUT TYPE="hidden" NAME="action" VALUE="change_comments_state" />
53
<INPUT TYPE="hidden" NAME="topic" VALUE="[% topic %]" />
54
 
55
<INPUT TYPE="hidden" NAME="scontext" VALUE="[% scontext %]" />
56
<INPUT TYPE="hidden" NAME="sauthor" VALUE="[% sauthor %]" />
57
<INPUT TYPE="hidden" NAME="sstate" VALUE="[% sstate %]" />
58
 
59
 
60
<P><FONT size="5">Comments: &nbsp; &nbsp;</FONT>
61
 
62
<BR/>
63
<TABLE>
64
<TR>
65
  <TD ALIGN="right">Show authored by: &nbsp;</TD>
66
  <TD ALIGN="left">
67
  <SELECT name="filter_comments_author" onChange="SelectFilter(0)">
68
     <OPTION value="1"> Everybody </OPTION>
69
     [% FOREACH user = users %]
70
     <OPTION value="[% user %]" [% IF sauthor == user %] SELECTED [% END %] >[% user %]</OPTION>
71
     [% END %]
72
  </SELECT>
73
 
74
with
75
  <SELECT name="show_context_in_comments" onChange="SelectFilter(0)">
76
     <OPTION value="0" [% IF scontext == 0 %] SELECTED [% END %]>no context</OPTION>
77
     <OPTION value="3" [% IF scontext == 3 %] SELECTED [% END %]>with context 3 lines</OPTION>
78
     <OPTION value="6" [% IF scontext == 6 %] SELECTED [% END %]>with context 6 lines</OPTION>
79
  </SELECT>
80
  </TD>
81
</TR>
82
 
83
[% IF metrics != '' %]
84
[% FOREACH metric = metrics %]
85
  [% IF loop.index() % 4 == 0 %]<TR><TD>&nbsp;</TD><TD ALIGN="left">[% END %]
86
  [% metric.name %]:
87
  <SELECT NAME="comment_state_metric_[% metric.name %]" onChange="SelectFilter(0)">
88
    <OPTION VALUE="__any__">Any</OPTION>
89
    [% SET selected_value = metrics_selection.${metric.name} %]
90
    [% FOREACH value = metric.values %]
91
      [% IF selected_value != '' && selected_value == value %]
92
        <OPTION SELECTED VALUE="[% value %]">[% value %]</OPTION>
93
      [% ELSE %]
94
        <OPTION VALUE="[% value %]">[% value %]</OPTION>
95
      [% END %]
96
    [% END %]
97
  </SELECT>
98
  &nbsp;&nbsp;&nbsp;&nbsp;
99
  [% IF loop.index() % 4 == 3 || loop.last() %]</TD></TR>[% END %]
100
[% END %]
101
[% END %]
102
</TABLE>
103
 
104
<P>
105
<TABLE CELLPADDING="1" CELLSPACING="3" BORDER="0" WIDTH="100%">
106
 
107
[% last_fileline = -999 %]
108
[% last_filenumber = -999 %]
109
[% FOREACH comment = comments %]
110
[% FLUSH IF loop.count() % 10 == 1 %]
111
 
112
    [% IF comment.fileline != last_fileline ||
113
          comment.filenumber != last_filenumber %]
114
    <TR CLASS="comments">
115
        [%# Display the comment thread information #%]
116
	<TD>
117
	    [% IF comment.filename != '' %]
118
	       <A HREF="[% comment.view_file %]">[% comment.filename %][% IF comment.fileline != -1 %]:[% comment.fileline %]</A>[% ELSE %]</A> (File Level)[% END %]
119
	       [% IF allow_repositories != 0 %] | <A HREF="[% comment.view_parallel %]">Parallel</A> [% END %]
120
	    [% ELSIF comment.fileline == -1 && comment.filenumber == -1 %]
121
	       Topic Level
122
	    [% ELSE %]
123
	       Line: [% comment.line %]
124
	    [% END %]
125
 
126
	    [%# Check to see if the topic is open or not #%]
127
            [% IF topic_readonly == 0 %]
128
	    | <A NAME="[% comment.anchor %]" HREF="[% comment.edit_url %]">Add comment</A>
129
	    [% END %]
130
	</TD>
131
    </TR>
132
 
133
    [%# Now display the metric dropdowns #%]
134
    [% IF metrics != '' %]
135
    [% FOREACH metric = metrics %]
136
        [% IF loop.index() % 4 == 0 %]<TR><TD>[% END %]
137
        [% SET metric_name = metric.name %]
138
	[% metric_name %]:
139
   	<SELECT NAME="comment_state_metric|[% metric_name %]|[%comment.filenumber %]|[% comment.fileline %]|[% comment.filenew %]|[% comment.version %]"
140
 
141
	[%# Check to see if the topic is readonly or not #%]
142
        [% IF topic_readonly != 0 %]
143
		disabled
144
	[% END %]
145
	>
146
 
147
 	[% SET comment_metric_value = comment.metrics.$metric_name %]
148
        [% SET found_current_value = 0 %]
149
	[% FOREACH value = metric.values %]
150
	    [% IF value == comment_metric_value %]
151
	        <OPTION SELECTED VALUE="[% value %]">[% value %]</OPTION>
152
		[% SET found_current_value = 1 %]
153
	    [% ELSE %]
154
	        <OPTION VALUE="[% value %]">[% value %]</OPTION>
155
	    [% END %]
156
	[% END %]
157
 
158
	[% IF found_current_value == 0 %]
159
	    <OPTION SELECTED VALUE="[% comment_metric_value %]">[% comment_metric_value %]</OPTION>
160
	[% END %]
161
	</SELECT>
162
	&nbsp;&nbsp;&nbsp;&nbsp;
163
        [% IF loop.index() % 4 == 3 || loop.last() %]</TD></TR>[% END %]
164
    [% END %]
165
    [% END %]
166
 
167
    [% IF comment.context != '' %]
168
    <TR CLASS="commentc">
169
        <TD><PRE>[% comment.context %]</PRE></TD>
170
    </TR>
171
    [% END %]
172
    [% last_fileline = comment.fileline %]
173
    [% last_filenumber = comment.filenumber %]
174
 
175
    [% END %]
176
 
177
    <TR CLASS="commenth">
178
        <TD>[% comment.author | html_entity %]&nbsp;[% comment.date | html_entity %]</TD>
179
    </TR>
180
    <TR CLASS="commentb">
181
        <TD>[% comment.data | html_entity | $FormatWhitespace | $AutomagicLinks %]</TD>
182
    </TR>
183
    <TR><TD><HR></TD></TR>
184
[% END %]
185
 
186
</TABLE>
187
 
188
[%# Check to see if the topic is open or not #%]
189
[% IF topic_readonly == 0 %]
190
<P>
191
<INPUT TYPE="submit" NAME="button" VALUE="Update" />
192
[% END %]
193
 
194
</FORM>
195
 
196
[% PROCESS trailer.html.tmpl %]
197
 
198
</body>
199
</html>
200