|
|
Choosing A Webhost: |
[mb-commits] r7679 - mb_server/trunk/htdocs/mod: msg#00285audio.musicbrainz.cvs
Author: keschte Date: 2006-05-26 17:58:19 +0000 (Fri, 26 May 2006) New Revision: 7679 Modified: mb_server/trunk/htdocs/mod/voting-buttons.inc Log: scriptlets again. Modified: mb_server/trunk/htdocs/mod/voting-buttons.inc =================================================================== --- mb_server/trunk/htdocs/mod/voting-buttons.inc 2006-05-26 17:57:39 UTC (rev 7678) +++ mb_server/trunk/htdocs/mod/voting-buttons.inc 2006-05-26 17:58:19 UTC (rev 7679) @@ -28,10 +28,12 @@ # </%perl> <%args> + $mod $vote => undef $inline => 0 $labelnextline => 1 + </%args> <%perl> @@ -43,51 +45,60 @@ # Allow $vote to specify the default vote, either as a word # ("yes") or a constant (VOTE_YES). my %v = ( - yes => &ModDefs::VOTE_YES, - no => &ModDefs::VOTE_NO, - 'abs' => &ModDefs::VOTE_ABS, + 'yes' => &ModDefs::VOTE_YES, + 'no' => &ModDefs::VOTE_NO, + 'abs' => &ModDefs::VOTE_ABS, ); %v = (%v, reverse %v); - $default = $v{$vote} if defined $v{$vote}; + $default = $v{$vote} if (defined $v{$vote}); } - my $modid = $mod->GetId; + my $editid = $mod->GetId; - if (!$inline) - { - my $n = ($show_novote ? 4 : 3); - $m->out(qq!<table class="votechoice votechoice$n"><tr>!); - } +</%perl> - for ("Yes=yes", "No=no", "Abs=abs", "No Vote=novote") - { - my ($display, $key) = split /=/; - next if ($key eq "novote" and not $show_novote); +% if (!$inline) +% { +% my $n = ($show_novote ? 4 : 3); - if (!$inline) - { - my $checked = (($key eq $default) ? 'checked="checked"' : ""); + <table class="votechoice votechoice<% $n %>"> + <tr> - $m->out(qq!<td>!); - $m->out(qq!<label for="rowid$modid-$key">!); - $m->out(qq!<input type="radio" name="rowid$modid" id="rowid$modid-$key" value="$key" $checked ondblclick="this.form.submit()" />!); +% } - # add a <br/> if the label should be on the next line, else nothing. - $m->out(qq!<br />!) if ($labelnextline); +% for ("Yes=yes", "No=no", "Abs=abs", "No Vote=novote") +% { +% my ($display, $key) = split /=/; +% next if ($key eq "novote" and not $show_novote); - $m->out(qq!$display</label></td>!); - } - else - { - $m->out(qq!<input type="submit" name="rowid$modid" value="$key" /> !); - } - } +% if (!$inline) +% { +% my $checked = (($key eq $default) ? 'checked="checked"' : ""); - if (!$inline) - { - $m->out(qq!</tr></table>!); - } +% # add a <br/> if the radio button text should be on +% # the next line, else nothing. +% my $lbr = ($labelnextline ? qq!<br />! : ""); +% my $ondblclick = (!$labelnextline ? qq!ondblclick="this.form.submit()"! : ""); -</%perl> + <td> + <label for="rowid<% $editid %>-<% $key %>"> + <input type="radio" name="rowid<% $editid %>" + id="rowid<% $editid %>-<% $key %>" value="<% $key %>" + <% $checked |n %> <% $ondblclick |n %> + /><% $lbr |n %><% $display |n %></label></td> +% } +% else +% { + <input type="submit" name="rowid<% $editid %>" value="<% $key %>" /> +% } +% } + +% if (!$inline) +% { + </tr> + </table> +% } + +%# vi: set ts=4 sw=4 ft=mason :
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [mb-commits] r7678 - mb_server/trunk/htdocs/show/user, root |
|---|---|
| Next by Date: | [mb-commits] r7680 - mb_server/trunk/cgi-bin, root |
| Previous by Thread: | [mb-commits] r7678 - mb_server/trunk/htdocs/show/user, root |
| Next by Thread: | [mb-commits] r7680 - mb_server/trunk/cgi-bin, root |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |