Albums almost done, group, chat moderation, photo, video page updates
This commit is contained in:
mgabdev
2020-12-21 13:25:05 -05:00
parent a2ffbadedb
commit ee91809e8d
45 changed files with 1013 additions and 509 deletions

View File

@@ -2,7 +2,7 @@
%td
= admin_account_link_to(account)
- if account.is_flagged_as_spam
%span SPAM
%span{ :style => "display:block;margin:5px 0 0 20px;font-size:12px;background-color:#781600;border-radius:6px;color:#fff;width:40px;line-height:22px;font-weight:600;padding:2px 0 0 6px;" } SPAM
%td
- if account.user_current_sign_in_ip
%samp.ellipsized-ip{ title: account.user_current_sign_in_ip }= account.user_current_sign_in_ip

View File

@@ -123,6 +123,14 @@
%time.formatted{ datetime: @account.created_at.iso8601, title: l(@account.created_at) }= l @account.created_at
%td
%tr
%th Is flagged as spam
%td
- if @account.is_flagged_as_spam?
%span YES
- else
%span no
%tr
%th= t('admin.accounts.most_recent_ip')
%td= @account.user_current_sign_in_ip

View File

@@ -0,0 +1,16 @@
.batch-table__row
%label.batch-table__row__select.batch-checkbox
= f.check_box :chat_message_ids, { multiple: true, include_hidden: false }, chat_message.id
.batch-table__row__content
%div{:style=>"display:flex;flex-direction:column;"}
%span= chat_message.text
%div{:style=> "display:block;color:#555;"}
%span Created:
%span= chat_message.created_at
- if chat_message.expires_at
%div{:style=> "display:block;color:#555;"}
%span Expires:
%span= chat_message.expires_at
%div{:style=> "display:block;color:#555;"}
%span In conversation:
%span= chat_message.chat_conversation_id

View File

@@ -1,28 +1,29 @@
- content_for :header_tags do
= javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'
- content_for :page_title do
= t('admin.followers.title', acct: @account.acct)
%span Chat Messages
\-
= "@#{@account.acct}"
.filters
.filter-subset
%strong= t('admin.accounts.location.title')
%ul
%li= link_to t('admin.accounts.location.local'), admin_account_followers_path(@account.id), class: 'selected'
.back-link{ style: 'flex: 1 1 auto; text-align: right' }
= link_to admin_account_path(@account.id) do
= fa_icon 'chevron-left fw'
= t('admin.followers.back_to_account')
%span Back to account
%hr.spacer/
.table-wrapper
%table.table
%thead
%tr
%th= t('admin.accounts.username')
%th= t('admin.accounts.role')
%th= t('admin.accounts.most_recent_ip')
%th= t('admin.accounts.most_recent_activity')
%th
%tbody
= render partial: 'admin/accounts/account', collection: @followers
= form_for(@form, url: admin_account_chat_messages_path(@account.id)) do |f|
= hidden_field_tag :page, params[:page]
= paginate @followers
.batch-table
.batch-table__toolbar
%label.batch-table__toolbar__select.batch-checkbox-all
= check_box_tag :batch_checkbox_all, nil, false
.batch-table__toolbar__actions
= f.button safe_join([fa_icon('trash'), 'Delete']), name: :delete, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
.batch-table__body
= render partial: 'admin/chat_messages/chat_message', collection: @chat_messages, locals: { f: f }
= paginate @chat_messages

View File

@@ -4,11 +4,14 @@
%td= group.member_count
%td
- if group.is_featured?
= t('admin.groups.featured')
%span Y
%td
- if not group.is_featured?
= table_link_to 'power-off', t('admin.groups.enable_featured'), enable_featured_admin_group_path(group, page: params[:page], **@filter_params), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
- else
= table_link_to 'power-off', t('admin.groups.disable_featured'), disable_featured_admin_group_path(group, page: params[:page], **@filter_params), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
%td
= table_link_to 'times', t('admin.groups.delete'), admin_group_path(group, page: params[:page], **@filter_params), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
= table_link_to '', 'Edit', admin_group_path(group)
-# %td
-# - if not group.is_featured?
-# = table_link_to 'power-off', t('admin.groups.enable_featured'), enable_featured_admin_group_path(group, page: params[:page], **@filter_params), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
-# - else
-# = table_link_to 'power-off', t('admin.groups.disable_featured'), disable_featured_admin_group_path(group, page: params[:page], **@filter_params), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
-# %td
-# = table_link_to 'times', t('admin.groups.delete'), admin_group_path(group, page: params[:page], **@filter_params), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }

View File

@@ -17,7 +17,7 @@
%th= t('admin.groups.id')
%th= t('admin.groups.title')
%th= t('admin.groups.member_count')
%th
%th Featured?
%th
%th
%tbody

View File

@@ -8,28 +8,60 @@
-# delete
-# view accounts
-# view removed accounts
-# number of accounts
-# number of removed accounts
-# number of posts
.card.h-card{:style => "height:300px"}
.card__img
= image_tag @group.cover_image.url, alt: '', :style => "height:300px"
= image_tag full_asset_url(@group.cover_image.url), alt: '', :style => "height:300px"
.dashboard__counters{ style: 'margin-top: 10px' }
%div
%div
.dashboard__counters__num= number_with_delimiter 0 #@account.statuses_count
.dashboard__counters__num= number_with_delimiter Status.where(group:@group).count
.dashboard__counters__label Status Count
%div
%div
.dashboard__counters__num= number_to_human_size 0 #@account.media_attachments.sum('file_file_size')
.dashboard__counters__num= number_with_delimiter @group.accounts.count
.dashboard__counters__label Member Count
%div
%div
.dashboard__counters__num= number_with_delimiter 0 #@account.local_followers_count
.dashboard__counters__num= number_with_delimiter @group.removed_accounts.count
.dashboard__counters__label Removed Members Count
%div
%div
.dashboard__counters__num= number_with_delimiter 0 #@account.reports.count
.dashboard__counters__label Member Requests Count
.dashboard__counters__num= number_with_delimiter @group.join_requests.count
.dashboard__counters__label Member Requests Count
= simple_form_for(@group, url: admin_group_path(@group.id), html: { method: :put }) do |f|
= render 'shared/error_messages', object: @group
.fields-group
= f.input :title, wrapper: :with_label, label: 'Title'
.fields-group
= f.input :description, wrapper: :with_label, label: 'Description'
.fields-group
= f.input :slug, wrapper: :with_label, label: 'Slug'
.fields-group
= f.input :tags, wrapper: :with_label, label: 'Tags'
.fields-group
= f.input :is_nsfw, as: :boolean, wrapper: :with_label, label: 'Is NSFW?'
.fields-group
= f.input :is_featured, as: :boolean, wrapper: :with_label, label: 'Is Featured?'
.fields-group
= f.input :is_private, as: :boolean, wrapper: :with_label, label: 'Is Private?'
.fields-group
= f.input :is_visible, as: :boolean, wrapper: :with_label, label: 'Is Visible?'
.actions
= f.button :button, t('generic.save_changes'), type: :submit
-# : todo : delete
-# : todo : list admins
-# : todo : list mods
-# : todo : make ME admin