forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix admin redesign module (decidim#11648)
* Fix admin redesign module * More admin customizations * Lint erb * Remove components sidebar * Apply review recommendations
- Loading branch information
Showing
23 changed files
with
341 additions
and
345 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
decidim-admin/app/views/decidim/admin/admin_terms/show.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
decidim-admin/app/views/decidim/admin/attachment_collections/_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
decidim-admin/app/views/decidim/admin/attachments/_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
decidim-admin/app/views/decidim/admin/attachments/new.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 36 additions & 26 deletions
62
decidim-admin/app/views/decidim/admin/block_user/new.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,42 @@ | ||
<h2 class="process-title-summary"> | ||
<%= t(".title", name: user.name) %> | ||
</h2> | ||
<div class="item_show__header"> | ||
<h2 class="item_show__header-title"> | ||
<%= t(".title", name: user.name) %> | ||
</h2> | ||
</div> | ||
|
||
<%= decidim_form_for(@form, html: { class: "form new_user_block" }, url: user_block_path(user_id: user.id), method: :post) do |f| %> | ||
<div class="card"> | ||
<div class="card-section"> | ||
<div class="row column"> | ||
<%= t(".description") %> | ||
</div> | ||
<br> | ||
<% if @form.hide %> | ||
<% announcement_message = t(".already_reported_html", link: new_user_block_path(user_id: user.id)) %> | ||
<%= cell("decidim/announcement", announcement_message, callout_class: "alert" ) %> | ||
<% end %> | ||
<div class="item__edit item__edit-1col"> | ||
<div class="item__edit-form"> | ||
<%= decidim_form_for(@form, url: user_block_path(user_id: user.id), method: :post, html: { class: "form-defaults form import_participatory_process" }) do |f| %> | ||
<div class="form__wrapper"> | ||
<div class="card pt-4"> | ||
<div class="card-section"> | ||
<div class="row column"> | ||
<%= t(".description") %> | ||
</div> | ||
|
||
<% if @form.hide %> | ||
<% announcement_message = t(".already_reported_html", link: new_user_block_path(user_id: user.id)) %> | ||
<%= cell("decidim/announcement", announcement_message, callout_class: "alert" ) %> | ||
<% end %> | ||
|
||
<% if defined?(Decidim::Templates) %> | ||
<%= render "decidim/templates/admin/block_user_templates/template_chooser", form: f %> | ||
<% end %> | ||
<% if defined?(Decidim::Templates) %> | ||
<%= render "decidim/templates/admin/block_user_templates/template_chooser", form: f %> | ||
<% end %> | ||
|
||
<div class="row column"> | ||
<%= f.hidden_field :user_id %> | ||
<%= f.hidden_field :hide %> | ||
<%= f.text_area :justification, required: true, label: t(".justification") %> | ||
<div class="row column"> | ||
<%= f.hidden_field :user_id %> | ||
<%= f.hidden_field :hide %> | ||
<%= f.text_area :justification, required: true, label: t(".justification") %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="form__wrapper-block flex-col-reverse md:flex-row justify-between"> | ||
<%= f.submit t(".action"), class: "button button__sm button__secondary" %> | ||
<div class="item__edit-sticky"> | ||
<div class="item__edit-sticky-container"> | ||
<%= f.submit t(".action"), class: "button button__sm button__secondary" %> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> |
11 changes: 1 addition & 10 deletions
11
decidim-admin/app/views/decidim/admin/categories/_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
decidim-admin/app/views/decidim/admin/dashboard/show.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
decidim-admin/app/views/decidim/admin/impersonations/_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
decidim-admin/app/views/decidim/admin/moderated_users/_report.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
<% if report.details.blank? %> | ||
<%= t(".reasons.#{report.reason}") %> | ||
<% else %> | ||
<span | ||
data-tooltip | ||
title="<%= report.details&.truncate(250) %>"> | ||
<%= t(".reasons.#{report.reason}") %> | ||
</span> | ||
<%= with_tooltip(strip_tags(report.details), class: :top) { t(".reasons.#{report.reason}") } %> | ||
<% end %> |
117 changes: 57 additions & 60 deletions
117
decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,65 @@ | ||
<% add_decidim_page_title(t(".title")) %> | ||
<div class="card"> | ||
<div class="card-divider mb-4"> | ||
<h2 class="card-title"> | ||
<div class="item_show__header"> | ||
<h2 class="item_show__header-title"> | ||
<%= t(".title") %> | ||
|
||
<%= t(".title") %> | ||
<div class="card__filter"> | ||
<%= link_to t("decidim.admin.moderated_users.tabs.unblocked"), moderated_users_path %> | ||
| | ||
<%= link_to t("decidim.admin.moderated_users.tabs.blocked"), moderated_users_path(blocked: true) %> | ||
</div> | ||
</h2> | ||
</div> | ||
|
||
<div class="card__filter"> | ||
<%= link_to t("decidim.admin.moderated_users.tabs.unblocked"), moderated_users_path %> | ||
| | ||
<%= link_to t("decidim.admin.moderated_users.tabs.blocked"), moderated_users_path(blocked: true) %> | ||
</div> | ||
</h2> | ||
</div> | ||
<%= admin_filter_selector(:moderated_users) %> | ||
<div class="table-scroll"> | ||
<table class="table-list"> | ||
<thead> | ||
<tr> | ||
<th><%= t(".name") %></th> | ||
<th><%= t(".nickname") %></th> | ||
<th><%= t(".reason") %></th> | ||
<th><%= sort_link(query, :created_at, t("models.moderation.fields.created_at", scope: "decidim.moderations")) %></th> | ||
<th><%= sort_link(query, :report_count, t(".reports"), default_order: :desc) %></th> | ||
<th class="actions"><%= t(".actions.title") %></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @moderated_users.each do |moderation| %> | ||
<tr data-id="<%= moderation.id %>"> | ||
<% if moderation.user.nickname.present? %> | ||
<td><%= link_to moderation.user.name, decidim.profile_path(moderation.user.nickname) %></td> | ||
<td><%= link_to moderation.user.nickname, decidim.profile_path(moderation.user.nickname) %></td> | ||
<% else %> | ||
<td><%= moderation.user.name %></td> | ||
<td><%= moderation.user.nickname %></td> | ||
<% end %> | ||
<td> | ||
<% reports = moderation.reports.map { |report| render "report", report: } %> | ||
<%= safe_join(reports, ",") %> | ||
</td> | ||
<td> | ||
<%= l moderation.created_at, format: :decidim_short %> | ||
</td> | ||
<td> | ||
<%= moderation.report_count %> | ||
</td> | ||
|
||
<%= admin_filter_selector(:moderated_users) %> | ||
<div class="table-scroll"> | ||
<table class="table-list"> | ||
<thead> | ||
<tr> | ||
<th><%= t(".name") %></th> | ||
<th><%= t(".nickname") %></th> | ||
<th><%= t(".reason") %></th> | ||
<th><%= sort_link(query, :created_at, t("models.moderation.fields.created_at", scope: "decidim.moderations")) %></th> | ||
<th><%= sort_link(query, :report_count, t(".reports"), default_order: :desc) %></th> | ||
<th class="actions"><%= t(".actions.title") %></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @moderated_users.each do |moderation| %> | ||
<tr data-id="<%= moderation.id %>"> | ||
<% if moderation.user.nickname.present? %> | ||
<td><%= link_to moderation.user.name, decidim.profile_path(moderation.user.nickname) %></td> | ||
<td><%= link_to moderation.user.nickname, decidim.profile_path(moderation.user.nickname) %></td> | ||
<% else %> | ||
<td><%= moderation.user.name %></td> | ||
<td><%= moderation.user.nickname %></td> | ||
<td class="actions"> | ||
<% if !moderation.user.blocked? && allowed_to?(:unreport, :moderate_users) %> | ||
<%= icon_link_to "arrow-go-back-line", ignore_moderated_user_path(id: moderation), t(".actions.unreport"), class: "action-icon--unreport", method: :put %> | ||
<% end %> | ||
<td> <%#= moderation.reason %> | ||
<% reports = moderation.reports.map { |report| render "report", report: } %> | ||
<%= safe_join(reports, ",") %> | ||
</td> | ||
<td> | ||
<%= l moderation.created_at, format: :decidim_short %> | ||
</td> | ||
<td> | ||
<%= moderation.report_count %> | ||
</td> | ||
|
||
<td class="actions"> | ||
<% if !moderation.user.blocked? && allowed_to?(:unreport, :moderate_users) %> | ||
<%= icon_link_to "arrow-go-back-line", ignore_moderated_user_path(id: moderation), t(".actions.unreport"), class: "action-icon--unreport", method: :put %> | ||
<% if allowed_to?(:block, :moderate_users) %> | ||
<% if moderation.user.blocked? %> | ||
<%= icon_link_to "forbid-2-line", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %> | ||
<% else %> | ||
<%= icon_link_to "forbid-2-line", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %> | ||
<% end %> | ||
<% if allowed_to?(:block, :moderate_users) %> | ||
<% if moderation.user.blocked? %> | ||
<%= icon_link_to "forbid-2-line", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %> | ||
<% else %> | ||
<%= icon_link_to "forbid-2-line", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %> | ||
<% end %> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
<%= decidim_paginate @moderated_users %> |
Oops, something went wrong.