merges master and fixes conflicts

This commit is contained in:
kikito
2015-07-29 13:00:33 +02:00
32 changed files with 391 additions and 84 deletions

View File

@@ -14,6 +14,7 @@
//= require jquery_ujs
//= require foundation
//= require turbolinks
//= require ckeditor/init
//= require_tree .
$(function(){ $(document).foundation(); });

View File

@@ -0,0 +1,117 @@
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
/* Filebrowser routes */
// The location of an external file browser, that should be launched when "Browse Server" button is pressed.
config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog.
config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
// The location of a script that handles file uploads in the Flash dialog.
config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog.
config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog.
config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
// The location of a script that handles file uploads in the Image dialog.
config.filebrowserImageUploadUrl = "/ckeditor/pictures";
// The location of a script that handles file uploads.
config.filebrowserUploadUrl = "/ckeditor/attachment_files";
config.allowedContent = true;
// Rails CSRF token
config.filebrowserParams = function(){
var csrf_token, csrf_param, meta,
metas = document.getElementsByTagName('meta'),
params = new Object();
for ( var i = 0 ; i < metas.length ; i++ ){
meta = metas[i];
switch(meta.name) {
case "csrf-token":
csrf_token = meta.content;
break;
case "csrf-param":
csrf_param = meta.content;
break;
default:
continue;
}
}
if (csrf_param !== undefined && csrf_token !== undefined) {
params[csrf_param] = csrf_token;
}
return params;
};
config.addQueryString = function( url, params ){
var queryString = [];
if ( !params ) {
return url;
} else {
for ( var i in params )
queryString.push( i + "=" + encodeURIComponent( params[ i ] ) );
}
return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" );
};
// Integrate Rails CSRF token into file upload dialogs (link, image, attachment and flash)
CKEDITOR.on( 'dialogDefinition', function( ev ){
// Take the dialog name and its definition from the event data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
var content, upload;
if (CKEDITOR.tools.indexOf(['link', 'image', 'attachment', 'flash'], dialogName) > -1) {
content = (dialogDefinition.getContents('Upload') || dialogDefinition.getContents('upload'));
upload = (content == null ? null : content.get('upload'));
if (upload && upload.filebrowser && upload.filebrowser['params'] === undefined) {
upload.filebrowser['params'] = config.filebrowserParams();
upload.action = config.addQueryString(upload.action, upload.filebrowser['params']);
}
}
});
// Toolbar groups configuration.
config.toolbar = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source'] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
// { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
// { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
'/',
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }
];
config.toolbar_mini = [
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
{ name: 'styles', items: [ 'Font', 'FontSize' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'RemoveFormat' ] },
{ name: 'insert', items: [ 'Table', 'HorizontalRule', 'SpecialChar' ] }
];
config.toolbar = "mini";
};

View File

@@ -5,7 +5,7 @@
<h3><%= link_to debate.title, debate %></h3>
<p>Por <%= debate.author.name %> el <%= l debate.created_at.to_date %></p>
<p><%= debate.description %></p>
<p><%= sanitize(debate.description.html_safe) %></p>
<p><%= render 'shared/tags', debate: debate %></p>

View File

@@ -18,8 +18,7 @@
<br/>
<p><strong><%= t("debates.form.debate_text") %></strong></p>
<p><%= t("debates.form.text_instructions") %></p>
<%= f.text_area :description %>
<%= f.cktext_area :description, ckeditor: { language: I18n.locale } %>
<div>
<%= f.label :tag_list, t("debates.form.tags_label") %><br />
<%= f.text_field :tag_list, value: @debate.tag_list.to_s %>

View File

@@ -6,7 +6,7 @@
<div id="debate-<%= @debate.id %>" class="small-12 medium-9 column">
<h1><%= @debate.title %></h1>
<p>Por <%= @debate.author.name %> el <%= l @debate.created_at.to_date %></p>
<p><%= @debate.description %></p>
<p><%= sanitize(@debate.description.html_safe) %></p>
<p><%= render 'shared/tags', debate: @debate %></p>
</div>

View File

@@ -1,15 +1,15 @@
<h2>Resend confirmation instructions</h2>
<h2><%= t("devise_views.confirmations.title") %></h2>
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.label :email, t("devise_views.confirmations.email_label") %><br />
<%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
</div>
<div class="actions">
<%= f.submit "Resend confirmation instructions", class: "button radius" %>
<%= f.submit(t("devise_views.confirmations.submit"), class: "button radius") %>
</div>
<% end %>

View File

