[Slashdotjp-dev 457] CVS update: slashjp/plugins/PollBooth/templates

Back to archive index

Tatsuki SUGIURA sugi****@users*****
2006年 7月 12日 (水) 20:41:53 JST


Index: slashjp/plugins/PollBooth/templates/data;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/data;pollBooth;default:1.3 slashjp/plugins/PollBooth/templates/data;pollBooth;default:1.4
--- slashjp/plugins/PollBooth/templates/data;pollBooth;default:1.3	Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/data;pollBooth;default	Wed Jul 12 20:41:53 2006
@@ -32,17 +32,12 @@
 	Story is already attatched to a different poll.  Please detach poll from that story before saving.
 [% CASE 'invalid' %]
 	[% returnme.data_constant = 1 %]
-	Invalid poll!<BR>
+	Invalid poll!<br>
 
 [% CASE 'display' %]
 	[% returnme.data_constant = 1 %]
 	Displaying poll results.
 
-[% CASE 'anon' %]
-	[% returnme.data_constant = 1 %]
-	You may not vote anonymously.  Please
-	<A HREF="[% constants.real_rootdir %]/users.pl">log in</A>.
-
 [% CASE 'uid_voted' %]
 	[% user.nickname | strip_literal %] at [% env.remote_addr %] has already voted.
 	[% IF env.http_x_forwarded_for %]
@@ -67,9 +62,31 @@
 	[% returnme.data_constant = 1 %]
 	You must provide one or more answers.
 
