Merge pull request #5892 from consuldemocracy/html_indentation

Add a linter to check indentation in ERB+HTML files
This commit is contained in:
Javi Martín
2025-03-07 17:17:30 +01:00
committed by GitHub
97 changed files with 897 additions and 983 deletions

View File

@@ -21,6 +21,8 @@ jobs:
run: npx stylelint app/assets/stylesheets run: npx stylelint app/assets/stylesheets
- name: Markdownlint - name: Markdownlint
run: bundle exec mdl *.md docs/ run: bundle exec mdl *.md docs/
- name: HTML Beautifier
run: find app/ -name "*.html.erb" -exec bundle exec htmlbeautifier --lint-only --keep-blank-lines 1 -e {} +
name: ${{ matrix.name }} name: ${{ matrix.name }}
steps: steps:
- name: Checkout code - name: Checkout code

View File

@@ -95,6 +95,7 @@ group :development do
gem "capistrano3-puma", "~> 5.2.0" gem "capistrano3-puma", "~> 5.2.0"
gem "erb_lint", "~> 0.9.0", require: false gem "erb_lint", "~> 0.9.0", require: false
gem "faraday-retry", "~> 2.2.1", require: false gem "faraday-retry", "~> 2.2.1", require: false
gem "htmlbeautifier", "~> 1.4.3", require: false
gem "mdl", "~> 0.13.0", require: false gem "mdl", "~> 0.13.0", require: false
gem "pronto", "~> 0.11.2", require: false gem "pronto", "~> 0.11.2", require: false
gem "pronto-erb_lint", "~> 0.1.6", require: false gem "pronto-erb_lint", "~> 0.1.6", require: false

View File

@@ -272,6 +272,7 @@ GEM
hashery (2.1.2) hashery (2.1.2)
hashie (5.0.0) hashie (5.0.0)
highline (2.0.3) highline (2.0.3)
htmlbeautifier (1.4.3)
htmlentities (4.3.4) htmlentities (4.3.4)
httparty (0.22.0) httparty (0.22.0)
csv csv
@@ -755,6 +756,7 @@ DEPENDENCIES
graphiql-rails (~> 1.8.0) graphiql-rails (~> 1.8.0)
graphql (~> 2.3.18) graphql (~> 2.3.18)
groupdate (~> 6.5.1) groupdate (~> 6.5.1)
htmlbeautifier (~> 1.4.3)
i18n-tasks (~> 0.9.37) i18n-tasks (~> 0.9.37)
image_processing (~> 1.13.0) image_processing (~> 1.13.0)
invisible_captcha (~> 2.3.0) invisible_captcha (~> 2.3.0)

View File

@@ -812,7 +812,6 @@
.proposal h3 { .proposal h3 {
font-size: rem-calc(20); font-size: rem-calc(20);
margin-top: 0;
} }
} }

View File

@@ -88,15 +88,6 @@
} }
} }
.supports-container {
border-top: 1px solid $border;
@include breakpoint(medium) {
border-left: 1px solid $border;
border-top: 0;
}
}
.participation-not-allowed { .participation-not-allowed {
background: $warning-bg; background: $warning-bg;
color: $color-warning; color: $color-warning;
@@ -394,41 +385,53 @@
@include breakpoint(medium) { @include breakpoint(medium) {
min-height: $line-height * 15; min-height: $line-height * 15;
.with-image > .row {
display: flex;
}
} }
} }
.budget-investments-list .budget-investment, .debates-list,
.proposals-list .proposal, .proposals-list,
.legislation-proposals .proposal { .budget-investments-list,
.legislation-proposals {
@include breakpoint(medium) { .panel {
column-gap: calc(rem-calc(map-get($grid-column-gutter, medium)) * 3 / 4);
display: flex;
flex-wrap: wrap;
.panel { > * {
flex-grow: 1;
}
&.with-image { &.with-image {
padding: 0 calc($line-height / 2) 0 0; padding-bottom: 0;
padding-top: 0;
.panel-image {
margin-#{$global-left}: rem-calc(-12);
text-align: center;
~ * {
padding-top: calc($line-height / 2);
}
}
img {
height: 100%;
} }
} }
.column:first-child { .debate-content,
overflow: hidden; .budget-investment-content,
} .proposal-content {
flex-basis: calc((35rem - 100%) * 999);
flex-grow: 1000;
max-width: 50rem;
.column:nth-child(2) { + * {
float: left; flex-basis: 22.5%;
} flex-shrink: 0;
text-align: center;
.column:last-child:not(:first-child) { }
padding-top: calc($line-height / 2);
}
img {
height: 100%;
max-width: 12rem;
} }
} }
} }
@@ -592,27 +595,19 @@
.legislation-proposals { .legislation-proposals {
.votes { .votes {
border-top: 1px solid $border;
margin-top: $line-height; margin-top: $line-height;
padding: calc($line-height / 2) 0; padding: calc($line-height / 2) 0;
position: relative; position: relative;
@include breakpoint(medium) { @include breakpoint(medium) {
border-left: 1px solid $border;
border-top: 0;
margin-top: 0; margin-top: 0;
text-align: center; text-align: center;
} }
.total-votes { .total-votes {
float: right; display: block;
font-weight: bold; font-weight: bold;
line-height: $line-height * 2; line-height: $line-height * 2;
@include breakpoint(medium) {
display: block;
float: none;
}
} }
} }
} }
@@ -624,12 +619,6 @@
} }
} }
.proposal-show .votes,
.debate-show .votes {
border: 0;
padding: calc($line-height / 2) 0;
}
.proposal, .proposal,
.budget-investment { .budget-investment {

View File

@@ -1,9 +1,5 @@
.in-favor-against { .in-favor-against {
@include flex-with-gap($line-height * 0.25); @include flex-with-gap($line-height * 0.75);
@include breakpoint(medium) {
@include flex-with-gap($line-height * 0.75);
}
&, &,
.in-favor, .in-favor,
@@ -77,16 +73,8 @@
} }
.percentage { .percentage {
display: inline-block; display: block;
font-size: $small-font-size; font-size: $small-font-size;
line-height: $line-height * 2; line-height: $line-height;
padding-right: calc($line-height / 2);
vertical-align: top;
@include breakpoint(medium) {
display: block;
line-height: $line-height;
padding-right: 0;
}
} }
} }

View File

@@ -8,7 +8,8 @@
<div class="small-12 medium-3 column highlight padding"> <div class="small-12 medium-3 column highlight padding">
<strong><%= t("admin.poll_shifts.new.officer") %></strong> <strong><%= t("admin.poll_shifts.new.officer") %></strong>
<br><%= officer.name %> <br>
<%= officer.name %>
<%= f.hidden_field :officer_id, value: officer.id %> <%= f.hidden_field :officer_id, value: officer.id %>
</div> </div>

View File

@@ -17,28 +17,28 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% pages.each do |page| %> <% pages.each do |page| %>
<tr id="<%= dom_id(page) %>"> <tr id="<%= dom_id(page) %>">
<td><%= page.title %></td> <td><%= page.title %></td>
<td><%= page.slug %></td> <td><%= page.slug %></td>
<td><%= I18n.l page.created_at, format: :long %></td> <td><%= I18n.l page.created_at, format: :long %></td>
<td><%= I18n.l page.updated_at, format: :long %></td> <td><%= I18n.l page.updated_at, format: :long %></td>
<td><%= t("admin.site_customization.pages.page.status_#{page.status}") %></td> <td><%= t("admin.site_customization.pages.page.status_#{page.status}") %></td>
<td> <td>
<%= render Admin::TableActionsComponent.new(page) do |actions| %> <%= render Admin::TableActionsComponent.new(page) do |actions| %>
<%= actions.action(:cards, <%= actions.action(:cards,
text: t("admin.site_customization.pages.page.see_cards"), text: t("admin.site_customization.pages.page.see_cards"),
path: admin_site_customization_page_widget_cards_path(page)) %> path: admin_site_customization_page_widget_cards_path(page)) %>
<% if page.status == "published" %> <% if page.status == "published" %>
<%= actions.action(:show, <%= actions.action(:show,
text: t("admin.site_customization.pages.index.see_page"), text: t("admin.site_customization.pages.index.see_page"),
path: page.url) %> path: page.url) %>
<% end %>
<% end %> <% end %>
<% end %> </td>
</td> </tr>
</tr> <% end %>
<% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -30,7 +30,9 @@
<table class="investment-projects-summary"> <table class="investment-projects-summary">
<thead> <thead>
<tr><th colspan="2"><%= t("admin.stats.budget_balloting.votes_per_heading") %></th></tr> <tr>
<th colspan="2"><%= t("admin.stats.budget_balloting.votes_per_heading") %></th>
</tr>
</thead> </thead>
<tbody> <tbody>
@@ -49,7 +51,9 @@
<table class="investment-projects-summary user-count-by-heading"> <table class="investment-projects-summary user-count-by-heading">
<thead> <thead>
<tr><th colspan="2"><%= t("admin.stats.budget_balloting.participants_per_district") %></th></tr> <tr>
<th colspan="2"><%= t("admin.stats.budget_balloting.participants_per_district") %></th>
</tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -1,5 +1,6 @@
<div class="small-12 medium-4 column"> <div class="small-12 medium-4 column">
<%= tag.p(**options) do %> <%= tag.p(**options) do %>
<%= text %> <br><span class="number"><%= amount %></span> <%= text %> <br>
<span class="number"><%= amount %></span>
<% end %> <% end %>
</div> </div>

View File

@@ -24,7 +24,9 @@
</div> </div>
<div class="small-12 column"> <div class="small-12 column">
<div class="progress-bar-placeholder"><div class="loading-bar"></div></div> <div class="progress-bar-placeholder">
<div class="loading-bar"></div>
</div>
</div> </div>
<hr> <hr>

View File

@@ -9,7 +9,7 @@
</h2> </h2>
<p class="confirmed"> <p class="confirmed">
<%= t("budgets.ballots.show.voted_info") %> <%= t("budgets.ballots.show.voted_info") %>
<p> </p>
<p><%= t("budgets.ballots.show.voted_info_2") %></p> <p><%= t("budgets.ballots.show.voted_info_2") %></p>
</div> </div>
</header> </header>

View File

@@ -1,9 +1,4 @@
<% if budget.image.present? %> <div <%= tag.attributes(html_attributes) %>>
<div class="budget-header with-background-image"
style="<%= attached_background_css polymorphic_path(budget.image.variant(:large)) %>">
<% else %>
<div class="budget-header">
<% end %>
<div class="row"> <div class="row">
<div class="small-12 column text-center"> <div class="small-12 column text-center">
<span class="budget-title"><%= t("budgets.index.title") %></span> <span class="budget-title"><%= t("budgets.index.title") %></span>

View File

@@ -5,4 +5,17 @@ class Budgets::BudgetComponent < ApplicationComponent
def initialize(budget) def initialize(budget)
@budget = budget @budget = budget
end end
private
def html_attributes
if budget.image.present?
{
class: "budget-header with-background-image",
style: attached_background_css(polymorphic_path(budget.image.variant(:large)))
}
else
{ class: "budget-header" }
end
end
end end

View File