@@ -1,5 +1,5 @@
<p>Welcome <%= @email %>!</p>
<p><%= t("devise_views.mailer.confirmation_instructions.welcome") %> <%= @email %></p>
<p>You can confirm your account email through the link below:</p>
<p><%= t("devise_views.mailer.confirmation_instructions.text") %></p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
<p><%= link_to t("devise_views.mailer.confirmation_instructions.confirm_link"), confirmation_url(@resource, confirmation_token: @token) %></p>

View File

@@ -1,8 +1,8 @@
<p>Hello <%= @resource.email %>!</p>
<p><%= t("devise_views.mailer.reset_password_instructions.hello") %> <%= @resource.email %></p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= t("devise_views.mailer.reset_password_instructions.text") %></p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p><%= link_to t("devise_views.mailer.reset_password_instructions.change_link"), edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
<p><%= t("devise_views.mailer.reset_password_instructions.ignore_text") %></p>
<p><%= t("devise_views.mailer.reset_password_instructions.info_text") %></p>

View File

@@ -1,7 +1,7 @@
<p>Hello <%= @resource.email %>!</p>
<p><%= t("devise_views.mailer.unlock_instructions.hello") %> <%= @resource.email %></p>
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
<p><%= t("devise_views.mailer.unlock_instructions.info_text") %></p>
<p>Click the link below to unlock your account:</p>
<p><%= t("devise_views.mailer.unlock_instructions.instructions_text") %></p>
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
<p><%= link_to t("devise_views.mailer.unlock_instructions.unlock_link"), unlock_url(@resource, unlock_token: @token) %></p>

View File

@@ -1,14 +1,14 @@
<ul class="right">
<% if user_signed_in? %>
<li>
<%= link_to('Salir', destroy_user_session_path, method: :delete) %>
<%= link_to(t("devise_views.menu.login_items.logout"), destroy_user_session_path, method: :delete) %>
</li>
<% else %>
<li>
<%= link_to('Entrar', new_user_session_path) %>
<%= link_to(t("devise_views.menu.login_items.login"), new_user_session_path) %>
</li>
<li class="active">
<%= link_to('Registrarse', new_user_registration_path) %>
<%= link_to(t("devise_views.menu.login_items.signup"), new_user_registration_path) %>
</li>
<% end %>
</ul>

View File

@@ -1,24 +1,24 @@
<h2>Change your password</h2>
<h2><%= t("devise_views.passwords.edit.title") %></h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<%= f.hidden_field :reset_password_token %>
<div class="field">
<%= f.label :password, "New password" %><br />
<%= f.label :password, t("devise_views.passwords.edit.password_label") %><br />
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<em><%= t("devise_views.passwords.edit.min_length", min: @minimum_password_length) %></em>
<% end %><br />
<%= f.password_field :password, autofocus: true, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation, "Confirm new password" %><br />
<%= f.label :password_confirmation, t("devise_views.passwords.edit.password_confirmation_label") %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Change my password" %>
<%= f.submit t("devise_views.passwords.edit.change_submit") %>
</div>
<% end %>

View File

@@ -1,15 +1,15 @@
<h2>Forgot your password?</h2>
<h2><%= t("devise_views.passwords.new.title") %></h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.label :email, t("devise_views.passwords.new.email_label") %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="actions">
<%= f.submit "Send me reset password instructions" %>
<%= f.submit t("devise_views.passwords.new.send_submit") %>
</div>
<% end %>

View File

