Commit fed21919 authored by Stefan Busemann's avatar Stefan Busemann

Merge branch '24-randomize-order-of-nominess' into 'master'

Resolve "Randomize Order of nominess"

Closes #24

See merge request t3o/election!13
parents f6ce097e 61e861c1
......@@ -473,7 +473,7 @@
<source>Nominees</source>
</trans-unit>
<trans-unit id="view.fe.election.vote.votes">
<source>You can vote for up to %d nominees in this election. You can only vote once, remaining votes will be discarded. You can abstain, by selecting no nominee.</source>
<source>You can vote for up to %d nominees in this election. You can only vote once, remaining votes will be discarded. You can abstain, by selecting no nominee. The nominees are shown in a randomized order.</source>
</trans-unit>
<trans-unit id="view.fe.election.vote.vote">
<source>Vote</source>
......
......@@ -20,7 +20,7 @@
</th>
</tr>
</thead>
<tbody>
<tbody class="shuffle-rows">
<f:for each="{nominees}" as="nominee">
<tr {f:if(condition:'{nominee.public}',else:'style="background-color:#ddd;"')}>
<td>
......
......@@ -14,7 +14,7 @@
</th>
</tr>
</thead>
<tbody>
<tbody class="shuffle-rows">
<f:for each="{nominees}" as="nominee">
<f:if condition="{nominee.public}">
<tr>
......
......@@ -28,7 +28,7 @@
</th>
</tr>
</thead>
<tbody>
<tbody class="shuffle-rows">
<f:for each="{election.nominees}" as="nominee">
<tr>
<td>
......
.shuffle-rows {
display: none;
}
\ No newline at end of file
$(function () {
$(document).ready(function () {
$('.shuffle-rows').each(function(){
var parent = $(this);
var elements = parent.children();
while (elements.length) {
parent.append(elements.splice(Math.floor(Math.random() * elements.length), 1)[0]);
}
}).show();
});
});
\ No newline at end of file
......@@ -231,3 +231,11 @@ plugin {
}
}
}
page {
includeCSS {
election = EXT:election/Resources/Public/Css/election.css
}
includeJSFooter {
election = EXT:election/Resources/Public/JavaScript/election.js
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment