Merge pull request #1296 from consul/accessibility

Accessibility
This commit is contained in:
Raimond Garcia
2016-12-20 13:14:19 +01:00
committed by GitHub
17 changed files with 84 additions and 93 deletions

View File

@@ -35,7 +35,7 @@ gem 'kaminari'
gem 'ancestry', '~> 2.2.2'
gem 'acts-as-taggable-on'
gem 'responders', '~> 2.3.0'
gem 'foundation-rails', '~> 6.2.4.0'
gem 'foundation-rails', '6.2.3.0' # Allows use responsive menu
gem 'foundation_rails_helper', '~> 2.0.0'
gem 'acts_as_votable'
gem 'ckeditor', '~> 4.2.0'

View File

@@ -160,7 +160,7 @@ GEM
i18n (~> 0.5)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
foundation-rails (6.2.4.0)
foundation-rails (6.2.3.0)
railties (>= 3.1.0)
sass (>= 3.3.0, < 3.5)
sprockets-es6 (>= 0.9.0)
@@ -477,7 +477,7 @@ DEPENDENCIES
email_spec
factory_girl_rails
faker
foundation-rails (~> 6.2.4.0)
foundation-rails (= 6.2.3.0)
foundation_rails_helper (~> 2.0.0)
fuubar
groupdate (~> 3.1.0)

View File

@@ -246,7 +246,7 @@ a {
}
}
h2 {
h2, h3 {
font-size: $base-font-size;
}
}

View File

@@ -1,6 +1,6 @@
<% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (@comment_flags[comment.id] if @comment_flags)] do %>
<div class="row">
<div id="<%= dom_id(comment) %>" class="comment small-12 column">
<ul id="<%= dom_id(comment) %>" class="comment no-bullet small-12 column">
<% if comment.hidden? || comment.user.hidden? %>
<% if comment.children.size > 0 %>
@@ -23,7 +23,7 @@
<% end %>
<% end %>
<div class="comment-body">
<li class="comment-body">
<div class="comment-info">
<% if comment.as_administrator? %>
@@ -92,14 +92,13 @@
<%= render 'comments/form', {commentable: comment.commentable, parent_id: comment.id, toggeable: true} %>
<% end %>
</div>
</div>
</li>
<% end %>
<div id="<%= dom_id(comment) %>_children" class="comment-children">
<ul id="<%= dom_id(comment) %>_children" class="no-bullet comment-children">
<% child_comments_of(comment).each do |child| %>
<%= render 'comments/comment', comment: child %>
<% end %>
</div>
</div>
</ul>
</ul>
</div>
<% end %>

View File

