From 53e22e78ec0c140768e06370a779b7df166037f3 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 29 Jul 2015 17:41:19 +0200 Subject: [PATCH 1/7] Renames images for header, adds for default user --- ...er-logo-madrid.png => header_logo_madrid.png} | Bin .../{home-header-bg.jpg => home_header_bg.jpg} | Bin app/assets/images/user_default.jpg | Bin 0 -> 1631 bytes app/views/layouts/_header.html.erb | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename app/assets/images/{header-logo-madrid.png => header_logo_madrid.png} (100%) rename app/assets/images/{home-header-bg.jpg => home_header_bg.jpg} (100%) create mode 100644 app/assets/images/user_default.jpg diff --git a/app/assets/images/header-logo-madrid.png b/app/assets/images/header_logo_madrid.png similarity index 100% rename from app/assets/images/header-logo-madrid.png rename to app/assets/images/header_logo_madrid.png diff --git a/app/assets/images/home-header-bg.jpg b/app/assets/images/home_header_bg.jpg similarity index 100% rename from app/assets/images/home-header-bg.jpg rename to app/assets/images/home_header_bg.jpg diff --git a/app/assets/images/user_default.jpg b/app/assets/images/user_default.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c67f27f555328b4ed9e886516eceec1f92446ea2 GIT binary patch literal 1631 zcmex=G?WUP)qwZeFo6%mkOz;^d;tf|AVqJOz-6iAnjTCALaHmqNUdTL3o}Ygi#E^!3HB zG&dI%0AOQ_OM+4n?!{_waY$uBs(w&vaeir0aw<@{GDvfQm2**QVo82cNPd0}EEEGW z@=NlIGx7@*oSng;rl8@Qn4Fmh64V6i^7Xay%quQQ%u7!7bg@+enxmJQnPO#VV&H6O zX<%;TYUpHW=xXZdVrJ^>yn>bnwy$e0@Is<&})HHFDOCe765H_ zNiE7OOHFYr%Fk5*d)z7$w_8kcng`XJg4-=-IQ8lS9itD5UZm)T2?5g(hzU=;Kn^_l zr{)3Ed=W5l|9{882TrmKDF=X=i1Ghzh86}!;sFx^Fv9^c62vn8A7BvV zU{GLCU}h9#U=n0x7G(T?grN!OK2}CV2>^006DtQN7b7DB6El!N07e#8b`Ca90R|>U z76uj;c9;w!6Egz~E1RIA5WAAF7>8ltL1ht9PC*7nW@biqW>&Z|20=xNcW(%BWt};*pEWdqGfm|a zQ{NJo6AjFhre1th-se*Bq_@k;YD!6|iqWR+Y+)?L>@yZGS(KJI}K^`|{G+*Xo|9)_i-epc8tW?G%ssoaBd(1Ufr@UbQ*3Gw$yBt$FjC zZ9K1jdj0bCuFR6JwePf-_fHQlxOOV}7oREPUEi8S*A=(+n%JiP*sJhkIsf|EUwcaa zow#ArGVOQUjf2MzUkq%G*V%vRx9I+PHvV6(vB}E$FZxW1@qS;hj_Qcf=OndV7D{@44TuCa!t1DZTs`Jk2?9=;pTDY=2?OLS8 z(!Ng?*FKpf^GCJ?F_a{pnxPxrc4;gWas7W202ogM@c;k- literal 0 HcmV?d00001 diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 773bb1e46..95b5fb7af 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -14,7 +14,7 @@
  • <%= link_to root_path do %> - <%= image_tag('header-logo-madrid.png', class: 'left', size: '96x96') %> + <%= image_tag('header_logo_madrid.png', class: 'left', size: '96x96') %> <%= t("layouts.header.open_gov", open: "#{t('layouts.header.open')}").html_safe %> | <%= t("layouts.header.participation") %> <% end %>
  • From 63895f52c3e41e28d97a5b463df4f2b52d7f8011 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 29 Jul 2015 17:42:03 +0200 Subject: [PATCH 2/7] Changes tags styles --- app/helpers/application_helper.rb | 2 +- app/views/shared/_tags.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9b07780f2..499265f5a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,7 +1,7 @@ module ApplicationHelper def tags(debate) - debate.tag_list.sort.map { |tag| link_to sanitize(tag), debates_path(tag: tag) }.join(', ').html_safe + debate.tag_list.sort.map { |tag| link_to sanitize(tag), debates_path(tag: tag) }.join('').html_safe end def percentage(vote, debate) diff --git a/app/views/shared/_tags.html.erb b/app/views/shared/_tags.html.erb index 645fd2b4f..8be6da579 100644 --- a/app/views/shared/_tags.html.erb +++ b/app/views/shared/_tags.html.erb @@ -1,3 +1,3 @@ <% if debate.tags.any? %> - <%= tags(debate) %> + <%= tags(debate) %> <% end %> \ No newline at end of file From 0efa9c77f138dd77eb5d036b7ded5c2f8bd321fa Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 29 Jul 2015 17:42:27 +0200 Subject: [PATCH 3/7] Adds new styles for debates show --- app/assets/stylesheets/debates.scss | 165 ++++++++++++++++++++----- app/views/debates/show.html.erb | 49 ++++++-- app/views/layouts/application.html.erb | 6 +- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 5 files changed, 174 insertions(+), 48 deletions(-) diff --git a/app/assets/stylesheets/debates.scss b/app/assets/stylesheets/debates.scss index f8e017474..d99c589f8 100644 --- a/app/assets/stylesheets/debates.scss +++ b/app/assets/stylesheets/debates.scss @@ -5,7 +5,10 @@ // 03. Header // 04. Footer // 05. Debates -// 06. Comentarios +// 05.1. Debates Index +// 05.2. Debates Show +// 06. Comments +// 06. Tags // // 01. Variables @@ -14,14 +17,31 @@ $font-family-sans-serif: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; $line-height: rem-calc(24); -$background: #EDEFF0; +$background: #F9F9F9; +$border: #DEE0E3; $brand: #0077B9; + $debates: #008CCF; + +$comments-bg: #FAF9F8; + $header-color: #292B33; +$link: #0077B9; + +$tags-bg: #FAFAFA; +$tags-border: #F0F0F0; +$tags-color: #8F8F8F; + $text-color: #919399; +$text-medium: #999999; +$text-light: #a3a6ad; + $votes-background: #EDEDED; -$votes-dislike: #FF7978; -$votes-like: #00D288; +$votes-border: #DEE0E3; +$votes-dislike: #EF8585; +$votes-dislike-b: #D26463;//FF7978; +$votes-like: #7BD2A8; +$votes-like-b: #56A47D; // 02. Global styles // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -32,8 +52,9 @@ $votes-like: #00D288; } body { - background: $background; + background: white; font-family: $font-family-sans-serif; + font-size: rem-calc(13); font-weight: normal; p { @@ -45,6 +66,14 @@ body { max-width: 1170px; } +.row-full { + max-width: 100% !important; +} + +.clear { + clear: both; +} + .inline-block { display: inline-block; } @@ -53,13 +82,13 @@ body { // - - - - - - - - - - - - - - - - - - - - - - - - - header { - background: url('home-header-bg.jpg'); + background: url('home_header_bg.jpg'); background-position: 50% 50%; background-size: cover; - height: $line-height*20; + min-height: $line-height*20; &.results { - height: $line-height*8 !important; + min-height: $line-height*8; } h1 { @@ -152,6 +181,9 @@ header { // 05. Debates // - - - - - - - - - - - - - - - - - - - - - - - - - +// 05.1. Debates Index +// - - - - - - - - - - - - + .debates-index { margin-top: $line-height; } @@ -160,7 +192,6 @@ header { .panel { background: white; - border: 0; box-shadow: 0 2px 0 rgba(0,0,0,.1); .fi-comment-quotes { @@ -254,48 +285,97 @@ header { } } +// 05.2. Debates Show +// - - - - - - - - - - - - + .debate-show { - background: white; + color: $text-medium; margin-top: $line-height; - padding: $line-height/2; + padding: 0 $line-height/2; + + .back { + color: $text-light; + font-size: rem-calc(13); + line-height: $line-height; + } h1 { - font-size: rem-calc(30); + clear: both; + font-size: rem-calc(24); font-weight: bold; + line-height: $line-height*1.3333; margin: 0; + padding-top: $line-height/2; } - .fi-price-tag { - color: $text-color; - font-size: rem-calc(18); - line-height: $line-height; + .debate-info { + color: $text-light; + font-weight: lighter; + line-height: $line-height*2; + margin-bottom: $line-height*0.5; + text-align: justify; + + span { + color: $border; + } + + p { + font-size: rem-calc(14); + line-height: $line-height; + margin-bottom: 0; + } + } + + .author-photo { + border-radius: 2px; + display: inline-block; + height: 32px; + line-height: $line-height*2; + margin-right: $line-height/4; + vertical-align: middle; + width: 32px; } .votes { + border: 1px solid $votes-border; + box-shadow: 0 2px 0 rgba(0,0,0,.1); + border-radius: 3px; + padding: $line-height/2; .fi-like { - color: $votes-like; + background: $votes-like; + border: 1px solid $votes-like-b; + border-radius: $line-height*2.5; + color: white; + display: block; font-size: rem-calc(48); - line-height: $line-height*2; + height: $line-height*2.5; + line-height: $line-height*2.5; + width: $line-height*2.5; } .fi-dislike { - color: $votes-dislike; - display: inline-block; + background: $votes-dislike; + border: 1px solid $votes-dislike-b; + border-radius: $line-height*2.5; + color: white; + display: block; font-size: rem-calc(48); - line-height: $line-height*2; - padding-top: $line-height/3; + height: $line-height*2.5; + line-height: $line-height*2.5; + width: $line-height*2.5; } .in-favor { color: $votes-like; line-height: rem-calc(48); - vertical-align: top; span { display: inline-block; - line-height: 48px; - padding-top: 5px; + font-size: rem-calc(18); + font-weight: bold; + line-height: $line-height; + padding-top: $line-height/4; vertical-align: top; } } @@ -307,24 +387,26 @@ header { .total-votes { font-size: rem-calc(14); - line-height: $line-height*2; + margin: 0; } .divider { - background: rgba(0,0,0, .1); + background: rgba(0,0,0,.05); display: inline-block; - height: 3rem; - margin: 0 .5rem; + height: $line-height*4; + margin: 0 $line-height; width: 1px; } } } -// 06. Comentarios +// 06. Comments // - - - - - - - - - - - - - - - - - - - - - - - - - .comments { - clear: both; + background: $comments-bg; + margin-top: $line-height*2; + padding-top: $line-height; h2 { margin: 0; @@ -332,6 +414,27 @@ header { } } +// 07. Tags +// - - - - - - - - - - - - - - - - - - - - - - - - - + +.tags a { + background: $tags-bg; + border: 1px solid $tags-border; + border-radius: 3px; + color: $tags-color; + font-size: rem-calc(13); + margin-bottom: 8px; + margin-right: $line-height/3; + padding: $line-height/4 $line-height/3; + + &:hover { + color: $link; + cursor: pointer; + background: #e5f1f8; + border: 1px solid $brand; + } + +} diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index f2c713103..4d01a0575 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -1,21 +1,28 @@ -
    - - <%= link_to t("debates.show.back_link"), debates_path, class: 'right' %> - -
    -
    +
    + +
    + +
    + + <%= link_to "< ".html_safe + t("debates.show.back_link"), debates_path, class: 'left back' %> +

    <%= @debate.title %>

    -

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

    -

    <%= sanitize(@debate.description.html_safe) %>

    -

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

    +
    + + <%= image_tag('user_default.jpg', class: 'author-photo', size: '32x32') %> + + <%= @debate.author.name %>  •  <%= l @debate.created_at.to_date %>  •  <%= pluralize(@debate.comment_threads.count, t("debates.show.comment"), t("debates.show.comments")) %> +
    +

    <%= @debate.description %>

    +

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

    -
    +
    <%= link_to debate_votes_path(@debate, value: 'yes'), class: 'in-favor', method: "post" do %> - <%= percentage('likes', @debate) %> + <%= percentage('likes', @debate) %> <% end %>
    @@ -34,7 +41,9 @@
    +
    +<<<<<<< HEAD

    <%= t("debates.show.comments") %>

    @@ -47,5 +56,21 @@ <% if current_user && @debate.editable_by?(current_user) %> <%= link_to t("debates.show.edit_debate_link"), edit_debate_path(@debate), class: 'button radius right' %> <% end %> +======= +
    +
    +
    +

    <%= t("debates.show.comments") %>

    +
    + <%= t("debates.show.leave_comment") %> + <%= render 'comments/form', parent: @debate %> +
    + <%= render @debate.root_comments %> +
    +>>>>>>> Adds new styles for debates show -
    + <% if current_user && @debate.editable_by?(current_user) %> + <%= link_to t("debates.show.edit_debate_link"), edit_debate_path(@debate), :class => 'button radius right' %> + <% end %> + + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index cb502dce6..36a3c44cc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -23,11 +23,7 @@

    <%= alert %>

    <% end %> -
    -
    - <%= yield %> -
    -
    + <%= yield %> <%= render 'layouts/footer' %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f0ee05b66..0374b471b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -27,6 +27,7 @@ en: accept_terms: I accept the privacy policy and the legal terms show: back_link: Back + comment: Comment comments: Comments leave_comment: Write a comment edit_debate_link: Edit diff --git a/config/locales/es.yml b/config/locales/es.yml index 53ad433ea..e88b83346 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -27,6 +27,7 @@ es: accept_terms: Acepto la política de privacidad y el aviso legal show: back_link: Volver + comment: Comentario comments: Comentarios leave_comment: Deja tu comentario edit_debate_link: Editar From a4bc9ed08fd6ae6f4c0ac4388aa89ed9c2ce14a4 Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 29 Jul 2015 18:45:10 +0200 Subject: [PATCH 4/7] removes conflict code which was left there by mistake --- app/views/debates/show.html.erb | 34 +++++++++------------------------ 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 4d01a0575..4f91fbe96 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -1,20 +1,20 @@
    - +
    - +
    - + <%= link_to "< ".html_safe + t("debates.show.back_link"), debates_path, class: 'left back' %> - +

    <%= @debate.title %>

    - + <%= image_tag('user_default.jpg', class: 'author-photo', size: '32x32') %> - + <%= @debate.author.name %>  •  <%= l @debate.created_at.to_date %>  •  <%= pluralize(@debate.comment_threads.count, t("debates.show.comment"), t("debates.show.comments")) %> -
    +

    <%= @debate.description %>

    -

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

    +

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

    @@ -22,7 +22,7 @@
    <%= link_to debate_votes_path(@debate, value: 'yes'), class: 'in-favor', method: "post" do %> - <%= percentage('likes', @debate) %> + <%= percentage('likes', @debate) %> <% end %>
    @@ -43,20 +43,6 @@
    -<<<<<<< HEAD -
    -

    <%= t("debates.show.comments") %>

    -
    - <%= t("debates.show.leave_comment") %> - <%= render 'comments/form', parent: @debate %> -
    - <%= render @debate.root_comments %> -
    - - <% if current_user && @debate.editable_by?(current_user) %> - <%= link_to t("debates.show.edit_debate_link"), edit_debate_path(@debate), class: 'button radius right' %> - <% end %> -=======
    @@ -67,8 +53,6 @@
    <%= render @debate.root_comments %>
    ->>>>>>> Adds new styles for debates show - <% if current_user && @debate.editable_by?(current_user) %> <%= link_to t("debates.show.edit_debate_link"), edit_debate_path(@debate), :class => 'button radius right' %> <% end %> From 6d10d97a32c34278f4ab5ad832a2f3544882a014 Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 29 Jul 2015 18:46:09 +0200 Subject: [PATCH 5/7] Fixes specs: "Por" was removed from the view. --- spec/features/debates_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index bfaebdada..ae177c49d 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 "Por #{Debate.first.author.name}" expect(page).to have_content "el #{I18n.l Date.today}" + expect(page).to have_content Debate.first.author.name 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 "Por #{debate.author.name}" expect(page).to have_content "el #{I18n.l Date.today}" + expect(page).to have_content debate.author.name end scenario 'Create' do @@ -41,8 +41,8 @@ feature 'Debates' do expect(page).to have_content 'Debate was successfully created.' 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 "Por #{author.name}" expect(page).to have_content "el #{I18n.l Date.today}" + expect(page).to have_content author.name end scenario 'Update should not be posible if logged user is not the author' do From efbb9a52d882e7a4f53cf4930656ea1517b0b89d Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 29 Jul 2015 18:47:22 +0200 Subject: [PATCH 6/7] Fixes spec: "el " was removed from view --- spec/features/debates_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index ae177c49d..e06872416 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 "el #{I18n.l Date.today}" expect(page).to have_content Debate.first.author.name + expect(page).to have_content 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 "el #{I18n.l Date.today}" expect(page).to have_content debate.author.name + expect(page).to have_content I18n.l(Date.today) end scenario 'Create' do @@ -41,8 +41,8 @@ feature 'Debates' do expect(page).to have_content 'Debate was successfully created.' 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 "el #{I18n.l Date.today}" expect(page).to have_content author.name + expect(page).to have_content I18n.l(Date.today) end scenario 'Update should not be posible if logged user is not the author' do From cee0aef9164e523b6e0b85d86670032a7cb57dd5 Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 29 Jul 2015 18:48:39 +0200 Subject: [PATCH 7/7] Fixes spec: Tags are not separated by commas any more --- spec/features/tags_spec.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/features/tags_spec.rb b/spec/features/tags_spec.rb index 43f04b5f0..6b5889ea7 100644 --- a/spec/features/tags_spec.rb +++ b/spec/features/tags_spec.rb @@ -36,7 +36,8 @@ feature 'Tags' do visit debate_path(debate) - expect(page).to have_content "Economía, Hacienda" + expect(page).to have_content "Economía" + expect(page).to have_content "Hacienda" end scenario 'Tag Cloud' do @@ -67,7 +68,9 @@ feature 'Tags' do click_button 'Create Debate' expect(page).to have_content 'Debate was successfully created.' - expect(page).to have_content 'Economía, Hacienda, Impuestos' + expect(page).to have_content 'Economía' + expect(page).to have_content 'Hacienda' + expect(page).to have_content 'Impuestos' end scenario 'Update' do @@ -101,4 +104,4 @@ feature 'Tags' do expect(page).to_not have_content 'Economía' end -end \ No newline at end of file +end