Skip to content

Commit

Permalink
Vote graph fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tashian committed Jun 12, 2011
1 parent 64ececd commit 19af91e
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 80 deletions.
2 changes: 1 addition & 1 deletion app/helpers/votes_helper.rb
Expand Up @@ -14,7 +14,7 @@ module VotesHelper

def vote_chart_image_tag(vote)

height, width = 100, 602
height, width = 100, 535
bar_height = 20

vote_types = ['yes', 'no', 'other']
Expand Down
4 changes: 2 additions & 2 deletions app/stylesheets/layout.scss
Expand Up @@ -45,7 +45,7 @@ padding-left: 1.5em;
}

ol li{
list-style-type: decimal !important;
list-style-type: decimal;
color: #36676f;
font-weight: bold;
font-style: italic;
Expand Down Expand Up @@ -79,7 +79,7 @@ th{

td{
min-width: 100px;
padding: 6px 20px 6px 0 !important;
padding: 6px 20px 6px 0;
vertical-align: top;
}

Expand Down
66 changes: 30 additions & 36 deletions app/stylesheets/vote.scss
Expand Up @@ -265,48 +265,42 @@ margin-top: 10px;


/* Big vote chart -- votes/show */
.vote_chart table {
width: 400px !important;
}

.vote_chart table td {
min-width: 25px;
}
.vote_chart {
table {
width: 686px;
}

.vote_chart table td.vote_chart {
width: 300px ; /* See votes_helper full-size chart width */
}
table td {
min-width: 20px;
}

.vote_chart table caption {
background: transparent;
font-size: 10px;
}
table td.vote_chart {
width: 300px ; /* See votes_helper full-size chart width */
}

.vote_chart table td,
.vote_chart table th {
height: 24px;
vertical-align: middle;
text-align: right;
line-height: 24px;
padding: 0;
border: 0;
}
table caption {
background: transparent;
font-size: 10px;
}

.vote_chart table td.first,
.vote_chart table th.first
{
padding-top: 26px !important;
}
.label {
vertical-align: middle;
text-align: right;
padding: 0;
border: 0;
padding: 4px 2px 2px 0;
font-size: 16px;
font-weight: bold;
line-height: 1.3em;
}

.vote_chart table td.last,
.vote_chart table th.last {
padding-bottom: 9px !important;
}
.first .label {
padding-top: 32px;
}

.vote_chart table .label {
padding-right: 2px;
font-size: 16px;
font-weight: bold;
.last .label {
padding-bottom: 9px;
}
}

.vote-type{
Expand Down
16 changes: 8 additions & 8 deletions app/views/votes/show.html.haml
Expand Up @@ -28,19 +28,19 @@
%h2
= t '.vote_breakdown'
%table
%tr
%th.first.label(scope='row')= t '.yeslabel'
%td.first.label!= @vote.passed? ? '√' : ''
%td.first.label= @vote.yes_count
%tr.first
%th.label(scope='row')= t '.yeslabel'
%td.label!= @vote.passed? ? '√' : ''
%td.label= @vote.yes_count
%td(rowspan=3 class="vote_chart")= vote_chart_image_tag(@vote)
%tr
%th.label(scope='row')= t '.nolabel'
%td.label!= @vote.passed? ? '' : '√'
%td.label= @vote.no_count
%tr
%th.last.label(scope='row')= t '.otherlabel'
%td.last.label
%td.last.label #{@vote.other_count}
%tr.last
%th.label(scope='row')= t '.otherlabel'
%td.label
%td.label #{@vote.other_count}
%caption(align='bottom')
= t '.not_always_accurate'
= link_to(t('.why'), '#', :id => "votes_needed_why", :'data-dialog' => '#votes_needed_dialog')
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Expand Up @@ -53,7 +53,7 @@ en:
track: Track
and_share: and Share
states:
blue_party_label: Democratic
blue_party_label: Democrat
red_party_label: Republican
grey_party_label: Other
show:
Expand Down
4 changes: 2 additions & 2 deletions public/stylesheets/layout.css
Expand Up @@ -43,7 +43,7 @@ ol {

/* line 47, ../../app/stylesheets/layout.scss */
ol li {
list-style-type: decimal !important;
list-style-type: decimal;
color: #36676f;
font-weight: bold;
font-style: italic;
Expand Down Expand Up @@ -78,7 +78,7 @@ th {
/* line 80, ../../app/stylesheets/layout.scss */
td {
min-width: 100px;
padding: 6px 20px 6px 0 !important;
padding: 6px 20px 6px 0;
vertical-align: top;
}

Expand Down
46 changes: 16 additions & 30 deletions public/stylesheets/vote.css
Expand Up @@ -288,59 +288,45 @@ td.vote-failed .vote-no {
}

/* Big vote chart -- votes/show */
/* line 268, ../../app/stylesheets/vote.scss */
/* line 269, ../../app/stylesheets/vote.scss */
.vote_chart table {
width: 400px !important;
width: 686px;
}

/* line 272, ../../app/stylesheets/vote.scss */
/* line 273, ../../app/stylesheets/vote.scss */
.vote_chart table td {
min-width: 25px;
min-width: 20px;
}

/* line 276, ../../app/stylesheets/vote.scss */
/* line 277, ../../app/stylesheets/vote.scss */
.vote_chart table td.vote_chart {
width: 300px;
/* See votes_helper full-size chart width */
}

/* line 280, ../../app/stylesheets/vote.scss */
/* line 281, ../../app/stylesheets/vote.scss */
.vote_chart table caption {
background: transparent;
font-size: 10px;
}

/* line 286, ../../app/stylesheets/vote.scss */
.vote_chart table td,
.vote_chart table th {
height: 24px;
.vote_chart .label {
vertical-align: middle;
text-align: right;
line-height: 24px;
padding: 0;
border: 0;
padding: 4px 2px 2px 0;
font-size: 16px;
font-weight: bold;
line-height: 1.3em;
}

/* line 297, ../../app/stylesheets/vote.scss */
.vote_chart table td.first,
.vote_chart table th.first {
padding-top: 26px !important;
.vote_chart .first .label {
padding-top: 32px;
}

/* line 302, ../../app/stylesheets/vote.scss */
.vote_chart table td.last,
.vote_chart table th.last {
padding-bottom: 9px !important;
/* line 301, ../../app/stylesheets/vote.scss */
.vote_chart .last .label {
padding-bottom: 9px;
}

/* line 306, ../../app/stylesheets/vote.scss */
.vote_chart table .label {
padding-right: 2px;
font-size: 16px;
font-weight: bold;
}

/* line 312, ../../app/stylesheets/vote.scss */
.vote-type {
padding: 2px 0 0 10px;
display: block;
Expand Down

0 comments on commit 19af91e

Please sign in to comment.