diff --git a/app/assets/fonts/roboto-black.eot b/app/assets/fonts/roboto-black.eot deleted file mode 100755 index fa326d1d1..000000000 Binary files a/app/assets/fonts/roboto-black.eot and /dev/null differ diff --git a/app/assets/fonts/roboto-black.svg b/app/assets/fonts/roboto-black.svg deleted file mode 100755 index 945dec6cb..000000000 --- a/app/assets/fonts/roboto-black.svg +++ /dev/null @@ -1,642 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/assets/fonts/roboto-black.ttf b/app/assets/fonts/roboto-black.ttf deleted file mode 100755 index 3c3b2b8ae..000000000 Binary files a/app/assets/fonts/roboto-black.ttf and /dev/null differ diff --git a/app/assets/fonts/roboto-black.woff b/app/assets/fonts/roboto-black.woff deleted file mode 100755 index 022908657..000000000 Binary files a/app/assets/fonts/roboto-black.woff and /dev/null differ diff --git a/app/assets/stylesheets/debates.scss b/app/assets/stylesheets/debates.scss index 7fd35c790..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 // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -13,23 +14,41 @@ $font-family-sans-serif: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; $line-height: rem-calc(24); +$background: #EDEFF0; $brand: #0077B9; $debates: #008CCF; $header-color: #292B33; $text-color: #919399; +$votes-background: #EDEDED; +$votes-dislike: #FF7978; +$votes-like: #00D288; // 02. Global styles // - - - - - - - - - - - - - - - - - - - - - - - - - +*, html { + margin: 0; + padding: 0; +} + body { + background: $background; font-family: $font-family-sans-serif; - font-weight: 300; + font-weight: normal; p { - font-weight: 300; + font-weight: normal; } } +.row { + max-width: 1170px; +} + +.inline-block { + display: inline-block; +} + // 03. Header // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -38,6 +57,30 @@ header { background-position: 50% 50%; background-size: cover; min-height: $line-height*20; + + h1 { + color: white; + font-size: rem-calc(45); + font-weight: bolder; + line-height: $line-height*3; + margin: $line-height 0 0 0; + padding: 0; + } + + h2 { + @extend h1; + font-size: rem-calc(24); + font-weight: normal; + line-height: $line-height*2; + margin: 0; + } + + .button { + background: none; + border: 2px solid white; + color: white; + margin-top: $line-height*2; + } } .contain-to-grid { @@ -48,15 +91,15 @@ header { background: white; color: $header-color; height: $line-height*4; + max-width: 1170px !important; - .name h1 a { + .name a { color: black; font-family: 'Lato'; font-size: rem-calc(36); font-weight: lighter; line-height: $line-height*4; padding-left: 0; - white-space: nowrap; span { color: $brand; @@ -70,16 +113,25 @@ header { } } -.top-bar-section li:not(.has-form) a:not(.button) { - background: white; - color: $brand; - line-height: $line-height*4; +.top-bar-section { + + li:not(.has-form) a:not(.button) { + background: white; + color: $brand; + line-height: $line-height*4; + } + + li.active:not(.has-form) a:not(.button) { + height: $line-height*4; + line-height: $line-height*4; + } } .top-links { color: white; font-size: rem-calc(14); - padding: $header-line-height/2+em 0; + height: $line-height*2; + padding: $line-height/2 0; a { color: white; @@ -101,31 +153,179 @@ header { } .debate { - + .panel { + background: white; + border: 0; + box-shadow: 0 2px 0 rgba(0,0,0,.1); .fi-comment-quotes { color: $debates; font-size: rem-calc(36); line-height: $line-height; + margin-bottom: $line-height*0.77; + } + + .fi-price-tag { + color: $text-color; + font-size: rem-calc(18); + line-height: $line-height; } .label { - margin-top: $line-height/4; + margin-top: $line-height/4; } - h3 a { - clear: both; - color: $header-color; - display: block; - font-size: rem-calc(16); + h3 { + margin: 0; + font-weight: bold; + + a { + clear: both; + color: $header-color; + display: block; + font-size: rem-calc(16); + line-height: $line-height; + } } p { color: $text-color; font-size: rem-calc(13); + 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; + + .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; + 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; + } } @@ -133,9 +333,3 @@ header { - - - - - - diff --git a/app/assets/stylesheets/fonts.scss b/app/assets/stylesheets/fonts.scss index b9353cc92..b6fc2d973 100644 --- a/app/assets/stylesheets/fonts.scss +++ b/app/assets/stylesheets/fonts.scss @@ -73,17 +73,6 @@ font-style: italic; } -@font-face { - font-family: 'Roboto'; - src: font-url('roboto-black.eot'); - src: font-url('roboto-black.eot?#iefix') format('embedded-opentype'), - font-url('roboto-black.woff') format('woff'), - font-url('roboto-black.ttf') format('truetype'), - font-url('roboto-black.svg#latoblack') format('svg'); - font-weight: bolder; - font-style: normal; -} - @font-face { font-family: 'Roboto'; src: font-url('roboto-blackitalic.eot'); diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index e3f796026..03b6caad7 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -6,6 +6,6 @@ <%= f.hidden_field :commentable_type, value: parent.class %> <%= f.hidden_field :commentable_id, value: parent.id %> - <%= f.submit comment_button_text(parent) %> + <%= f.submit comment_button_text(parent), :class => "button radius" %> <% end %> - \ No newline at end of file + diff --git a/app/views/debates/_debate.html.erb b/app/views/debates/_debate.html.erb index 045c2b1cd..6080bfbcc 100644 --- a/app/views/debates/_debate.html.erb +++ b/app/views/debates/_debate.html.erb @@ -1,13 +1,33 @@ -
- +
Debate

