diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index ed9fa9769..2b1e72b75 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -21,6 +21,8 @@ jobs: run: npx stylelint app/assets/stylesheets - name: Markdownlint 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 }} steps: - name: Checkout code diff --git a/Gemfile b/Gemfile index be82402ce..d206f2233 100644 --- a/Gemfile +++ b/Gemfile @@ -95,6 +95,7 @@ group :development do gem "capistrano3-puma", "~> 5.2.0" gem "erb_lint", "~> 0.9.0", 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 "pronto", "~> 0.11.2", require: false gem "pronto-erb_lint", "~> 0.1.6", require: false diff --git a/Gemfile.lock b/Gemfile.lock index bf7816ac8..118f85a39 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -272,6 +272,7 @@ GEM hashery (2.1.2) hashie (5.0.0) highline (2.0.3) + htmlbeautifier (1.4.3) htmlentities (4.3.4) httparty (0.22.0) csv @@ -755,6 +756,7 @@ DEPENDENCIES graphiql-rails (~> 1.8.0) graphql (~> 2.3.18) groupdate (~> 6.5.1) + htmlbeautifier (~> 1.4.3) i18n-tasks (~> 0.9.37) image_processing (~> 1.13.0) invisible_captcha (~> 2.3.0) diff --git a/app/assets/stylesheets/legislation_process.scss b/app/assets/stylesheets/legislation_process.scss index 3bd4106e0..5e7f78fc7 100644 --- a/app/assets/stylesheets/legislation_process.scss +++ b/app/assets/stylesheets/legislation_process.scss @@ -812,7 +812,6 @@ .proposal h3 { font-size: rem-calc(20); - margin-top: 0; } } diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 911c9debb..c9f4cc37d 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -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 { background: $warning-bg; color: $color-warning; @@ -394,41 +385,53 @@ @include breakpoint(medium) { min-height: $line-height * 15; - - .with-image > .row { - display: flex; - } } } -.budget-investments-list .budget-investment, -.proposals-list .proposal, -.legislation-proposals .proposal { +.debates-list, +.proposals-list, +.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 { - padding: 0 calc($line-height / 2) 0 0; + &.with-image { + 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 { - overflow: hidden; - } + .debate-content, + .budget-investment-content, + .proposal-content { + flex-basis: calc((35rem - 100%) * 999); + flex-grow: 1000; + max-width: 50rem; - .column:nth-child(2) { - float: left; - } - - .column:last-child:not(:first-child) { - padding-top: calc($line-height / 2); - } - - img { - height: 100%; - max-width: 12rem; + + * { + flex-basis: 22.5%; + flex-shrink: 0; + text-align: center; + } } } } @@ -592,27 +595,19 @@ .legislation-proposals { .votes { - border-top: 1px solid $border; margin-top: $line-height; padding: calc($line-height / 2) 0; position: relative; @include breakpoint(medium) { - border-left: 1px solid $border; - border-top: 0; margin-top: 0; text-align: center; } .total-votes { - float: right; + display: block; font-weight: bold; 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, .budget-investment { diff --git a/app/assets/stylesheets/shared/in_favor_against.scss b/app/assets/stylesheets/shared/in_favor_against.scss index c7a59f7cb..0aaa86104 100644 --- a/app/assets/stylesheets/shared/in_favor_against.scss +++ b/app/assets/stylesheets/shared/in_favor_against.scss @@ -1,9 +1,5 @@ .in-favor-against { - @include flex-with-gap($line-height * 0.25); - - @include breakpoint(medium) { - @include flex-with-gap($line-height * 0.75); - } + @include flex-with-gap($line-height * 0.75); &, .in-favor, @@ -77,16 +73,8 @@ } .percentage { - display: inline-block; + display: block; font-size: $small-font-size; - line-height: $line-height * 2; - padding-right: calc($line-height / 2); - vertical-align: top; - - @include breakpoint(medium) { - display: block; - line-height: $line-height; - padding-right: 0; - } + line-height: $line-height; } } diff --git a/app/components/admin/poll/shifts/form_component.html.erb b/app/components/admin/poll/shifts/form_component.html.erb index 74ac8105e..b5e74ba6a 100644 --- a/app/components/admin/poll/shifts/form_component.html.erb +++ b/app/components/admin/poll/shifts/form_component.html.erb @@ -8,7 +8,8 @@
| <%= t("admin.stats.budget_balloting.votes_per_heading") %> | |||
|---|---|---|---|
| <%= t("admin.stats.budget_balloting.votes_per_heading") %> | +|||
| <%= t("admin.stats.budget_balloting.participants_per_district") %> | |||
|---|---|---|---|
| <%= t("admin.stats.budget_balloting.participants_per_district") %> | +<%= activity.user.name %> (<%= activity.user.email %>) | diff --git a/app/views/admin/admin_notifications/index.html.erb b/app/views/admin/admin_notifications/index.html.erb index de8b3f392..233d32f1b 100644 --- a/app/views/admin/admin_notifications/index.html.erb +++ b/app/views/admin/admin_notifications/index.html.erb @@ -14,34 +14,34 @@ - <% @admin_notifications.order(created_at: :desc).each do |admin_notification| %> -||
| - <%= admin_notification.title %> - | -- <%= segment_name(admin_notification.segment_recipient) %> - | -- <% if admin_notification.draft? %> - <%= t("admin.admin_notifications.index.draft") %> - <% else %> - <%= l admin_notification.sent_at.to_date %> - <% end %> - | -- <% if admin_notification.draft? %> - <%= render Admin::TableActionsComponent.new(admin_notification) do |actions| %> - <%= actions.action(:preview, text: t("admin.admin_notifications.index.preview")) %> + <% @admin_notifications.order(created_at: :desc).each do |admin_notification| %> + |
| + <%= admin_notification.title %> + | ++ <%= segment_name(admin_notification.segment_recipient) %> + | ++ <% if admin_notification.draft? %> + <%= t("admin.admin_notifications.index.draft") %> + <% else %> + <%= l admin_notification.sent_at.to_date %> <% end %> - <% else %> - <%= render Admin::TableActionsComponent.new(admin_notification, actions: []) do |actions| %> - <%= 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 %> - | -
<%= proposal.summary %>
- <%= wysiwyg(proposal.description) %> - <% if proposal.video_url.present? %> -<%= sanitize_and_auto_link proposal.video_url %>
- <% end %> -<%= proposal.summary %>
+ <%= wysiwyg(proposal.description) %> + <% if proposal.video_url.present? %> +<%= sanitize_and_auto_link proposal.video_url %>
+ <% end %> +<%= link_to user.name, admin_hidden_user_path(user) %>
-<%= link_to user.name, admin_hidden_user_path(user) %>
+| <%= t("admin.legislation.questions.table.title") %> | <%= t("admin.legislation.questions.table.question_options") %> | @@ -27,22 +27,22 @@||
|---|---|---|---|
| - <%= link_to question.title, edit_admin_legislation_process_question_path(@process, question) %> - | -
-
|
- <%= question.answers_count %> | -<%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: "comments") %> | -
| + <%= link_to question.title, edit_admin_legislation_process_question_path(@process, question) %> + | +
+
|
+ <%= question.answers_count %> | +<%= link_to question.comments.count, legislation_process_question_path(@process, question, anchor: "comments") %> | +
| <%= t("admin.officials.index.name") %> | -<%= t("admin.officials.index.official_position") %> | -<%= t("admin.officials.index.official_level") %> | -<%= t("admin.shared.actions") %> | +<%= t("admin.officials.index.name") %> | +<%= t("admin.officials.index.official_position") %> | +<%= t("admin.officials.index.official_level") %> | +<%= t("admin.shared.actions") %> | <% @users.each do |user| %> diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index 7632445be..0406852e8 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -21,30 +21,30 @@<%= t("admin.shared.actions") %> | - <% @organizations.each do |organization| %> - <% hidden += 1 and next if organization.user.nil? %> -
|---|---|---|---|---|---|
| <%= organization.name %> | -<%= organization.email %> | -<%= organization.phone_number %> | -<%= organization.responsible_name %> | -- <% if organization.verified? %> - - <%= t("admin.organizations.index.verified") %> - <% elsif organization.rejected? %> - - <%= t("admin.organizations.index.rejected") %> - <% else %> - - <%= t("admin.organizations.index.pending") %> - <% end %> - | -- <%= render Admin::Organizations::TableActionsComponent.new(organization) %> - | -
| <%= organization.name %> | +<%= organization.email %> | +<%= organization.phone_number %> | +<%= organization.responsible_name %> | ++ <% if organization.verified? %> + + <%= t("admin.organizations.index.verified") %> + <% elsif organization.rejected? %> + + <%= t("admin.organizations.index.rejected") %> + <% else %> + + <%= t("admin.organizations.index.pending") %> + <% end %> + | ++ <%= render Admin::Organizations::TableActionsComponent.new(organization) %> + | +
<%= t "admin.stats.show.summary.proposal_votes" %>
- <%= number_with_delimiter(@proposal_votes) %>
+
+ <%= number_with_delimiter(@proposal_votes) %>
+
<%= t "admin.stats.show.summary.debate_votes" %>
diff --git a/app/views/admin/system_emails/index.html.erb b/app/views/admin/system_emails/index.html.erb
index beddb8f7d..ea3545e30 100644
--- a/app/views/admin/system_emails/index.html.erb
+++ b/app/views/admin/system_emails/index.html.erb
@@ -9,41 +9,41 @@
- <%= t("admin.system_emails.edit_info") %>
- <%= "app/views/mailer/#{system_email_title}.html.erb" %>
-
+ <%= t("admin.system_emails.edit_info") %>
+ <%= "app/views/mailer/#{system_email_title}.html.erb" %>
+
- <%= t("stats.budgets.participatory_disclaimer") %> + <%= t("stats.budgets.participatory_disclaimer") %>
- <%= t("stats.budgets.heading_disclaimer") %> + <%= t("stats.budgets.heading_disclaimer") %>
+ <%= l debate.created_at.to_date %> + • + <%= render Shared::CommentsCountComponent.new( + debate.comments_count, + url: debate_path(debate, anchor: "comments") + ) %> -
- <%= l debate.created_at.to_date %> + <% if debate.author.hidden? || debate.author.erased? %> + • + + <% else %> + • + + <% if debate.author.display_official_position_badge? %> • - <%= render Shared::CommentsCountComponent.new( - debate.comments_count, - url: debate_path(debate, anchor: "comments") - ) %> + + <% end %> + <% end %> - <% if debate.author.hidden? || debate.author.erased? %> - • - - <% else %> - • - - <% if debate.author.display_official_position_badge? %> - • - - <% end %> - <% end %> + <% if debate.author.verified_organization? %> + • + + <%= t("shared.collective") %> + + <% end %> - <% if debate.author.verified_organization? %> - • - - <%= t("shared.collective") %> - - <% end %> - -
-<%= t("debates.index.section_footer.help_text_1") %>
<%= sanitize(t("debates.index.section_footer.help_text_2", org: link_to(setting["org_name"], new_user_registration_path))) %>
-<%= f.password_field :password %>
-<%= f.password_field :password_confirmation %>
+<%= f.password_field :password %>
+<%= f.password_field :password_confirmation %>
<% end %> <%= hidden_field_tag :confirmation_token, @confirmation_token %> diff --git a/app/views/devise/password_expired/show.html.erb b/app/views/devise/password_expired/show.html.erb index 8eb10f6b4..930563eac 100644 --- a/app/views/devise/password_expired/show.html.erb +++ b/app/views/devise/password_expired/show.html.erb @@ -2,9 +2,9 @@ <%= form_for(resource, as: resource_name, url: [resource_name, :password_expired], html: { method: :put }) do |f| %> - <%= f.password_field :current_password %> - <%= f.password_field :password, label: t("devise.password_expired.new_password") %> - <%= f.password_field :password_confirmation %> + <%= f.password_field :current_password %> + <%= f.password_field :password, label: t("devise.password_expired.new_password") %> + <%= f.password_field :password_confirmation %><%= f.submit t("devise.password_expired.change_password") %>
<% end %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb index dadc44e4d..d4f343b14 100644 --- a/app/views/devise/shared/_links.html.erb +++ b/app/views/devise/shared/_links.html.erb @@ -3,20 +3,6 @@ <%= link_to t("devise_views.shared.links.login"), new_session_path(resource_name) %>