Skip to content

Commit

Permalink
#11, some content to separated files
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiandouce committed Dec 31, 2012
1 parent 731415c commit bd52f77
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 52 deletions.
21 changes: 21 additions & 0 deletions views/issue-final-results.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.span9.box.block-results
h3.block-title
i.icon
span Resultados final
- var totalVoters = element.vote.voters.length;
.box-content.clearfix
h4
span.number= element.vote.voters.length
| votos contados

- element.vote.choices.forEach(function(choice) {
.partial(style="width:100%;float:left;")
- var partial = choice.result / (totalVoters || 1) * 100;
h5
strong #{choice.idea.title}
a(data-toggle="modal", role="button", href="#choice-full-#{choice.id}")
| Leer...
.bar(style="width:#{partial.toFixed(0)}%;")
span.tt(rel="tooltip", data-placement="top", title="#{choice.result} votos")
| #{partial.toFixed(0)} %
- });
31 changes: 31 additions & 0 deletions views/issue-preliminar-results.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.span9.box.block-results
h3.block-title
i.icon
span Resultados preliminares

.box-content.clearfix
h4
| Hay
span.number= element.vote.voters.length
| votos contados
- element.vote.voters.forEach(function(voter) {
a(href="/profiles/#{voter.id}", rel="tooltip", title="#{voter.fullName}", data-placement="bottom", class="tt")
img(src="#{voter.imageUrlMini}")
- });

h4
span.number= element.vote.voters.length
| votos por delegados
- element.vote.voters.forEach(function(voter) {
a(href="/profiles/#{voter.id}", rel="tooltip", title="#{voter.fullName}", data-placement="bottom", class="tt")
img(src="#{voter.imageUrlMini}")
- })

h4
| y
span.number= element.vote.voters.length
| votos unipersonales
- element.vote.voters.forEach(function(voter) {
a(href="/profiles/#{voter.id}", rel="tooltip", title="#{voter.fullName}", data-placement="bottom", class="tt")
img(src="#{voter.imageUrlMini}")
- })
54 changes: 2 additions & 52 deletions views/issue.jade
Original file line number Diff line number Diff line change
Expand Up @@ -78,62 +78,12 @@ block content

//- Preliminar results
- if( voted && (Date.now() < element.votingEndDate) ) {
.span9.box.block-results
h3.block-title
i.icon
span Resultados preliminares

.box-content.clearfix
h4
| Hay
span.number= element.vote.voters.length
| votos contados
- element.vote.voters.forEach(function(voter) {
a(href="/profiles/#{voter.id}", rel="tooltip", title="#{voter.fullName}", data-placement="bottom", class="tt")
img(src="#{voter.imageUrlMini}")
- });

h4
span.number= element.vote.voters.length
| votos por delegados
- element.vote.voters.forEach(function(voter) {
a(href="/profiles/#{voter.id}", rel="tooltip", title="#{voter.fullName}", data-placement="bottom", class="tt")
img(src="#{voter.imageUrlMini}")
- })

h4
| y
span.number= element.vote.voters.length
| votos unipersonales
- element.vote.voters.forEach(function(voter) {
a(href="/profiles/#{voter.id}", rel="tooltip", title="#{voter.fullName}", data-placement="bottom", class="tt")
img(src="#{voter.imageUrlMini}")
- })
include issue-preliminar-results
- }

//- Final results
- if(Date.now() > element.votingEndDate) {
.span9.box.block-results
h3.block-title
i.icon
span Resultados final
- var totalVoters = element.vote.voters.length;
.box-content.clearfix
h4
span.number= element.vote.voters.length
| votos contados

- element.vote.choices.forEach(function(choice) {
.partial(style="width:100%;float:left;")
- var partial = choice.result / (totalVoters || 1) * 100;
h5
strong #{choice.idea.title}
a(data-toggle="modal", role="button", href="#choice-full-#{choice.id}")
| Leer...
.bar(style="width:#{partial.toFixed(0)}%;")
span.tt(rel="tooltip", data-placement="top", title="#{choice.result} votos")
| #{partial.toFixed(0)} %
- });
include issue-final-results
- };

.modals
Expand Down

0 comments on commit bd52f77

Please sign in to comment.