<%= link_to debate.title, debate %>

-

<%= debate.description %>

-

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

+

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

+

<%= debate.description %>

<%= 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

+
+
\ No newline at end of file diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index 5581e21ea..f48884c24 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -1,5 +1,3 @@ -<%#= link_to 'New Debate', new_debate_path, :class => 'button radius right' %> -
<%= render @debates %> diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 719857185..ec8a99422 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 %> +
+
+ +
+

<%= pluralize(@debate.total_votes, 'voto', 'votos') %> 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 diff --git a/app/views/devise/menu/_login_items.html.erb b/app/views/devise/menu/_login_items.html.erb index 167d3e87e..22ffa4b0e 100644 --- a/app/views/devise/menu/_login_items.html.erb +++ b/app/views/devise/menu/_login_items.html.erb @@ -1,14 +1,14 @@
    <% if user_signed_in? %>
  • - <%= link_to('Logout', destroy_user_session_path, method: :delete) %> + <%= link_to('Salir', destroy_user_session_path, method: :delete) %>
  • <% else %>
  • - <%= link_to('Login', new_user_session_path) %> + <%= link_to('Entrar', new_user_session_path) %>
  • - <%#= link_to('Sign up', new_registration_path) %> + <%= link_to('Registrarse', new_user_registration_path) %>
  • <% end %>
\ No newline at end of file diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 8c4da21cd..695586600 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -33,7 +33,7 @@
- <%= f.submit "Sign up" %> + <%= f.submit "Registrarse" %>
<% end %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index b261cfd15..ba96a7ecd 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -19,7 +19,7 @@ <% end -%>
- <%= f.submit "Log in" %> + <%= f.submit "Entrar" %>
<% end %> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index d41a28bb6..504923748 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -12,13 +12,11 @@
+ +
+
+

Estamos abriendo Madrid

+

Para que todos los madrileños decidamos que ciudad queremos tener.