@@ -13,7 +13,8 @@
<h1> <h1>
<%= link_to namespace_path do %> <%= link_to namespace_path do %>
<%= setting["org_name"] %> <%= setting["org_name"] %>
<br><small><%= namespaced_header_title %></small> <br>
<small><%= namespaced_header_title %></small>
<% end %> <% end %>
</h1> </h1>

View File

@@ -9,7 +9,7 @@
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</header> </header>
<p><%= t("cookies_management.description") %><p> <p><%= t("cookies_management.description") %></p>
<% if more_info_link.present? %> <% if more_info_link.present? %>
<p><%= link_to t("cookies_consent.more_info_link"), more_info_link, target: "_blank" %></p> <p><%= link_to t("cookies_consent.more_info_link"), more_info_link, target: "_blank" %></p>
<% end %> <% end %>

View File

@@ -47,9 +47,7 @@
</p> </p>
<% option.videos.each do |video| %> <% option.videos.each do |video| %>
<%= link_to video.title, <%= link_to video.title, video.url, rel: "nofollow" %><br>
video.url,
rel: "nofollow" %><br>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

View File

@@ -17,8 +17,8 @@
<% else %> <% else %>
<dl> <dl>
<% targets.sort.each do |target| %> <% targets.sort.each do |target| %>
<dt><%= target.code %><dt> <dt><%= target.code %></dt>
<dd><%= target.long_title %><dd> <dd><%= target.long_title %></dd>
<% end %> <% end %>
</dl> </dl>
<% end %> <% end %>

View File

@@ -18,13 +18,13 @@ module LegislationHelper
} }
end end
def banner_color? def banner_color?(process)
@process.background_color.present? && @process.font_color.present? process.background_color.present? && process.font_color.present?
end end
def css_for_process_header def css_for_process_header(process)
if banner_color? if banner_color?(process)
"background: #{@process.background_color};color: #{@process.font_color};" "background: #{process.background_color};color: #{process.font_color};"
end end
end end
end end

View File

@@ -64,22 +64,6 @@ module ProposalsHelper
proposals_current_view == "default" ? "minimal" : "default" proposals_current_view == "default" ? "minimal" : "default"
end end
def css_for_proposal_info_row(proposal)
if proposal.image.present?
if params[:selected].present?
"small-12 medium-9 column"
else
"small-12 medium-6 large-7 column"
end
else
if params[:selected].present?
"small-12 column"
else
"small-12 medium-9 column"
end
end
end
def show_proposal_votes? def show_proposal_votes?
params[:selected].blank? params[:selected].blank?
end end

View File

@@ -44,6 +44,7 @@
<br> <br>
<%= sanitize(activity.actionable.description) %> <%= sanitize(activity.actionable.description) %>
<% end %> <% end %>
</td>
<td class="align-top"> <td class="align-top">
<%= activity.user.name %> (<%= activity.user.email %>) <%= activity.user.name %> (<%= activity.user.email %>)
</td> </td>

View File

