From 1c6588accca23599ea1537ec527a5be04408b2af Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 8 Jan 2019 13:39:49 +0100 Subject: Redesign admin instances area (#9645) --- app/views/admin/instances/_instance.html.haml | 4 +-- app/views/admin/instances/index.html.haml | 48 ++++++++++++++++++--------- app/views/admin/instances/show.html.haml | 44 ++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 app/views/admin/instances/show.html.haml (limited to 'app/views/admin/instances') diff --git a/app/views/admin/instances/_instance.html.haml b/app/views/admin/instances/_instance.html.haml index e36ebae47..57d3e0b06 100644 --- a/app/views/admin/instances/_instance.html.haml +++ b/app/views/admin/instances/_instance.html.haml @@ -1,7 +1,5 @@ %tr %td - = link_to instance.domain, admin_accounts_path(by_domain: instance.domain) + = link_to instance.domain, admin_instance_path(instance) %td.count = instance.accounts_count - %td - = table_link_to 'paper-plane-o', t('admin.accounts.resubscribe'), resubscribe_admin_instances_url(by_domain: instance.domain), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } diff --git a/app/views/admin/instances/index.html.haml b/app/views/admin/instances/index.html.haml index 3314ce077..ce35b5db4 100644 --- a/app/views/admin/instances/index.html.haml +++ b/app/views/admin/instances/index.html.haml @@ -1,23 +1,39 @@ - content_for :page_title do = t('admin.instances.title') -= form_tag admin_instances_url, method: 'GET', class: 'simple_form' do - .fields-group - - %i(domain_name).each do |key| - .input.string.optional - = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.instances.#{key}") +.filters + .filter-subset + %strong= t('admin.instances.moderation.title') + %ul + %li= filter_link_to t('admin.instances.moderation.all'), limited: nil + %li= filter_link_to t('admin.instances.moderation.limited'), limited: '1' - .actions - %button= t('admin.instances.search') - = link_to t('admin.instances.reset'), admin_instances_path, class: 'button negative' + %div{ style: 'flex: 1 1 auto; text-align: right' } + = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button' -.table-wrapper - %table.table - %thead - %tr - %th= t('admin.instances.domain_name') - %th= t('admin.instances.account_count') - %tbody - = render @instances +%hr.spacer/ + +- @instances.each do |instance| + .directory__tag + = link_to admin_instance_path(instance) do + %h4 + = instance.domain + %small + = t('admin.instances.known_accounts', count: instance.accounts_count) + + - if instance.domain_block + - if !instance.domain_block.noop? + • + = t("admin.domain_blocks.severity.#{instance.domain_block.severity}") + - if instance.domain_block.reject_media? + • + = t('admin.domain_blocks.rejecting_media') + - if instance.domain_block.reject_reports? + • + = t('admin.domain_blocks.rejecting_reports') + + .avatar-stack + - instance.cached_sample_accounts.each do |account| + = image_tag current_account&.user&.setting_auto_play_gif ? account.avatar_original_url : account.avatar_static_url, width: 48, height: 48, alt: '', class: 'account__avatar' = paginate paginated_instances diff --git a/app/views/admin/instances/show.html.haml b/app/views/admin/instances/show.html.haml new file mode 100644 index 000000000..c7992a490 --- /dev/null +++ b/app/views/admin/instances/show.html.haml @@ -0,0 +1,44 @@ +- content_for :page_title do + = @instance.domain + +.dashboard__counters + %div + %div + .dashboard__counters__num= number_with_delimiter @following_count + .dashboard__counters__label= t 'admin.instances.total_followed_by_them' + %div + %div + .dashboard__counters__num= number_with_delimiter @followers_count + .dashboard__counters__label= t 'admin.instances.total_followed_by_us' + %div + %div + .dashboard__counters__num= number_to_human_size @media_storage + .dashboard__counters__label= t 'admin.instances.total_storage' + %div + %div + .dashboard__counters__num= number_with_delimiter @blocks_count + .dashboard__counters__label= t 'admin.instances.total_blocked_by_us' + %div + %div + .dashboard__counters__num= number_with_delimiter @reports_count + .dashboard__counters__label= t 'admin.instances.total_reported' + %div + %div + .dashboard__counters__num + - if @available + = fa_icon 'check' + - else + = fa_icon 'times' + .dashboard__counters__label= t 'admin.instances.delivery_available' + +%hr.spacer/ + +%div{ style: 'overflow: hidden' } + %div{ style: 'float: left' } + = link_to t('admin.accounts.title'), admin_accounts_path(remote: '1', by_domain: @instance.domain), class: 'button' + + %div{ style: 'float: right' } + - if @domain_block + = link_to t('admin.domain_blocks.undo'), admin_domain_block_path(@domain_block), class: 'button' + - else + = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path(_domain: @instance.domain), class: 'button' -- cgit From a269ffdfa5721c6d51c33a143ed28c740d17f247 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 8 Jan 2019 17:41:27 +0100 Subject: Change "federation" admin UI link to point to "limited" domains (#9762) --- app/views/admin/instances/_instance.html.haml | 5 ----- config/navigation.rb | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 app/views/admin/instances/_instance.html.haml (limited to 'app/views/admin/instances') diff --git a/app/views/admin/instances/_instance.html.haml b/app/views/admin/instances/_instance.html.haml deleted file mode 100644 index 57d3e0b06..000000000 --- a/app/views/admin/instances/_instance.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%tr - %td - = link_to instance.domain, admin_instance_path(instance) - %td.count - = instance.accounts_count diff --git a/config/navigation.rb b/config/navigation.rb index 2365191dc..a9521f956 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -29,7 +29,7 @@ SimpleNavigation::Configuration.run do |navigation| admin.item :accounts, safe_join([fa_icon('users fw'), t('admin.accounts.title')]), admin_accounts_url, highlights_on: %r{/admin/accounts} admin.item :invites, safe_join([fa_icon('user-plus fw'), t('admin.invites.title')]), admin_invites_path admin.item :tags, safe_join([fa_icon('tag fw'), t('admin.tags.title')]), admin_tags_path - admin.item :instances, safe_join([fa_icon('cloud fw'), t('admin.instances.title')]), admin_instances_url, highlights_on: %r{/admin/instances|/admin/domain_blocks}, if: -> { current_user.admin? } + admin.item :instances, safe_join([fa_icon('cloud fw'), t('admin.instances.title')]), admin_instances_url(limited: '1'), highlights_on: %r{/admin/instances|/admin/domain_blocks}, if: -> { current_user.admin? } admin.item :email_domain_blocks, safe_join([fa_icon('envelope fw'), t('admin.email_domain_blocks.title')]), admin_email_domain_blocks_url, highlights_on: %r{/admin/email_domain_blocks}, if: -> { current_user.admin? } end -- cgit