Skip to content

Commit

Permalink
Separate the current user from the others when you haven't voted yet x…
Browse files Browse the repository at this point in the history
…wikisas#33

* added a row that will separate the user
  • Loading branch information
oanalavinia committed May 22, 2019
1 parent 523514a commit 1a29933
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<content>contrib.xpoll.app.title=Polls
contrib.xpoll.finish.message=Vote is finished. Here are the results:
contrib.xpoll.home.title=Polls
contrib.xpoll.notVoted=You haven't voted yet
contrib.xpoll.numberVotes=Number of votes
contrib.xpoll.preparation.hasRight=This xpoll is currently in preparation, click "edit" to modify it and activate it.
contrib.xpoll.preparation.noRight=This xpoll is currently in preparation, you do not have the rights to modify it.
Expand Down
34 changes: 23 additions & 11 deletions application-xpoll-ui/src/main/resources/XPoll/XPollSheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,33 @@
#end ##
&lt;/tr&gt;
#end

## third table row
&lt;tr&gt;
&lt;td&gt;
$services.localization.render('contrib.xpoll.numberVotes')
&lt;/td&gt;
#foreach ($proposal in $proposals) &lt;td&gt; $!voteCount.get($proposal) &lt;/td&gt; #end
&lt;/tr&gt;

## Separate the current user if he hasn't voted yet.
#if (!$foundUser &amp;&amp; $xcontext.user != 'XWiki.XWikiGuest')
&lt;tr&gt;
&lt;td class="noBorder"&gt;$services.localization.render('contrib.xpoll.notVoted')&lt;/td&gt;
#foreach ($proposal in $proposals) &lt;td class="noBorder"&gt;&lt;/td&gt; #end
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
#displayUser($xwiki.getDocument($xcontext.user))
&lt;/td&gt;
#foreach ($proposal in $proposals)
#set ($checked = false) ##
#set ($checked = false)
&lt;td&gt;
&lt;input type="checkbox" name="${proposal.hashCode()}" #if($checked)CHECKED#end /&gt;
&lt;/td&gt;
#end ##
#end
&lt;/tr&gt;
#end

## third table row
&lt;tr&gt;
&lt;td&gt;
$services.localization.render('contrib.xpoll.numberVotes')
&lt;/td&gt;
#foreach ($proposal in $proposals) &lt;td&gt; $!voteCount.get($proposal) &lt;/td&gt; #end
&lt;/tr&gt;
&lt;/table&gt;

#if ($xcontext.user != 'XWiki.XWikiGuest')
Expand Down Expand Up @@ -398,7 +404,13 @@
.info
{
float: left;
}</code>
}

#xpollSaveForm .noBorder {
border-right: solid 1px #FFF;
border-left: solid 1px #FFF;
padding-top: 30px;
}</code>
</property>
<property>
<contentType>CSS</contentType>
Expand Down

0 comments on commit 1a29933

Please sign in to comment.