@@ -14,34 +14,34 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @admin_notifications.order(created_at: :desc).each do |admin_notification| %> <% @admin_notifications.order(created_at: :desc).each do |admin_notification| %>
<tr id="<%= dom_id(admin_notification) %>" class="admin_notification"> <tr id="<%= dom_id(admin_notification) %>" class="admin_notification">
<td> <td>
<%= admin_notification.title %> <%= admin_notification.title %>
</td> </td>
<td> <td>
<%= segment_name(admin_notification.segment_recipient) %> <%= segment_name(admin_notification.segment_recipient) %>
</td> </td>
<td> <td>
<% if admin_notification.draft? %> <% if admin_notification.draft? %>
<%= t("admin.admin_notifications.index.draft") %> <%= t("admin.admin_notifications.index.draft") %>
<% else %> <% else %>
<%= l admin_notification.sent_at.to_date %> <%= l admin_notification.sent_at.to_date %>
<% end %>
</td>
<td>
<% if admin_notification.draft? %>
<%= render Admin::TableActionsComponent.new(admin_notification) do |actions| %>
<%= actions.action(:preview, text: t("admin.admin_notifications.index.preview")) %>
<% end %> <% end %>
<% else %> </td>
<%= render Admin::TableActionsComponent.new(admin_notification, actions: []) do |actions| %> <td>
<%= actions.action(:show, text: t("admin.admin_notifications.index.view")) %> <% if admin_notification.draft? %>
<%= render Admin::TableActionsComponent.new(admin_notification) do |actions| %>
<%= actions.action(:preview, text: t("admin.admin_notifications.index.preview")) %>
<% end %>
<% else %>
<%= render Admin::TableActionsComponent.new(admin_notification, actions: []) do |actions| %>
<%= actions.action(:show, text: t("admin.admin_notifications.index.view")) %>
<% end %>
<% end %> <% end %>
<% end %> </td>
</td> </tr>
</tr> <% end %>
<% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -28,7 +28,7 @@
</div> </div>
<div class="small-12 column"> <div class="small-12 column">
<strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br> <strong><%= t("admin.admin_notifications.show.segment_recipient") %></strong><br>
<%= segment_name(@admin_notification.segment_recipient) %> <%= segment_name(@admin_notification.segment_recipient) %>
<% if @admin_notification.draft? %> <% if @admin_notification.draft? %>
<%= t("admin.admin_notifications.show.will_get_notified", <%= t("admin.admin_notifications.show.will_get_notified",

View File

@@ -11,7 +11,7 @@
<%= render "shared/errors", resource: @investment %> <%= render "shared/errors", resource: @investment %>
<% Budget::Investment.filter_params(params).to_h.each do |filter_name, filter_value| %> <% Budget::Investment.filter_params(params).to_h.each do |filter_name, filter_value| %>
<%= hidden_field_tag filter_name, filter_value %> <%= hidden_field_tag filter_name, filter_value %>
<% end %> <% end %>
<div class="row expanded"> <div class="row expanded">
@@ -74,9 +74,9 @@
<div class="small-12 column margin-top"> <div class="small-12 column margin-top">
<%= f.label :valuator_ids %> <%= f.label :valuator_ids %>
<ul> <ul>
<%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %> <%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %>
<li><%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %></li> <li><%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
@@ -85,7 +85,7 @@
<%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %> <%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %>
<ul> <ul>
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %> <%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
<li><%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li> <li><%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
@@ -93,11 +93,11 @@
<div class="row expanded margin-top"> <div class="row expanded margin-top">
<% if @investment.incompatible? || @investment.winner? %> <% if @investment.incompatible? || @investment.winner? %>
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2> <h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2>
<%= f.check_box :incompatible, <%= f.check_box :incompatible,
title: t("admin.budget_investments.edit.compatibility") %> title: t("admin.budget_investments.edit.compatibility") %>
</div> </div>
<% end %> <% end %>
<div class="small-12 medium-3 column float-left"> <div class="small-12 medium-3 column float-left">
<h2 id="selected"><%= t("admin.budget_investments.edit.selection") %></h2> <h2 id="selected"><%= t("admin.budget_investments.edit.selection") %></h2>

View File

@@ -39,17 +39,17 @@
<div class="in-favor inline-block"> <div class="in-favor inline-block">
<span class="icon-like"> <span class="icon-like">
<span class="show-for-sr"><%= t("votes.agree") %></span> <span class="show-for-sr"><%= t("votes.agree") %></span>
</span> </span>
<span class="percentage"><%= votes_percentage("likes", @debate) %></span> <span class="percentage"><%= votes_percentage("likes", @debate) %></span>
</div> </div>
<span class="bullet">&nbsp;&bull;&nbsp;</span> <span class="bullet">&nbsp;&bull;&nbsp;</span>
<div class="against inline-block"> <div class="against inline-block">
<span class="icon-unlike"> <span class="icon-unlike">
<span class="show-for-sr"><%= t("votes.disagree") %></span> <span class="show-for-sr"><%= t("votes.disagree") %></span>
</span> </span>
<span class="percentage"><%= votes_percentage("dislikes", @debate) %></span> <span class="percentage"><%= votes_percentage("dislikes", @debate) %></span>
</div> </div>

View File

@@ -14,21 +14,21 @@
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @investments.each do |investment| %> <% @investments.each do |investment| %>
<tr id="<%= dom_id(investment) %>"> <tr id="<%= dom_id(investment) %>">
<td class="align-top"> <td class="align-top">
<strong><%= investment.title %></strong> <strong><%= investment.title %></strong>
</td> </td>
<td> <td>
<div class="moderation-description"> <div class="moderation-description">
<%= wysiwyg(investment.description) %> <%= wysiwyg(investment.description) %>
</div> </div>
</td> </td>
<td class="align-top"> <td class="align-top">
<%= render Admin::HiddenTableActionsComponent.new(investment) %> <%= render Admin::HiddenTableActionsComponent.new(investment) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -13,21 +13,21 @@
<th scope="col"><%= t("admin.shared.actions") %></th> <th scope="col"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @comments.each do |comment| %> <% @comments.each do |comment| %>
<tr id="<%= dom_id(comment) %>"> <tr id="<%= dom_id(comment) %>">
<td> <td>
<%= sanitize_and_auto_link comment.body %><br> <%= sanitize_and_auto_link comment.body %><br>
<% if comment.commentable.hidden? %> <% if comment.commentable.hidden? %>
(<%= t("admin.hidden_comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>) (<%= t("admin.hidden_comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>)
<% else %> <% else %>
<%= link_to comment.commentable.title, commentable_path(comment) %> <%= link_to comment.commentable.title, commentable_path(comment) %>
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::HiddenTableActionsComponent.new(comment) %> <%= render Admin::HiddenTableActionsComponent.new(comment) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -14,21 +14,21 @@
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @debates.each do |debate| %> <% @debates.each do |debate| %>
<tr id="<%= dom_id(debate) %>"> <tr id="<%= dom_id(debate) %>">
<td class="align-top"> <td class="align-top">
<strong><%= debate.title %></strong> <strong><%= debate.title %></strong>
</td> </td>
<td> <td>
<div class="moderation-description"> <div class="moderation-description">
<%= wysiwyg(debate.description) %> <%= wysiwyg(debate.description) %>
</div> </div>
</td> </td>
<td class="align-top"> <td class="align-top">
<%= render Admin::HiddenTableActionsComponent.new(debate) %> <%= render Admin::HiddenTableActionsComponent.new(debate) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -14,21 +14,21 @@
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @proposal_notifications.each do |proposal_notification| %> <% @proposal_notifications.each do |proposal_notification| %>
<tr id="<%= dom_id(proposal_notification) %>"> <tr id="<%= dom_id(proposal_notification) %>">
<td class="align-top"> <td class="align-top">
<strong><%= proposal_notification.title %></strong> <strong><%= proposal_notification.title %></strong>
</td> </td>
<td> <td>
<div class="moderation-description"> <div class="moderation-description">
<%= proposal_notification.body %> <%= proposal_notification.body %>
</div> </div>
</td> </td>
<td class="align-top"> <td class="align-top">
<%= render Admin::HiddenTableActionsComponent.new(proposal_notification) %> <%= render Admin::HiddenTableActionsComponent.new(proposal_notification) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -14,25 +14,25 @@
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @proposals.each do |proposal| %> <% @proposals.each do |proposal| %>
<tr id="<%= dom_id(proposal) %>"> <tr id="<%= dom_id(proposal) %>">
<td class="align-top"> <td class="align-top">
<strong><%= proposal.title %></strong> <strong><%= proposal.title %></strong>
</td> </td>
<td> <td>
<div class="moderation-description"> <div class="moderation-description">
<p><small><%= proposal.summary %></small></p> <p><small><%= proposal.summary %></small></p>
<%= wysiwyg(proposal.description) %> <%= wysiwyg(proposal.description) %>
<% if proposal.video_url.present? %> <% if proposal.video_url.present? %>
<p><%= sanitize_and_auto_link proposal.video_url %></p> <p><%= sanitize_and_auto_link proposal.video_url %></p>
<% end %> <% end %>
</div> </div>
</td> </td>
<td class="align-top"> <td class="align-top">
<%= render Admin::HiddenTableActionsComponent.new(proposal) %> <%= render Admin::HiddenTableActionsComponent.new(proposal) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -13,23 +13,23 @@
<th scope="col"><%= t("admin.shared.actions") %></th> <th scope="col"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr id="<%= dom_id(user) %>"> <tr id="<%= dom_id(user) %>">
<td> <td>
<p><%= link_to user.name, admin_hidden_user_path(user) %></p> <p><%= link_to user.name, admin_hidden_user_path(user) %></p>
</td> </td>
<td> <td>
<%= render Admin::HiddenTableActionsComponent.new(user) %> <%= render Admin::HiddenTableActionsComponent.new(user) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<%= paginate @users %> <%= paginate @users %>
<% else %> <% else %>
<div class="callout primary margin"> <div class="callout primary margin">
<%= t("admin.hidden_users.index.no_hidden_users") %> <%= t("admin.hidden_users.index.no_hidden_users") %>
</div> </div>
<% end %> <% end %>

View File

@@ -29,31 +29,31 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @process.draft_versions.each do |draft_version| %> <% @process.draft_versions.each do |draft_version| %>
<tr id="<%= dom_id(draft_version) %>"> <tr id="<%= dom_id(draft_version) %>">
<td> <td>
<%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %> <%= link_to draft_version.title, edit_admin_legislation_process_draft_version_path(@process, draft_version) %>
</td> </td>
<td><%= draft_version.created_at.to_date %></td> <td><%= draft_version.created_at.to_date %></td>
<td> <td>
<% if draft_version.status == "draft" %> <% if draft_version.status == "draft" %>
<%= Legislation::DraftVersion.human_attribute_name(:status_draft) %> <%= Legislation::DraftVersion.human_attribute_name(:status_draft) %>
<%= link_to "(#{t("admin.legislation.draft_versions.index.preview")})", <%= link_to "(#{t("admin.legislation.draft_versions.index.preview")})",
legislation_process_draft_version_path(@process, draft_version) %> legislation_process_draft_version_path(@process, draft_version) %>
<% else %> <% else %>
<%= Legislation::DraftVersion.human_attribute_name(:status_published) %> <%= Legislation::DraftVersion.human_attribute_name(:status_published) %>
<% end %> <% end %>
</td> </td>
<td class="text-center"><%= draft_version.total_comments %></td> <td class="text-center"><%= draft_version.total_comments %></td>
<td class="text-center"> <td class="text-center">
<% if draft_version.final_version %> <% if draft_version.final_version %>
<span class="icon-check" title="<%= draft_version.final_version %>"></span> <span class="icon-check" title="<%= draft_version.final_version %>"></span>
<% else %> <% else %>
<span class="icon-x delete" title="<%= draft_version.final_version %>"></span> <span class="icon-x delete" title="<%= draft_version.final_version %>"></span>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% end %> <% end %>

View File

@@ -18,7 +18,7 @@
<% if @process.questions.any? %> <% if @process.questions.any? %>
<table class="stack"> <table class="stack">
<thead> <thead>
<tr> <tr>
<th><%= t("admin.legislation.questions.table.title") %></th> <th><%= t("admin.legislation.questions.table.title") %></th>
<th><%= t("admin.legislation.questions.table.question_options") %></th> <th><%= t("admin.legislation.questions.table.question_options") %></th>
@@ -27,22 +27,22 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @process.questions.each do |question| %> <% @process.questions.each do |question| %>
<tr id="<%= dom_id(question) %>"> <tr id="<%= dom_id(question) %>">
<td> <td>
<%= link_to question.title, edit_admin_legislation_process_question_path(@process, question) %> <%= link_to question.title, edit_admin_legislation_process_question_path(@process, question) %>
</td> </td>
<td> <td>
<ul> <ul>
<% question.question_options.each do |question_option| %> <% question.question_options.each do |question_option| %>
<li><%= "#{question_option.value} (#{question_option.answers_count})" %></li> <li><%= "#{question_option.value} (#{question_option.answers_count})" %></li>
<% end %> <% end %>
</ul> </ul>
</td> </td>
<td class="text-center"><%= question.answers_count %></td> <td class="text-center"><%= question.answers_count %></td>
<td class="text-center"><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: "comments") %></td> <td class="text-center"><%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: "comments") %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% end %> <% end %>

View File

@@ -13,15 +13,15 @@
<th scope="col"><%= t("admin.shared.actions") %></th> <th scope="col"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr> <tr>
<td><%= user.name %></td> <td><%= user.name %></td>
<td><%= user.email %></td> <td><%= user.email %></td>
<td> <td>
<%= render Admin::Roles::TableActionsComponent.new(user.manager || user.build_manager) %> <%= render Admin::Roles::TableActionsComponent.new(user.manager || user.build_manager) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -13,15 +13,16 @@
<th scope="col"><%= t("admin.shared.actions") %></th> <th scope="col"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr> <tr>
<td><%= user.name %></td> <td><%= user.name %></td>
<td><%= user.email %></td> <td><%= user.email %></td>
<td> <td>
<%= render Admin::Roles::TableActionsComponent.new(user.moderator || user.build_moderator) %> <%= render Admin::Roles::TableActionsComponent.new(user.moderator || user.build_moderator) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</table> </table>
<% else %> <% else %>
<div class="callout alert margin"> <div class="callout alert margin">

View File

@@ -14,28 +14,28 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @newsletters.order(created_at: :desc).each do |newsletter| %> <% @newsletters.order(created_at: :desc).each do |newsletter| %>
<tr id="<%= dom_id(newsletter) %>" class="newsletter"> <tr id="<%= dom_id(newsletter) %>" class="newsletter">
<td> <td>
<%= newsletter.subject %> <%= newsletter.subject %>
</td> </td>
<td> <td>
<%= segment_name(newsletter.segment_recipient) %> <%= segment_name(newsletter.segment_recipient) %>
</td> </td>
<td> <td>
<% if newsletter.draft? %> <% if newsletter.draft? %>
<%= t("admin.newsletters.index.draft") %> <%= t("admin.newsletters.index.draft") %>
<% else %> <% else %>
<%= l newsletter.sent_at.to_date %> <%= l newsletter.sent_at.to_date %>
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::TableActionsComponent.new(newsletter) do |actions| %> <%= render Admin::TableActionsComponent.new(newsletter) do |actions| %>
<%= actions.action :preview, text: t("admin.newsletters.index.preview") %> <%= actions.action :preview, text: t("admin.newsletters.index.preview") %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -8,10 +8,10 @@
<table> <table>
<thead> <thead>
<th scope="col"><%= t("admin.officials.index.name") %></th> <th scope="col"><%= t("admin.officials.index.name") %></th>
<th scope="col"><%= t("admin.officials.index.official_position") %></th> <th scope="col"><%= t("admin.officials.index.official_position") %></th>
<th scope="col"><%= t("admin.officials.index.official_level") %></th> <th scope="col"><%= t("admin.officials.index.official_level") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>

View File

@@ -21,30 +21,30 @@
<th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @organizations.each do |organization| %> <% @organizations.each do |organization| %>
<% hidden += 1 and next if organization.user.nil? %> <% hidden += 1 and next if organization.user.nil? %>
<tr id="<%= dom_id(organization) %>"> <tr id="<%= dom_id(organization) %>">
<td><%= organization.name %></td> <td><%= organization.name %></td>
<td><%= organization.email %></td> <td><%= organization.email %></td>
<td><%= organization.phone_number %></td> <td><%= organization.phone_number %></td>
<td><%= organization.responsible_name %></td> <td><%= organization.responsible_name %></td>
<td> <td>
<% if organization.verified? %> <% if organization.verified? %>
<span class="icon-check"></span> <span class="icon-check"></span>
<%= t("admin.organizations.index.verified") %> <%= t("admin.organizations.index.verified") %>
<% elsif organization.rejected? %> <% elsif organization.rejected? %>
<span class="icon-x rejected"></span> <span class="icon-x rejected"></span>
<%= t("admin.organizations.index.rejected") %> <%= t("admin.organizations.index.rejected") %>
<% else %> <% else %>
<span class="icon-eye"></span> <span class="icon-eye"></span>
<%= t("admin.organizations.index.pending") %> <%= t("admin.organizations.index.pending") %>
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::Organizations::TableActionsComponent.new(organization) %> <%= render Admin::Organizations::TableActionsComponent.new(organization) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -16,29 +16,29 @@
<th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @organizations.each do |organization| %> <% @organizations.each do |organization| %>
<tr> <tr>
<td><%= organization.name %></td> <td><%= organization.name %></td>
<td><%= organization.email %></td> <td><%= organization.email %></td>
<td><%= organization.phone_number %></td> <td><%= organization.phone_number %></td>
<td><%= organization.responsible_name %></td> <td><%= organization.responsible_name %></td>
<td> <td>
<% if organization.verified? %> <% if organization.verified? %>
<span class="icon-check"></span> <span class="icon-check"></span>
<%= t("admin.organizations.index.verified") %> <%= t("admin.organizations.index.verified") %>
<% elsif organization.rejected? %> <% elsif organization.rejected? %>
<span class="icon-x"></span> <span class="icon-x"></span>
<%= t("admin.organizations.index.rejected") %> <%= t("admin.organizations.index.rejected") %>
<% else %> <% else %>
<span class="icon-eye"></span> <span class="icon-eye"></span>
<%= t("admin.organizations.index.pending") %> <%= t("admin.organizations.index.pending") %>
<% end %> <% end %>
</td> </td>
<td> <td>
<%= render Admin::Organizations::TableActionsComponent.new(organization) %> <%= render Admin::Organizations::TableActionsComponent.new(organization) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -16,14 +16,14 @@
</thead> </thead>
<tbody> <tbody>
<% @booths.each do |booth| %> <% @booths.each do |booth| %>
<tr> <tr>
<td> <td>
<%= booth.name %> <%= booth.name %>
</td> </td>
<td> <td>
<%= booth.location %> <%= booth.location %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -15,11 +15,11 @@
<th class="small-3"><%= t("admin.actions.actions") %></th> <th class="small-3"><%= t("admin.actions.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @booths.each do |booth| %> <% @booths.each do |booth| %>
<tr id="<%= dom_id(booth) %>" class="booth"> <tr id="<%= dom_id(booth) %>" class="booth">
<%= render "booth_assignment", booth: booth, booth_assignment: booth.assignment_on_poll(@poll) %> <%= render "booth_assignment", booth: booth, booth_assignment: booth.assignment_on_poll(@poll) %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -21,9 +21,9 @@
<th><%= t("admin.actions.actions") %></th> <th><%= t("admin.actions.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @booths.each do |booth| %> <% @booths.each do |booth| %>
<%= render "booth", booth: booth %> <%= render "booth", booth: booth %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -16,16 +16,16 @@
</thead> </thead>
<tbody> <tbody>
<% @officers.each do |user| %> <% @officers.each do |user| %>
<tr> <tr>
<td> <td>
<strong> <strong>
<%= link_to user.name, by_officer_admin_poll_officer_assignments_path(@poll, officer_id: user.id) %> <%= link_to user.name, by_officer_admin_poll_officer_assignments_path(@poll, officer_id: user.id) %>
</strong> </strong>
</td> </td>
<td> <td>
<%= user.email %> <%= user.email %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -19,8 +19,8 @@
<div class="inline-block margin-left"> <div class="inline-block margin-left">
<strong><%= t("admin.polls.index.geozone_restricted") %></strong> <strong><%= t("admin.polls.index.geozone_restricted") %></strong>
<br> <br>
<%= @poll.geozones.pluck(:name).to_sentence %> <%= @poll.geozones.pluck(:name).to_sentence %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -15,22 +15,22 @@
</thead> </thead>
<tbody> <tbody>
<% @officers.each do |user| %> <% @officers.each do |user| %>
<tr> <tr>
<td> <td>
<%= user.name %> <%= user.name %>
</td> </td>
<td> <td>
<%= user.email %> <%= user.email %>
</td> </td>
<td> <td>
<%= render Admin::TableActionsComponent.new( <%= render Admin::TableActionsComponent.new(
user, user,
actions: [:edit], actions: [:edit],
edit_text: t("admin.poll_shifts.new.edit_shifts"), edit_text: t("admin.poll_shifts.new.edit_shifts"),
edit_path: new_admin_booth_shift_path(officer_id: user.poll_officer.id) edit_path: new_admin_booth_shift_path(officer_id: user.poll_officer.id)
) %> ) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -32,28 +32,28 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @content_blocks.each do |content_block| %> <% @content_blocks.each do |content_block| %>
<tr id="<%= dom_id(content_block) %>"> <tr id="<%= dom_id(content_block) %>">
<td><%= "#{content_block.name} (#{content_block.locale})" %></td> <td><%= "#{content_block.name} (#{content_block.locale})" %></td>
<td><%= raw content_block.body %></td> <td><%= raw content_block.body %></td>
<td> <td>
<%= render Admin::TableActionsComponent.new(content_block) %> <%= render Admin::TableActionsComponent.new(content_block) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
<% @headings_content_blocks.each do |content_block| %> <% @headings_content_blocks.each do |content_block| %>
<tr id="<%= dom_id(content_block) %>"> <tr id="<%= dom_id(content_block) %>">
<td><%= "#{content_block.name} (#{content_block.locale})" %></td> <td><%= "#{content_block.name} (#{content_block.locale})" %></td>
<td><%= raw content_block.body %></td> <td><%= raw content_block.body %></td>
<td> <td>
<%= render Admin::TableActionsComponent.new( <%= render Admin::TableActionsComponent.new(
content_block, content_block,
edit_path: admin_site_customization_edit_heading_content_block_path(content_block), edit_path: admin_site_customization_edit_heading_content_block_path(content_block),
destroy_path: admin_site_customization_delete_heading_content_block_path(content_block) destroy_path: admin_site_customization_delete_heading_content_block_path(content_block)
) %> ) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% else %>

View File

@@ -37,7 +37,7 @@
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
<table> </table>
<% else %> <% else %>
<div class="callout primary"> <div class="callout primary">
<%= t("admin.documents.index.no_documents") %> <%= t("admin.documents.index.no_documents") %>

View File

@@ -56,7 +56,9 @@
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<p class="featured"> <p class="featured">
<%= t "admin.stats.show.summary.proposal_votes" %> <br> <%= t "admin.stats.show.summary.proposal_votes" %> <br>
<span class="number"><%= number_with_delimiter(@proposal_votes) %> <br></span> <span class="number">
<%= number_with_delimiter(@proposal_votes) %> <br>
</span>
</p> </p>
<p> <p>
<%= t "admin.stats.show.summary.debate_votes" %> <br> <%= t "admin.stats.show.summary.debate_votes" %> <br>

View File

@@ -9,41 +9,41 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @system_emails.each do |system_email_title, system_email_actions| %> <% @system_emails.each do |system_email_title, system_email_actions| %>
<tr id="<%= system_email_title %>" class="system_email"> <tr id="<%= system_email_title %>" class="system_email">
<td> <td>
<%= t("admin.system_emails.#{system_email_title}.title") %> <%= t("admin.system_emails.#{system_email_title}.title") %>
</td> </td>
<td> <td>
<%= t("admin.system_emails.#{system_email_title}.description") %> <%= t("admin.system_emails.#{system_email_title}.description") %>
</td> </td>
<td> <td>
<%= render Admin::TableActionsComponent.new(system_email_title, actions: []) do |actions| %> <%= render Admin::TableActionsComponent.new(system_email_title, actions: []) do |actions| %>
<% if system_email_actions.include?("view") %> <% if system_email_actions.include?("view") %>
<%= actions.action(:show, <%= actions.action(:show,
text: t("admin.shared.view"), text: t("admin.shared.view"),
path: admin_system_email_view_path(system_email_title)) %> path: admin_system_email_view_path(system_email_title)) %>
<% end %> <% end %>
<% if system_email_actions.include?("preview_pending") %> <% if system_email_actions.include?("preview_pending") %>
<%= actions.action(:preview_pending, <%= actions.action(:preview_pending,
text: t("admin.system_emails.preview_pending.action"), text: t("admin.system_emails.preview_pending.action"),
path: admin_system_email_preview_pending_path(system_email_title)) %> path: admin_system_email_preview_pending_path(system_email_title)) %>
<%= actions.action(:send_pending, <%= actions.action(:send_pending,
text: t("admin.system_emails.preview_pending.send_pending"), text: t("admin.system_emails.preview_pending.send_pending"),
path: admin_system_email_send_pending_path(system_email_title), path: admin_system_email_send_pending_path(system_email_title),
method: :put) %> method: :put) %>
<% end %> <% end %>
<% if system_email_actions.include?("edit_info") %> <% if system_email_actions.include?("edit_info") %>
<p class="help-text"> <p class="help-text">
<%= t("admin.system_emails.edit_info") %><br> <%= t("admin.system_emails.edit_info") %><br>
<code><%= "app/views/mailer/#{system_email_title}.html.erb" %></code> <code><%= "app/views/mailer/#{system_email_title}.html.erb" %></code>
</p> </p>
<% end %>
<% end %> <% end %>
<% end %> </td>
</td> </tr>
</tr> <% end %>
<% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -18,22 +18,22 @@
<th scope="col"><%= t("admin.actions.actions") %></th> <th scope="col"><%= t("admin.actions.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<tr> <tr>
<td> <td>
<%= form_for(tag, <%= form_for(tag,
url: admin_tag_path(tag), url: admin_tag_path(tag),
as: :tag, as: :tag,
html: { id: "edit_tag_#{tag.id}" }) do |f| %> html: { id: "edit_tag_#{tag.id}" }) do |f| %>
<strong><%= tag.name %></strong> <strong><%= tag.name %></strong>
<% end %> <% end %>
</td> </td>
<td id="tag_<%= tag.id %>"> <td id="tag_<%= tag.id %>">
<%= render Admin::TableActionsComponent.new(tag, actions: [:destroy]) %> <%= render Admin::TableActionsComponent.new(tag, actions: [:destroy]) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -1,10 +1,10 @@
<% provide :title, t("budgets.executions.page_title", budget: @budget.name) %> <% provide :title, t("budgets.executions.page_title", budget: @budget.name) %>
<% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %> <% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: budget_executions_url(@budget), social_url: budget_executions_url(@budget),
social_title: @budget.name, social_title: @budget.name,
social_description: @budget.description_for_phase("finished") %> social_description: @budget.description_for_phase("finished") %>
<% end %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>

View File

@@ -7,12 +7,12 @@
edit_budget_investment_path(investment.budget, investment), edit_budget_investment_path(investment.budget, investment),
method: :get, class: "button hollow expanded" %> method: :get, class: "button hollow expanded" %>
<% else %> <% else %>
<%= link_to image_path(investment.image), <%= link_to image_path(investment.image),
method: :delete, method: :delete,
class: "button hollow alert expanded" do %> class: "button hollow alert expanded" do %>
<span class="icon-image"></span> <span class="icon-image"></span>
<%= t("images.remove_image") %> <%= t("images.remove_image") %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

View File

@@ -2,69 +2,55 @@
<div class="panel <%= ("with-image" if feature?(:allow_images) && investment.image.present?) %>"> <div class="panel <%= ("with-image" if feature?(:allow_images) && investment.image.present?) %>">
<% if feature?(:allow_images) && investment.image.present? %> <% if feature?(:allow_images) && investment.image.present? %>
<div class="row"> <div class="panel-image">
<div class="small-12 medium-3 large-2 column text-center">
<%= image_tag investment.image.variant(:thumb), alt: investment.image.title.unicode_normalize %> <%= image_tag investment.image.variant(:thumb), alt: investment.image.title.unicode_normalize %>
</div> </div>
<div class="small-12 medium-6 large-7 column">
<% else %>
<div class="row">
<div class="small-12 medium-9 column">
<% end %> <% end %>
<div class="budget-investment-content">
<% cache [locale_and_user_status(investment), "index", investment, investment.author] do %> <div class="budget-investment-content">
<h3><%= link_to investment.title, namespaced_budget_investment_path(investment) %></h3> <% cache [locale_and_user_status(investment), "index", investment, investment.author] do %>
<h3><%= link_to investment.title, namespaced_budget_investment_path(investment) %></h3>
<%= render Budgets::Investments::InfoComponent.new(investment) %> <%= render Budgets::Investments::InfoComponent.new(investment) %>
<div class="investment-project-description"> <div class="investment-project-description">
<%= wysiwyg(investment.description) %> <%= wysiwyg(investment.description) %>
<div class="truncate"></div> <div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: investment, limit: 5 %>
<% end %>
</div> </div>
</div> <%= render "shared/tags", taggable: investment, limit: 5 %>
<% unless investment.unfeasible? %>
<% if investment.should_show_votes? %>
<div id="<%= dom_id(investment) %>_votes"
class="small-12 medium-3 column text-center">
<%= render Budgets::Investments::VotesComponent.new(investment) %>
</div>
<% elsif investment.should_show_vote_count? %>
<div id="<%= dom_id(investment) %>_votes"
class="small-12 medium-3 column text-center">
<div class="supports">
<span class="total-supports no-button">
<%= t("budgets.investments.investment.supports",
count: investment.total_votes) %>
</span>
</div>
</div>
<% elsif investment.should_show_ballots? && !management_controller? %>
<div id="<%= dom_id(investment) %>_ballot"
class="small-12 medium-3 column text-center">
<%= render "/budgets/investments/ballot",
investment: investment,
investment_ids: investment_ids,
ballot: ballot %>
</div>
<% elsif investment.should_show_price? %>
<div id="<%= dom_id(investment) %>_price"
class="supports small-12 medium-3 column text-center">
<div class="supports">
<span class="total-supports no-button">
<%= investment.formatted_price %>
</span>
</div>
</div>
<% end %>
<% end %> <% end %>
</div> </div>
<% unless investment.unfeasible? %>
<% if investment.should_show_votes? %>
<div id="<%= dom_id(investment) %>_votes">
<%= render Budgets::Investments::VotesComponent.new(investment) %>
</div>
<% elsif investment.should_show_vote_count? %>
<div id="<%= dom_id(investment) %>_votes">
<div class="supports">
<span class="total-supports no-button">
<%= t("budgets.investments.investment.supports",
count: investment.total_votes) %>
</span>
</div>
</div>
<% elsif investment.should_show_ballots? && !management_controller? %>
<div id="<%= dom_id(investment) %>_ballot">
<%= render "/budgets/investments/ballot",
investment: investment,
investment_ids: investment_ids,
ballot: ballot %>
</div>
<% elsif investment.should_show_price? %>
<div id="<%= dom_id(investment) %>_price" class="supports">
<div class="supports">
<span class="total-supports no-button">
<%= investment.formatted_price %>
</span>
</div>
</div>
<% end %>
<% end %>
</div> </div>
</div> </div>

View File

@@ -1,13 +1,9 @@
<div id="<%= dom_id(investment) %>" class="budget-investment minimal clear"> <div id="<%= dom_id(investment) %>" class="budget-investment minimal clear">
<div class="panel"> <div class="panel">
<div class="row"> <div class="budget-investment-content">
<div class="small-12 column"> <% cache [locale_and_user_status(investment), "index_minimal", investment, investment.author] do %>
<div class="budget-investment-content"> <h3><%= link_to investment.title, namespaced_budget_investment_path(investment) %></h3>
<% cache [locale_and_user_status(investment), "index_minimal", investment, investment.author] do %> <% end %>
<h3><%= link_to investment.title, namespaced_budget_investment_path(investment) %></h3>
<% end %>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,10 +1,10 @@
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: budget_investments_path(investment), social_url: budget_investments_path(investment),
social_title: investment.title, social_title: investment.title,
social_description: investment.description, social_description: investment.description,
twitter_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil), twitter_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil),
og_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil) %> og_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil) %>
<% end %> <% end %>
<section class="budget-investment-show" id="<%= dom_id(investment) %>"> <section class="budget-investment-show" id="<%= dom_id(investment) %>">
@@ -120,6 +120,6 @@
<%= render "communities/access_button", community: investment.community %> <%= render "communities/access_button", community: investment.community %>
</aside> </aside>
</div> </div>
</section> </section>

