Merge pull request #154 from AyuntamientoMadrid/debates

Debates
This commit is contained in:
Raimond Garcia
2015-08-12 15:59:20 +02:00
19 changed files with 152 additions and 141 deletions

Binary file not shown.

View File

@@ -19,4 +19,5 @@
<glyph unicode="&#106;" d="M91 347c0-5-1-9-5-12-4-4-8-6-13-6-5 0-9 2-13 6-3 3-5 7-5 12 0 6 2 10 5 13 4 4 8 6 13 6 5 0 9-2 13-6 4-3 5-7 5-13z m46-146l0 183c0 5-2 9-5 13-4 3-8 5-13 5l-82 0c-5 0-10-2-13-5-4-4-6-8-6-13l0-183c0-5 2-9 6-13 3-3 8-5 13-5l82 0c5 0 9 2 13 5 3 4 5 8 5 13z m323 43c10-12 15-26 15-43 0-15-5-28-16-38-11-11-24-17-38-17l-80 0c1-2 2-5 3-7 0-1 2-4 3-6 1-2 2-4 3-5 3-7 6-12 7-16 2-4 4-10 6-17 2-7 3-15 3-22 0-4 0-8 0-11-1-3-1-7-2-13-1-6-2-10-3-14-2-4-4-8-7-13-3-5-7-9-12-12-4-3-10-5-17-7-7-2-15-3-23-3-5 0-10 2-13 5-4 4-7 9-10 15-3 5-4 10-5 15-1 4-3 10-4 17-2 8-3 14-4 17-1 4-2 8-5 14-2 6-5 10-9 14-6 6-16 18-29 34-9 12-19 24-28 35-10 11-18 16-22 17-5 0-9 2-12 5-4 4-6 8-6 13l0 183c0 5 2 9 6 13 3 3 8 5 13 5 6 0 21 5 45 13 15 5 26 9 34 11 9 3 20 5 35 8 15 3 29 5 41 5l37 0c25-1 44-8 56-22 11-14 16-31 14-52 8-7 13-16 16-27 3-12 3-23 0-33 8-12 13-25 12-40 0-6-1-13-4-21z"/>
<glyph unicode="&#107;" d="M91 128c0 5-1 9-5 13-4 3-8 5-13 5-5 0-9-2-13-5-3-4-5-8-5-13 0-5 2-9 5-13 4-4 8-5 13-5 5 0 9 1 13 5 4 4 5 8 5 13z m46 146l0-183c0-5-2-9-5-12-4-4-8-6-13-6l-82 0c-5 0-10 2-13 6-4 3-6 7-6 12l0 183c0 5 2 10 6 13 3 4 8 6 13 6l82 0c5 0 9-2 13-6 3-3 5-8 5-13z m338 0c0-16-5-30-15-42 3-9 4-16 4-22 1-14-4-28-12-39 3-11 3-22 0-34-3-10-8-19-16-26 2-22-3-39-14-52-12-15-31-22-56-22l-37 0c-12 0-26 1-41 4-15 3-26 6-35 8-8 3-19 7-34 12-24 8-39 12-45 12-5 0-10 2-13 6-4 3-6 7-6 12l0 184c0 4 2 8 6 12 3 4 7 5 12 6 4 0 12 6 22 17 9 11 19 22 28 34 13 17 23 28 29 35 4 3 7 8 9 13 3 6 4 11 5 14 1 4 2 9 4 17 1 8 3 14 4 18 1 4 2 9 5 15 3 5 6 10 10 14 3 4 8 5 13 5 8 0 16-1 23-3 7-2 13-4 17-7 5-3 9-7 12-12 3-4 5-9 7-12 1-4 2-9 3-15 1-5 1-10 2-13 0-2 0-6 0-11 0-7-1-14-3-21-2-8-4-13-5-18-2-4-5-9-8-16-1-1-2-2-3-5-1-2-3-4-3-6-1-2-2-4-3-7l80 0c14 0 27-5 38-16 11-11 16-24 16-39z"/>
<glyph unicode="&#108;" d="M477 350c0-7-2-14-8-19l-206-207-39-39c-6-5-12-8-20-8-7 0-14 3-19 8l-142 142c-6 6-8 12-8 20 0 7 2 14 8 19l38 39c6 5 12 8 20 8 7 0 14-3 19-8l84-84 188 188c5 5 12 8 19 8 8 0 14-3 20-8l38-39c6-6 8-12 8-20z"/>
<glyph unicode="&#109;" d="M140 73l26 26-67 67-26-26 0-30 37 0 0-37z m150 265c0 4-2 7-7 7-1 0-3-1-4-2l-155-155c-2-2-2-3-2-5 0-4 2-6 6-6 2 0 4 0 5 2l155 154c1 2 2 3 2 5z m-16 55l119-119-238-237-118 0 0 118z m195-27c0-10-3-19-10-26l-48-47-118 118 47 48c7 7 15 10 26 10 10 0 18-3 26-10l67-67c7-8 10-16 10-26z"/>
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -138,9 +138,11 @@
// 02. Index
// - - - - - - - - - - - - - - - - - - - - - - - - -
.debate-featured {
margin-bottom: rem-calc(34);
.featured-debates {
margin-top: rem-calc(23);
}
.debate-featured {
.panel {
background: white;
@@ -242,6 +244,7 @@
.debates-list {
margin-bottom: $line-height*2;
margin-top: $line-height;
}
.debate {
@@ -318,12 +321,16 @@
}
}
.sidebar {
margin-top: $line-height;
}
// 03. Show
// - - - - - - - - - - - - - - - - - - - - - - - - -
.debate-show {
background: white;
padding: rem-calc(24) rem-calc(12) 0 rem-calc(12);
padding: rem-calc(24) rem-calc(12) rem-calc(48);
.back {
@include back;
@@ -378,8 +385,13 @@
font-weight: bold;
}
.sidebar {
.sidebar-divider {
border-top: 1px solid $border;
margin-top: $line-height;
&:first-child {
margin-top: 0;
}
}
h3 {

View File

@@ -72,4 +72,7 @@
}
.icon-check:before {
content: "l";
}
.icon-edit:before {
content: "m";
}

View File

@@ -350,8 +350,24 @@ footer {
.auth {
min-height: $line-height*20;
h2 {
clear: both;
font-size: rem-calc(30);
font-weight: bold;
line-height: $line-height*2;
}
.back, .icon-angle-left {
@include back;
}
.simple_captcha {
margin-bottom: $line-height/2;
}
.panel {
background: white;
border: 0;
h1 {
font-size: rem-calc(30);
@@ -436,17 +452,12 @@ form {
.account {
background: white;
min-height: $line-height*23;
padding-top: $line-height;
input[type="checkbox"], .checkbox {
margin-top: -(rem-calc(12));
}
.back, .icon-angle-left {
@include back;
}
h1 {
clear: both;
font-size: rem-calc(36);
@@ -467,6 +478,15 @@ form {
}
h2 {
clear: both;
font-size: rem-calc(30);
font-weight: bold;
line-height: $line-height;
margin: 0;
margin-bottom: $line-height/2;
}
h3 {
clear: both;
font-size: rem-calc(20);
font-weight: bold;

View File

@@ -2,7 +2,7 @@ class WelcomeController < ApplicationController
skip_authorization_check
def index
@featured_debates = Debate.order("created_at DESC").limit(3)
@featured_debates = Debate.order("created_at DESC").limit(9)
set_voted_values @featured_debates.map(&:id)
end

View File

@@ -2,7 +2,7 @@
<div class="small-12 column">
<%= link_to t("account.show.change_credentials_link"), edit_user_registration_path, class: 'button radius small secondary right' %>
<h1 class="inline-block"><%= t("account.show.title") %></h1>
<h2 class="inline-block"><%= t("account.show.title") %></h2>
<%= form_for @account, as: :account, url: account_path do |f| %>
@@ -19,7 +19,7 @@
<div class="row">
<div class="small-12 medium-6 column">
<h2><%= t("account.show.personal")%></h2>
<h3><%= t("account.show.personal")%></h3>
<%= f.label :first_name, t("account.show.first_name_label") %>
<%= f.text_field :first_name, placeholder: t("account.show.first_name_label") %>
@@ -35,10 +35,10 @@
</div>
<div class="small-12 medium-6 column">
<h2><%= t("account.show.avatar")%></h2>
<h3><%= t("account.show.avatar")%></h3>
<%= image_tag('user_default_big.jpg', class: "avatar", size: "100x100") %>
<h2><%= t("account.show.notifications")%></h2>
<h3><%= t("account.show.notifications")%></h3>
<%= f.label :email_on_debate_comment do %>
<%= f.check_box :email_on_debate_comment %>
<span class="checkbox"><%= t("account.show.email_on_debate_comment_label") %></span>

View File

@@ -4,7 +4,7 @@
<%= render @debates %>
</div>
<div class="small-12 medium-3 column">
<aside role="complementary">
<aside class="sidebar" role="complementary">
<%= link_to t("debates.index.create_debate"), new_debate_path, class: 'button radius expand' %>
<%= render "shared/tag_cloud" %>
</aside>

View File

@@ -2,6 +2,15 @@
<div id="debate-<%= @debate.id %>" class="row">
<div class="small-12 medium-9 column">
<i class="icon-angle-left left"></i>&nbsp;<%= link_to t("debates.show.back_link"), debates_path, class: 'left back' %>
<% if current_user && @debate.editable_by?(current_user) %>
<%= link_to edit_debate_path(@debate), :class => 'right' do %>
<i class="icon-edit"></i>
<%= t("debates.show.edit_debate_link") %>
<% end %>
<% end %>
<h1><%= @debate.title %></h1>
<div class="debate-info">
@@ -18,23 +27,24 @@
<%= @debate.description %>
<%= render 'shared/tags', debate: @debate %>
<p><%= social_share_button_tag(@debate.title) %></p>
</div>
<aside class="small-12 medium-3 column">
<div class="sidebar"></div>
<div class="sidebar-divider"></div>
<h3><%= t("votes.supports") %></h3>
<div class="text-center">
<div id="<%= dom_id(@debate) %>_votes">
<%= render 'debates/votes', debate: @debate %>
</div>
<% if user_signed_in? %>
</div>
<div class="sidebar-divider"></div>
<h3><%= t("debates.show.share") %></h3>
<%= social_share_button_tag(@debate.title) %>
<% if user_signed_in? %>
<%= link_to t("debates.show.leave_comment"), "#comments", class: "leave-comment" %>
<% else %>
<%= link_to t("debates.show.login_to_comment"), new_user_session_path, class: "leave-comment" %>
<% end %>
</div>
</aside>
</div>
</section>
@@ -51,8 +61,5 @@
<% end %>
<%= render @debate.root_comments.recent %>
</div>
<% 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 %>
</div>
</section>
</section>

View File

@@ -1,45 +1,46 @@
<div class="row">
<div class="account small-12 medium-5 column small-centered">
<div class="auth row">
<div class="small-12 medium-8 large-5 column small-centered">
<div class="panel">
<i class="icon-angle-left left"></i>&nbsp;<%= link_to t("devise_views.registrations.edit.back_link"), :back, class: "left back" %>
<i class="icon-angle-left left"></i>&nbsp;<%= link_to t("devise_views.registrations.edit.back_link"), :back, class: "left back" %>
<h2><%= t("devise_views.registrations.edit.edit") %> <%= resource_name.to_s.humanize %></h2>
<h1><%= t("devise_views.registrations.edit.edit") %> <%= resource_name.to_s.humanize %></h1>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<div class="row">
<div class="small-12 column">
<%= f.label :email, t("devise_views.registrations.edit.email_label") %>
<%= f.email_field :email, autofocus: true, placeholder: t("devise_views.registrations.edit.email_label") %>
</div>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<div class="row">
<div class="small-12 column">
<%= f.label :email, t("devise_views.registrations.edit.email_label") %>
<%= f.email_field :email, autofocus: true, placeholder: t("devise_views.registrations.edit.email_label") %>
<div class="small-12 column">
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div><%= t("devise_views.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %></div>
<% end %>
</div>
<div class="small-12 column">
<%= f.label :password, t("devise_views.registrations.edit.password_label") %>
<span class="note"><%= t("devise_views.registrations.edit.leave_blank") %></span>
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_label") %>
</div>
<div class="small-12 column">
<%= f.label :password_confirmation, t("devise_views.registrations.edit.password_confirmation_label") %>
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_confirmation_label") %>
</div>
<div class="small-12 column">
<%= f.label :current_password, t("devise_views.registrations.edit.current_password_label") %>
<span class="note"><%= t("devise_views.registrations.edit.need_current") %></span>
<%= f.password_field :current_password, autocomplete: "off", placeholder: t("devise_views.registrations.edit.current_password_label") %>
</div>
<div class="small-12 column">
<%= f.submit t("devise_views.registrations.edit.update_submit"), class: "button radius" %>
</div>
</div>
<div class="small-12 column">
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div><%= t("devise_views.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %></div>
<% end %>
</div>
<div class="small-12 column">
<%= f.label :password, t("devise_views.registrations.edit.password_label") %>
<span class="note"><%= t("devise_views.registrations.edit.leave_blank") %></span>
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_label") %>
</div>
<div class="small-12 column">
<%= f.label :password_confirmation, t("devise_views.registrations.edit.password_confirmation_label") %>
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_confirmation_label") %>
</div>
<div class="small-12 column">
<%= f.label :current_password, t("devise_views.registrations.edit.current_password_label") %>
<span class="note"><%= t("devise_views.registrations.edit.need_current") %></span>
<%= f.password_field :current_password, autocomplete: "off", placeholder: t("devise_views.registrations.edit.current_password_label") %>
</div>
<div class="small-12 column">
<%= f.submit t("devise_views.registrations.edit.update_submit"), class: "button radius" %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>

View File

@@ -1,75 +1,46 @@
<div class="row-full auth">
<div class="row">
<div class="small-12 medium-8 large-5 column small-centered">
<div class="panel">
<h1 class="text-center"><%= t("devise_views.registrations.new.title") %></h1>
<div class="auth row">
<div class="small-12 medium-8 large-5 column small-centered">
<div class="panel">
<h2><%= t("devise_views.registrations.new.title") %></h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div class="row">
<div class="small-12 columns">
<%= f.label :first_name, t("devise_views.registrations.new.first_name_label") %>
<%= f.text_field :first_name, autofocus: true, placeholder: t("devise_views.registrations.new.first_name_label") %>
</div>
</div>
<div class="row">
<div class="small-12 column">
<%= f.label :first_name, t("devise_views.registrations.new.first_name_label") %>
<%= f.text_field :first_name, autofocus: true, placeholder: t("devise_views.registrations.new.first_name_label") %>
<div class="row">
<div class="small-12 columns">
<%= f.label :last_name, t("devise_views.registrations.new.last_name_label") %>
<%= f.text_field :last_name, placeholder: t("devise_views.registrations.new.last_name_label") %>
</div>
</div>
<%= f.label :last_name, t("devise_views.registrations.new.last_name_label") %>
<%= f.text_field :last_name, placeholder: t("devise_views.registrations.new.last_name_label") %>
<div class="row">
<div class="small-12 columns">
<%= f.check_box :use_nickname %>
<%= t("devise_views.registrations.new.use_nickname_label") %>
</div>
</div>
<%= f.label :email, t("devise_views.registrations.new.email_label") %>
<%= f.email_field :email, placeholder: t("devise_views.registrations.new.email_label") %>
<div class="row">
<div class="small-12 columns">
<%= f.label :nickname, t("devise_views.registrations.new.nickname_label") %>
<%= f.text_field :nickname, placeholder: t("devise_views.registrations.new.nickname_label") %>
</div>
</div>
<%= f.label :nickname, t("devise_views.registrations.new.nickname_label") %>
<%= f.text_field :nickname, placeholder: t("devise_views.registrations.new.nickname_label") %>
<div class="row">
<div class="small-12 columns">
<%= f.label :email, t("devise_views.registrations.new.email_label") %>
<%= f.email_field :email, placeholder: t("devise_views.registrations.new.email_label") %>
</div>
</div>
<%= f.label :use_nickname do %>
<%= f.check_box :use_nickname %>
<span class="checkbox"><%= t("devise_views.registrations.new.use_nickname_label") %></span>
<% end %>
<div class="row">
<div class="small-12 columns">
<%= f.label :password, t("devise_views.registrations.new.password_label"), class: "inline-block" %>
<% if @minimum_password_length %>
<span class="inline-block"><i><%= t("devise_views.registrations.new.min_length", min: @minimum_password_length) %></i></span>
<% end %>
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.registrations.new.password_label") %>
</div>
</div>
<%= f.label :password, t("devise_views.registrations.new.password_label"), class: "inline-block" %>
<% if @minimum_password_length %>
<span class="inline-block"><%= t("devise_views.registrations.new.min_length", min: @minimum_password_length) %></span>
<% end %>
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.registrations.new.password_label") %>
<div class="row">
<div class="small-12 columns">
<%= f.label :password_confirmation, t("devise_views.registrations.new.password_confirmation_label") %>
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.registrations.new.password_confirmation_label") %>
</div>
</div>
<%= f.label :password_confirmation, t("devise_views.registrations.new.password_confirmation_label") %>
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.registrations.new.password_confirmation_label") %>
<%= f.simple_captcha %>
<%= f.simple_captcha %>
<div class="row">
<div class="small-12 columns">
<%= f.submit t("devise_views.registrations.new.submit"), class: "button radius expand" %>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>
</div>
<%= f.submit t("devise_views.registrations.new.submit"), class: "button radius expand" %>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>
</div>
</div>
</div>
</div>

View File

@@ -1,7 +1,7 @@
<div class="auth row">
<div class="small-12 medium-8 large-5 column small-centered">
<div class="panel">
<h1 class="text-center"><%= t("devise_views.sessions.new.title") %></h1>
<h2><%= t("devise_views.sessions.new.title") %></h2>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="row">
@@ -17,8 +17,10 @@
<% if devise_mapping.rememberable? -%>
<div class="small-12 columns">
<%= f.check_box :remember_me %>
<%= f.label :remember_me, t("devise_views.sessions.new.remember_me") %>
<%= f.label :remember_me do %>
<%= f.check_box :remember_me %>
<span class="checkbox"><%= t("devise_views.sessions.new.remember_me") %>
<% end %>
</div>
<% end -%>

View File

@@ -1,13 +1,5 @@
<section role="main">
<div id="featured-debates" class="row">
<div id="featured-debates" class="featured-debates row">
<%= render partial: "featured_debate", collection: @featured_debates %>
</div>
<div class="row">
<div class="small-12 medium-3 column">
<aside role="complementary">
<%= link_to t("layouts.header.see_all_debates"), debates_path, class: 'button radius expand' %>
<%= render "shared/tag_cloud" %>
</aside>
</div>
</div>
</section>

View File

@@ -29,7 +29,7 @@ en:
edit:
title: "Change your password"
password_label: "New password"
min_length: "(%{min} characters minimum)"
min_length: "%{min} characters minimum"
password_confirmation_label: "Confirm new password"
change_submit: "Change my password"
new:

View File

@@ -29,7 +29,7 @@ es:
edit:
title: "Cambia tu contraseña"
password_label: "Contraseña nueva"
min_length: "(mínimo %{min} caracteres)"
min_length: "Mínimo %{min} caracteres"
password_confirmation_label: "Confirmar contraseña nueva"
change_submit: "Cambiar mi contraseña"
new:

View File

@@ -58,6 +58,7 @@ en:
leave_comment: Write a comment
login_to_comment: Log in to participate
edit_debate_link: Edit
share: Share
edit:
editing: Edit debate
show_link: Show debate

View File

@@ -58,6 +58,7 @@ es:
leave_comment: Deja tu comentario
login_to_comment: Entra para participar
edit_debate_link: Editar
share: Compartir
edit:
editing: Editar debate
show_link: Ver debate