Skip to content

Commit

Permalink
Transition almost done
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Altmann committed Feb 8, 2015
1 parent 7b7a1f9 commit 793a40b
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 61 deletions.
Binary file modified app/assets/images/sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/images/sprites/negative.png
Binary file not shown.
Binary file removed app/assets/images/sprites/negative_small.png
Binary file not shown.
Binary file removed app/assets/images/sprites/neutral.png
Binary file not shown.
Binary file removed app/assets/images/sprites/neutral_small.png
Binary file not shown.
Binary file removed app/assets/images/sprites/positive.png
Binary file not shown.
Binary file removed app/assets/images/sprites/positive_small.png
Binary file not shown.
19 changes: 8 additions & 11 deletions app/assets/stylesheets/controller/ratings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
@include whitebox;
}

.rating_form .rating-choice span{
vertical-align: middle;

}

// rating #index

.ratings > .Rating {
margin-bottom:1em;
margin-bottom: 1em;
}

// layouts and responsiveness
Expand All @@ -36,10 +31,12 @@

@include at-breakpoint($bp-mobile-horizontal) {
.rating_form .rating-choice .choice {
display:inline;
margin-right:1em;
display: inline;
margin-right: 1em;
line-height: 170%;

.iradio {
top: 0;
}
}
}



46 changes: 6 additions & 40 deletions app/assets/stylesheets/sprites.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,23 @@
app/assets/images/sprites/taz.png (195x30)
app/assets/images/sprites/hochschulanzeiger.png (154x30)
app/assets/images/sprites/tagesspiegel.png (116x30)
app/assets/images/sprites/get_share.png (96x96)
app/assets/images/sprites/arte.png (90x30)
app/assets/images/sprites/deutschlandfunk.png (90x30)
app/assets/images/sprites/neutral.png (60x60)
app/assets/images/sprites/positive.png (60x60)
app/assets/images/sprites/negative.png (60x60)
app/assets/images/sprites/arte.png (90x30)
app/assets/images/sprites/pioneerbutton.png (60x59)
app/assets/images/sprites/negative_small.png (30x30)
app/assets/images/sprites/positive_small.png (30x30)
app/assets/images/sprites/neutral_small.png (30x30)
app/assets/images/sprites/down_arrow.png (28x21)
app/assets/images/sprites/up_arrow.png (28x21)
app/assets/images/sprites/openbox.png (23x21)
app/assets/images/sprites/box.png (23x20)
app/assets/images/sprites/paper.png (22x18)
app/assets/images/sprites/helper.png (20x20)
app/assets/images/sprites/helper--hover.png (20x20)
app/assets/images/sprites/pencil.png (17x17)
app/assets/images/sprites/briefcase.png (14x12)
app/assets/images/sprites/user.png (13x12)
Output files:
app/assets/images/sprites.png
app/assets/stylesheets/sprites.css.scss
app/assets/stylesheets/sprites.scss
Output size:
296x210
260x150
*/
span.sprite_sueddeutsche { width: 200px; height: 30px; background: image-url('sprites.png') 0px 0px no-repeat; }
span.sprite_taz { width: 195px; height: 30px; background: image-url('sprites.png') 0px -30px no-repeat; }
span.sprite_hochschulanzeiger { width: 154px; height: 30px; background: image-url('sprites.png') 0px -60px no-repeat; }
span.sprite_tagesspiegel { width: 116px; height: 30px; background: image-url('sprites.png') 0px -90px no-repeat; }
span.sprite_get_share { width: 96px; height: 96px; background: image-url('sprites.png') -200px 0px no-repeat; }
span.sprite_arte { width: 90px; height: 30px; background: image-url('sprites.png') 0px -120px no-repeat; }
span.sprite_deutschlandfunk { width: 90px; height: 30px; background: image-url('sprites.png') -90px -120px no-repeat; }
span.sprite_neutral { width: 60px; height: 60px; background: image-url('sprites.png') 0px -150px no-repeat; }
span.sprite_positive { width: 60px; height: 60px; background: image-url('sprites.png') -60px -150px no-repeat; }
span.sprite_negative { width: 60px; height: 60px; background: image-url('sprites.png') -120px -150px no-repeat; }
span.sprite_pioneerbutton { width: 60px; height: 59px; background: image-url('sprites.png') -180px -150px no-repeat; }
span.sprite_negative_small { width: 30px; height: 30px; background: image-url('sprites.png') -154px -60px no-repeat; }
span.sprite_positive_small { width: 30px; height: 30px; background: image-url('sprites.png') -116px -90px no-repeat; }
span.sprite_neutral_small { width: 30px; height: 30px; background: image-url('sprites.png') -146px -90px no-repeat; }
span.sprite_down_arrow { width: 28px; height: 21px; background: image-url('sprites.png') -200px -96px no-repeat; }
span.sprite_up_arrow { width: 28px; height: 21px; background: image-url('sprites.png') -228px -96px no-repeat; }
span.sprite_openbox { width: 23px; height: 21px; background: image-url('sprites.png') -256px -96px no-repeat; }
span.sprite_box { width: 23px; height: 20px; background: image-url('sprites.png') -176px -90px no-repeat; }
span.sprite_paper { width: 22px; height: 18px; background: image-url('sprites.png') -180px -120px no-repeat; }
span.sprite_helper { width: 20px; height: 20px; background: image-url('sprites.png') -240px -150px no-repeat; }
span.sprite_helper:hover { width: 20px; height: 20px; background: image-url('sprites.png') -260px -150px no-repeat; }
span.sprite_pencil { width: 17px; height: 17px; background: image-url('sprites.png') -279px -96px no-repeat; }
span.sprite_briefcase { width: 14px; height: 12px; background: image-url('sprites.png') -184px -60px no-repeat; }
span.sprite_user { width: 13px; height: 12px; background: image-url('sprites.png') -184px -72px no-repeat; }
span.sprite_deutschlandfunk { width: 90px; height: 30px; background: image-url('sprites.png') 0px -120px no-repeat; }
span.sprite_arte { width: 90px; height: 30px; background: image-url('sprites.png') -90px -120px no-repeat; }
span.sprite_pioneerbutton { width: 60px; height: 59px; background: image-url('sprites.png') -200px 0px no-repeat; }
8 changes: 7 additions & 1 deletion app/views/line_item_groups/show/_rating.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
- rating = line_item_group.rating
.Rating
.Rating-image
span*{class: "sprite_#{rating.value}" }
- case rating.value
- when 'positive'
= fa_icon 'smile-o 3x', title: 'positiv'
- when 'neutral'
= fa_icon 'meh-o 3x', title: 'neutral'
- when 'negative'
= fa_icon 'frown-o 3x', title: 'negativ'
.Rating-quote
- if rating.text.empty?
p
Expand Down
9 changes: 8 additions & 1 deletion app/views/ratings/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@
- @ratings.each do |rating|
.Rating
.Rating-image
span class="sprite_#{ rating.value }"
- case rating.value
- when 'positive'
= fa_icon 'smile-o 3x', title: 'positiv'
- when 'neutral'
= fa_icon 'meh-o 3x', title: 'neutral'
- when 'negative'
= fa_icon 'frown-o 3x', title: 'negativ'
/span class="sprite_#{ rating.value }"
.Rating-quote
- if rating.rating_user
- if rating.text.empty?
Expand Down
5 changes: 4 additions & 1 deletion app/views/ratings/new.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
= f.inputs do
= f.input :line_item_group_id, as: :hidden
= f.semantic_errors :line_item_group_id
= f.input :rating, as: :plain_radio, wrapper_html: { class: "rating-choice"}, label: false, collection: { content_tag(:span, class: "sprite_positive"){} => "positive", content_tag(:span, class: "sprite_neutral"){} => "neutral", content_tag(:span, class: "sprite_negative"){} => "negative" }
= f.input :rating, as: :plain_radio,
wrapper_html: { class: "rating-choice"}, label: false,
collection: { 'positiv' => "positive",
'neutral' => "neutral", 'negativ' => "negative" }
= f.inputs do
= f.input :text, label: t('rating.create.comment'), input_html: { rows: 6 }