+ <%= link_to 'Participa en los últimos debates e iniciativas', new_debate_path, :class => 'button radius' %> +
+
\ No newline at end of file diff --git a/app/views/shared/_tags.html.erb b/app/views/shared/_tags.html.erb index 2537e274b..645fd2b4f 100644 --- a/app/views/shared/_tags.html.erb +++ b/app/views/shared/_tags.html.erb @@ -1,5 +1,3 @@ <% if debate.tags.any? %> -
- Temas: <%= tags(debate) %> -
+ <%= tags(debate) %> <% end %> \ No newline at end of file diff --git a/spec/features/comments_spec.rb b/spec/features/comments_spec.rb index 31c07770c..64cec27a8 100644 --- a/spec/features/comments_spec.rb +++ b/spec/features/comments_spec.rb @@ -59,7 +59,7 @@ feature 'Comments' do end end - scenario "N replies" do + scenario "N replies", :js do debate = create(:debate) parent = create(:comment, commentable: debate) diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index df1b8bb3c..f0b5b346b 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -11,8 +11,8 @@ feature 'Debates' do within first('.debate') do expect(page).to have_content "Debate title" expect(page).to have_content "Debate description" - expect(page).to have_content "Creado el: #{I18n.l Date.today}" - expect(page).to have_content "por: #{Debate.first.author.name}" + expect(page).to have_content "Por #{Debate.first.author.name}" + expect(page).to have_content "el #{I18n.l Date.today}" end end @@ -23,8 +23,8 @@ feature 'Debates' do expect(page).to have_content "Debate title" expect(page).to have_content "Debate description" - expect(page).to have_content "Creado el: #{I18n.l Date.today}" - expect(page).to have_content "por: #{debate.author.name}" + expect(page).to have_content "Por #{debate.author.name}" + expect(page).to have_content "el #{I18n.l Date.today}" end scenario 'Create' do @@ -41,8 +41,8 @@ feature 'Debates' do expect(page).to have_content 'Debate creado correctamente' expect(page).to have_content 'Acabar con los desahucios' expect(page).to have_content 'Esto es un tema muy importante porque...' - expect(page).to have_content "Creado el: #{I18n.l Date.today}" - expect(page).to have_content "por: #{author.name}" + expect(page).to have_content "Por #{author.name}" + expect(page).to have_content "el #{I18n.l Date.today}" end scenario 'Update should not be posible if logged user is not the author' do diff --git a/spec/features/tags_spec.rb b/spec/features/tags_spec.rb index 4be725c7a..27b2528bd 100644 --- a/spec/features/tags_spec.rb +++ b/spec/features/tags_spec.rb @@ -9,11 +9,11 @@ feature 'Tags' do visit debates_path within "#debate-#{earth.id}" do - expect(page).to have_content "Temas: Medio Ambiente" + expect(page).to have_content "Medio Ambiente" end within "#debate-#{money.id}" do - expect(page).to have_content "Temas: Economía" + expect(page).to have_content "Economía" end end @@ -24,9 +24,11 @@ feature 'Tags' do visit debates_path first(:link, "Salud").click - expect(page).to have_css('.debate', count: 2) - expect(page).to have_content('Temas: Salud') - expect(page).to_not have_content('Temas: Hacienda') + within('#debates') do + expect(page).to have_css('.debate', count: 2) + expect(page).to have_content('Salud') + expect(page).to_not have_content('Hacienda') + end end scenario 'Show' do @@ -34,7 +36,7 @@ feature 'Tags' do visit debate_path(debate) - expect(page).to have_content "Temas: Economía, Hacienda" + expect(page).to have_content "Economía, Hacienda" end scenario 'Tag Cloud' do @@ -65,7 +67,7 @@ feature 'Tags' do click_button 'Crear Debate' expect(page).to have_content 'Debate creado correctamente' - expect(page).to have_content 'Temas: Economía, Hacienda, Impuestos' + expect(page).to have_content 'Economía, Hacienda, Impuestos' end scenario 'Update' do @@ -80,8 +82,7 @@ feature 'Tags' do click_button 'Actualizar Debate' expect(page).to have_content 'Debate actualizado correctamente' - within('#tags') do - expect(page).to have_content 'Temas:' + within('.tags') do expect(page).to have_css('a', text: 'Economía') expect(page).to have_css('a', text: 'Hacienda') end @@ -97,7 +98,7 @@ feature 'Tags' do click_button 'Actualizar Debate' expect(page).to have_content 'Debate actualizado correctamente' - expect(page).to_not have_content 'Temas:' + expect(page).to_not have_content 'Economía' end end \ No newline at end of file diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index 30755c56f..e0fbb1edd 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -4,8 +4,7 @@ feature 'Users' do scenario 'Sign up' do visit '/' - click_link 'Login' - click_link 'Sign up' + click_link 'Registrarse' fill_in 'user_first_name', with: 'Manuela' fill_in 'user_last_name', with: 'Carmena' @@ -13,7 +12,7 @@ feature 'Users' do fill_in 'user_password', with: 'judgementday' fill_in 'user_password_confirmation', with: 'judgementday' - click_button 'Sign up' + click_button 'Registrarse' expect(page).to have_content '¡Bienvenido! Has sido identificado.' end @@ -22,10 +21,10 @@ feature 'Users' do user = create(:user, email: 'manuela@madrid.es', password: 'judgementday') visit '/' - click_link 'Login' + click_link 'Entrar' fill_in 'user_email', with: 'manuela@madrid.es' fill_in 'user_password', with: 'judgementday' - click_button 'Log in' + click_button 'Entrar' expect(page).to have_content 'Has iniciado sesión correctamente.' end @@ -35,7 +34,7 @@ feature 'Users' do login_as(user) visit "/" - click_link 'Logout' + click_link 'Salir' expect(page).to have_content 'Has cerrado la sesión correctamente.' end diff --git a/spec/features/votes_spec.rb b/spec/features/votes_spec.rb index fb4fc29dd..f5399c9b1 100644 --- a/spec/features/votes_spec.rb +++ b/spec/features/votes_spec.rb @@ -17,7 +17,7 @@ feature 'Votes' do visit debate_path(@debate) - expect(page).to have_content "Votos 2" + expect(page).to have_content "2 votos" within('#in_favor') do expect(page).to have_content "50%" @@ -29,21 +29,21 @@ feature 'Votes' do end scenario 'Create' do - click_link 'up' + find('#in_favor a').click expect(page).to have_content "Gracias por votar" end scenario 'Update' do - click_link 'up' - click_link 'down' + find('#in_favor a').click + find('#against a').click expect(page).to have_content "Gracias por votar" end scenario 'Trying to vote multiple times' do - click_link 'up' - click_link 'up' + find('#in_favor a').click + find('#in_favor a').click expect(page).to have_content "Tu voto ya ha sido registrado" - expect(page).to have_content "Votos 1" + expect(page).to have_content "1 voto" end end \ No newline at end of file