@@ -1,39 +1,39 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<h2><%= t("devise_views.registrations.edit.edit") %> <%= resource_name.to_s.humanize %></h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.label :email, t("devise_views.registrations.edit.email_label") %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<div><%= t("devise_views.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %></div>
<% end %>
<div class="field">
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
<%= f.label :password, t("devise_views.registrations.edit.password_label") %> <i><%= t("devise_views.registrations.edit.leave_blank") %></i><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.label :password_confirmation, t("devise_views.registrations.edit.password_confirmation_label") %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.label :current_password, t("devise_views.registrations.edit.current_password_label") %> <i><%= t("devise_views.registrations.edit.need_current") %></i><br />
<%= f.password_field :current_password, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Update" %>
<%= f.submit t("devise_views.registrations.edit.update_submit") %>
</div>
<% end %>
<h3>Cancel my account</h3>
<h3><%= t("devise_views.registrations.edit.cancel_title") %></h3>
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
<p><%= t("devise_views.registrations.edit.cancel_text") %> <%= button_to t("devise_views.registrations.edit.cancel_link"), registration_path(resource_name), data: { confirm: t("devise_views.registrations.edit.cancel_confirm") }, method: :delete %></p>
<%= link_to "Back", :back %>
<%= link_to t("devise_views.registrations.edit.back_link"), :back %>

View File

@@ -1,39 +1,39 @@
<h2>Sign up</h2>
<h2><%= t("devise_views.registrations.new.title") %></h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :first_name %><br />
<%= f.label :first_name, t("devise_views.registrations.new.first_name_label") %><br />
<%= f.text_field :first_name, autofocus: true %>
</div>
<div class="field">
<%= f.label :last_name %><br />
<%= f.label :last_name, t("devise_views.registrations.new.last_name_label") %><br />
<%= f.text_field :last_name %>
</div>
<div class="field">
<%= f.label :email %><br />
<%= f.label :email, t("devise_views.registrations.new.email_label") %><br />
<%= f.email_field :email %>
</div>
<div class="field">
<%= f.label :password %>
<%= f.label :password, t("devise_views.registrations.new.password_label") %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<em><%= t("devise_views.registrations.new.min_length", min: @minimum_password_length) %></em>
<% end %><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.label :password_confirmation, t("devise_views.registrations.new.password_confirmation_label") %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Registrarse", class: 'button radius' %>
<%= f.submit t("devise_views.registrations.new.submit"), class: 'button radius' %>
</div>
<% end %>

View File

@@ -1,25 +1,25 @@
<h2>Log in</h2>
<h2><%= t("devise_views.sessions.new.title") %></h2>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
<%= f.label :email %><br />
<%= f.label :email, t("devise_views.sessions.new.email_label") %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="field">
<%= f.label :password %><br />
<%= f.label :password, t("devise_views.sessions.new.password_label") %><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<% if devise_mapping.rememberable? -%>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
<%= f.label :remember_me, t("devise_views.sessions.new.remember_me") %>
</div>
<% end -%>
<div class="actions">
<%= f.submit "Entrar", class: "button radius" %>
<%= f.submit(t("devise_views.sessions.new.submit"), class: "button radius") %>
</div>
<% end %>

View File

@@ -1,25 +1,25 @@
<%- if controller_name != 'sessions' %>
<%= link_to "Log in", new_session_path(resource_name) %><br />
<%= link_to t("devise_views.shared.links.login"), new_session_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<%= link_to t("devise_views.shared.links.signup"), new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
<%= link_to t("devise_views.shared.links.new_password"), new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<%= link_to t("devise_views.shared.links.new_confirmation"), new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<%= link_to t("devise_views.shared.links.new_unlock"), new_unlock_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<%= link_to t("devise_views.shared.links.signin_with_provider", provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
<% end -%>

View File

@@ -1,15 +1,15 @@
<h2>Resend unlock instructions</h2>
<h2><%= t("devise_views.unlocks.new.title") %></h2>
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.label :email, t("devise_views.unlocks.new.email_label") %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="actions">
<%= f.submit "Resend unlock instructions" %>
<%= f.submit t("devise_views.unlocks.new.submit") %>
</div>
<% end %>

View File

@@ -3,7 +3,7 @@
<div class="row">
<div class="small-12 column">
<div class="right">
<a href="#">Portal de Transparencia</a> | <a href="#">Datos abiertos</a>
<a href="#"><%= t("layouts.header.external_link_transparency") %></a> | <a href="#"><%= t("layouts.header.external_link_opendata") %></a>
</div>
</div>
</div>
@@ -12,13 +12,13 @@
<div class="contain-to-grid">
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<li class="name">
<%= link_to root_path do %>
<%= image_tag('header-logo-madrid.png', :class => 'left', :size => '96x96') %>
gobierno<strong>abierto</strong> | <span>Participación</span>
<%= t("layouts.header.open_gov", open: "<strong>#{t('layouts.header.open')}</strong>").html_safe %> | <span><%= t("layouts.header.participation") %></span>
<% end %>
</li>
<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
<li class="toggle-topbar menu-icon"><a href="#"><span><%= t("layouts.header.menu") %></span></a></li>
</ul>
<section class="top-bar-section">
@@ -30,9 +30,9 @@
<% if home_page? %>
<div class="row">
<div class="small-12 column text-center">
<h1>Estamos abriendo Madrid</h1>
<h2>Para que todos los madrileños decidamos que ciudad queremos tener.</h2>
<%= link_to 'Participa en los últimos debates e iniciativas', new_debate_path, :class => 'button radius' %>
<h1><%= t("layouts.header.open_city") %></h1>
<h2><%= t("layouts.header.open_city_slogan") %></h2>
<%= link_to t("layouts.header.create_debate"), new_debate_path, :class => 'button radius' %>
</div>
</div>
<% end %>