From c0a5200c10a3f98e814e57a993308bc3410c18c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Garci=CC=81a=20Cabeza?= Date: Mon, 27 Jul 2015 22:01:13 +0200 Subject: [PATCH] Adds styles for debates show --- app/assets/stylesheets/debates.scss | 183 ++++++++++++++++++++-------- app/views/comments/_form.html.erb | 2 +- app/views/debates/show.html.erb | 81 ++++++------ 3 files changed, 176 insertions(+), 90 deletions(-) diff --git a/app/assets/stylesheets/debates.scss b/app/assets/stylesheets/debates.scss index 3b42c6c05..dc97b7e43 100644 --- a/app/assets/stylesheets/debates.scss +++ b/app/assets/stylesheets/debates.scss @@ -5,7 +5,8 @@ // 03. Header // 04. Footer // 05. Debates - +// 06. Comentarios +// // 01. Variables // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -44,6 +45,10 @@ body { max-width: 1170px; } +.inline-block { + display: inline-block; +} + // 03. Header // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -148,7 +153,7 @@ header { } .debate { - + .panel { background: white; border: 0; @@ -168,7 +173,7 @@ header { } .label { - margin-top: $line-height/4; + margin-top: $line-height/4; } h3 { @@ -190,58 +195,136 @@ header { line-height: $line-height; margin-bottom: $line-height; } + } + + .votes { + background: $votes-background; + margin: -5px -20px -20px -20px; + padding: 1.25rem 1.25rem 0 1.25rem; - .votes { - background: $votes-background; - margin: -5px -20px -20px -20px; - padding: 1.25rem 1.25rem 0 1.25rem; + .fi-like { + color: $votes-like; + font-size: rem-calc(48); + line-height: $line-height*2; + } - .fi-like { - color: $votes-like; - font-size: rem-calc(48); - line-height: $line-height*2; - } + .fi-dislike { + color: $votes-dislike; + display: inline-block; + font-size: rem-calc(48); + line-height: $line-height*2; + padding-top: $line-height/3; + } - .fi-dislike { - color: $votes-dislike; + .in-favor { + color: $votes-like; + line-height: rem-calc(48); + vertical-align: top; + + span { display: inline-block; - font-size: rem-calc(48); - line-height: $line-height*2; - padding-top: $line-height/3; - } - - .in-favor { - color: $votes-like; - line-height: rem-calc(48); + line-height: 48px; + padding-top: 5px; vertical-align: top; - - span { - display: inline-block; - line-height: 48px; - padding-top: 5px; - vertical-align: top; - } - } - - .against { - @extend .in-favor; - color: $votes-dislike; - display: inline-block; - } - - .total-votes { - font-size: rem-calc(12); - line-height: $line-height*2; - } - - .divider { - background: rgba(0,0,0, .1); - display: inline-block; - height: 3rem; - margin: 0 .5rem; - width: 1px; } } + + .against { + @extend .in-favor; + color: $votes-dislike; + display: inline-block; + } + + .total-votes { + font-size: rem-calc(12); + line-height: $line-height*2; + } + + .divider { + background: rgba(0,0,0, .1); + display: inline-block; + height: 3rem; + margin: 0 .5rem; + width: 1px; + } + } +} + +.debate-show { + background: white; + margin-top: $line-height; + padding: $line-height/2; + + h1 { + font-size: rem-calc(30); + font-weight: bold; + margin: 0; + } + + .fi-price-tag { + color: $text-color; + font-size: rem-calc(18); + line-height: $line-height; + } + + .votes { + + .fi-like { + color: $votes-like; + font-size: rem-calc(48); + line-height: $line-height*2; + } + + .fi-dislike { + color: $votes-dislike; + display: inline-block; + font-size: rem-calc(48); + line-height: $line-height*2; + padding-top: $line-height/3; + } + + .in-favor { + color: $votes-like; + line-height: rem-calc(48); + vertical-align: top; + + span { + display: inline-block; + line-height: 48px; + padding-top: 5px; + vertical-align: top; + } + } + + .against { + @extend .in-favor; + color: $votes-dislike; + } + + .total-votes { + font-size: rem-calc(14); + line-height: $line-height*2; + } + + .divider { + background: rgba(0,0,0, .1); + display: inline-block; + height: 3rem; + margin: 0 .5rem; + width: 1px; + } + } +} + +// 06. Comentarios +// - - - - - - - - - - - - - - - - - - - - - - - - - + +.comments { + clear: both; + + h2 { + margin: 0; + font-weight: bold; } } @@ -250,7 +333,3 @@ header { - - - - diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index 4ef99b4b0..b309a34ef 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -3,5 +3,5 @@ <%= f.hidden_field :commentable_type, value: parent.class %> <%= f.hidden_field :commentable_id, value: parent.id %> - <%= f.submit 'Publicar comentario' %> + <%= f.submit 'Publicar comentario', :class => "button radius" %> <% end %> \ No newline at end of file diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 719857185..87b3ffd24 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -1,44 +1,51 @@ -
+
+ + <%= link_to 'Volver', debates_path, :class => 'right' %> +
-
-

<%= @debate.title %>

+
+

<%= @debate.title %>

+

Por <%= @debate.author.name %> el <%= l @debate.created_at.to_date %>

<%= @debate.description %>

-

- Creado el: <%= l @debate.created_at.to_date %> - por: <%= @debate.author.name %> -

+

<%= render 'shared/tags', debate: @debate %>

+
+ +
+
+
+ <%= link_to debate_votes_path(@debate, value: 'yes'), :class => 'in-favor', method: "post" do %> + + <%= percentage('likes', @debate) %> + <% end %> +
+ + + +
+ <%= link_to debate_votes_path(@debate, value: 'no'), :class => 'against', method: "post" do %> + + <%= percentage('dislikes', @debate) %> + <% end %> +
+
+ +
+

<%= @debate.total_votes %> votos

+
+
- -
- <%= link_to "up", debate_votes_path(@debate, value: 'yes'), method: "post" %> - <%= percentage('likes', @debate) %> -
+
+

Comentarios

+
+ Deja tu comentario + <%= render 'comments/form', parent: @debate %> +
+ <%= render @debate.root_comments %> +
-
- <%= link_to "down", debate_votes_path(@debate, value: 'no'), method: "post" %> - <%= percentage('dislikes', @debate) %> -
+ <% if current_user && @debate.editable_by?(current_user) %> + <%= link_to 'Edit', edit_debate_path(@debate), :class => 'button radius right' %> | + <% end %> - Votos <%= @debate.total_votes %> -
- -
- <%= render 'shared/tags', debate: @debate %> -
- -

-
-

Comentarios

-
- Deja tu comentario - <%= render 'comments/form', parent: @debate %> -
- <%= render @debate.root_comments %> -
- -<% if current_user && @debate.editable_by?(current_user) %> - <%= link_to 'Edit', edit_debate_path(@debate) %> | -<% end %> -<%= link_to 'Back', debates_path %>
\ No newline at end of file