View File

@@ -30,40 +30,40 @@
<tbody> <tbody>
<% amount_available = heading_price %> <% amount_available = heading_price %>
<% investments.each do |investment| %> <% investments.each do |investment| %>
<tr id="<%= dom_id(investment) %>" <tr id="<%= dom_id(investment) %>"
class="budget-investments <%= investment.winner? ? "success" : "js-discarded" %>" class="budget-investments <%= investment.winner? ? "success" : "js-discarded" %>"
style="<%= investment.winner? ? "" : "display: none" %>"> style="<%= investment.winner? ? "" : "display: none" %>">
<td> <td>
<% if investment.winner? %> <% if investment.winner? %>
<span class="icon-check"> <span class="icon-check">
<span class="show-for-sr"> <span class="show-for-sr">
<%= t("budgets.results.accepted") %> <%= t("budgets.results.accepted") %>
</span>
</span> </span>
<% else %> </span>
<span class="icon-x delete"> <% else %>
<span class="show-for-sr"> <span class="icon-x delete">
<%= t("budgets.results.discarded") %> <span class="show-for-sr">
</span> <%= t("budgets.results.discarded") %>
</span> </span>
<% end %> </span>
<%= link_to investment.title, budget_investment_path(@budget, investment) %>
</td>
<td class="text-center">
<%= investment.ballot_lines_count %>
</td>
<% if @budget.show_money? %>
<td class="text-center">
<%= @budget.formatted_amount(investment.price) %>
</td>
<% if results_type == :compatible %>
<td class="small text-right"
title="<%= @budget.formatted_amount(amount_available) %> - <%= @budget.formatted_amount(investment.price) %>">
<%= @budget.formatted_amount(amount_available - investment.price) %>
<% amount_available -= investment.price if investment.winner? %>
</td>
<% end %>
<% end %> <% end %>
<%= link_to investment.title, budget_investment_path(@budget, investment) %>
</td>
<td class="text-center">
<%= investment.ballot_lines_count %>
</td>
<% if @budget.show_money? %>
<td class="text-center">
<%= @budget.formatted_amount(investment.price) %>
</td>
<% if results_type == :compatible %>
<td class="small text-right"
title="<%= @budget.formatted_amount(amount_available) %> - <%= @budget.formatted_amount(investment.price) %>">
<%= @budget.formatted_amount(amount_available - investment.price) %>
<% amount_available -= investment.price if investment.winner? %>
</td>
<% end %>
<% end %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