+[% CASE 'slashbox_head' %]
+	[% returnme.data_constant = 1 %]
+	<div id="slashboxes">
+
+[% CASE 'slashbox_foot' %]
+	[% returnme.data_constant = 1 %]
+	</div>
+
+[%# for ResKeys %]
+[% CASE 'anon' %]
+	[% returnme.data_constant = 1 %]
+	You may not vote anonymously.  Please
+	<a href="[% constants.real_rootdir %]/users.pl">log in</a>.
+
+[% CASE 'no qid' %]
+	[% returnme.data_constant = 1 %]
+	The poll ID is missing.
+
+[% CASE 'already voted' %]
+	[% returnme.data_constant = 1 %]
+	You've already voted.
+
 [% END %]
 
 __seclev__
 10000
 __version__
-$Id: data;pollBooth;default,v 1.3 2004/12/31 12:37:12 oliver Exp $
+$Id: data;pollBooth;default,v 1.4 2006/07/12 11:41:53 sugi Exp $
Index: slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default:1.2 slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default:1.3
--- slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default:1.2	Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default	Wed Jul 12 20:41:53 2006
@@ -17,17 +17,17 @@
 __template__
 [% PROCESS titlebar width='100%' %]
 [% IF warning.no_sid %]
-	<B>No story sid given--could not complete operation.</B>
+	<b>No story sid given--could not complete operation.</b>
 [% ELSIF warning.no_sid_qid_match %]
-	<B>Warning: </B>The poll qid you specified ('[% qid %]') does not appear to be currently attached to the story sid specified ('[% sid %]').  This could mean that the story doesn't have a poll attached to it or is linked to a different poll.  <P>If you're sure you want to detach any polls currently connected to this story click <A HREF="[% gSkin.rootdir %]/pollBooth.pl?sid=[% sid | fixparam %]&amp;qid=[% qid | fixparam %]&amp;op=detach&amp;force=1">continue</A>.
+	<b>Warning: </b>The poll qid you specified ('[% qid %]') does not appear to be currently attached to the story sid specified ('[% sid %]').  This could mean that the story doesn't have a poll attached to it or is linked to a different poll.  <p>If you're sure you want to detach any polls currently connected to this story click <a href="[% gSkin.rootdir %]/pollBooth.pl?sid=[% sid | strip_paramattr %]&amp;qid=[% qid | strip_paramattr %]&amp;op=detach&amp;force=1">continue</a>.
 
 [% ELSE %]
-	Poll detached from story successfully.<BR>
-	You can now <A HREF="[% gSkin.rootdir %]/admin.pl?op=edit&amp;sid=[% sid |fixparam %]">edit</A> or <A HREF="[% gSkin.rootdir %]/article.pl?sid=[% sid |fixparam %]">view</A> the story.<BR><BR>
+	Poll detached from story successfully.<br>
+	You can now <a href="[% gSkin.rootdir %]/admin.pl?op=edit&amp;sid=[% sid | strip_paramattr %]">edit</a> or <a href="[% gSkin.rootdir %]/article.pl?sid=[% sid | strip_paramattr %]">view</a> the story.<br><br>
 	[% IF qid %]
-	You can also continue on <A HREF="[% gSkin.rootdir %]/pollBooth.pl?op=edit&amp;qid=[% qid |fixparam %]">edit</A> or <A HREF="[% gSkin.rootdir %]/pollBooth.pl?qid=[% qid |fixparam %]">view</A> the poll that was attached to this story.<BR>
+	You can also continue on <a href="[% gSkin.rootdir %]/pollBooth.pl?op=edit&amp;qid=[% qid | strip_paramattr %]">edit</a> or <a href="[% gSkin.rootdir %]/pollBooth.pl?qid=[% qid | strip_paramattr %]">view</a> the poll that was attached to this story.<br>
 
 	[% END %]
 [% END %]
 __version__
-$Id: detachpoll;pollBooth;default,v 1.2 2004/12/31 12:37:12 oliver Exp $
+$Id: detachpoll;pollBooth;default,v 1.3 2006/07/12 11:41:53 sugi Exp $
Index: slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default:1.3 slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default:1.4
--- slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default:1.3	Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default	Wed Jul 12 20:41:53 2006
@@ -18,77 +18,86 @@
 __name__
 editpoll
 __template__
-[% PROCESS titlebar width='100%' %]
-[% USE Slash %]
-<TABLE WIDTH="90%" BORDER="0" CELLPADDING="2" CELLSPACING="0"><TR><TD VALIGN="TOP">
-<FORM ACTION="[% env.script_name %]" METHOD="POST">
-	[% IF warning.invalid_sid %]<B>Story ID specified does not exist invalid</B><BR>[% END %]
-	[% IF warning.attached_to_other %]<B>Story is already attached to another poll -- detach poll from that story before attaching this one</B><BR>[% END %]
+[% IF pollbooth %]
+        <div id="slashboxes">
+		[% PROCESS sidebox contents=poll %]
+        </div>
+<div id="polls">
+[% ELSE %]
+<div id="wide">
+[% END %]
+	[% PROCESS titlebar %]
+	<div class="generalbody">
+<form action="[% env.script_name %]" method="post">
+	<legend>Poll Edit Page</legend>
+	<fieldset>
+	[% IF warning.invalid_sid %]<b>Story ID specified does not exist invalid</b><br>[% END %]
+	[% IF warning.attached_to_other %]<b>Story is already attached to another poll -- detach poll from that story before attaching this one</b><br>[% END %]
 	
 	[% PROCESS formLabel value => "The Question" comment => "followed by the total number of voters so far" %]
-	<INPUT TYPE="TEXT" NAME="question" VALUE="[% question.question %]" SIZE="40">
-	<INPUT TYPE="TEXT" NAME="voters" VALUE="[% question.voters %]" SIZE="5"><BR>
+	<input type="text" name="question" value="[% question.question %]" size="40">
+	<input type="text" name="voters" value="[% question.voters %]" size="5"><br>
 	[% PROCESS formLabel value => "Poll Section" comment => "what section this will be visible in" %]
 	[% skins = Slash.db.getDescriptions('skins') %]
 	[% IF story %]
-		[% skins.${question.primaryskid}.title %] *<BR>
-		<INPUT TYPE="hidden" name="primaryskid" value="[% question.primaryskid %]">
+		[% skins.${question.primaryskid}.title %] *<br>
+		<input type="hidden" name="primaryskid" value="[% question.primaryskid %]">
 	[% ELSE %]
-		[% Slash.createSelect('primaryskid', skins, question.primaryskid, 1) %]
+		[% primaryskid_val = question.primaryskid.defined ? question.primaryskid : constants.mainpage_skid %]
+		[% Slash.createSelect('primaryskid', skins, primaryskid_val, 1, 0, 1) %]
 	[% END %]
 	[% PROCESS formLabel value => "Poll Topic" comment => "" %]
 	[% DEFAULT question.topic=constants.discussion_default_topic %]
 	[% IF story %]
-		[% topics.${question.topic} %] *<BR>
-		<INPUT TYPE="hidden" name="topic" value="[% question.topic %]">
+		[% topics.${question.topic} %] *<br>
+		<input type="hidden" name="topic" value="[% question.topic %]">
 	[% ELSE %]
 		[% Slash.createSelect('topic', topics, question.topic, 1, 0 ,1) %]
 	[% END %]
         [% polltype.section = "SlashBox Section Poll"; polltype.story = "Story-Related Poll"; polltype.nodisplay = "Never Display" %]
       	[% PROCESS formLabel value => "Poll Type" comment => "" %]
 	[% IF story %]
-		[% polltype.${question.polltype} %] *<BR>
-		<INPUT TYPE="hidden" name="polltype" value="[% question.polltype %]">
+		[% polltype.${question.polltype} %] *<br>
+		<input type="hidden" name="polltype" value="[% question.polltype %]">
 	[% ELSE %]
 		[% Slash.createSelect('polltype', polltype, question.polltype, 1) %]
 	[% END %]
-<font size="-1"><BR>
-Never Display - Poll won't display to regular users until type is changed<BR>
-SlashBox Section Poll - Poll will show up on the side for a given section<BR>
-Story Related Display - Poll is displayed on the specified story's page<BR>
-</font>
+	<div class="notes">
+		Never Display - Poll won't display to regular users until type is changed<br>
+		SlashBox Section Poll - Poll will show up on the side for a given section<br>
+		Story Related Display - Poll is displayed on the specified story's page<br>
+	</div>
+
 
 	        [% PROCESS formLabel value => "Poll Time" comment => "choose a time in the future if you want to delay this poll's appearance" %]
-        <INPUT TYPE="TEXT" NAME="date" VALUE="[% date %]" size="19" [% IF story %]readonly[% END %]>[% IF story %]*[% END %]<BR>
+        <input type="text" name="date" value="[% date %]" size="19" [% IF story %]readonly[% END %]>[% IF story %]*[% END %]<br>
 	[% PROCESS formLabel value => "The Answers" comment => "voters" %]
 
 [% FOREACH n = [0 .. 7] %]
-	<INPUT TYPE="text" NAME="aid[% n + 1%]" VALUE="[% answers.$n.0 %]" SIZE="40">
-	<INPUT TYPE="text" NAME="votes[% n + 1%]" VALUE="[% answers.$n.1 or 0 %]" SIZE="5"><BR>
+	<input type="text" name="aid[% n + 1%]" value="[% answers.$n.0 %]" size="40">
+	<input type="text" name="votes[% n + 1%]" value="[% answers.$n.1 or 0 %]" size="5"><br>
 [% END %]
 
 
-	<INPUT TYPE="HIDDEN" NAME="qid" VALUE="[% qid %]">
+	<input type="hidden" name="qid" value="[% qid %]">
 
 [% PROCESS formLabel value => "Story ID" comment => "if this matches a story's ID, it will appear on the story's page" %]
-        <INPUT TYPE="TEXT" NAME="sid" VALUE="[% question.sid %]" SIZE="20" >[% IF question.sid %]<A HREF="[% gSkin.rootdir %]/article.pl?sid=[% question.sid %]">Related story</A> [% END %] [% IF question.sid && story && qid %]| <A HREF="[% gSkin.rootdir %]/pollBooth.pl?op=detach&amp;sid=[% question.sid | fixparam %]&amp;qid=[% qid %]">Detach Poll from Story</A>[% END %]<BR>
-	<font size="2">(time, section, topic, and polltype will be set based on related story's settings)</font><BR>
+        <input type="text" name="sid" value="[% question.sid %]" size="20" >[% IF question.sid %]<a href="[% gSkin.rootdir %]/article.pl?sid=[% question.sid %]">Related story</a> [% END %] [% IF question.sid && story && qid %]| <a href="[% gSkin.rootdir %]/pollBooth.pl?op=detach&amp;sid=[% question.sid | strip_paramattr %]&amp;qid=[% qid %]">Detach Poll from Story</a>[% END %]<br>
+	<div class="notes">
+		Time, section, topic, and polltype will be set based on related story's settings<br>
 	[% IF story %]
-		*<font size="2">These values set from related story</font><BR>
+		*These values set from related story<br>
 	[% END %]
+	</div>
 	
 
-        <INPUT TYPE="SUBMIT" NAME="op" VALUE="preview">
-	<INPUT TYPE="SUBMIT" NAME="op" VALUE="save">
-</FORM>
-[% IF pollbooth %]
-	</TD>
-	<TD VALIGN="TOP">
-	[% pollbooth %]
-[% END %]
-</TD></TR></TABLE>
-
+        <input type="submit" name="op" value="preview" class="button">
+	<input type="submit" name="op" value="save" class="button">
+	</fieldset>
+</form>
+	</div>
+</div>
 __seclev__
 10000
 __version__
-$Id: editpoll;pollBooth;default,v 1.3 2004/12/31 12:37:12 oliver Exp $
+$Id: editpoll;pollBooth;default,v 1.4 2006/07/12 11:41:53 sugi Exp $
Index: slashjp/plugins/PollBooth/templates/linkstory;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/linkstory;pollBooth;default:1.2 slashjp/plugins/PollBooth/templates/linkstory;pollBooth;default:1.3
--- slashjp/plugins/PollBooth/templates/linkstory;pollBooth;default:1.2	Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/linkstory;pollBooth;default	Wed Jul 12 20:41:53 2006
@@ -17,29 +17,29 @@
 10000
 __template__
 [% PROCESS titlebar %]
-<P>Click the correct link to choose which poll you would like to attach to the story you've selected.  You
+<p>Click the correct link to choose which poll you would like to attach to the story you've selected.  You
 can also use the form below to select the poll qid you like to attach the story to.
 
-<TABLE width="99%">
+<table width="99%">
 	[% FOREACH question = questions %]
-	<TR>
-		<TD VALIGN="TOP" ALIGN="LEFT">
-				<A HREF="[% gSkin.rootdir %]/pollBooth.pl?qid=[% question.0 %]">[% question.1 %]</A>
-		</TD>
-		<TD>
-			<A HREF="[% gSkin.rootdir %]/pollBooth.pl?qid=[% question.0 %]&amp;op=edit&amp;override_sid=[% sid | fixparam %]">Attach poll to story</A>
-		</TD>
-	</TR>
+	<tr>
+		<td valign="TOP" align="LEFT">
+				<a href="[% gSkin.rootdir %]/pollBooth.pl?qid=[% question.0 %]">[% question.1 %]</a>
+		</td>
+		<td>
+			<a href="[% gSkin.rootdir %]/pollBooth.pl?qid=[% question.0 %]&amp;op=edit&amp;override_sid=[% sid | strip_paramattr %]">Attach poll to story</a>
+		</td>
+	</tr>
 	[% END %]
-	<TR>
-		<TD colspan="2">
-			<FORM method="GET">
-			<INPUT TYPE="hidden" name="override_sid" value="[% sid %]">
-			<INPUT TYPE="hidden" name="op" value="edit">
-			Poll qid to attach story to: <INPUT TYPE="text" name="qid" size="8">
-			<INPUT TYPE="submit" name="attach" value="Attach Story to Poll">
-			</FORM>
-		</TD>
-</TABLE>
+	<tr>
+		<td colspan="2">
+			<form method="get">
+			<input type="hidden" name="override_sid" value="[% sid %]">
+			<input type="hidden" name="op" value="edit">
+			Poll qid to attach story to: <input type="text" name="qid" size="8">
+			<input type="submit" name="attach" value="Attach Story to Poll">
+			</form>
+		</td>
+</table>
 __version__
-$Id: linkstory;pollBooth;default,v 1.2 2004/12/31 12:37:12 oliver Exp $
+$Id: linkstory;pollBooth;default,v 1.3 2006/07/12 11:41:53 sugi Exp $
Index: slashjp/plugins/PollBooth/templates/listpolls;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/listpolls;pollBooth;default:1.3 slashjp/plugins/PollBooth/templates/listpolls;pollBooth;default:1.4
--- slashjp/plugins/PollBooth/templates/listpolls;pollBooth;default:1.3	Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/listpolls;pollBooth;default	Wed Jul 12 20:41:53 2006
@@ -18,50 +18,57 @@
 __name__
 listpolls
 __template__
-[% PROCESS titlebar %]
-
-<TABLE width="99%">
-	<TR>
-		<TD VALIGN="TOP" ALIGN="LEFT">
-			[% FOREACH question = questions %]
-				<A HREF="[% gSkin.rootdir %]/pollBooth.pl?qid=[% question.0 %]">[% question.1 %]</A> on [% Slash.timeCalc(question.2, '%B %o, %Y') %] with [% question.3 %] votes and [% question.4 %] comments.
+<div id="slashboxes">
+[% Slash.sidebox(
+	Slash.db.getBlock('poll', 'title'),
+	Slash.pollbooth('_currentqid', 1, 0),
+	'poll',
+        1);
+%]
+</div>
+<div id="polls">
+	[% PROCESS titlebar %]
+	<div class="generalbody">
+		[% skins = Slash.db.getSkins %]
+		<ul>
+		[% FOREACH question = questions %]
+			<li><b><a href="[% skins.${question.8}.rootdir || gSkin.rootdir %]/pollBooth.pl?qid=[% question.0 %]">[% question.1 %]</a></b> on [% Slash.timeCalc(question.2, '%B %o, %Y') %]<br>
+			<small>[% question.3 %] votes and [% question.4 %] comments.
 				[% IF user.is_admin %]
 					[% SWITCH question.5 %]
-					[% CASE 'story' %]
-					(<I>story</I>)
-					[% CASE 'section' %]
-					(<I>section</I>)
-					[% CASE 'nodisplay' %]
-					(<I>nd</I>)
-				[% END %]
-				[% IF question.6 %](<I>future</I>)[% END %]
-					(<A HREF="[% gSkin.rootdir %]/pollBooth.pl?op=edit&amp;qid=[% question.0 %]">Edit</A>)
-					(<A HREF="[% gSkin.rootdir %]/pollBooth.pl?op=delete&amp;qid=[% question.0 %]">Delete</A>)
-
-				[% END %]
-				<BR>
-				[% IF type == "story" %]
-				&nbsp;&nbsp;&middot;<A HREF="[% gSkin.rootdir %]/article.pl?sid=[% question.9 | fixparam %]">[% question.8 %]</A>
-				<BR>
+						[% CASE 'story' %]
+						(<i>story</i>)
+						[% CASE 'section' %]
+						(<i>section</i>)
+						[% CASE 'nodisplay' %]
+						(<i>nd</i>)
+					[% END %]
+					[% IF question.6 %]
+						(<i>future</i>)
+					[% END %]
+					(<a href="[% gSkin.rootdir %]/pollBooth.pl?op=edit&amp;qid=[% question.0 %]">Edit</a>)
+					(<a href="[% gSkin.rootdir %]/pollBooth.pl?op=delete&amp;qid=[% question.0 %]">Delete</a>)
 				[% END %]
+				</small>
+			</li>
+			[% IF type == "story" %]
+				<li>
+					<a href="[% gSkin.rootdir %]/article.pl?sid=[% question.9 | strip_paramattr %]">[% question.8 %]</a>
+				</li>
 			[% END %]
-		</TD>
-		<TD VALIGN="TOP" ALIGN="RIGHT">
-			[% Slash.fancybox(
-				constants.fancyboxwidth,
-				Slash.db.getBlock('poll', 'title'),
-				Slash.pollbooth('_currentqid', 1),
-				0,
-				1	
-			); %]
-		</TD>
-	</TR>
-</TABLE>
+		[% END %]
+		</ul>
 
-<P><FONT SIZE="4"><B><A HREF="[% gSkin.rootdir %]/search.pl?op=polls">More Polls</A></B></FONT>
-<BR><FONT SIZE="4"><B><A HREF="[% gSkin.rootdir %]/submit.pl">Submit Poll</A></B></FONT>
+		<p>
+			<b>
+				<a href="[% gSkin.rootdir %]/search.pl?op=polls">More Polls</a><br>
+				<a href="[% gSkin.rootdir %]/submit.pl">Submit Poll</a>
+			</b>
+		</p>
+	</div>
+</div>
 
 __seclev__
 10000
 __version__
-$Id: listpolls;pollBooth;default,v 1.3 2004/12/31 12:37:12 oliver Exp $
+$Id: listpolls;pollBooth;default,v 1.4 2006/07/12 11:41:53 sugi Exp $
Index: slashjp/plugins/PollBooth/templates/pollbooth;misc;default
diff -u slashjp/plugins/PollBooth/templates/pollbooth;misc;default:1.3 slashjp/plugins/PollBooth/templates/pollbooth;misc;default:1.4
--- slashjp/plugins/PollBooth/templates/pollbooth;misc;default:1.3	Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/pollbooth;misc;default	Wed Jul 12 20:41:53 2006
@@ -8,8 +8,6 @@
 * qid = question ID
 * has_activated = has this poll become active?
 * poll_open = is this poll still open?
-* has_voted = has this user already voted?
-* can_vote = can this user still vote?
 * voters = number of voters
 * comments = number of comments
 * primaryskid = primaryskid
@@ -26,52 +24,62 @@
 pollbooth
 __template__
 [% IF has_activated or user.is_admin %]
-[% IF user.is_admin %]
-	[% IF !has_activated %]
-	(Poll not yet active)<BR>
-	[% END %]
-[% END %]
-[% IF !can_vote %]
-
-	<B>[% question %]</B>
-
-	[% FOREACH ans = answers %]
-		<BR>&middot; [% ans.answer %] ([% ans.votes %])
-	[% END %]
-
-	<P><EM>[% IF has_voted %](You've already voted.)[% ELSIF !poll_open %](Poll is closed.)[% END %]</EM><BR>
-	[ <A HREF="[% gSkin.rootdir %]/pollBooth.pl?qid=[% qid %]&amp;aid=-1"><B>Results</B></A> |
-	<A HREF="[% gSkin.rootdir %]/pollBooth.pl"><B>Polls</B></A> ] <BR>
-	Comments:<B>[% comments %]</B> | Votes:<B>[% voters %]</B>
-
-[% ELSE %]
-
-	<FORM ACTION="[% gSkin.rootdir %]/pollBooth.pl">
-		[%- IF returnto -%]
-		<INPUT TYPE="HIDDEN" NAME="op" VALUE="vote_return">
-		<INPUT TYPE="HIDDEN" NAME="returnto" VALUE="[% returnto | strip_attribute %]">
-		[%- END -%]
-		<INPUT TYPE="hidden" NAME="qid" VALUE="[% qid | strip_attribute %]">
-		[% IF user.currentSkin %]
-		<INPUT TYPE="hidden" NAME="section" VALUE="[% user.currentSkin | strip_attribute %]">
+	[% IF user.is_admin %]
+		[% IF !has_activated %]
+		(Poll not yet active.)<br>
 		[% END %]
-	<B>[% question %]</B>
-
-	[% FOREACH ans = answers %]
-		<BR><INPUT TYPE="radio" NAME="aid"
-		VALUE="[% ans.aid | strip_attribute %]">[% ans.answer | strip_html %]
 	[% END %]
 
-	<BR><INPUT TYPE="submit" VALUE="Vote">
-	[ <A HREF="[% gSkin.rootdir %]/pollBooth.pl?qid=[% qid %]&amp;aid=-1"><B>Results</B></A> |
-	<A HREF="[% gSkin.rootdir %]/pollBooth.pl"><B>Polls</B></A> ] <BR>
-	Comments:<B>[% comments %]</B> | Votes:<B>[% voters %]</B>
-	</FORM>
+	[% can_vote = poll_open ? 1 : 0 %]
 
-[% END %]
+	[% IF env.script_name && can_vote;
+	      reskey = Slash.getObject('Slash::ResKey');
+	      rkey = reskey.key('pollbooth', { qid => qid });
+	      IF !rkey.create;  # didn't work, bail
+	         can_vote = 0;
+	      END;
+	   ELSE;	
+	      rkey = '';
+	   END;
+	%]
+
+	[% IF !can_vote %]
+		<b>[% question | strip_literal %]</b>
+	   [% FOREACH ans = answers %]
+		<li>[% ans.answer | strip_literal %] <em>([% ans.votes %])</em></li>
+	   [% END %]
+
+		<p><em>[% IF rkey && rkey.errstr %]([% rkey.errstr %])[% ELSIF !poll_open %](Poll is closed.)[% END %]</em><br>
+		[ <a href="[% gSkin.rootdir %]/pollBooth.pl?qid=[% qid %]&amp;aid=-1"><b>Results</b></a> |
+		<a href="[% gSkin.rootdir %]/pollBooth.pl"><b>Polls</b></a> ] <br>
+		Comments:<b>[% comments %]</b> | Votes:<b>[% voters %]</b>
+
+	[% ELSE %]
+	
+		<form action="[% gSkin.rootdir %]/pollBooth.pl" method="post">
+			<fieldset>
+				<legend>Poll</legend>
+				<input type="hidden" name="qid" value="[% qid | strip_attribute %]">
+			[% IF user.currentSkin %]
+				<input type="hidden" name="section" value="[% user.currentSkin | strip_attribute %]">
+			[% END %]
+				<b>[% question | strip_literal %]</b>
+
+			[% FOREACH ans = answers %]
+				<br><input type="radio" name="aid" value="[% ans.aid | strip_attribute %]">[% ans.answer | strip_literal %]
+			[% END %]
+
+				<br><input type="submit" value="Vote">
+				[% IF env.gateway_interface; PROCESS reskey_tag; END %]
+				[ <a href="[% gSkin.rootdir %]/pollBooth.pl?qid=[% qid %]&amp;aid=-1"><b>Results</b></a> |
+				<a href="[% gSkin.rootdir %]/pollBooth.pl"><b>Polls</b></a> ] <br>
+				Comments:<b>[% comments %]</b> | Votes:<b>[% voters %]</b>
+			</fieldset>
+		</form>
+	[% END %]
 [% END %]
 __seclev__
 10000
 __version__
-$Id: pollbooth;misc;default,v 1.3 2004/12/31 12:37:12 oliver Exp $
+$Id: pollbooth;misc;default,v 1.4 2006/07/12 11:41:53 sugi Exp $
 
Index: slashjp/plugins/PollBooth/templates/savepoll;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/savepoll;pollBooth;default:1.1.1.1 slashjp/plugins/PollBooth/templates/savepoll;pollBooth;default:1.2
--- slashjp/plugins/PollBooth/templates/savepoll;pollBooth;default:1.1.1.1	Wed Jan 28 06:55:06 2004
+++ slashjp/plugins/PollBooth/templates/savepoll;pollBooth;default	Wed Jul 12 20:41:53 2006
@@ -17,11 +17,11 @@
 	[% aid = "aid$n" %]
 	[% votes = "votes$n" %]
 	[% IF form.$aid %]
-<BR>Answer [% n %] '[% form.$aid %]' [% form.$votes %]
+<br>Answer [% n %] '[% form.$aid %]' [% form.$votes %]
 	[% END %]
 [% END %]
 
 __seclev__
 10000
 __version__
-$Id: savepoll;pollBooth;default,v 1.1.1.1 2004/01/27 21:55:06 oliver Exp $
+$Id: savepoll;pollBooth;default,v 1.2 2006/07/12 11:41:53 sugi Exp $
Index: slashjp/plugins/PollBooth/templates/vote;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/vote;pollBooth;default:1.2 slashjp/plugins/PollBooth/templates/vote;pollBooth;default:1.3
--- slashjp/plugins/PollBooth/templates/vote;pollBooth;default:1.2	Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/vote;pollBooth;default	Wed Jul 12 20:41:53 2006
@@ -18,55 +18,47 @@
 __name__
 vote
 __template__
-<CENTER><TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0" WIDTH="600">
-	<TR><TD> </TD><TD COLSPAN="1">
-[% PROCESS titlebar %]
-<FONT SIZE="2">[% notes %]</FONT></TD></TR>
-[% FOR poll = pollitems %]
-	[% answer     = poll.0
-		imagewidth = poll.1
-		votes      = poll.2
-		percent    = poll.3
-	%]
-	<TR>
-		<TD WIDTH="150" ALIGN="RIGHT">[% answer %] &nbsp;</TD>
-		<TD WIDTH="450"><NOBR><IMG
-			SRC="[% constants.imagedir %]/leftbar.gif" WIDTH="4" HEIGHT="20" ALT=""><IMG
-			SRC="[% constants.imagedir %]/mainbar.gif" HEIGHT=20
-			width="[% imagewidth %]" ALT="[% percent %]%"><IMG
-			SRC="[% constants.imagedir %]/rightbar.gif" WIDTH="4" HEIGHT="20" ALT="">
-			[% votes %] /
-			<FONT COLOR="#006666">[% percent %]%</FONT></NOBR>
-		</TD>
-	</TR>
-
-[% END %]
-
-	<TR><TD COLSPAN="2" ALIGN="RIGHT">
-		<FONT SIZE="4"><B>[% voters %] total votes.</B></FONT>
-	</TD></TR><TR><TD COLSPAN="2"><P ALIGN="CENTER">
+<div id="wide">
+	[% PROCESS titlebar %]
+	<div class="generalbody">
+		<div class="message">
+			[% notes %]
+		</div>
+		[% FOR poll = pollitems %]
+		[% answer     = poll.0
+			imagewidth = poll.1
+			votes      = poll.2
+			percent    = poll.3
+		%]
+			<table width="100%" border="0" cellpadding="0" cellspacing="0" class="bar">
+				<caption class="barAnswer">[% answer %]</caption>
+			        <tr>
+				[% IF percent > 0 %]
+       	        			<td width="[% percent %]%" class="barColor">&nbsp;</td>
+				[% END %]	
+       	 		       		<td class="barPercent">[% percent %]%</td>
+					<td align="right" class="barVotes">[% votes %] votes</td>
+        			</tr>
+			</table>
+		[% END %]
+		<b class="totalVotes">[% voters %] total votes.</b>
+		<br>
 		[
-			<A HREF="[% env.script_name %]?qid=[% qid | fixparam %]">Voting Booth</A> |
-			<A HREF="[% env.script_name %]">Other Polls</A> |
-			<A HREF="[% gSkin.rootdir %]/">Back Home</A>
+			<a href="[% env.script_name %]?qid=[% qid | strip_paramattr %]">Voting Booth</a> |
+			<a href="[% env.script_name %]">Other Polls</a> |
+			<a href="[% gSkin.rootdir %]/">Back Home</a>
 		]
-	</TD></TR><TR><TD COLSPAN="2">
-<P>
-	<LI>Don't complain about lack of options. You've got to pick a few
-	when you do multiple choice.  Those are the breaks.
-
-	<LI>Feel free to suggest poll ideas if you're feeling creative.
-	I'd strongly suggest reading the past polls first.
-
-	<LI>This whole thing is wildly inaccurate.  Rounding errors,
-	ballot stuffers, dynamic IPs, firewalls.  If you're using these
-	numbers to do anything important, you're insane.
-</P>
-	</TD></TR>
-</TABLE></CENTER>
-
+		<div class="note">
+			<ul>
+				<li>Don't complain about lack of options. You've got to pick a few when you do multiple choice.  Those are the breaks.</li>
+				<li>Feel free to suggest poll ideas if you're feeling creative. I'd strongly suggest reading the past polls first.</li>
+				<li>This whole thing is wildly inaccurate.  Rounding errors, ballot stuffers, dynamic IPs, firewalls.  If you're using these numbers to do anything important, you're insane.</li>
+			</ul>
+		</div>
+	</div>
+</div>
 
 __seclev__
 10000
 __version__
-$Id: vote;pollBooth;default,v 1.2 2004/12/31 12:37:12 oliver Exp $
+$Id: vote;pollBooth;default,v 1.3 2006/07/12 11:41:53 sugi Exp $


Slashdotjp-dev メーリングリストの案内
Back to archive index