Expand Down
23 changes: 16 additions & 7 deletions app/views/users/_ratings.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,26 @@
/ along with Fairmondo. If not, see <http://www.gnu.org/licenses/>.
.User-rating
= link_to user_ratings_path(user), data: { push: true } do
= link_to user_ratings_path(user), data: { push: true } do
=> t('rating.show.nr_of_ratings')
= user.ratings.count
.User-rating-images
- if user.ratings.count > 0
.User-rating-image
span.sprite_positive_small
=< number_with_precision( user.percentage_of_positive_ratings, :precision => 1 ).to_s+"%"
= fa_icon 'smile-o lg', title: 'positiv'
/= fa_icon 'thumbs-up lg'
=< number_with_precision( user.percentage_of_positive_ratings,
precision: 1 ).to_s
| &thinsp;%
.User-rating-image
span.sprite_neutral_small
=< number_with_precision( user.percentage_of_neutral_ratings, :precision => 1 ).to_s+"%"
= fa_icon 'meh-o lg', title: 'neutral'
/= fa_icon 'thumbs-down lg rotate-270'
=< number_with_precision( user.percentage_of_neutral_ratings,
precision: 1 ).to_s
| &thinsp;%
.User-rating-image
span.sprite_negative_small
=< number_with_precision( user.percentage_of_negative_ratings, :precision => 1 ).to_s+"%"
= fa_icon 'frown-o lg', title: 'negativ'
/= fa_icon 'thumbs-down lg'
=< number_with_precision( user.percentage_of_negative_ratings,
precision: 1 ).to_s
| &thinsp;%

0 comments on commit 793a40b

Please sign in to comment.