View File

@@ -1,10 +1,10 @@
<% provide :title, t("budgets.results.page_title", budget: @budget.name) %> <% provide :title, t("budgets.results.page_title", budget: @budget.name) %>
<% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %> <% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: budget_results_url(@budget), social_url: budget_results_url(@budget),
social_title: @budget.name, social_title: @budget.name,
social_description: @budget.description_for_phase("finished") %> social_description: @budget.description_for_phase("finished") %>
<% end %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: budget_results_url(@budget) %> <%= render "shared/canonical", href: budget_results_url(@budget) %>

View File

@@ -1,9 +1,9 @@
<% provide :title, t("stats.budgets.page_title", budget: @budget.name) %> <% provide :title, t("stats.budgets.page_title", budget: @budget.name) %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: budget_stats_url(@budget), social_url: budget_stats_url(@budget),
social_title: @budget.name, social_title: @budget.name,
social_description: @budget.description_for_phase("finished") %> social_description: @budget.description_for_phase("finished") %>
<% end %> <% end %>
<div class="participation-stats budgets-stats"> <div class="participation-stats budgets-stats">
@@ -40,10 +40,10 @@
</p> </p>
<% end %> <% end %>
<p class="help-text"> <p class="help-text">
<%= t("stats.budgets.participatory_disclaimer") %> <%= t("stats.budgets.participatory_disclaimer") %>
</p> </p>
<p class="help-text"> <p class="help-text">
<%= t("stats.budgets.heading_disclaimer") %> <%= t("stats.budgets.heading_disclaimer") %>
</p> </p>
</div> </div>
</div> </div>

View File

@@ -12,7 +12,7 @@
<% if author?(@community, participant) %> <% if author?(@community, participant) %>
&nbsp;&bull;&nbsp; &nbsp;&bull;&nbsp;
<span class="label round is-author"> <span class="label round is-author">
<%= t("comments.comment.author") %> <%= t("comments.comment.author") %>
</span> </span>
<% end %> <% end %>

View File

@@ -25,9 +25,9 @@
</div> </div>
<div class="poster-content"> <div class="poster-content">
<h2><%= t("dashboard.poster.index.support") %></h2> <h2><%= t("dashboard.poster.index.support") %></h2>
<%= image_tag "quote_before_blue.png", alt: "" %> <%= image_tag "quote_before_blue.png", alt: "" %>
<h3><%= proposal.title %></h3> <h3><%= proposal.title %></h3>
<%= image_tag "quote_after_blue.png", alt: "" %> <%= image_tag "quote_after_blue.png", alt: "" %>
<p class="poster-footer"> <p class="poster-footer">
<%= sanitize(t("dashboard.poster.index.footer", link: proposal_url(proposal))) %> <%= sanitize(t("dashboard.poster.index.footer", link: proposal_url(proposal))) %>
</p> </p>

View File

@@ -1,57 +1,51 @@
<% cache [locale_and_user_status, debate, current_user&.voted_as_when_voted_for(debate)] do %> <% cache [locale_and_user_status, debate, current_user&.voted_as_when_voted_for(debate)] do %>
<div id="<%= dom_id(debate) %>" class="debate clear" data-type="debate"> <div id="<%= dom_id(debate) %>" class="debate clear" data-type="debate">
<div class="panel"> <div class="panel">
<div class="row"> <div class="debate-content">
<h3><%= link_to debate.title, debate %></h3>
<p class="debate-info">
<%= l debate.created_at.to_date %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render Shared::CommentsCountComponent.new(
debate.comments_count,
url: debate_path(debate, anchor: "comments")
) %>
<div class="small-12 medium-9 column"> <% if debate.author.hidden? || debate.author.erased? %>
<div class="debate-content"> <span class="bullet">&nbsp;&bull;&nbsp;</span>
<h3><%= link_to debate.title, debate %></h3> <span class="author">
<p class="debate-info"> <%= t("debates.show.author_deleted") %>
<%= l debate.created_at.to_date %> </span>
<% else %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= debate.author.name %>
</span>
<% if debate.author.display_official_position_badge? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span> <span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render Shared::CommentsCountComponent.new( <span class="label round level-<%= debate.author.official_level %>">
debate.comments_count, <%= debate.author.official_position %>
url: debate_path(debate, anchor: "comments") </span>
) %> <% end %>
<% end %>
<% if debate.author.hidden? || debate.author.erased? %> <% if debate.author.verified_organization? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span> <span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author"> <span class="label round is-association">
<%= t("debates.show.author_deleted") %> <%= t("shared.collective") %>
</span> </span>
<% else %> <% end %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= debate.author.name %>
</span>
<% if debate.author.display_official_position_badge? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round level-<%= debate.author.official_level %>">
<%= debate.author.official_position %>
</span>
<% end %>
<% end %>
<% if debate.author.verified_organization? %> </p>
<span class="bullet">&nbsp;&bull;&nbsp;</span> <div class="debate-description">
<span class="label round is-association"> <%= wysiwyg(debate.description) %>
<%= t("shared.collective") %> <div class="truncate"></div>
</span>
<% end %>
</p>
<div class="debate-description">
<%= wysiwyg(debate.description) %>
<div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: debate, limit: 5 %>
</div>
</div>
<div id="<%= dom_id(debate) %>_votes" class="small-12 medium-3 column">
<%= render Debates::VotesComponent.new(debate) %>
</div> </div>
<%= render "shared/tags", taggable: debate, limit: 5 %>
</div>
<div id="<%= dom_id(debate) %>_votes">
<%= render Debates::VotesComponent.new(debate) %>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,14 +1,10 @@
<div id="<%= dom_id(debate) %>" class="debate minimal clear" data-type="debate"> <div id="<%= dom_id(debate) %>" class="debate minimal clear" data-type="debate">
<div class="panel"> <div class="panel">
<div class="row"> <div class="debate-content">
<div class="small-12 column"> <% cache [locale_and_user_status,
<div class="debate-content"> "index_minimal", debate, current_user&.voted_as_when_voted_for(debate)] do %>
<% cache [locale_and_user_status, <h3><%= link_to debate.title, debate %></h3>
"index_minimal", debate, current_user&.voted_as_when_voted_for(debate)] do %> <% end %>
<h3><%= link_to debate.title, debate %></h3>
<% end %>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -69,7 +69,6 @@
<p><%= t("debates.index.section_footer.help_text_1") %></p> <p><%= t("debates.index.section_footer.help_text_1") %></p>
<p><%= sanitize(t("debates.index.section_footer.help_text_2", <p><%= sanitize(t("debates.index.section_footer.help_text_2",
org: link_to(setting["org_name"], new_user_registration_path))) %></p> org: link_to(setting["org_name"], new_user_registration_path))) %></p>
</p>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -9,8 +9,8 @@
<%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> <%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
<% if @requires_password %> <% if @requires_password %>
<p><%= f.password_field :password %></p> <p><%= f.password_field :password %></p>
<p><%= f.password_field :password_confirmation %></p> <p><%= f.password_field :password_confirmation %></p>
<% end %> <% end %>
<%= hidden_field_tag :confirmation_token, @confirmation_token %> <%= hidden_field_tag :confirmation_token, @confirmation_token %>