@@ -1,31 +1,29 @@
<% cache [locale_and_user_status, @current_order, commentable_cache_key(@debate), @comment_tree.comments, @comment_tree.comment_authors, @debate.comments_count, @comment_flags] do %>
<section class="row-full comments">
<div class="row">
<div id="comments" class="small-12 column">
<h2>
<%= t("debates.show.comments_title") %>
<span class="js-comments-count">(<%= @debate.comments_count %>)</span>
</h2>
<div class="row comments">
<div id="comments" class="small-12 column">
<h3>
<%= t("debates.show.comments_title") %>
<span class="js-comments-count">(<%= @debate.comments_count %>)</span>
</h3>
<%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>
<%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>
<% if user_signed_in? %>
<%= render 'comments/form', {commentable: @debate, parent_id: nil, toggeable: false} %>
<% else %>
<br>
<% if user_signed_in? %>
<%= render 'comments/form', {commentable: @debate, parent_id: nil, toggeable: false} %>
<% else %>
<br>
<div data-alert class="callout primary">
<%= t("debates.show.login_to_comment",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<div data-alert class="callout primary">
<%= t("debates.show.login_to_comment",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<% @comment_tree.root_comments.each do |comment| %>
<%= render 'comments/comment', comment: comment %>
<% end %>
<%= paginate @comment_tree.root_comments %>
</div>
<% @comment_tree.root_comments.each do |comment| %>
<%= render 'comments/comment', comment: comment %>
<% end %>
<%= paginate @comment_tree.root_comments %>
</div>
</section>
</div>
<% end %>

View File

@@ -1,6 +1,6 @@
<% provide :title do %><%= @debate.title %><% end %>
<% cache [locale_and_user_status(@debate), @debate, @debate.author, Flag.flagged?(current_user, @debate), @debate_votes] do %>
<section class="debate-show">
<div class="debate-show">
<div id="<%= dom_id(@debate) %>" class="row">
<div class="small-12 medium-9 column">
<%= render "shared/back_link" %>
@@ -59,7 +59,7 @@
<% end %>
</div>
</div>
</section>
</div>
<% end %>
<%= render "comments" %>

View File

@@ -16,12 +16,7 @@
<div class="top-bar-title">
<%= link_to root_path, class: "hide-for-small-only", accesskey: "/" do %>
<%= image_tag('logo_header.png', class: 'hide-for-small-only float-left', size: '80x80', alt: t("layouts.header.logo")) %>
<% if opendata_page? %>
<%= t("layouts.header.open_gov", open: "#{t('layouts.header.open')}") %> <span>|</span>
<span class="logo-site"><%= t("layouts.header.open_data") %></span>
<% else %>
<%= setting['org_name'] %>
<% end %>
<%= setting['org_name'] %>
<% end %>
</div>
@@ -34,9 +29,6 @@
<div class="show-for-small-only">
<div class="subnavigation row">
<%= render "shared/subnavigation" %>
<div class="small-12 medium-3 column">
<%= yield :header_addon %>
</div>
</div>
</div>
</div>
@@ -48,9 +40,9 @@
<div class="row">
<div class="hide-for-small-only">
<%= render "shared/subnavigation" %>
<div class="small-12 medium-3 column">
<%= yield :header_addon %>
</div>
</div>
<div class="small-12 medium-3 column">
<%= yield :header_addon %>
</div>
</div>
</div>

View File

@@ -1,26 +1,24 @@
<% cache [locale_and_user_status, @current_order, commentable_cache_key(@proposal), @comment_tree.comments, @comment_tree.comment_authors, @proposal.comments_count, @comment_flags] do %>
<section class="comments">
<div class="row">
<div id="comments" class="small-12 column">
<%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>
<div class="row comments">
<div id="comments" class="small-12 column">
<%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>
<% if user_signed_in? %>
<%= render 'comments/form', {commentable: @proposal, parent_id: nil, toggeable: false} %>
<% else %>
<br>
<% if user_signed_in? %>
<%= render 'comments/form', {commentable: @proposal, parent_id: nil, toggeable: false} %>
<% else %>
<br>
<div data-alert class="callout primary">
<%= t("proposals.show.login_to_comment",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<div data-alert class="callout primary">
<%= t("proposals.show.login_to_comment",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<% @comment_tree.root_comments.each do |comment| %>
<%= render 'comments/comment', comment: comment %>
<% end %>
<%= paginate @comment_tree.root_comments %>
</div>
<% @comment_tree.root_comments.each do |comment| %>
<%= render 'comments/comment', comment: comment %>
<% end %>
<%= paginate @comment_tree.root_comments %>
</div>
</section>
</div>
<% end %>

View File

@@ -3,18 +3,18 @@
<ul class="tabs" data-tabs id="example-tabs">
<li class="tabs-title is-active">
<%= link_to "#tab-comments" do %>
<h2>
<h3>
<%= t("proposals.show.comments_tab") %>
<span class="js-comments-count">(<%= @proposal.comments_count %>)</span>
</h2>
</h3>
<% end %>
</li>
<li class="tabs-title">
<%= link_to "#tab-notifications" do %>
<h2>
<h3>
<%= t("proposals.show.notifications_tab") %>
(<%= @notifications.count %>)
</h2>
</h3>
<% end %>
</li>
</ul>

View File

@@ -6,8 +6,7 @@
social_description: @proposal.summary %>
<% end %>
<% cache [locale_and_user_status(@proposal), @proposal, @proposal.author, Flag.flagged?(current_user, @proposal), @proposal_votes] do %>
<section class="proposal-show">
<div class="proposal-show">
<div id="<%= dom_id(@proposal) %>" class="row">
<div class="small-12 medium-9 column">
<%= render "shared/back_link" %>
@@ -134,7 +133,7 @@
</div>
</aside>
</div>
</section>
</div>
<% end %>
<div class="tabs-content" data-tabs-content="example-tabs">

View File

@@ -15,14 +15,14 @@
</div>
<div class="small-12 large-3 column">
<label><%= t("shared.advanced_search.author_type") %></label>
<label for="advanced_search_official_level"><%= t("shared.advanced_search.author_type") %></label>
<%= select_tag('advanced_search[official_level]', official_level_search_options,
include_blank: t("shared.advanced_search.author_type_blank")) %>
</div>
<div class="small-12 large-9">
<div class="small-12 large-4 column">
<label><%= t("shared.advanced_search.date") %></label>
<label for="js-advanced-search-date-min"><%= t("shared.advanced_search.date") %></label>
<%= select_tag('advanced_search[date_min]', date_range_options,
include_blank: t("shared.advanced_search.date_range_blank"),
id: 'js-advanced-search-date-min') %>
@@ -31,14 +31,18 @@
<div id='js-custom-date' class='small-12 large-8 column' style="display: none">
<div class="row">
<div class='small-12 large-6 column'>
<label><%= t("shared.advanced_search.from") %> (<%= t("shared.advanced_search.date_placeholder") %>)</label>
<label for="advanced_search_date_min">
<%= t("shared.advanced_search.from") %> (<%= t("shared.advanced_search.date_placeholder") %>)
</label>
<%= text_field_tag 'advanced_search[date_min]',
params[:advanced_search].try(:[], :date_min),
placeholder: t("shared.advanced_search.date_placeholder"),
class: 'js-calendar' %>
</div>
<div class='small-12 large-6 column'>
<label><%= t("shared.advanced_search.to") %> (<%= t("shared.advanced_search.date_placeholder") %>)</label>
<label for="advanced_search_date_max">
<%= t("shared.advanced_search.to") %> (<%= t("shared.advanced_search.date_placeholder") %>)
</label>
<%= text_field_tag 'advanced_search[date_max]',
params[:advanced_search].try(:[], :date_max),
placeholder: t("shared.advanced_search.date_placeholder"),

View File

@@ -1,9 +1,11 @@
<div class="submenu">
<ul class="no-bullet submenu">
<% valid_orders.each do |order| %>
<%= link_to current_path_with_query_params(order: order, page: 1), class: order == @current_order ? 'active' : '' do %>
<%= content_tag(order == @current_order ? :h2 : :span) do %>
<%= t("#{i18n_namespace}.orders.#{order}") %>
<li class="inline-block">
<%= link_to current_path_with_query_params(order: order, page: 1), class: order == @current_order ? 'active' : '' do %>
<%= content_tag(order == @current_order ? :h2 : :span) do %>
<%= t("#{i18n_namespace}.orders.#{order}") %>
<% end %>
<% end %>
<% end %>
</li>
<% end %>
</div>
</ul>

View File

@@ -1,7 +1,7 @@
<%- limit ||= nil %>
<% if taggable.tags.any? %>
<ul id="tags" class="no-bullet tags">
<ul id="tags_<%= dom_id(taggable) %>" class="no-bullet tags">
<% taggable.tag_list_with_limit(limit).each do |tag| %>
<li class="inline-block"><%= link_to sanitize(tag.name), send("#{taggable.class.name.underscore.pluralize}_path", search: tag.name) %></li>
<% end %>

View File

@@ -207,7 +207,6 @@ en:
open: open
open_city_slogan_html: There are cities that are governed directly by their inhabitants, who <b>discuss</b> the topics they are concerned about, <b>propose</b> ideas to improve their lives and <b>decide</b> among themselves which ones will be carried out.
open_city_title: Love the city, and it will become a city you love.
open_data: Open data
open_gov: Open government
proposals: Proposals
proposal_ballot: Voting

View File

@@ -207,7 +207,6 @@ es:
open: abierto
open_city_slogan_html: Existen ciudades gobernadas directamente por sus habitantes, que <strong>debaten</strong> sobre temas que les preocupan, <strong>proponen</strong> ideas para mejorar sus vidas y <strong>deciden</strong> entre todas y todos las que se llevan a cabo.
open_city_title: La ciudad que quieres será la ciudad que quieras.
open_data: Datos abiertos
open_gov: Gobierno %{open}
proposals: Propuestas
proposal_ballot: Votaciones

View File

@@ -232,7 +232,7 @@ feature 'Debates' do
expect(page).to have_content 'Debate created successfully.'
within "#tags" do
within "#tags_debate_#{Debate.last.id}" do
expect(page).to have_content 'Education'
expect(page).to_not have_content 'Health'
end
@@ -249,7 +249,8 @@ feature 'Debates' do
click_button 'Start a debate'
expect(page).to have_content 'Debate created successfully.'
within "#tags" do
within "#tags_debate_#{Debate.last.id}" do
expect(page).to have_content 'Refugees'
expect(page).to have_content 'Solidarity'
end

View File

@@ -333,7 +333,7 @@ feature 'Proposals' do
expect(page).to have_content 'Proposal created successfully.'
within "#tags" do
within "#tags_proposal_#{Proposal.last.id}" do
expect(page).to have_content 'Education'
expect(page).to_not have_content 'Health'
end
@@ -355,7 +355,7 @@ feature 'Proposals' do
click_button 'Create proposal'
expect(page).to have_content 'Proposal created successfully.'
within "#tags" do
within "#tags_proposal_#{Proposal.last.id}" do
expect(page).to have_content 'Refugees'
expect(page).to have_content 'Solidarity'
end