Skip to content

Commit cc4a61f

Browse files
author
Visnu Pitiyanuvath
committed
show that we're collecting ip address
correct tab order in voting box
1 parent bfc6f7d commit cc4a61f

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

nodeko.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ get '/teams/:id', ->
179179

180180
if @currentPerson
181181
Vote.firstByTeamAndPerson team, @currentPerson, (error, vote) =>
182-
@vote = vote or new Vote()
182+
@vote = vote or new Vote(null, @req)
183183
@vote.person = @currentPerson
184184
@vote.email = @vote.person.email
185185
renderVotes()
186186
else
187-
@vote = new Vote()
187+
@vote = new Vote(null, @req)
188188
renderVotes()
189189
else
190190
# TODO make this a 404

public/stylesheets/application.css

+8-4
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,12 @@ aside#pullout {
424424
padding: 2px;
425425
-webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
426426
-moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1); }
427-
.body.teams-show .votes li .voter time, .body.teams-show #your_vote .voter time {
427+
.body.teams-show .votes li .voter .details, .body.teams-show #your_vote .voter .details {
428428
font-size: small;
429429
font-style: italic;
430-
color: rgba(0, 0, 0, 0.4);
430+
line-height: 125%;
431+
color: rgba(0, 0, 0, 0.4); }
432+
.body.teams-show .votes li .voter time, .body.teams-show #your_vote .voter time {
431433
display: block; }
432434
.body.teams-show .votes li .vote, .body.teams-show #your_vote .vote {
433435
margin-left: 180px; }
@@ -513,18 +515,20 @@ aside#pullout {
513515
margin: 0.5ex 0px; }
514516
#your_vote .dimensions {
515517
margin-bottom: 0.5ex; }
518+
#your_vote .email_input, #your_vote .email_hidden {
519+
float: left; }
516520
#your_vote .email_input {
517521
margin-bottom: 0.5ex; }
518522
#your_vote .email_input .note {
519523
font-size: small; }
520-
#your_vote input.button {
521-
float: right; }
522524
#your_vote .email_hidden {
523525
font-size: small;
524526
margin: 0.5em 0em; }
525527
#your_vote textarea {
526528
font-size: medium;
527529
width: 97%; }
530+
#your_vote input.button {
531+
float: right; }
528532

529533
.clear {
530534
clear: both; }

public/stylesheets/application.sass

+7-3
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,12 @@ aside#pullout
415415
:margin-right 5px
416416
:padding 2px
417417
+shadow
418-
time
418+
.details
419419
:font-size small
420420
:font-style italic
421+
:line-height 125%
421422
:color hsla(0, 0%, 0%, 0.4)
423+
time
422424
:display block
423425
.vote
424426
:margin-left 180px
@@ -506,17 +508,19 @@ aside#pullout
506508
:margin 0.5ex 0px
507509
.dimensions
508510
:margin-bottom 0.5ex
511+
.email_input, .email_hidden
512+
:float left
509513
.email_input
510514
:margin-bottom 0.5ex
511515
.note
512516
:font-size small
513-
input.button
514-
:float right
515517
.email_hidden
516518
:font-size small
517519
:margin 0.5em 0em
518520
textarea
519521
:font-size medium
520522
:width 97%
523+
input.button
524+
:float right
521525
.clear
522526
:clear both

views/partials/votes/voter.html.haml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
!= gravatar(vote.person, 50)
2-
= vote.person.displayName()
3-
%time{ datetime: vote.createdAt.toISOString() }
1+
- if (vote.person)
2+
!= gravatar(vote.person, 50)
3+
= vote.person.displayName()
4+
.details
5+
%time{ datetime: vote.createdAt.toISOString() }
6+
= vote.remoteAddress

views/teams/show.html.haml

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,10 @@
7272
%form#your_vote{ method: 'POST', action: '/teams/' + ctx.team.toParam() + '/votes' }
7373
.voter
7474
%h3 Your Vote
75-
- if(ctx.vote.person)
76-
!= partial('votes/voter.html.haml', { locals: { vote: ctx.vote }})
75+
!= partial('votes/voter.html.haml', { locals: { vote: ctx.vote }})
7776
.vote
7877
!= partial('votes/stars.html.haml', { locals: { vote: ctx.vote }})
7978
%textarea{ name: 'comment', id: 'comment', placeholder: '2-3 sentence review. Optional.', rows: 4 }= ctx.vote.comment || ''
80-
%input.button{ type: 'submit', value: 'Vote!' }
8179
- if (!ctx.currentPerson)
8280
.email_input
8381
%input.email{ type: 'text', name: 'email', id: 'email', value: ctx.vote.email || '', placeholder: '[email protected]' }
@@ -90,6 +88,7 @@
9088
= ' ' + ctx.vote.email + ' '
9189
—
9290
%a{ href: '/logout?return_to=' + escapeURL('/teams/' + ctx.team.toParam() + '#draft') } Change
91+
%input.button{ type: 'submit', value: 'Vote!' }
9392
.clear
9493

9594
%ul.votes

0 commit comments

Comments
 (0)