View File

@@ -2,9 +2,9 @@
<%= form_for(resource, as: resource_name, url: [resource_name, :password_expired], html: { method: :put }) do |f| %> <%= form_for(resource, as: resource_name, url: [resource_name, :password_expired], html: { method: :put }) do |f| %>
<%= f.password_field :current_password %></p> <%= f.password_field :current_password %>
<%= f.password_field :password, label: t("devise.password_expired.new_password") %></p> <%= f.password_field :password, label: t("devise.password_expired.new_password") %>
<%= f.password_field :password_confirmation %></p> <%= f.password_field :password_confirmation %>
<p><%= f.submit t("devise.password_expired.change_password") %></p> <p><%= f.submit t("devise.password_expired.change_password") %></p>
<% end %> <% end %>

View File

@@ -3,20 +3,6 @@
<%= link_to t("devise_views.shared.links.login"), new_session_path(resource_name) %><br> <%= link_to t("devise_views.shared.links.login"), new_session_path(resource_name) %><br>
<% end -%> <% end -%>
<%#- if devise_mapping.registerable? &&
controller_name != "registrations" ||
controller_path != "users/registrations" %>
<%#= link_to t("devise_views.shared.links.signup"), new_user_registration_path %><!-- <br> -->
<%# end -%>
<%#- if devise_mapping.registerable? && controller_name == "registrations" && controller_path != "organizations/registrations" %>
<%#= link_to t("devise_views.shared.links.organization_signup"), new_organization_registration_path %>
<%# end -%>
<%#- if devise_mapping.recoverable? && controller_name != "passwords" && controller_name != "registrations" %>
<%#= link_to t("devise_views.shared.links.new_password"), new_password_path(resource_name) %><!-- <br> -->
<%# end -%>
<%- if devise_mapping.confirmable? && controller_name != "confirmations" %> <%- if devise_mapping.confirmable? && controller_name != "confirmations" %>
<%= link_to t("devise_views.shared.links.new_confirmation"), new_confirmation_path(resource_name) %><br> <%= link_to t("devise_views.shared.links.new_confirmation"), new_confirmation_path(resource_name) %><br>
<% end -%> <% end -%>

View File

@@ -38,7 +38,7 @@
</div> </div>
<div class="progress" role="progressbar" tabindex="0" aria-valuenow="0" aria-valuemin="0" <div class="progress" role="progressbar" tabindex="0" aria-valuenow="0" aria-valuemin="0"
aria-valuetext="<%= "#{next_goal_progress}%" %>" aria-valuemax="100"> aria-valuetext="<%= "#{next_goal_progress}%" %>" aria-valuemax="100">
<div class="progress-meter" style="width: <%= next_goal_progress %>%"></div> <div class="progress-meter" style="width: <%= next_goal_progress %>%"></div>
</div> </div>
</div> </div>

View File

@@ -1,22 +1,22 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html <%= common_html_attributes %>> <html <%= common_html_attributes %> id="mailer_layout">
<head> <head>
<title><%= t("mailers.title") %></title> <title><%= t("mailers.title") %></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,maximum-scale=10.0" /> <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,maximum-scale=10.0" />
</head> </head>
<body style="background: #fff; font-family:font-family: 'Open Sans','Helvetica Neue',arial,sans-serif !important; margin: 0 10px; padding: 0; text-align: left;"> <body style="background: #fff; font-family:font-family: 'Open Sans','Helvetica Neue',arial,sans-serif !important; margin: 0 10px; padding: 0; text-align: left;">
<%= render "layouts/mailer_header" %> <%= render "layouts/mailer_header" %>
<table cellpadding="0" cellspacing="0" border="0" style="background: #fff; margin: 0 auto; max-width: 700px; width:100%;"> <table cellpadding="0" cellspacing="0" border="0" style="background: #fff; margin: 0 auto; max-width: 700px; width:100%;">
<tbody> <tbody>
<tr> <tr>
<%= yield %> <%= yield %>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<%= render "layouts/mailer_footer" %> <%= render "layouts/mailer_footer" %>
</body> </body>
</html> </html>

View File

@@ -2,4 +2,4 @@
<span id="annotation-link" data-sub-annotation-ids="8"> <span id="annotation-link" data-sub-annotation-ids="8">
<%= render "annotation_link", annotation: annotation %> <%= render "annotation_link", annotation: annotation %>
<span> </span>

View File

@@ -11,7 +11,7 @@
<div class="comment-footer"> <div class="comment-footer">
<% if annotation.comments.roots.count > Legislation::Annotation::COMMENTS_PAGE_SIZE %> <% if annotation.comments.roots.count > Legislation::Annotation::COMMENTS_PAGE_SIZE %>
<%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation), class: "button" do %> <%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation), class: "button" do %>
<strong><%= t("legislation.annotations.comments.see_all") %></strong> <strong><%= t("legislation.annotations.comments.see_all") %></strong>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -18,8 +18,8 @@
<aside class="small-12 medium-3 column"> <aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<h2><%= t("legislation.shared.share") %></h2> <h2><%= t("legislation.shared.share") %></h2>
<%= render "/shared/social_share", <%= render "/shared/social_share",
title: t("legislation.shared.share_comment", version_name: @draft_version.title.downcase, process_name: @process.title), title: t("legislation.shared.share_comment", version_name: @draft_version.title.downcase, process_name: @process.title),
url: legislation_process_draft_version_path(process, draft_version) %> url: legislation_process_draft_version_path(process, draft_version) %>
</aside> </aside>
</div> </div>

View File

@@ -58,14 +58,14 @@
<div><span class="panel-title"><%= t("legislation.draft_versions.show.text_body") %></span></div> <div><span class="panel-title"><%= t("legislation.draft_versions.show.text_body") %></span></div>
</div> </div>
<div id="sticky-panel" class="draft-text"> <div id="sticky-panel" class="draft-text">
<% if @draft_version.final_version? %> <section <%= tag.attributes(
<section> class: "legislation-annotatable",
<% else %> data: {
<section class="legislation-annotatable" "legislation-draft-version-id": @draft_version.id,
data-legislation-draft-version-id="<%= @draft_version.id %>" "legislation-annotatable-base-url": legislation_process_draft_version_path(@process, @draft_version),
data-legislation-annotatable-base-url="<%= legislation_process_draft_version_path(@process, @draft_version) %>" "legislation-open-phase": @process.allegations_phase.open?
data-legislation-open-phase="<%= @process.allegations_phase.open? %>"> }
<% end %> ) unless @draft_version.final_version? %>>
<%= AdminLegislationSanitizer.new.sanitize(@draft_version.body_html) %> <%= AdminLegislationSanitizer.new.sanitize(@draft_version.body_html) %>
</section> </section>
</div> </div>

View File

@@ -1,8 +1,8 @@
<div class="legislation-hero jumbo" style="<%= css_for_process_header %>"> <div class="legislation-hero jumbo" style="<%= css_for_process_header(@process) %>">
<div class="row"> <div class="row">
<div class="small-12 medium-9 column"> <div class="small-12 medium-9 column">
<% if banner_color? %> <% if banner_color?(@process) %>
<%= link_to t("shared.back"), <%= link_to t("shared.back"),
legislation_processes_path, legislation_processes_path,
class: "icon-angle-left", class: "icon-angle-left",

View File

@@ -12,10 +12,7 @@
<%= markdown @process.additional_info if @process.additional_info %> <%= markdown @process.additional_info if @process.additional_info %>
</div> </div>
<button type="button" class="button" data-toggle="additional_info" <button type="button" class="button" data-toggle="additional_info" style="<%= css_for_process_header(process) %>">
<% if banner_color? %>
style="background:<%= process.font_color %>; color:<%= process.background_color %>;"
<% end %>>
<%= t("legislation.processes.header.additional_info") %> <%= t("legislation.processes.header.additional_info") %>
</button> </button>
<% end %> <% end %>

View File

@@ -2,78 +2,74 @@
class="proposal clear <%= ("successful" if proposal.total_votes > Proposal.votes_needed_for_success) %>" class="proposal clear <%= ("successful" if proposal.total_votes > Proposal.votes_needed_for_success) %>"
data-type="proposal"> data-type="proposal">
<div class="panel <%= ("with-image" if proposal.image.present?) %>"> <div class="panel <%= ("with-image" if proposal.image.present?) %>">
<div class="icon-successful"></div> <% if proposal.total_votes > Proposal.votes_needed_for_success %>
<div class="icon-successful"></div>
<% end %>
<% if proposal.image.present? %> <% if proposal.image.present? %>
<div class="row"> <div class="panel-image">
<div class="small-12 medium-3 large-2 column text-center"> <%= image_tag proposal.image.variant(:thumb),
<%= image_tag proposal.image.variant(:thumb), alt: proposal.image.title.unicode_normalize %>
alt: proposal.image.title.unicode_normalize %> </div>
</div>
<div class="small-12 medium-6 large-7 column margin-top">
<% else %>
<div class="row">
<div class="small-12 medium-9 column">
<% end %> <% end %>
<div class="proposal-content">
<% cache [locale_and_user_status(proposal), "index", proposal, proposal.author] do %> <div class="proposal-content">
<h3><%= link_to proposal.title, legislation_process_proposal_path(proposal.legislation_process_id, proposal) %></h3> <% cache [locale_and_user_status(proposal), "index", proposal, proposal.author] do %>
<p class="proposal-info"> <h3><%= link_to proposal.title, legislation_process_proposal_path(proposal.legislation_process_id, proposal) %></h3>
<%= l proposal.created_at.to_date %> <p class="proposal-info">
<%= l proposal.created_at.to_date %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render Shared::CommentsCountComponent.new(
proposal.comments_count,
url: legislation_process_proposal_path(
proposal.legislation_process_id,
proposal,
anchor: "comments"
)
) %>
<% if proposal.author.hidden? || proposal.author.erased? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= t("proposals.show.author_deleted") %>
</span>
<% else %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= proposal.author.name %>
</span>
<% if proposal.author.display_official_position_badge? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span> <span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render Shared::CommentsCountComponent.new( <span class="label round level-<%= proposal.author.official_level %>">
proposal.comments_count, <%= proposal.author.official_position %>
url: legislation_process_proposal_path( </span>
proposal.legislation_process_id, <% end %>
proposal,
anchor: "comments"
)
) %>
<% if proposal.author.hidden? || proposal.author.erased? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= t("proposals.show.author_deleted") %>
</span>
<% else %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= proposal.author.name %>
</span>
<% if proposal.author.display_official_position_badge? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round level-<%= proposal.author.official_level %>">
<%= proposal.author.official_position %>
</span>
<% end %>
<% end %>
<% if proposal.author.verified_organization? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>
<% if Geozone.any? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="geozone">
<%= link_to geozone_name(proposal), legislation_process_proposals_path(proposal.legislation_process_id, search: geozone_name(proposal)) %>
</span>
<% end %>
</p>
<div class="proposal-description">
<p><%= proposal.summary %></p>
<div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: proposal, limit: 5 %>
<% end %> <% end %>
</div>
</div>
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column"> <% if proposal.author.verified_organization? %>
<%= render Legislation::Proposals::VotesComponent.new(proposal) %> <span class="bullet">&nbsp;&bull;&nbsp;</span>
</div> <span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>
<% if Geozone.any? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="geozone">
<%= link_to geozone_name(proposal), legislation_process_proposals_path(proposal.legislation_process_id, search: geozone_name(proposal)) %>
</span>
<% end %>
</p>
<div class="proposal-description">
<p><%= proposal.summary %></p>
<div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: proposal, limit: 5 %>
<% end %>
</div>
<div id="<%= dom_id(proposal) %>_votes">
<%= render Legislation::Proposals::VotesComponent.new(proposal) %>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,10 +1,10 @@
<% provide :title, @proposal.title %> <% provide :title, @proposal.title %>
<% content_for :meta_description do %><%= @proposal.summary %><% end %> <% content_for :meta_description do %><%= @proposal.summary %><% end %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: legislation_process_proposal_url(process_id: @process), social_url: legislation_process_proposal_url(process_id: @process),
social_title: @proposal.title, social_title: @proposal.title,
social_description: @proposal.summary %> social_description: @proposal.summary %>
<% end %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: legislation_process_proposal_url(process_id: @process) %> <%= render "shared/canonical", href: legislation_process_proposal_url(process_id: @process) %>

