From 19af91e34cba93ee3b038b31c084262d9f1c85dc Mon Sep 17 00:00:00 2001 From: tashian Date: Sat, 11 Jun 2011 17:51:25 -0700 Subject: [PATCH] Vote graph fixes --- app/helpers/votes_helper.rb | 2 +- app/stylesheets/layout.scss | 4 +-- app/stylesheets/vote.scss | 66 ++++++++++++++++------------------ app/views/votes/show.html.haml | 16 ++++----- config/locales/en.yml | 2 +- public/stylesheets/layout.css | 4 +-- public/stylesheets/vote.css | 46 +++++++++--------------- 7 files changed, 60 insertions(+), 80 deletions(-) diff --git a/app/helpers/votes_helper.rb b/app/helpers/votes_helper.rb index 7522b7f6..e88673b5 100644 --- a/app/helpers/votes_helper.rb +++ b/app/helpers/votes_helper.rb @@ -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'] diff --git a/app/stylesheets/layout.scss b/app/stylesheets/layout.scss index a1e2081b..b84c8bee 100644 --- a/app/stylesheets/layout.scss +++ b/app/stylesheets/layout.scss @@ -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; @@ -79,7 +79,7 @@ th{ td{ min-width: 100px; - padding: 6px 20px 6px 0 !important; + padding: 6px 20px 6px 0; vertical-align: top; } diff --git a/app/stylesheets/vote.scss b/app/stylesheets/vote.scss index 76b6dd3e..c422b1fe 100644 --- a/app/stylesheets/vote.scss +++ b/app/stylesheets/vote.scss @@ -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{ diff --git a/app/views/votes/show.html.haml b/app/views/votes/show.html.haml index eb56b6ce..2b29fd60 100644 --- a/app/views/votes/show.html.haml +++ b/app/views/votes/show.html.haml @@ -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') diff --git a/config/locales/en.yml b/config/locales/en.yml index a0816af5..7da840c4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: diff --git a/public/stylesheets/layout.css b/public/stylesheets/layout.css index f08a5023..75086d93 100644 --- a/public/stylesheets/layout.css +++ b/public/stylesheets/layout.css @@ -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; @@ -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; } diff --git a/public/stylesheets/vote.css b/public/stylesheets/vote.css index 6fa995ca..ab96529c 100644 --- a/public/stylesheets/vote.css +++ b/public/stylesheets/vote.css @@ -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;