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,24 +1,24 @@
|
|||||||
<main class="admin-budgets-show">
|
<% provide :main_class, "admin-budgets-show" %>
|
||||||
<%= back_link_to admin_budgets_path %>
|
|
||||||
|
|
||||||
<%= header %>
|
<%= back_link_to admin_budgets_path %>
|
||||||
|
|
||||||
<%= render Admin::Budgets::DraftingComponent.new(budget) %>
|
<%= header %>
|
||||||
<%= render Admin::Budgets::LinksComponent.new(budget) %>
|
|
||||||
|
|
||||||
<section class="groups-and-headings" aria-labelledby="groups_and_headings_header">
|
<%= render Admin::Budgets::DraftingComponent.new(budget) %>
|
||||||
<h3 id="groups_and_headings_header"><%= t("admin.budgets.show.groups_and_headings") %></h3>
|
<%= render Admin::Budgets::LinksComponent.new(budget) %>
|
||||||
<%= render Admin::Budgets::GroupsAndHeadingsComponent.new(budget) %>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="phases" aria-labelledby="phases_header">
|
<section class="groups-and-headings" aria-labelledby="groups_and_headings_header">
|
||||||
<h3 id="phases_header"><%= t("admin.budgets.edit.phases_caption") %></h3>
|
<h3 id="groups_and_headings_header"><%= t("admin.budgets.show.groups_and_headings") %></h3>
|
||||||
<span class="help-text"><%= t("admin.budgets.edit.phases_table_help_text") %></span>
|
<%= render Admin::Budgets::GroupsAndHeadingsComponent.new(budget) %>
|
||||||
<%= render Admin::BudgetPhases::PhasesComponent.new(budget) %>
|
</section>
|
||||||
</section>
|
|
||||||
|
|
||||||
<section aria-labelledby="actions_header">
|
<section class="phases" aria-labelledby="phases_header">
|
||||||
<h3 id="actions_header"><%= t("admin.budgets.edit.actions") %></h3>
|
<h3 id="phases_header"><%= t("admin.budgets.edit.phases_caption") %></h3>
|
||||||
<%= render Admin::Budgets::ActionsComponent.new(budget) %>
|
<span class="help-text"><%= t("admin.budgets.edit.phases_table_help_text") %></span>
|
||||||
</section>
|
<%= render Admin::BudgetPhases::PhasesComponent.new(budget) %>
|
||||||
</main>
|
</section>
|
||||||
|
|
||||||
|
<section aria-labelledby="actions_header">
|
||||||
|
<h3 id="actions_header"><%= t("admin.budgets.edit.actions") %></h3>
|
||||||
|
<%= render Admin::Budgets::ActionsComponent.new(budget) %>
|
||||||
|
</section>
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<main class="admin-budgets-wizard-headings-index">
|
<% provide :main_class, "admin-budgets-wizard-headings-index" %>
|
||||||
<%= back_link_to admin_budgets_wizard_budget_groups_path(budget, url_params), back_link_text %>
|
|
||||||
|
|
||||||
<%= header %>
|
<%= back_link_to admin_budgets_wizard_budget_groups_path(budget, url_params), back_link_text %>
|
||||||
|
|
||||||
<%= render Admin::Budgets::HelpComponent.new("headings") %>
|
<%= header %>
|
||||||
<%= render Admin::BudgetsWizard::CreationTimelineComponent.new("headings") %>
|
|
||||||
|
|
||||||
<% unless single_heading? %>
|
<%= render Admin::Budgets::HelpComponent.new("headings") %>
|
||||||
<%= render Admin::BudgetsWizard::Headings::GroupSwitcherComponent.new(group) %>
|
<%= render Admin::BudgetsWizard::CreationTimelineComponent.new("headings") %>
|
||||||
<%= render Admin::BudgetHeadings::HeadingsComponent.new(headings) %>
|
|
||||||
<% end %>
|
<% unless single_heading? %>
|
||||||
<%= render Admin::BudgetsWizard::Headings::CreationStepComponent.new(new_heading) %>
|
<%= render Admin::BudgetsWizard::Headings::GroupSwitcherComponent.new(group) %>
|
||||||
</main>
|
<%= render Admin::BudgetHeadings::HeadingsComponent.new(headings) %>
|
||||||
|
<% end %>
|
||||||
|
<%= render Admin::BudgetsWizard::Headings::CreationStepComponent.new(new_heading) %>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
<% provide :main_class, "budget-groups-index" %>
|
||||||
|
|
||||||
<% content_for :canonical do %>
|
<% content_for :canonical do %>
|
||||||
<%= render "shared/canonical", href: budget_groups_url %>
|
<%= render "shared/canonical", href: budget_groups_url %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<main class="budget-groups-index">
|
<%= header(before: back_link_to(budget_path(budget))) %>
|
||||||
<%= header(before: back_link_to(budget_path(budget))) %>
|
<%= render Budgets::GroupsAndHeadingsComponent.new(budget) %>
|
||||||
<%= render Budgets::GroupsAndHeadingsComponent.new(budget) %>
|
|
||||||
</main>
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<main class="budget-investment-new">
|
<% provide :main_class, "budget-investment-new" %>
|
||||||
<%= back_link_to budgets_path %>
|
|
||||||
|
|
||||||
<%= header %>
|
<%= back_link_to budgets_path %>
|
||||||
|
|
||||||
<%= render "/budgets/investments/form", form_url: budget_investments_path(budget) %>
|
<%= header %>
|
||||||
</main>
|
|
||||||
|
<%= render "/budgets/investments/form", form_url: budget_investments_path(budget) %>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
<main class="debate-new">
|
<% provide :main_class, "debate-new" %>
|
||||||
<%= back_link_to debates_path, t("debates.index.section_header.title") %>
|
|
||||||
|
|
||||||
<%= header do %>
|
<%= back_link_to debates_path, t("debates.index.section_header.title") %>
|
||||||
<%= new_window_link_to t("debates.new.more_info"), help_path(anchor: "debates") %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<aside>
|
<%= header do %>
|
||||||
<h2><%= t("debates.new.recommendations_title") %></h2>
|
<%= new_window_link_to t("debates.new.more_info"), help_path(anchor: "debates") %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<ul class="recommendations">
|
<aside>
|
||||||
<li><%= t("debates.new.recommendation_one") %></li>
|
<h2><%= t("debates.new.recommendations_title") %></h2>
|
||||||
<li><%= t("debates.new.recommendation_two") %></li>
|
|
||||||
<li><%= t("debates.new.recommendation_three") %></li>
|
|
||||||
<li><%= t("debates.new.recommendation_four") %></li>
|
|
||||||
</ul>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<%= render Debates::FormComponent.new(debate) %>
|
<ul class="recommendations">
|
||||||
</main>
|
<li><%= t("debates.new.recommendation_one") %></li>
|
||||||
|
<li><%= t("debates.new.recommendation_two") %></li>
|
||||||
|
<li><%= t("debates.new.recommendation_three") %></li>
|
||||||
|
<li><%= t("debates.new.recommendation_four") %></li>
|
||||||
|
</ul>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<%= render Debates::FormComponent.new(debate) %>
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
<main class="moderation-users-index">
|
<% provide :main_class, "moderation-users-index" %>
|
||||||
<h2><%= t("moderation.users.index.title") %></h2>
|
|
||||||
|
|
||||||
<%= render Admin::SearchComponent.new(label: t("moderation.users.index.search_placeholder")) %>
|
<h2><%= t("moderation.users.index.title") %></h2>
|
||||||
|
|
||||||
<% if users.present? %>
|
<%= render Admin::SearchComponent.new(label: t("moderation.users.index.search_placeholder")) %>
|
||||||
<h3><%= page_entries_info users %></h3>
|
|
||||||
|
|
||||||
<table id="moderation_users" class="moderation-users">
|
<% if users.present? %>
|
||||||
<thead>
|
<h3><%= page_entries_info users %></h3>
|
||||||
<th><%= t("admin.hidden_users.index.user") %></th>
|
|
||||||
<th><%= t("admin.actions.actions") %></th>
|
<table id="moderation_users" class="moderation-users">
|
||||||
</thead>
|
<thead>
|
||||||
<tbody>
|
<th><%= t("admin.hidden_users.index.user") %></th>
|
||||||
<% users.each do |user| %>
|
<th><%= t("admin.actions.actions") %></th>
|
||||||
<tr>
|
</thead>
|
||||||
<td>
|
<tbody>
|
||||||
<%= user.name %>
|
<% users.each do |user| %>
|
||||||
</td>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<% if user.hidden? %>
|
<%= user.name %>
|
||||||
<%= status(user) %>
|
</td>
|
||||||
<% else %>
|
<td>
|
||||||
<%= render Admin::TableActionsComponent.new(user, actions: []) do |actions| %>
|
<% if user.hidden? %>
|
||||||
<%= actions.action(
|
<%= status(user) %>
|
||||||
:hide,
|
<% else %>
|
||||||
text: t("moderation.users.index.hide"),
|
<%= render Admin::TableActionsComponent.new(user, actions: []) do |actions| %>
|
||||||
confirm: ->(name) { t("moderation.users.index.confirm_hide", name: name) },
|
<%= actions.action(
|
||||||
method: :put
|
:hide,
|
||||||
) %>
|
text: t("moderation.users.index.hide"),
|
||||||
<%= actions.action(
|
confirm: ->(name) { t("moderation.users.index.confirm_hide", name: name) },
|
||||||
:block,
|
method: :put
|
||||||
text: t("moderation.users.index.block"),
|
) %>
|
||||||
confirm: ->(name) { t("moderation.users.index.confirm_block", name: name) },
|
<%= actions.action(
|
||||||
method: :put
|
:block,
|
||||||
) %>
|
text: t("moderation.users.index.block"),
|
||||||
<% end %>
|
confirm: ->(name) { t("moderation.users.index.confirm_block", name: name) },
|
||||||
|
method: :put
|
||||||
|
) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
<% end %>
|
||||||
</tr>
|
</td>
|
||||||
<% end %>
|
</tr>
|
||||||
</tbody>
|
<% end %>
|
||||||
</table>
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<%= paginate users %>
|
<%= paginate users %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</main>
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<main class="proposal-new">
|
<% provide :main_class, "proposal-new" %>
|
||||||
<%= back_link_to proposals_path, t("proposals.index.section_header.title") %>
|
|
||||||
|
|
||||||
<%= header do %>
|
<%= back_link_to proposals_path, t("proposals.index.section_header.title") %>
|
||||||
<%= new_window_link_to t("proposals.new.more_info"), help_path(anchor: "proposals") %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<aside>
|
<%= header do %>
|
||||||
<h2><%= t("proposals.new.recommendations_title") %></h2>
|
<%= new_window_link_to t("proposals.new.more_info"), help_path(anchor: "proposals") %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<ul class="recommendations">
|
<aside>
|
||||||
<li><%= t("proposals.new.recommendation_one") %></li>
|
<h2><%= t("proposals.new.recommendations_title") %></h2>
|
||||||
<li><%= t("proposals.new.recommendation_two") %></li>
|
|
||||||
<li><%= t("proposals.new.recommendation_three") %></li>
|
|
||||||
</ul>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<%= render Proposals::FormComponent.new(proposal, url: proposals_path) %>
|
<ul class="recommendations">
|
||||||
</main>
|
<li><%= t("proposals.new.recommendation_one") %></li>
|
||||||
|
<li><%= t("proposals.new.recommendation_two") %></li>
|
||||||
|
<li><%= t("proposals.new.recommendation_three") %></li>
|
||||||
|
</ul>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<%= render Proposals::FormComponent.new(proposal, url: proposals_path) %>
|
||||||
|
|||||||
@@ -1,25 +1,24 @@
|
|||||||
<% provide(:title) { title } %>
|
<% provide(:title) { title } %>
|
||||||
|
<% provide :main_class, "sdg-goals-index" %>
|
||||||
|
|
||||||
<main class="sdg-goals-index">
|
<% if header.present? %>
|
||||||
<% if header.present? %>
|
<%= render "shared/header", header: header %>
|
||||||
<%= render "shared/header", header: header %>
|
<% else %>
|
||||||
<% else %>
|
<header class="section-header">
|
||||||
<header class="section-header">
|
<h1><%= title %></h1>
|
||||||
<h1><%= title %></h1>
|
</header>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= render Shared::BannerComponent.new("sdg") %>
|
||||||
|
|
||||||
|
<%= link_list(*goal_links, class: "sdg-goal-list") %>
|
||||||
|
|
||||||
|
<% phases.each do |phase| %>
|
||||||
|
<section class="sdg-phase" id="sdg_phase_<%= phase.kind %>">
|
||||||
|
<header>
|
||||||
|
<h2 class="title"><%= phase.title %></h2>
|
||||||
</header>
|
</header>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= render Shared::BannerComponent.new("sdg") %>
|
<%= render "shared/cards", cards: phase.cards.sort_by_order %>
|
||||||
|
</section>
|
||||||
<%= link_list(*goal_links, class: "sdg-goal-list") %>
|
<% end %>
|
||||||
|
|
||||||
<% phases.each do |phase| %>
|
|
||||||
<section class="sdg-phase" id="sdg_phase_<%= phase.kind %>">
|
|
||||||
<header>
|
|
||||||
<h2 class="title"><%= phase.title %></h2>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<%= render "shared/cards", cards: phase.cards.sort_by_order %>
|
|
||||||
</section>
|
|
||||||
<% end %>
|
|
||||||
</main>
|
|
||||||
|
|||||||
@@ -1,39 +1,38 @@
|
|||||||
<% provide(:title) { goal.title } %>
|
<% provide(:title) { goal.title } %>
|
||||||
|
<% provide :main_class, "sdg-goal-show" %>
|
||||||
|
|
||||||
<main class="sdg-goal-show">
|
<%= back_link_to sdg_goals_path %>
|
||||||
<%= back_link_to sdg_goals_path %>
|
|
||||||
|
|
||||||
<article class="sdg-goal sdg-goal-<%= code %>">
|
<article class="sdg-goal sdg-goal-<%= code %>">
|
||||||
<header>
|
<header>
|
||||||
<h1><%= heading %></h1>
|
<h1><%= heading %></h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="goal-description-content">
|
<div class="goal-description-content">
|
||||||
<div id="description_goal_<%= goal.code %>" class="goal-description short" data-toggler="short">
|
<div id="description_goal_<%= goal.code %>" class="goal-description short" data-toggler="short">
|
||||||
<%= long_description %>
|
<%= long_description %>
|
||||||
</div>
|
|
||||||
<div class="read-more">
|
|
||||||
<button type="button" id="read_more_goal_<%= goal.code %>"
|
|
||||||
data-toggle="description_goal_<%= goal.code %> read_more_goal_<%= goal.code %> read_less_goal_<%= goal.code %>"
|
|
||||||
data-toggler="hide">
|
|
||||||
<%= t("sdg.goals.show.read_more", goal: goal.title) %>
|
|
||||||
</button>
|
|
||||||
<button type="button" id="read_less_goal_<%= goal.code %>"
|
|
||||||
data-toggle="description_goal_<%= goal.code %> read_more_goal_<%= goal.code %> read_less_goal_<%= goal.code %>"
|
|
||||||
data-toggler="hide"
|
|
||||||
class="hide">
|
|
||||||
<%= t("sdg.goals.show.read_less", goal: goal.title) %>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</article>
|
<div class="read-more">
|
||||||
|
<button type="button" id="read_more_goal_<%= goal.code %>"
|
||||||
<%= render ::Widget::Feeds::ParticipationComponent.new(feeds) %>
|
data-toggle="description_goal_<%= goal.code %> read_more_goal_<%= goal.code %> read_less_goal_<%= goal.code %>"
|
||||||
|
data-toggler="hide">
|
||||||
<% if processes_feed %>
|
<%= t("sdg.goals.show.read_more", goal: goal.title) %>
|
||||||
<div class="feeds-list">
|
</button>
|
||||||
<%= render ::Widget::Feeds::FeedComponent.new(processes_feed) %>
|
<button type="button" id="read_less_goal_<%= goal.code %>"
|
||||||
|
data-toggle="description_goal_<%= goal.code %> read_more_goal_<%= goal.code %> read_less_goal_<%= goal.code %>"
|
||||||
|
data-toggler="hide"
|
||||||
|
class="hide">
|
||||||
|
<%= t("sdg.goals.show.read_less", goal: goal.title) %>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
<%= render SDG::Goals::TargetsComponent.new(goal) %>
|
<%= render ::Widget::Feeds::ParticipationComponent.new(feeds) %>
|
||||||
</main>
|
|
||||||
|
<% if processes_feed %>
|
||||||
|
<div class="feeds-list">
|
||||||
|
<%= render ::Widget::Feeds::FeedComponent.new(processes_feed) %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= render SDG::Goals::TargetsComponent.new(goal) %>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<main class="subscriptions-edit">
|
<% provide :main_class, "subscriptions-edit" %>
|
||||||
<%= form_for user, url: subscriptions_path(token: user.subscriptions_token) do |f| %>
|
|
||||||
<h2><%= t("account.show.notifications") %></h2>
|
|
||||||
|
|
||||||
<div><%= f.check_box :email_on_comment %></div>
|
<%= form_for user, url: subscriptions_path(token: user.subscriptions_token) do |f| %>
|
||||||
<div><%= f.check_box :email_on_comment_reply %></div>
|
<h2><%= t("account.show.notifications") %></h2>
|
||||||
<div><%= f.check_box :newsletter %></div>
|
|
||||||
<div><%= f.check_box :email_digest %></div>
|
|
||||||
<div><%= f.check_box :email_on_direct_message %></div>
|
|
||||||
|
|
||||||
<%= f.submit t("account.show.save_changes_submit"), class: "button margin-top" %>
|
<div><%= f.check_box :email_on_comment %></div>
|
||||||
<% end %>
|
<div><%= f.check_box :email_on_comment_reply %></div>
|
||||||
</main>
|
<div><%= f.check_box :newsletter %></div>
|
||||||
|
<div><%= f.check_box :email_digest %></div>
|
||||||
|
<div><%= f.check_box :email_on_direct_message %></div>
|
||||||
|
|
||||||
|
<%= f.submit t("account.show.save_changes_submit"), class: "button margin-top" %>
|
||||||
|
<% end %>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
<main id="ballot" class="budget-ballot-show">
|
<% provide :main_class, "budget-ballot-show" %>
|
||||||
|
|
||||||
|
<div id="ballot">
|
||||||
<%= render "budgets/ballot/ballot" %>
|
<%= render "budgets/ballot/ballot" %>
|
||||||
</main>
|
</div>
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<main class="budget-group-show">
|
<% provide :main_class, "budget-group-show" %>
|
||||||
<header>
|
|
||||||
<%= back_link_to budget_path(@budget) %>
|
|
||||||
<h1><%= t("budgets.groups.show.title") %></h1>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="row margin">
|
<header>
|
||||||
<div id="headings" class="small-12 medium-7 column select-district">
|
<%= back_link_to budget_path(@budget) %>
|
||||||
<div class="row">
|
<h1><%= t("budgets.groups.show.title") %></h1>
|
||||||
<% @group.headings.sort_by_name.each_slice(7) do |slice| %>
|
</header>
|
||||||
<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>
|
|
||||||
|
|
||||||
<div class="medium-5 column show-for-medium text-center">
|
<div class="row margin">
|
||||||
<%= image_tag(image_path_for("map.jpg")) %>
|
<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>
|
||||||
</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") %>
|
<%= render Shared::BannerComponent.new("budgets") %>
|
||||||
|
|
||||||
<% provide :title do %><%= t("budgets.index.title") %><% end %>
|
<% provide :title do %><%= t("budgets.index.title") %><% end %>
|
||||||
|
<% provide :main_class, "budgets-index" %>
|
||||||
|
|
||||||
<% content_for :canonical do %>
|
<% content_for :canonical do %>
|
||||||
<%= render "shared/canonical", href: budgets_url %>
|
<%= render "shared/canonical", href: budgets_url %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<main class="budgets-index">
|
<% if @budget.present? %>
|
||||||
<% if @budget.present? %>
|
<%= render Budgets::BudgetComponent.new(@budget) %>
|
||||||
<%= render Budgets::BudgetComponent.new(@budget) %>
|
|
||||||
|
|
||||||
<% if @finished_budgets.present? %>
|
<% if @finished_budgets.present? %>
|
||||||
<%= render "finished", budgets: @finished_budgets %>
|
<%= render "finished", budgets: @finished_budgets %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<header>
|
<header>
|
||||||
<h1><%= t("budgets.index.title") %></h1>
|
<h1><%= t("budgets.index.title") %></h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<div class="callout primary">
|
<div class="callout primary">
|
||||||
<%= t("budgets.index.empty_budgets") %>
|
<%= t("budgets.index.empty_budgets") %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= render Budgets::FooterComponent.new %>
|
<%= render Budgets::FooterComponent.new %>
|
||||||
</main>
|
|
||||||
|
|||||||
@@ -15,76 +15,74 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<main id="budget-investments-main">
|
<% if @search_terms || @advanced_search_terms %>
|
||||||
<% if @search_terms || @advanced_search_terms %>
|
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
results: @investments,
|
||||||
results: @investments,
|
search_terms: @search_terms,
|
||||||
search_terms: @search_terms,
|
advanced_search_terms: @advanced_search_terms
|
||||||
advanced_search_terms: @advanced_search_terms
|
) %>
|
||||||
) %>
|
<% else %>
|
||||||
<% else %>
|
<%= render "/budgets/investments/header" %>
|
||||||
<%= render "/budgets/investments/header" %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="budget-investments" class="budget-investments-list small-12 medium-9 column">
|
<div id="budget-investments" class="budget-investments-list small-12 medium-9 column">
|
||||||
|
|
||||||
<% if @current_filter == "unfeasible" %>
|
<% if @current_filter == "unfeasible" %>
|
||||||
<div class="small-12 margin-bottom">
|
<div class="small-12 margin-bottom">
|
||||||
<h2><%= t("budgets.investments.index.unfeasible") %></h2>
|
<h2><%= t("budgets.investments.index.unfeasible") %></h2>
|
||||||
<div class="callout primary margin">
|
<div class="callout primary margin">
|
||||||
<%= t("budgets.investments.index.unfeasible_text") %>
|
<%= t("budgets.investments.index.unfeasible_text") %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<% elsif @heading.present? %>
|
</div>
|
||||||
<div class="row">
|
<% elsif @heading.present? %>
|
||||||
<div class="small-12 column">
|
<div class="row">
|
||||||
<%= render "view_mode" %>
|
<div class="small-12 column">
|
||||||
</div>
|
<%= render "view_mode" %>
|
||||||
</div>
|
</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 %>
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
|
||||||
<%= render Shared::AdvancedSearchComponent.new %>
|
<% @investments.each do |investment| %>
|
||||||
|
<%= render "/budgets/investments/investment_minimal",
|
||||||
<% if unfeasible_or_unselected_filter %>
|
investment: investment %>
|
||||||
<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 %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if investments_default_view? %>
|
<%= paginate @investments %>
|
||||||
|
|
||||||
<% @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>
|
|
||||||
|
|
||||||
</div>
|
</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 %>
|
<%= render "shared/canonical", href: debates_url %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<main>
|
<% if @search_terms || @advanced_search_terms %>
|
||||||
<% if @search_terms || @advanced_search_terms %>
|
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
results: @debates,
|
||||||
results: @debates,
|
search_terms: @search_terms,
|
||||||
search_terms: @search_terms,
|
advanced_search_terms: @advanced_search_terms
|
||||||
advanced_search_terms: @advanced_search_terms
|
) %>
|
||||||
) %>
|
<% else %>
|
||||||
<% else %>
|
<%= render "shared/section_header", i18n_namespace: "debates.index.section_header", image: "debates" %>
|
||||||
<%= render "shared/section_header", i18n_namespace: "debates.index.section_header", image: "debates" %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if feature?("user.recommendations") && @recommended_debates.present? %>
|
<% if feature?("user.recommendations") && @recommended_debates.present? %>
|
||||||
<%= render "shared/recommended_index", recommended: @recommended_debates,
|
<%= render "shared/recommended_index", recommended: @recommended_debates,
|
||||||
disable_recommendations_path: recommendations_disable_debates_path,
|
disable_recommendations_path: recommendations_disable_debates_path,
|
||||||
namespace: "debates" %>
|
namespace: "debates" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="debates" class="debates-list small-12 medium-9 column">
|
<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? %>
|
<% unless @search_terms || !has_featured? %>
|
||||||
<%= render "featured_debates" %>
|
<%= render "featured_debates" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= render "view_mode" %>
|
<%= render "view_mode" %>
|
||||||
</div>
|
|
||||||
</div>
|
</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">
|
<div class="show-for-small-only">
|
||||||
<%= link_to t("debates.index.start_debate"), new_debate_path, class: "button expanded" %>
|
<%= link_to t("debates.index.start_debate"), new_debate_path, class: "button expanded" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if @debates.any? || current_user.blank? %>
|
<% if @debates.any? || current_user.blank? %>
|
||||||
<% if debates_default_view? %>
|
<% if debates_default_view? %>
|
||||||
<%= render @debates %>
|
<%= render @debates %>
|
||||||
<% else %>
|
|
||||||
<% @debates.each do |debate| %>
|
|
||||||
<%= render "debates/debate_minimal", debate: debate %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= empty_recommended_debates_message_text(current_user) %>
|
<% @debates.each do |debate| %>
|
||||||
|
<%= render "debates/debate_minimal", debate: debate %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= paginate @debates %>
|
<% else %>
|
||||||
|
<%= empty_recommended_debates_message_text(current_user) %>
|
||||||
<% unless @search_terms || @advanced_search_terms %>
|
<% end %>
|
||||||
<div id="section_help" class="margin" data-magellan-target="section_help">
|
<%= paginate @debates %>
|
||||||
<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>
|
|
||||||
|
|
||||||
|
<% 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>
|
||||||
</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 %>
|
<% end %>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="admin-content <%= yield(:main_class) %>">
|
<main class="admin-content <%= yield(:main_class) %>">
|
||||||
<%= label_tag :show_menu, t("admin.menu.admin"),
|
<%= label_tag :show_menu, t("admin.menu.admin"),
|
||||||
"aria-hidden": true, class: "button hollow expanded" %>
|
"aria-hidden": true, class: "button hollow expanded" %>
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,11 @@
|
|||||||
|
|
||||||
<div class="wrapper <%= yield(:wrapper_class) %>">
|
<div class="wrapper <%= yield(:wrapper_class) %>">
|
||||||
<%= render "layouts/header", with_subnavigation: true %>
|
<%= render "layouts/header", with_subnavigation: true %>
|
||||||
<%= render "layouts/flash" %>
|
|
||||||
|
|
||||||
<%= yield %>
|
<main class="public-content <%= yield(:main_class) %>">
|
||||||
|
<%= render "layouts/flash" %>
|
||||||
|
<%= yield %>
|
||||||
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<%= render "dashboard/menu" %>
|
<%= render "dashboard/menu" %>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="admin-content">
|
<main class="admin-content <%= yield(:main_class) %>">
|
||||||
<%= label_tag :show_menu, t("admin.menu.admin"),
|
<%= label_tag :show_menu, t("admin.menu.admin"),
|
||||||
"aria-hidden": true, class: "button hollow expanded" %>
|
"aria-hidden": true, class: "button hollow expanded" %>
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<%= render "layouts/dashboard/proposal_totals" %>
|
<%= render "layouts/dashboard/proposal_totals" %>
|
||||||
<%= render "layouts/dashboard/proposal_header" %>
|
<%= render "layouts/dashboard/proposal_header" %>
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</div>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
<div class="small-12 medium-9 column">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 medium-9 large-7 small-centered column">
|
<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" %>
|
<%= render "layouts/flash" %>
|
||||||
|
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</div>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,123 +8,120 @@
|
|||||||
<%= render "shared/canonical", href: proposals_url %>
|
<%= render "shared/canonical", href: proposals_url %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<main>
|
<% if [
|
||||||
<% if [
|
@search_terms,
|
||||||
@search_terms,
|
@advanced_search_terms,
|
||||||
@advanced_search_terms,
|
params[:retired].present?,
|
||||||
params[:retired].present?,
|
params[:selected].present?
|
||||||
params[:selected].present?
|
].any? %>
|
||||||
].any? %>
|
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
results: @proposals,
|
||||||
results: @proposals,
|
search_terms: @search_terms,
|
||||||
search_terms: @search_terms,
|
advanced_search_terms: @advanced_search_terms
|
||||||
advanced_search_terms: @advanced_search_terms
|
) do %>
|
||||||
) do %>
|
<% if params[:retired].present? %>
|
||||||
<% if params[:retired].present? %>
|
<h2><%= t("proposals.index.retired_proposals") %></h2>
|
||||||
<h2><%= t("proposals.index.retired_proposals") %></h2>
|
<% elsif params[:selected].present? %>
|
||||||
<% elsif params[:selected].present? %>
|
<h2><%= t("proposals.index.selected_proposals") %></h2>
|
||||||
<h2><%= t("proposals.index.selected_proposals") %></h2>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
|
||||||
<%= render "shared/section_header", i18n_namespace: "proposals.index.section_header", image: "proposals" %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= render "shared/section_header", i18n_namespace: "proposals.index.section_header", image: "proposals" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if show_recommended_proposals? %>
|
<% if show_recommended_proposals? %>
|
||||||
<%= render "shared/recommended_index", recommended: @recommended_proposals,
|
<%= render "shared/recommended_index", recommended: @recommended_proposals,
|
||||||
disable_recommendations_path: recommendations_disable_proposals_path,
|
disable_recommendations_path: recommendations_disable_proposals_path,
|
||||||
namespace: "proposals" %>
|
namespace: "proposals" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="proposals" class="proposals-list small-12 medium-9 column">
|
<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? %>
|
<% if show_featured_proposals? %>
|
||||||
<div id="featured-proposals" class="row featured-proposals">
|
<div id="featured-proposals" class="row featured-proposals">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<h2>
|
<h2>
|
||||||
<%= t("proposals.index.featured_proposals") %>
|
<%= t("proposals.index.featured_proposals") %>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
|
||||||
<% @featured_proposals.each do |featured_proposal| %>
|
|
||||||
<%= render "featured_proposal", proposal: featured_proposal %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% @featured_proposals.each do |featured_proposal| %>
|
||||||
|
<%= render "featured_proposal", proposal: featured_proposal %>
|
||||||
<% 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>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
|
|
||||||
<div class="small-12 medium-3 column">
|
<% unless params[:selected].present? %>
|
||||||
<aside class="margin-bottom">
|
<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"),
|
<%= link_to t("proposals.index.start_proposal"),
|
||||||
new_proposal_path,
|
new_proposal_path,
|
||||||
class: "button expanded" %>
|
class: "button expanded" %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="sidebar-divider"></div>
|
<div id="proposals-list">
|
||||||
<h2 class="sidebar-title"><%= t("proposals.index.selected_proposals") %></h2>
|
<% if @proposals.any? || current_user.blank? %>
|
||||||
<br>
|
<% if proposals_default_view? %>
|
||||||
<p class="small">
|
<%= render partial: "proposals/proposal", collection: @proposals %>
|
||||||
<%= link_to t("proposals.index.selected_proposals_link"), proposals_path(selected: "all") %>
|
<% else %>
|
||||||
</p>
|
<% @proposals.each do |proposal| %>
|
||||||
|
<%= render "/proposals/proposal_minimal", proposal: proposal %>
|
||||||
<% if params[:retired].blank? %>
|
<% end %>
|
||||||
<%= render "categories" %>
|
|
||||||
<%= render "shared/tag_cloud", taggable: "Proposal" %>
|
|
||||||
<%= render Proposals::GeozonesComponent.new %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= render "retired" %>
|
<% else %>
|
||||||
<%= render "proposals_lists" %>
|
<%= empty_recommended_proposals_message_text(current_user) %>
|
||||||
</aside>
|
<% end %>
|
||||||
</div>
|
<%= 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>
|
</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 class="row proposals-summary">
|
<div id="proposals" class="proposals-list small-12 medium-9 column">
|
||||||
<div id="proposals" class="proposals-list small-12 medium-9 column">
|
<%= back_link_to %>
|
||||||
<%= back_link_to %>
|
|
||||||
|
|
||||||
<% @proposals.each do |group_name, proposals| %>
|
<% @proposals.each do |group_name, proposals| %>
|
||||||
<div id="<%= group_name.parameterize %>">
|
<div id="<%= group_name.parameterize %>">
|
||||||
<h2 class="margin-top"><%= group_name %></h2>
|
<h2 class="margin-top"><%= group_name %></h2>
|
||||||
|
|
||||||
<% proposals[0..2].each do |proposal| %>
|
<% proposals[0..2].each do |proposal| %>
|
||||||
<div class="proposal clear">
|
<div class="proposal clear">
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 medium-9 column">
|
<div class="small-12 medium-9 column">
|
||||||
<div class="proposal-contenta">
|
<div class="proposal-contenta">
|
||||||
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
|
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
|
||||||
|
|
||||||
<p class="proposal-info">
|
<p class="proposal-info">
|
||||||
<% if proposal.author.hidden? || proposal.author.erased? %>
|
<% if proposal.author.hidden? || proposal.author.erased? %>
|
||||||
<span class="author"><%= t("proposals.show.author_deleted") %></span>
|
<span class="author"><%= t("proposals.show.author_deleted") %></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="author"><%= proposal.author.name %></span>
|
<span class="author"><%= proposal.author.name %></span>
|
||||||
<% if proposal.author.display_official_position_badge? %>
|
<% if proposal.author.display_official_position_badge? %>
|
||||||
<span class="label round level-<%= proposal.author.official_level %>">
|
<span class="label round level-<%= proposal.author.official_level %>">
|
||||||
<%= proposal.author.official_position %>
|
<%= proposal.author.official_position %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
<% end %>
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="proposal-description">
|
<div class="proposal-description">
|
||||||
<p><%= proposal.summary %></p>
|
<p><%= proposal.summary %></p>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
<% end %>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
|
|
||||||
<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>
|
</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">
|
<% provide :main_class, "topic-edit" %>
|
||||||
<%= back_link_to community_path(@community) %>
|
|
||||||
|
|
||||||
<h1><%= t("community.topic.edit") %></h1>
|
<%= back_link_to community_path(@community) %>
|
||||||
|
|
||||||
<%= render "form" %>
|
<h1><%= t("community.topic.edit") %></h1>
|
||||||
</main>
|
|
||||||
|
<%= render "form" %>
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<main class="topic-new">
|
<% provide :main_class, "topic-new" %>
|
||||||
<%= back_link_to community_path(@community) %>
|
|
||||||
|
|
||||||
<h1><%= t("community.topic.create") %></h1>
|
<%= back_link_to community_path(@community) %>
|
||||||
|
|
||||||
<aside>
|
<h1><%= t("community.topic.create") %></h1>
|
||||||
<h2><%= t("community.topic.sidebar.recommendations_title") %></h2>
|
|
||||||
|
|
||||||
<ul class="recommendations">
|
<aside>
|
||||||
<li><%= t("community.topic.sidebar.recommendation_one") %></li>
|
<h2><%= t("community.topic.sidebar.recommendations_title") %></h2>
|
||||||
<li><%= t("community.topic.sidebar.recommendation_two") %></li>
|
|
||||||
<li><%= t("community.topic.sidebar.recommendation_three") %></li>
|
|
||||||
</ul>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<%= render "form" %>
|
<ul class="recommendations">
|
||||||
</main>
|
<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="activity row margin-top">
|
<div class="small-12 column">
|
||||||
<div class="small-12 column">
|
|
||||||
|
|
||||||
<% if @user != current_user %>
|
<% if @user != current_user %>
|
||||||
<% if @user.email_on_direct_message? %>
|
<% if @user.email_on_direct_message? %>
|
||||||
<%= link_to t("users.show.send_private_message"),
|
<%= link_to t("users.show.send_private_message"),
|
||||||
new_user_direct_message_path(@user),
|
new_user_direct_message_path(@user),
|
||||||
class: "button hollow float-right" %>
|
class: "button hollow float-right" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="callout primary float-right">
|
<div class="callout primary float-right">
|
||||||
<%= t("users.show.no_private_messages") %>
|
<%= t("users.show.no_private_messages") %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<h2 class="inline-block">
|
<h2 class="inline-block">
|
||||||
<%= render Shared::AvatarComponent.new(@user, size: 60) %>
|
<%= render Shared::AvatarComponent.new(@user, size: 60) %>
|
||||||
<%= @user.name %>
|
<%= @user.name %>
|
||||||
<% if current_user&.administrator? %>
|
<% if current_user&.administrator? %>
|
||||||
<small><%= @user.email %></small>
|
<small><%= @user.email %></small>
|
||||||
<% end %>
|
<% end %>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<%= render Users::PublicActivityComponent.new(@user) %>
|
<%= render Users::PublicActivityComponent.new(@user) %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</div>
|
||||||
|
|||||||
@@ -13,28 +13,26 @@
|
|||||||
|
|
||||||
<%= render "shared/header", header: @header %>
|
<%= render "shared/header", header: @header %>
|
||||||
|
|
||||||
<main>
|
<%= render "feeds" %>
|
||||||
<%= render "feeds" %>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<% if @cards.any? %>
|
<% if @cards.any? %>
|
||||||
<div class="small-12 column <%= "large-8" if feed_processes_enabled? %>">
|
<div class="small-12 column <%= "large-8" if feed_processes_enabled? %>">
|
||||||
<h2 class="title"><%= t("welcome.cards.title") %></h2>
|
<h2 class="title"><%= t("welcome.cards.title") %></h2>
|
||||||
|
|
||||||
<%= render "shared/cards", cards: @cards %>
|
<%= render "shared/cards", cards: @cards %>
|
||||||
</div>
|
</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 %>
|
|
||||||
<% end %>
|
<% 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 %>
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="error">
|
<main class="error">
|
||||||
<h1>403</h1>
|
<h1>403</h1>
|
||||||
<h2>Access to this page has been disabled by the administrators.</h2>
|
<h2>Access to this page has been disabled by the administrators.</h2>
|
||||||
</div>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="error">
|
<main class="error">
|
||||||
<h1>404</h1>
|
<h1>404</h1>
|
||||||
<h2>Not found.</h2>
|
<h2>Not found.</h2>
|
||||||
</div>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="error">
|
<main class="error">
|
||||||
<h1>422</h1>
|
<h1>422</h1>
|
||||||
<h2>The change you wanted was rejected.</h2>
|
<h2>The change you wanted was rejected.</h2>
|
||||||
</div>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="error">
|
<main class="error">
|
||||||
<h1>500</h1>
|
<h1>500</h1>
|
||||||
<h2>Internal server error.</h2>
|
<h2>Internal server error.</h2>
|
||||||
</div>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -53,6 +53,20 @@ end
|
|||||||
|
|
||||||
FactoryBot.use_parent_strategy = false
|
FactoryBot.use_parent_strategy = false
|
||||||
|
|
||||||
|
module Capybara
|
||||||
|
module DSL
|
||||||
|
alias_method :original_visit, :visit
|
||||||
|
|
||||||
|
def visit(url, ...)
|
||||||
|
original_visit(url, ...)
|
||||||
|
|
||||||
|
unless url.match?("robots.txt") || url.match?("active_storage/representations")
|
||||||
|
expect(page).to have_css "main", count: 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Capybara.register_driver :headless_chrome do |app|
|
Capybara.register_driver :headless_chrome do |app|
|
||||||
options = Selenium::WebDriver::Chrome::Options.new.tap do |opts|
|
options = Selenium::WebDriver::Chrome::Options.new.tap do |opts|
|
||||||
opts.add_argument "--headless"
|
opts.add_argument "--headless"
|
||||||
|
|||||||
Reference in New Issue
Block a user