View File

@@ -13,14 +13,14 @@
<%= link_to legislation_process_question_path(@process, @question.next_question_id), class: "quiz-next-link" do %> <%= link_to legislation_process_question_path(@process, @question.next_question_id), class: "quiz-next-link" do %>
<div class="quiz-next"> <div class="quiz-next">
<%= t("legislation.questions.show.next_question") %> <%= t("legislation.questions.show.next_question") %>
<span class="icon-angle-right" aria-hidden="true"> <span class="icon-angle-right" aria-hidden="true"></span>
</div> </div>
<% end %> <% end %>
<% elsif @question.first_question_id %> <% elsif @question.first_question_id %>
<%= link_to legislation_process_question_path(@process, @question.first_question_id), class: "quiz-next-link" do %> <%= link_to legislation_process_question_path(@process, @question.first_question_id), class: "quiz-next-link" do %>
<div class="quiz-next"> <div class="quiz-next">
<%= t("legislation.questions.show.first_question") %> <%= t("legislation.questions.show.first_question") %>
<span class="icon-angle-right" aria-hidden="true"> <span class="icon-angle-right" aria-hidden="true"></span>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -19,9 +19,9 @@
officing_poll_ballot_sheets_path(poll), officing_poll_ballot_sheets_path(poll),
class: "button" %> class: "button" %>
<%= link_to t("officing.polls.final.add_results"), <%= link_to t("officing.polls.final.add_results"),
new_officing_poll_ballot_sheet_path(poll), new_officing_poll_ballot_sheet_path(poll),
class: "button hollow" %> class: "button hollow" %>
<% else %> <% else %>
<%= link_to t("officing.polls.final.add_results"), <%= link_to t("officing.polls.final.add_results"),
new_officing_poll_result_path(poll), new_officing_poll_result_path(poll),

View File

@@ -81,7 +81,7 @@
<%= results_by_booth[booth_assignment].first.booth_assignment.booth.name %> <%= results_by_booth[booth_assignment].first.booth_assignment.booth.name %>
</td> </td>
<td> <td>
<%= link_to t("officing.results.new.see_results"), officing_poll_results_path(@poll, date: l(date), booth_assignment_id: booth_assignment) %> <%= link_to t("officing.results.new.see_results"), officing_poll_results_path(@poll, date: l(date), booth_assignment_id: booth_assignment) %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

@@ -9,10 +9,10 @@
method: :post, method: :post,
remote: true, remote: true,
html: { id: "new_officing_voter" } do |f| %> html: { id: "new_officing_voter" } do |f| %>
<%= f.hidden_field :poll_id, value: poll.id %> <%= f.hidden_field :poll_id, value: poll.id %>
<%= f.hidden_field :user_id, value: @user.id %> <%= f.hidden_field :user_id, value: @user.id %>
<%= f.submit t("officing.voters.show.submit"), <%= f.submit t("officing.voters.show.submit"),
class: "button success", class: "button success",
data: { disable_with: t("officing.voters.can_vote.submit_disable_with") } %> data: { disable_with: t("officing.voters.can_vote.submit_disable_with") } %>
<% end %> <% end %>
</td> </td>

View File

@@ -13,18 +13,18 @@
</thead> </thead>
<tbody> <tbody>
<% @polls.each do |poll| %> <% @polls.each do |poll| %>
<tr id="<%= dom_id(poll) %>"> <tr id="<%= dom_id(poll) %>">
<td> <td>
<%= poll.name %> <%= poll.name %>
</td> </td>
<% if poll.votable_by?(@user) %> <% if poll.votable_by?(@user) %>
<%= render "can_vote", poll: poll %> <%= render "can_vote", poll: poll %>
<% elsif poll.voted_by?(@user) || poll.user_has_an_online_ballot?(@user) %> <% elsif poll.voted_by?(@user) || poll.user_has_an_online_ballot?(@user) %>
<%= render "already_voted" %> <%= render "already_voted" %>
<% else %> <% else %>
<%= render "cannot_vote" %> <%= render "cannot_vote" %>
<% end %> <% end %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@@ -1,10 +1,10 @@
<% provide :title, t("devise_views.organizations.registrations.new.title") %> <% provide :title, t("devise_views.organizations.registrations.new.title") %>
<h2><%= t("devise_views.organizations.registrations.new.title") %></h2> <h2><%= t("devise_views.organizations.registrations.new.title") %></h2>
<%= form_for(resource, as: :user, url: organization_registration_path) do |f| %> <%= form_for(resource, as: :user, url: organization_registration_path) do |f| %>
<%= render "shared/errors", resource: resource %> <%= render "shared/errors", resource: resource %>
<div class="row"> <div class="row">
<div class="small-12 column"> <div class="small-12 column">
<%= f.fields_for :organization do |fo| %> <%= f.fields_for :organization do |fo| %>
<%= fo.text_field :name, autofocus: true, maxlength: Organization.name_max_length %> <%= fo.text_field :name, autofocus: true, maxlength: Organization.name_max_length %>

View File

@@ -1,94 +1,86 @@
<div id="<%= dom_id(proposal) %>" <div id="<%= dom_id(proposal) %>"
class="proposal clear class="proposal clear <%= ("successful" if proposal.successful?) %>"
<%= ("successful" if proposal.total_votes > Proposal.votes_needed_for_success) %>"
data-type="proposal"> data-type="proposal">
<div class="panel <%= "with-image" if proposal.image.present? %>"> <div class="panel <%= "with-image" if proposal.image.present? %>">
<div class="icon-successful"></div> <% if proposal.successful? %>
<div class="icon-successful"></div>
<% end %>
<% if proposal.image.present? %> <% if proposal.image.present? %>
<div class="row"> <div class="panel-image">
<div class="small-12 medium-3 large-2 column text-center"> <%= image_tag proposal.image.variant(:thumb),
<%= image_tag proposal.image.variant(:thumb), alt: proposal.image.title.unicode_normalize %>
alt: proposal.image.title.unicode_normalize %>
</div>
<div class="<%= css_for_proposal_info_row(proposal) %>">
<% else %>
<div class="row">
<div class="<%= css_for_proposal_info_row(proposal) %>">
<% end %>
<div class="proposal-content">
<% cache [locale_and_user_status(proposal), "index", proposal, proposal.author] do %>
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
<p class="proposal-info">
<%= l proposal.created_at.to_date %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render Shared::CommentsCountComponent.new(
proposal.comments_count,
url: namespaced_proposal_path(proposal, anchor: "comments")
) %>
<% if proposal.author.hidden? || proposal.author.erased? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= t("proposals.show.author_deleted") %>
</span>
<% else %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= proposal.author.name %>
</span>
<% if proposal.author.display_official_position_badge? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round level-<%= proposal.author.official_level %>">
<%= proposal.author.official_position %>
</span>
<% end %>
<% end %>
<% if proposal.author.verified_organization? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>
<% if Geozone.any? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="geozone">
<%= link_to geozone_name(proposal), proposals_path(search: geozone_name(proposal)) %>
</span>
<% end %>
</p>
<div class="proposal-description">
<p><%= proposal.summary %></p>
<div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: proposal, limit: 5 %>
<% end %>
</div>
</div> </div>
<% end %>
<% if show_proposal_votes? %> <div class="proposal-content">
<div id="<%= dom_id(proposal) %>_votes" <% cache [locale_and_user_status(proposal), "index", proposal, proposal.author] do %>
class="small-12 medium-3 column supports-container"> <h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
<% if proposal.successful? %> <p class="proposal-info">
<div class="padding"> <%= l proposal.created_at.to_date %>
<div class="supports text-center"> <span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render "proposals/supports", proposal: proposal %> <%= render Shared::CommentsCountComponent.new(
</div> proposal.comments_count,
</div> url: namespaced_proposal_path(proposal, anchor: "comments")
<% elsif proposal.archived? %> ) %>
<div class="padding text-center">
<strong><%= t("proposals.proposal.supports", count: proposal.total_votes) %></strong> <% if proposal.author.hidden? || proposal.author.erased? %>
<p><%= t("proposals.proposal.archived") %></p> <span class="bullet">&nbsp;&bull;&nbsp;</span>
</div> <span class="author">
<%= t("proposals.show.author_deleted") %>
</span>
<% else %> <% else %>
<%= render "votes", proposal: proposal %> <span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= proposal.author.name %>
</span>
<% if proposal.author.display_official_position_badge? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round level-<%= proposal.author.official_level %>">
<%= proposal.author.official_position %>
</span>
<% end %>
<% end %> <% end %>
</div>
<% end %>
<% if proposal.author.verified_organization? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>
<% if Geozone.any? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="geozone">
<%= link_to geozone_name(proposal), proposals_path(search: geozone_name(proposal)) %>
</span>
<% end %>
</p>
<div class="proposal-description">
<p><%= proposal.summary %></p>
<div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: proposal, limit: 5 %>
<% end %>
</div> </div>
<% if show_proposal_votes? %>
<div id="<%= dom_id(proposal) %>_votes" class="supports-container">
<% if proposal.successful? %>
<div class="padding">
<div class="supports">
<%= render "proposals/supports", proposal: proposal %>
</div>
</div>
<% elsif proposal.archived? %>
<div class="padding">
<strong><%= t("proposals.proposal.supports", count: proposal.total_votes) %></strong>
<p><%= t("proposals.proposal.archived") %></p>
</div>
<% else %>
<%= render "votes", proposal: proposal %>
<% end %>
</div>
<% end %>
</div> </div>
</div> </div>

