Use a <main> tag on every page
Many pages had this tag, but many other didn't, which made navigation inconsistent for people using screen readers. Note that there are slight changes in two pages: * The homepage now includes the banner and the content of the `shared/header` element inside the <main> tag * The budgets index now includes the banner inside the <main> tag I see both potential advantages and disadvantages of this approach, since banners aren't necessarily related to the main content of a page but on the other hand they aren't the same across pages and people using screen readers might accidentally skip them if they jump to the <main> tag. So I'm choosing the option that is easier to implement. Note we're adding a `public-content` class to the <main> element in the application layout. This might be redundat because the element could already be accessed through the `.public main` selector, but this is consistent with the `admin-content` class used in the admin section, and without it the <main> element would sometimes have an empty class attribute and we'd have to use `if content_for?(:main_class)` or `tag.main` which IMHO makes the code less consistent. The Capybara::DSL monkey-patch is only done on the `visit` method because it's the only reliable one. Other methods like `click_link` generate AJAX requests, so `expect(page).to have_css "main", count: 1` might be executed before the AJAX request is finished, meaning it wouldn't properly test anything.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
<main id="ballot" class="budget-ballot-show">
|
||||
<% provide :main_class, "budget-ballot-show" %>
|
||||
|
||||
<div id="ballot">
|
||||
<%= render "budgets/ballot/ballot" %>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
<main class="budget-group-show">
|
||||
<header>
|
||||
<%= back_link_to budget_path(@budget) %>
|
||||
<h1><%= t("budgets.groups.show.title") %></h1>
|
||||
</header>
|
||||
<% provide :main_class, "budget-group-show" %>
|
||||
|
||||
<div class="row margin">
|
||||
<div id="headings" class="small-12 medium-7 column select-district">
|
||||
<div class="row">
|
||||
<% @group.headings.sort_by_name.each_slice(7) do |slice| %>
|
||||
<div class="small-6 medium-4 column end">
|
||||
<% slice.each do |heading| %>
|
||||
<span id="<%= dom_id(heading) %>"
|
||||
class="<%= css_for_ballot_heading(heading) %>">
|
||||
<%= link_to heading.name, budget_investments_path(heading_id: heading.id) %>
|
||||
<br>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<header>
|
||||
<%= back_link_to budget_path(@budget) %>
|
||||
<h1><%= t("budgets.groups.show.title") %></h1>
|
||||
</header>
|
||||
|
||||
<div class="medium-5 column show-for-medium text-center">
|
||||
<%= image_tag(image_path_for("map.jpg")) %>
|
||||
<div class="row margin">
|
||||
<div id="headings" class="small-12 medium-7 column select-district">
|
||||
<div class="row">
|
||||
<% @group.headings.sort_by_name.each_slice(7) do |slice| %>
|
||||
<div class="small-6 medium-4 column end">
|
||||
<% slice.each do |heading| %>
|
||||
<span id="<%= dom_id(heading) %>"
|
||||
class="<%= css_for_ballot_heading(heading) %>">
|
||||
<%= link_to heading.name, budget_investments_path(heading_id: heading.id) %>
|
||||
<br>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="medium-5 column show-for-medium text-center">
|
||||
<%= image_tag(image_path_for("map.jpg")) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
<%= render Shared::BannerComponent.new("budgets") %>
|
||||
|
||||
<% provide :title do %><%= t("budgets.index.title") %><% end %>
|
||||
<% provide :main_class, "budgets-index" %>
|
||||
|
||||
<% content_for :canonical do %>
|
||||
<%= render "shared/canonical", href: budgets_url %>
|
||||
<% end %>
|
||||
|
||||
<main class="budgets-index">
|
||||
<% if @budget.present? %>
|
||||
<%= render Budgets::BudgetComponent.new(@budget) %>
|
||||
<% if @budget.present? %>
|
||||
<%= render Budgets::BudgetComponent.new(@budget) %>
|
||||
|
||||
<% if @finished_budgets.present? %>
|
||||
<%= render "finished", budgets: @finished_budgets %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<header>
|
||||
<h1><%= t("budgets.index.title") %></h1>
|
||||
</header>
|
||||
<% if @finished_budgets.present? %>
|
||||
<%= render "finished", budgets: @finished_budgets %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<header>
|
||||
<h1><%= t("budgets.index.title") %></h1>
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<div class="callout primary">
|
||||
<%= t("budgets.index.empty_budgets") %>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<div class="callout primary">
|
||||
<%= t("budgets.index.empty_budgets") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render Budgets::FooterComponent.new %>
|
||||
</main>
|
||||
<%= render Budgets::FooterComponent.new %>
|
||||
|
||||
@@ -15,76 +15,74 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<main id="budget-investments-main">
|
||||
<% if @search_terms || @advanced_search_terms %>
|
||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||
results: @investments,
|
||||
search_terms: @search_terms,
|
||||
advanced_search_terms: @advanced_search_terms
|
||||
) %>
|
||||
<% else %>
|
||||
<%= render "/budgets/investments/header" %>
|
||||
<% end %>
|
||||
<% if @search_terms || @advanced_search_terms %>
|
||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||
results: @investments,
|
||||
search_terms: @search_terms,
|
||||
advanced_search_terms: @advanced_search_terms
|
||||
) %>
|
||||
<% else %>
|
||||
<%= render "/budgets/investments/header" %>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<div id="budget-investments" class="budget-investments-list small-12 medium-9 column">
|
||||
<div class="row">
|
||||
<div id="budget-investments" class="budget-investments-list small-12 medium-9 column">
|
||||
|
||||
<% if @current_filter == "unfeasible" %>
|
||||
<div class="small-12 margin-bottom">
|
||||
<h2><%= t("budgets.investments.index.unfeasible") %></h2>
|
||||
<div class="callout primary margin">
|
||||
<%= t("budgets.investments.index.unfeasible_text") %>
|
||||
</div>
|
||||
<% if @current_filter == "unfeasible" %>
|
||||
<div class="small-12 margin-bottom">
|
||||
<h2><%= t("budgets.investments.index.unfeasible") %></h2>
|
||||
<div class="callout primary margin">
|
||||
<%= t("budgets.investments.index.unfeasible_text") %>
|
||||
</div>
|
||||
<% elsif @heading.present? %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "view_mode" %>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif @heading.present? %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "view_mode" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render Shared::AdvancedSearchComponent.new %>
|
||||
|
||||
<% if unfeasible_or_unselected_filter %>
|
||||
<ul class="no-bullet submenu">
|
||||
<li class="inline-block">
|
||||
<%= link_to current_path_with_query_params(order: "random", page: 1),
|
||||
class: "is-active" do %>
|
||||
<h2><%= t("budgets.investments.index.orders.random") %></h2>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
<% else %>
|
||||
<%= render("shared/order_links", i18n_namespace: "budgets.investments.index") %>
|
||||
<% end %>
|
||||
|
||||
<% if investments_default_view? %>
|
||||
|
||||
<% @investments.each do |investment| %>
|
||||
<%= render "/budgets/investments/investment",
|
||||
investment: investment,
|
||||
investment_ids: @investment_ids,
|
||||
ballot: @ballot %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
|
||||
<%= render Shared::AdvancedSearchComponent.new %>
|
||||
|
||||
<% if unfeasible_or_unselected_filter %>
|
||||
<ul class="no-bullet submenu">
|
||||
<li class="inline-block">
|
||||
<%= link_to current_path_with_query_params(order: "random", page: 1),
|
||||
class: "is-active" do %>
|
||||
<h2><%= t("budgets.investments.index.orders.random") %></h2>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
<% else %>
|
||||
<%= render("shared/order_links", i18n_namespace: "budgets.investments.index") %>
|
||||
<% @investments.each do |investment| %>
|
||||
<%= render "/budgets/investments/investment_minimal",
|
||||
investment: investment %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if investments_default_view? %>
|
||||
|
||||
<% @investments.each do |investment| %>
|
||||
<%= render "/budgets/investments/investment",
|
||||
investment: investment,
|
||||
investment_ids: @investment_ids,
|
||||
ballot: @ballot %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
|
||||
<% @investments.each do |investment| %>
|
||||
<%= render "/budgets/investments/investment_minimal",
|
||||
investment: investment %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= paginate @investments %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<aside class="margin-bottom">
|
||||
<div id="sidebar" class="budget-investments-sidebar">
|
||||
<%= render "/budgets/investments/sidebar" %>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<%= paginate @investments %>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<aside class="margin-bottom">
|
||||
<div id="sidebar" class="budget-investments-sidebar">
|
||||
<%= render "/budgets/investments/sidebar" %>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -8,80 +8,77 @@
|
||||
<%= render "shared/canonical", href: debates_url %>
|
||||
<% end %>
|
||||
|
||||
<main>
|
||||
<% if @search_terms || @advanced_search_terms %>
|
||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||
results: @debates,
|
||||
search_terms: @search_terms,
|
||||
advanced_search_terms: @advanced_search_terms
|
||||
) %>
|
||||
<% else %>
|
||||
<%= render "shared/section_header", i18n_namespace: "debates.index.section_header", image: "debates" %>
|
||||
<% end %>
|
||||
<% if @search_terms || @advanced_search_terms %>
|
||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||
results: @debates,
|
||||
search_terms: @search_terms,
|
||||
advanced_search_terms: @advanced_search_terms
|
||||
) %>
|
||||
<% else %>
|
||||
<%= render "shared/section_header", i18n_namespace: "debates.index.section_header", image: "debates" %>
|
||||
<% end %>
|
||||
|
||||
<% if feature?("user.recommendations") && @recommended_debates.present? %>
|
||||
<%= render "shared/recommended_index", recommended: @recommended_debates,
|
||||
disable_recommendations_path: recommendations_disable_debates_path,
|
||||
namespace: "debates" %>
|
||||
<% end %>
|
||||
<% if feature?("user.recommendations") && @recommended_debates.present? %>
|
||||
<%= render "shared/recommended_index", recommended: @recommended_debates,
|
||||
disable_recommendations_path: recommendations_disable_debates_path,
|
||||
namespace: "debates" %>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<div id="debates" class="debates-list small-12 medium-9 column">
|
||||
<div class="row">
|
||||
<div id="debates" class="debates-list small-12 medium-9 column">
|
||||
|
||||
<%= render Shared::BannerComponent.new("debates") %>
|
||||
<%= render Shared::BannerComponent.new("debates") %>
|
||||
|
||||
<% unless @search_terms || !has_featured? %>
|
||||
<%= render "featured_debates" %>
|
||||
<% end %>
|
||||
<% unless @search_terms || !has_featured? %>
|
||||
<%= render "featured_debates" %>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "view_mode" %>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "view_mode" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render Shared::AdvancedSearchComponent.new %>
|
||||
<%= render Shared::AdvancedSearchComponent.new %>
|
||||
|
||||
<%= render "shared/order_links", i18n_namespace: "debates.index" %>
|
||||
<%= render "shared/order_links", i18n_namespace: "debates.index" %>
|
||||
|
||||
<div class="show-for-small-only">
|
||||
<%= link_to t("debates.index.start_debate"), new_debate_path, class: "button expanded" %>
|
||||
</div>
|
||||
<div class="show-for-small-only">
|
||||
<%= link_to t("debates.index.start_debate"), new_debate_path, class: "button expanded" %>
|
||||
</div>
|
||||
|
||||
<% if @debates.any? || current_user.blank? %>
|
||||
<% if debates_default_view? %>
|
||||
<%= render @debates %>
|
||||
<% else %>
|
||||
<% @debates.each do |debate| %>
|
||||
<%= render "debates/debate_minimal", debate: debate %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @debates.any? || current_user.blank? %>
|
||||
<% if debates_default_view? %>
|
||||
<%= render @debates %>
|
||||
<% else %>
|
||||
<%= empty_recommended_debates_message_text(current_user) %>
|
||||
<% @debates.each do |debate| %>
|
||||
<%= render "debates/debate_minimal", debate: debate %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= paginate @debates %>
|
||||
|
||||
<% unless @search_terms || @advanced_search_terms %>
|
||||
<div id="section_help" class="margin" data-magellan-target="section_help">
|
||||
<p class="lead">
|
||||
<strong><%= t("debates.index.section_footer.title") %></strong>
|
||||
</p>
|
||||
<p><%= t("debates.index.section_footer.description") %></p>
|
||||
<p><%= t("debates.index.section_footer.help_text_1") %></p>
|
||||
<p><%= sanitize(t("debates.index.section_footer.help_text_2",
|
||||
org: link_to(setting["org_name"], new_user_registration_path))) %></p>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
|
||||
<aside class="margin-bottom">
|
||||
<%= link_to t("debates.index.start_debate"), new_debate_path, class: "button expanded" %>
|
||||
<%= render "shared/tag_cloud", taggable: "Debate" %>
|
||||
</aside>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= empty_recommended_debates_message_text(current_user) %>
|
||||
<% end %>
|
||||
<%= paginate @debates %>
|
||||
|
||||
<% unless @search_terms || @advanced_search_terms %>
|
||||
<div id="section_help" class="margin" data-magellan-target="section_help">
|
||||
<p class="lead">
|
||||
<strong><%= t("debates.index.section_footer.title") %></strong>
|
||||
</p>
|
||||
<p><%= t("debates.index.section_footer.description") %></p>
|
||||
<p><%= t("debates.index.section_footer.help_text_1") %></p>
|
||||
<p><%= sanitize(t("debates.index.section_footer.help_text_2",
|
||||
org: link_to(setting["org_name"], new_user_registration_path))) %></p>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
|
||||
<aside class="margin-bottom">
|
||||
<%= link_to t("debates.index.start_debate"), new_debate_path, class: "button expanded" %>
|
||||
<%= render "shared/tag_cloud", taggable: "Debate" %>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<% end %>
|
||||
</nav>
|
||||
|
||||
<div class="admin-content <%= yield(:main_class) %>">
|
||||
<main class="admin-content <%= yield(:main_class) %>">
|
||||
<%= label_tag :show_menu, t("admin.menu.admin"),
|
||||
"aria-hidden": true, class: "button hollow expanded" %>
|
||||
|
||||
|
||||
@@ -17,9 +17,11 @@
|
||||
|
||||
<div class="wrapper <%= yield(:wrapper_class) %>">
|
||||
<%= render "layouts/header", with_subnavigation: true %>
|
||||
<%= render "layouts/flash" %>
|
||||
|
||||
<%= yield %>
|
||||
<main class="public-content <%= yield(:main_class) %>">
|
||||
<%= render "layouts/flash" %>
|
||||
<%= yield %>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<%= render "dashboard/menu" %>
|
||||
</nav>
|
||||
|
||||
<div class="admin-content">
|
||||
<main class="admin-content <%= yield(:main_class) %>">
|
||||
<%= label_tag :show_menu, t("admin.menu.admin"),
|
||||
"aria-hidden": true, class: "button hollow expanded" %>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<%= render "layouts/dashboard/proposal_totals" %>
|
||||
<%= render "layouts/dashboard/proposal_header" %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
<div class="small-12 medium-9 column">
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 large-7 small-centered column">
|
||||
<div class="auth-form margin">
|
||||
<main class="auth-form margin <%= yield(:main_class) %>">
|
||||
<%= render "layouts/flash" %>
|
||||
|
||||
<%= yield %>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,123 +8,120 @@
|
||||
<%= render "shared/canonical", href: proposals_url %>
|
||||
<% end %>
|
||||
|
||||
<main>
|
||||
<% if [
|
||||
@search_terms,
|
||||
@advanced_search_terms,
|
||||
params[:retired].present?,
|
||||
params[:selected].present?
|
||||
].any? %>
|
||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||
results: @proposals,
|
||||
search_terms: @search_terms,
|
||||
advanced_search_terms: @advanced_search_terms
|
||||
) do %>
|
||||
<% if params[:retired].present? %>
|
||||
<h2><%= t("proposals.index.retired_proposals") %></h2>
|
||||
<% elsif params[:selected].present? %>
|
||||
<h2><%= t("proposals.index.selected_proposals") %></h2>
|
||||
<% end %>
|
||||
<% if [
|
||||
@search_terms,
|
||||
@advanced_search_terms,
|
||||
params[:retired].present?,
|
||||
params[:selected].present?
|
||||
].any? %>
|
||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||
results: @proposals,
|
||||
search_terms: @search_terms,
|
||||
advanced_search_terms: @advanced_search_terms
|
||||
) do %>
|
||||
<% if params[:retired].present? %>
|
||||
<h2><%= t("proposals.index.retired_proposals") %></h2>
|
||||
<% elsif params[:selected].present? %>
|
||||
<h2><%= t("proposals.index.selected_proposals") %></h2>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render "shared/section_header", i18n_namespace: "proposals.index.section_header", image: "proposals" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render "shared/section_header", i18n_namespace: "proposals.index.section_header", image: "proposals" %>
|
||||
<% end %>
|
||||
|
||||
<% if show_recommended_proposals? %>
|
||||
<%= render "shared/recommended_index", recommended: @recommended_proposals,
|
||||
disable_recommendations_path: recommendations_disable_proposals_path,
|
||||
namespace: "proposals" %>
|
||||
<% end %>
|
||||
<% if show_recommended_proposals? %>
|
||||
<%= render "shared/recommended_index", recommended: @recommended_proposals,
|
||||
disable_recommendations_path: recommendations_disable_proposals_path,
|
||||
namespace: "proposals" %>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<div id="proposals" class="proposals-list small-12 medium-9 column">
|
||||
<div class="row">
|
||||
<div id="proposals" class="proposals-list small-12 medium-9 column">
|
||||
|
||||
<%= render Shared::BannerComponent.new("proposals") %>
|
||||
<%= render Shared::BannerComponent.new("proposals") %>
|
||||
|
||||
<% if show_featured_proposals? %>
|
||||
<div id="featured-proposals" class="row featured-proposals">
|
||||
<div class="small-12 column">
|
||||
<h2>
|
||||
<%= t("proposals.index.featured_proposals") %>
|
||||
</h2>
|
||||
</div>
|
||||
<% @featured_proposals.each do |featured_proposal| %>
|
||||
<%= render "featured_proposal", proposal: featured_proposal %>
|
||||
<% end %>
|
||||
<% if show_featured_proposals? %>
|
||||
<div id="featured-proposals" class="row featured-proposals">
|
||||
<div class="small-12 column">
|
||||
<h2>
|
||||
<%= t("proposals.index.featured_proposals") %>
|
||||
</h2>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% unless params[:selected].present? %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "view_mode" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% unless params[:retired].present? || params[:selected].present? %>
|
||||
<%= render Shared::AdvancedSearchComponent.new %>
|
||||
<% end %>
|
||||
|
||||
<% unless params[:selected].present? %>
|
||||
<%= render "shared/order_links", i18n_namespace: "proposals.index" %>
|
||||
<% end %>
|
||||
|
||||
<% if @proposals.any? %>
|
||||
<div class="show-for-small-only">
|
||||
<%= link_to t("proposals.index.start_proposal"),
|
||||
new_proposal_path,
|
||||
class: "button expanded" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div id="proposals-list">
|
||||
<% if @proposals.any? || current_user.blank? %>
|
||||
<% if proposals_default_view? %>
|
||||
<%= render partial: "proposals/proposal", collection: @proposals %>
|
||||
<% else %>
|
||||
<% @proposals.each do |proposal| %>
|
||||
<%= render "/proposals/proposal_minimal", proposal: proposal %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= empty_recommended_proposals_message_text(current_user) %>
|
||||
<% end %>
|
||||
<%= paginate @proposals %>
|
||||
|
||||
<% unless @search_terms || @advanced_search_terms %>
|
||||
<div id="section_help" class="margin" data-magellan-target="section_help">
|
||||
<p class="lead">
|
||||
<strong><%= t("proposals.index.section_footer.title") %></strong>
|
||||
</p>
|
||||
<p><%= t("proposals.index.section_footer.description") %></p>
|
||||
</div>
|
||||
<% @featured_proposals.each do |featured_proposal| %>
|
||||
<%= render "featured_proposal", proposal: featured_proposal %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<aside class="margin-bottom">
|
||||
<% unless params[:selected].present? %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "view_mode" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% unless params[:retired].present? || params[:selected].present? %>
|
||||
<%= render Shared::AdvancedSearchComponent.new %>
|
||||
<% end %>
|
||||
|
||||
<% unless params[:selected].present? %>
|
||||
<%= render "shared/order_links", i18n_namespace: "proposals.index" %>
|
||||
<% end %>
|
||||
|
||||
<% if @proposals.any? %>
|
||||
<div class="show-for-small-only">
|
||||
<%= link_to t("proposals.index.start_proposal"),
|
||||
new_proposal_path,
|
||||
class: "button expanded" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="sidebar-divider"></div>
|
||||
<h2 class="sidebar-title"><%= t("proposals.index.selected_proposals") %></h2>
|
||||
<br>
|
||||
<p class="small">
|
||||
<%= link_to t("proposals.index.selected_proposals_link"), proposals_path(selected: "all") %>
|
||||
</p>
|
||||
|
||||
<% if params[:retired].blank? %>
|
||||
<%= render "categories" %>
|
||||
<%= render "shared/tag_cloud", taggable: "Proposal" %>
|
||||
<%= render Proposals::GeozonesComponent.new %>
|
||||
<div id="proposals-list">
|
||||
<% if @proposals.any? || current_user.blank? %>
|
||||
<% if proposals_default_view? %>
|
||||
<%= render partial: "proposals/proposal", collection: @proposals %>
|
||||
<% else %>
|
||||
<% @proposals.each do |proposal| %>
|
||||
<%= render "/proposals/proposal_minimal", proposal: proposal %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render "retired" %>
|
||||
<%= render "proposals_lists" %>
|
||||
</aside>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= empty_recommended_proposals_message_text(current_user) %>
|
||||
<% end %>
|
||||
<%= paginate @proposals %>
|
||||
|
||||
<% unless @search_terms || @advanced_search_terms %>
|
||||
<div id="section_help" class="margin" data-magellan-target="section_help">
|
||||
<p class="lead">
|
||||
<strong><%= t("proposals.index.section_footer.title") %></strong>
|
||||
</p>
|
||||
<p><%= t("proposals.index.section_footer.description") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<aside class="margin-bottom">
|
||||
<%= link_to t("proposals.index.start_proposal"),
|
||||
new_proposal_path,
|
||||
class: "button expanded" %>
|
||||
|
||||
<div class="sidebar-divider"></div>
|
||||
<h2 class="sidebar-title"><%= t("proposals.index.selected_proposals") %></h2>
|
||||
<br>
|
||||
<p class="small">
|
||||
<%= link_to t("proposals.index.selected_proposals_link"), proposals_path(selected: "all") %>
|
||||
</p>
|
||||
|
||||
<% if params[:retired].blank? %>
|
||||
<%= render "categories" %>
|
||||
<%= render "shared/tag_cloud", taggable: "Proposal" %>
|
||||
<%= render Proposals::GeozonesComponent.new %>
|
||||
<% end %>
|
||||
<%= render "retired" %>
|
||||
<%= render "proposals_lists" %>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,53 +1,51 @@
|
||||
<main>
|
||||
<div class="row proposals-summary">
|
||||
<div id="proposals" class="proposals-list small-12 medium-9 column">
|
||||
<%= back_link_to %>
|
||||
<div class="row proposals-summary">
|
||||
<div id="proposals" class="proposals-list small-12 medium-9 column">
|
||||
<%= back_link_to %>
|
||||
|
||||
<% @proposals.each do |group_name, proposals| %>
|
||||
<div id="<%= group_name.parameterize %>">
|
||||
<h2 class="margin-top"><%= group_name %></h2>
|
||||
<% @proposals.each do |group_name, proposals| %>
|
||||
<div id="<%= group_name.parameterize %>">
|
||||
<h2 class="margin-top"><%= group_name %></h2>
|
||||
|
||||
<% proposals[0..2].each do |proposal| %>
|
||||
<div class="proposal clear">
|
||||
<div class="panel">
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<div class="proposal-contenta">
|
||||
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
|
||||
<% proposals[0..2].each do |proposal| %>
|
||||
<div class="proposal clear">
|
||||
<div class="panel">
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<div class="proposal-contenta">
|
||||
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
|
||||
|
||||
<p class="proposal-info">
|
||||
<% if proposal.author.hidden? || proposal.author.erased? %>
|
||||
<span class="author"><%= t("proposals.show.author_deleted") %></span>
|
||||
<% else %>
|
||||
<span class="author"><%= proposal.author.name %></span>
|
||||
<% if proposal.author.display_official_position_badge? %>
|
||||
<span class="label round level-<%= proposal.author.official_level %>">
|
||||
<%= proposal.author.official_position %>
|
||||
</span>
|
||||
<% end %>
|
||||
<p class="proposal-info">
|
||||
<% if proposal.author.hidden? || proposal.author.erased? %>
|
||||
<span class="author"><%= t("proposals.show.author_deleted") %></span>
|
||||
<% else %>
|
||||
<span class="author"><%= proposal.author.name %></span>
|
||||
<% if proposal.author.display_official_position_badge? %>
|
||||
<span class="label round level-<%= proposal.author.official_level %>">
|
||||
<%= proposal.author.official_position %>
|
||||
</span>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<div class="proposal-description">
|
||||
<p><%= proposal.summary %></p>
|
||||
</div>
|
||||
<div class="proposal-description">
|
||||
<p><%= proposal.summary %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<aside class="sidebar">
|
||||
<%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: "button radius expand" %>
|
||||
<%= render "shared/tag_cloud", taggable: "Proposal" %>
|
||||
<%= render "categories" %>
|
||||
<%= render Proposals::GeozonesComponent.new %>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<aside class="sidebar">
|
||||
<%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: "button radius expand" %>
|
||||
<%= render "shared/tag_cloud", taggable: "Proposal" %>
|
||||
<%= render "categories" %>
|
||||
<%= render Proposals::GeozonesComponent.new %>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<main class="topic-edit">
|
||||
<%= back_link_to community_path(@community) %>
|
||||
<% provide :main_class, "topic-edit" %>
|
||||
|
||||
<h1><%= t("community.topic.edit") %></h1>
|
||||
<%= back_link_to community_path(@community) %>
|
||||
|
||||
<%= render "form" %>
|
||||
</main>
|
||||
<h1><%= t("community.topic.edit") %></h1>
|
||||
|
||||
<%= render "form" %>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<main class="topic-new">
|
||||
<%= back_link_to community_path(@community) %>
|
||||
<% provide :main_class, "topic-new" %>
|
||||
|
||||
<h1><%= t("community.topic.create") %></h1>
|
||||
<%= back_link_to community_path(@community) %>
|
||||
|
||||
<aside>
|
||||
<h2><%= t("community.topic.sidebar.recommendations_title") %></h2>
|
||||
<h1><%= t("community.topic.create") %></h1>
|
||||
|
||||
<ul class="recommendations">
|
||||
<li><%= t("community.topic.sidebar.recommendation_one") %></li>
|
||||
<li><%= t("community.topic.sidebar.recommendation_two") %></li>
|
||||
<li><%= t("community.topic.sidebar.recommendation_three") %></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<aside>
|
||||
<h2><%= t("community.topic.sidebar.recommendations_title") %></h2>
|
||||
|
||||
<%= render "form" %>
|
||||
</main>
|
||||
<ul class="recommendations">
|
||||
<li><%= t("community.topic.sidebar.recommendation_one") %></li>
|
||||
<li><%= t("community.topic.sidebar.recommendation_two") %></li>
|
||||
<li><%= t("community.topic.sidebar.recommendation_three") %></li>
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<%= render "form" %>
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
<main>
|
||||
<div class="activity row margin-top">
|
||||
<div class="small-12 column">
|
||||
<div class="activity row margin-top">
|
||||
<div class="small-12 column">
|
||||
|
||||
<% if @user != current_user %>
|
||||
<% if @user.email_on_direct_message? %>
|
||||
<%= link_to t("users.show.send_private_message"),
|
||||
new_user_direct_message_path(@user),
|
||||
class: "button hollow float-right" %>
|
||||
<% else %>
|
||||
<div class="callout primary float-right">
|
||||
<%= t("users.show.no_private_messages") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @user != current_user %>
|
||||
<% if @user.email_on_direct_message? %>
|
||||
<%= link_to t("users.show.send_private_message"),
|
||||
new_user_direct_message_path(@user),
|
||||
class: "button hollow float-right" %>
|
||||
<% else %>
|
||||
<div class="callout primary float-right">
|
||||
<%= t("users.show.no_private_messages") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<h2 class="inline-block">
|
||||
<%= render Shared::AvatarComponent.new(@user, size: 60) %>
|
||||
<%= @user.name %>
|
||||
<% if current_user&.administrator? %>
|
||||
<small><%= @user.email %></small>
|
||||
<% end %>
|
||||
</h2>
|
||||
<h2 class="inline-block">
|
||||
<%= render Shared::AvatarComponent.new(@user, size: 60) %>
|
||||
<%= @user.name %>
|
||||
<% if current_user&.administrator? %>
|
||||
<small><%= @user.email %></small>
|
||||
<% end %>
|
||||
</h2>
|
||||
|
||||
<%= render Users::PublicActivityComponent.new(@user) %>
|
||||
</div>
|
||||
<%= render Users::PublicActivityComponent.new(@user) %>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -13,28 +13,26 @@
|
||||
|
||||
<%= render "shared/header", header: @header %>
|
||||
|
||||
<main>
|
||||
<%= render "feeds" %>
|
||||
<%= render "feeds" %>
|
||||
|
||||
<div class="row">
|
||||
<% if @cards.any? %>
|
||||
<div class="small-12 column <%= "large-8" if feed_processes_enabled? %>">
|
||||
<h2 class="title"><%= t("welcome.cards.title") %></h2>
|
||||
<div class="row">
|
||||
<% if @cards.any? %>
|
||||
<div class="small-12 column <%= "large-8" if feed_processes_enabled? %>">
|
||||
<h2 class="title"><%= t("welcome.cards.title") %></h2>
|
||||
|
||||
<%= render "shared/cards", cards: @cards %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if feed_processes_enabled? %>
|
||||
<div class="small-12 large-4 column">
|
||||
<%= render "processes" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if feature?("user.recommendations") && (@recommended_debates.present? || @recommended_proposals.present?) %>
|
||||
<%= render "recommended",
|
||||
recommended_debates: @recommended_debates,
|
||||
recommended_proposals: @recommended_proposals %>
|
||||
<%= render "shared/cards", cards: @cards %>
|
||||
</div>
|
||||
<% end %>
|
||||
</main>
|
||||
|
||||
<% if feed_processes_enabled? %>
|
||||
<div class="small-12 large-4 column">
|
||||
<%= render "processes" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if feature?("user.recommendations") && (@recommended_debates.present? || @recommended_proposals.present?) %>
|
||||
<%= render "recommended",
|
||||
recommended_debates: @recommended_debates,
|
||||
recommended_proposals: @recommended_proposals %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user