Updated admin dashboard for ChatConversationAccounts
• Updated: - admin dashboard for ChatConversationAccounts
This commit is contained in:
parent
183e46aa57
commit
89a16b101f
@ -1,14 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class ChatConversationsController < BaseController
|
||||
class ChatConversationAccountsController < BaseController
|
||||
before_action :set_account
|
||||
|
||||
PER_PAGE = 20
|
||||
|
||||
def index
|
||||
authorize :account, :index?
|
||||
@chatConversationAccounts = ChatConversationAccount.where(account: @account).page(params[:page]).per(PER_PAGE)
|
||||
@chat_conversation_accounts = ChatConversationAccount.where(account: @account).page(params[:page]).per(PER_PAGE)
|
||||
end
|
||||
|
||||
def set_account
|
@ -47,7 +47,7 @@
|
||||
.dashboard__counters__num= number_with_delimiter @account.groups.count
|
||||
.dashboard__counters__label Joined Groups
|
||||
%div
|
||||
= link_to admin_account_chat_conversations_path(@account.id) do
|
||||
= link_to admin_account_chat_conversation_accounts_path(@account.id) do
|
||||
.dashboard__counters__num= number_with_delimiter @account.chat_conversation_accounts_count
|
||||
.dashboard__counters__label Chat Conversations
|
||||
%div
|
||||
|
@ -0,0 +1,12 @@
|
||||
%tr
|
||||
%td
|
||||
= admin_account_link_to(chat_conversation_account.account)
|
||||
%td
|
||||
- chat_conversation_account.participant_account_ids.each do |a|
|
||||
%a{href: "/admin/accounts/#{a}"}= a
|
||||
%td
|
||||
%span= chat_conversation_account.is_approved ? "Y" : "N"
|
||||
%td
|
||||
%span= chat_conversation_account.is_hidden ? "Y" : "N"
|
||||
%td
|
||||
%span= chat_conversation_account.is_muted ? "Y" : "N"
|
24
app/views/admin/chat_conversation_accounts/index.html.haml
Normal file
24
app/views/admin/chat_conversation_accounts/index.html.haml
Normal file
@ -0,0 +1,24 @@
|
||||
- content_for :page_title do
|
||||
%span= "Chat conversations including: @#{@account.acct}"
|
||||
|
||||
.filters
|
||||
.back-link{ style: 'flex: 1 1 auto; text-align: left' }
|
||||
= link_to admin_account_path(@account.id) do
|
||||
= fa_icon 'chevron-left fw'
|
||||
= t('admin.followers.back_to_account')
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
.table-wrapper
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
%th Account
|
||||
%th Members
|
||||
%th Approved?
|
||||
%th Hidden?
|
||||
%th Muted?
|
||||
%tbody
|
||||
= render @chat_conversation_accounts
|
||||
|
||||
= paginate @chat_conversation_accounts
|
@ -1,28 +0,0 @@
|
||||
- content_for :page_title do
|
||||
= t('admin.followers.title', acct: @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')
|
||||
|
||||
%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
|
||||
|
||||
= paginate @followers
|
@ -142,7 +142,7 @@ Rails.application.routes.draw do
|
||||
resources :statuses, only: [:index, :show, :create, :update, :destroy]
|
||||
resources :followers, only: [:index]
|
||||
resources :joined_groups, only: [:index]
|
||||
resources :chat_conversations, only: [:index]
|
||||
resources :chat_conversation_accounts, only: [:index]
|
||||
resources :chat_messages, only: [:index, :show, :create, :update, :destroy]
|
||||
|
||||
resource :confirmation, only: [:create] do
|
||||
|
Loading…
Reference in New Issue
Block a user