View File

@@ -1,14 +1,10 @@
<div id="<%= dom_id(proposal) %>" class="proposal minimal clear" data-type="proposal"> <div id="<%= dom_id(proposal) %>" class="proposal minimal clear" data-type="proposal">
<div class="panel"> <div class="panel">
<div class="row"> <div class="proposal-content">
<div class="small-12 column"> <% cache [locale_and_user_status(proposal),
<div class="proposal-content"> "index_minimal", proposal, proposal.author] do %>
<% cache [locale_and_user_status(proposal), <h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
"index_minimal", proposal, proposal.author] do %> <% end %>
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
<% end %>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -8,12 +8,7 @@
<%= render "shared/canonical", href: proposals_url %> <%= render "shared/canonical", href: proposals_url %>
<% end %> <% end %>
<% if [ <% if [@search_terms, @advanced_search_terms, params[:retired].present?, params[:selected].present?].any? %>
@search_terms,
@advanced_search_terms,
params[:retired].present?,
params[:selected].present?
].any? %>
<%= render Shared::SearchResultsSummaryComponent.new( <%= render Shared::SearchResultsSummaryComponent.new(
results: @proposals, results: @proposals,
search_terms: @search_terms, search_terms: @search_terms,

View File

@@ -7,7 +7,7 @@
<h3><%= link_to @proposal.title, @proposal %></h3> <h3><%= link_to @proposal.title, @proposal %></h3>
<div data-alert class="callout warning"> <div data-alert class="callout warning">
<%= t("proposals.retire_form.warning") %> <%= t("proposals.retire_form.warning") %>
</div> </div>
<%= render "shared/globalize_locales", resource: @proposal, manage_languages: false %> <%= render "shared/globalize_locales", resource: @proposal, manage_languages: false %>

View File

@@ -1,9 +1,9 @@
<% provide :title, @proposal.title %> <% provide :title, @proposal.title %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",
social_url: proposal_url(@proposal), social_url: proposal_url(@proposal),
social_title: @proposal.title, social_title: @proposal.title,
social_description: @proposal.summary %> social_description: @proposal.summary %>
<% end %> <% end %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: proposal_url(@proposal) %> <%= render "shared/canonical", href: proposal_url(@proposal) %>

View File

@@ -1,12 +1,12 @@
<% if resource.author.hidden? || resource.author.erased? %> <% if resource.author.hidden? || resource.author.erased? %>
<span class="icon-deleted author-deleted"></span> <span class="icon-deleted author-deleted"></span>
<span class="author deleted"> <span class="author deleted">
<%= t("shared.author_info.author_deleted") %> <%= t("shared.author_info.author_deleted") %>
</span> </span>
<% else %> <% else %>
<%= render Shared::AvatarComponent.new(resource.author, size: 32, class: "author-photo") %> <%= render Shared::AvatarComponent.new(resource.author, size: 32, class: "author-photo") %>
<span class="author"> <span class="author">
<%= link_to resource.author.name, user_path(resource.author) %> <%= link_to resource.author.name, user_path(resource.author) %>
</span> </span>
<% if resource.respond_to?(:association_name) && resource.association_name.present? %> <% if resource.respond_to?(:association_name) && resource.association_name.present? %>

View File

@@ -3,7 +3,9 @@
<% valid_filters.each do |filter| %> <% valid_filters.each do |filter| %>
<% if current_filter == filter %> <% if current_filter == filter %>
<li class="is-active"><h2><%= t("#{i18n_namespace}.filters.#{filter}") %></h2></li> <li class="is-active">
<h2><%= t("#{i18n_namespace}.filters.#{filter}") %></h2>
</li>
<% else %> <% else %>
<li><%= link_to t("#{i18n_namespace}.filters.#{filter}"), <li><%= link_to t("#{i18n_namespace}.filters.#{filter}"),
current_path_with_query_params(filter: filter, page: 1) %></li> current_path_with_query_params(filter: filter, page: 1) %></li>

View File

@@ -2,12 +2,12 @@
<p id="price"> <p id="price">
<strong> <strong>
<%= t("valuation.budget_investments.show.price") %> <%= t("valuation.budget_investments.show.price") %>
(<%= t("valuation.budget_investments.show.currency") %>): (<%= t("valuation.budget_investments.show.currency") %>):
</strong> </strong>
<% if @investment.price.present? %> <% if @investment.price.present? %>
<%= @investment.price %> <%= @investment.price %>
<% else %> <% else %>
<%= t("valuation.budget_investments.show.undefined") %> <%= t("valuation.budget_investments.show.undefined") %>
<% end %> <% end %>
</p> </p>
@@ -20,7 +20,7 @@
<% if @investment.price_first_year.present? %> <% if @investment.price_first_year.present? %>
<%= @investment.price_first_year %> <%= @investment.price_first_year %>
<% else %> <% else %>
<%= t("valuation.budget_investments.show.undefined") %> <%= t("valuation.budget_investments.show.undefined") %>
<% end %> <% end %>
</p> </p>
<% end %> <% end %>

View File

@@ -6,21 +6,21 @@
<fieldset class="fieldset"> <fieldset class="fieldset">
<legend><%= t("valuation.budget_investments.edit.feasibility") %></legend> <legend><%= t("valuation.budget_investments.edit.feasibility") %></legend>
<div class="small-4 column"> <div class="small-4 column">
<span class="radio"> <span class="radio">
<%= f.radio_button :feasibility, "undecided" %> <%= f.radio_button :feasibility, "undecided" %>
</span> </span>
</div> </div>
<div class="small-4 column"> <div class="small-4 column">
<span class="radio"> <span class="radio">
<%= f.radio_button :feasibility, "feasible" %> <%= f.radio_button :feasibility, "feasible" %>
</span> </span>
</div> </div>
<div class="small-4 column"> <div class="small-4 column">
<span class="radio"> <span class="radio">
<%= f.radio_button :feasibility, "unfeasible" %> <%= f.radio_button :feasibility, "unfeasible" %>
</span> </span>
</div> </div>
</fieldset> </fieldset>
</div> </div>

View File

@@ -17,11 +17,6 @@
<hr> <hr>
<%= render "/budgets/investments/investment_detail", investment: @investment, preview: true %> <%= render "/budgets/investments/investment_detail", investment: @investment, preview: true %>
</hr>
<% if @investment.external_url.present? %>
<p><%= sanitize_and_auto_link @investment.external_url %></p>
<% end %>
<hr> <hr>

View File

@@ -33,25 +33,25 @@
<div class="row"> <div class="row">
<div class="small-12 medium-8"> <div class="small-12 medium-8">
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<%= f.select :document_type, document_types, prompt: "" %> <%= f.select :document_type, document_types, prompt: "" %>
</div> </div>
<div class="small-12 medium-5 column end"> <div class="small-12 medium-5 column end">
<div class="inline-block"> <div class="inline-block">
<%= f.label :document_number, t("verification.residence.new.document_number") %> <%= f.label :document_number, t("verification.residence.new.document_number") %>
</div> </div>
<button type="button" class="inline-block" data-toggle="info-document-number"> <button type="button" class="inline-block" data-toggle="info-document-number">
<span class="icon-help"></span> <span class="icon-help"></span>
<span class="show-for-sr"><%= t("verification.residence.new.document_number_help_title") %></span> <span class="show-for-sr"><%= t("verification.residence.new.document_number_help_title") %></span>
</button> </button>
<div class="dropdown-pane" id="info-document-number" data-dropdown <div class="dropdown-pane" id="info-document-number" data-dropdown
data-hover="true" data-hover-pane="true"> data-hover="true" data-hover-pane="true">
<%= sanitize(t("verification.residence.new.document_number_help_text")) %> <%= sanitize(t("verification.residence.new.document_number_help_text")) %>
</div> </div>
<%= f.text_field :document_number, label: false %> <%= f.text_field :document_number, label: false %>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -13,8 +13,8 @@
<% @verified_users.each do |verified_user| %> <% @verified_users.each do |verified_user| %>
<% if verified_user.email.present? %> <% if verified_user.email.present? %>
<li id="<%= dom_id(verified_user) %>_email"> <li id="<%= dom_id(verified_user) %>_email">
<span><%= mask_email(verified_user.email) %></span> <span><%= mask_email(verified_user.email) %></span>
<span><%= render "form", url: email_path, verified_user: verified_user %></span> <span><%= render "form", url: email_path, verified_user: verified_user %></span>
</li> </li>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -15,15 +15,15 @@ describe Admin::Stats::SDG::GoalComponent do
render_inline component render_inline component
expect(page).to have_text "Proposals 3" expect(page).to have_text "Proposals 3", normalize_ws: true
expect(page).to have_text "Polls 2" expect(page).to have_text "Polls 2", normalize_ws: true
expect(page).to have_text "Debates 1" expect(page).to have_text "Debates 1", normalize_ws: true
expect("Current budget").to appear_before("Past year budget") expect("Current budget").to appear_before("Past year budget")
expect(page).to have_text "Investment projects sent 2" expect(page).to have_text "Investment projects sent 2", normalize_ws: true
expect(page).to have_text "Winner investment projects 0" expect(page).to have_text "Winner investment projects 0", normalize_ws: true
expect(page).to have_text "Approved amount $0" expect(page).to have_text "Approved amount $0", normalize_ws: true
expect(page).to have_text "Investment projects sent 1" expect(page).to have_text "Investment projects sent 1", normalize_ws: true
expect(page).to have_text "Winner investment projects 1" expect(page).to have_text "Winner investment projects 1", normalize_ws: true
expect(page).to have_text "Approved amount $1,000" expect(page).to have_text "Approved amount $1,000", normalize_ws: true
end end
end end

View File

@@ -9,23 +9,23 @@ describe LegislationHelper do
describe "banner colors presence" do describe "banner colors presence" do
it "background and font color exist" do it "background and font color exist" do
@process = build(:legislation_process, background_color: "#944949", font_color: "#ffffff") process = build(:legislation_process, background_color: "#944949", font_color: "#ffffff")
expect(banner_color?).to be true expect(banner_color?(process)).to be true
end end
it "background color exist and font color not exist" do it "background color exist and font color not exist" do
@process = build(:legislation_process, background_color: "#944949", font_color: "") process = build(:legislation_process, background_color: "#944949", font_color: "")
expect(banner_color?).to be false expect(banner_color?(process)).to be false
end end
it "background color not exist and font color exist" do it "background color not exist and font color exist" do
@process = build(:legislation_process, background_color: "", font_color: "#944949") process = build(:legislation_process, background_color: "", font_color: "#944949")
expect(banner_color?).to be false expect(banner_color?(process)).to be false
end end
it "background and font color not exist" do it "background and font color not exist" do
@process = build(:legislation_process, background_color: "", font_color: "") process = build(:legislation_process, background_color: "", font_color: "")
expect(banner_color?).to be false expect(banner_color?(process)).to be false
end end
end end
end end