Add avatar images and paging to subscribe settings

This commit is contained in:
noellabo 2020-11-14 10:05:24 +09:00
parent fe355a6468
commit 9720a83867
14 changed files with 158 additions and 142 deletions

View file

@ -50,7 +50,7 @@ class Settings::AccountSubscribesController < Settings::BaseController
end end
def set_account_subscribings def set_account_subscribings
@account_subscribings = current_account.active_subscribes.order('list_id NULLS FIRST', :updated_at).reject(&:new_record?) @account_subscribings = current_account.active_subscribes.eager_load(:target_account).order('list_id NULLS FIRST', :updated_at).page(params[:page]).per(40)
end end
def set_lists def set_lists

View file

@ -49,7 +49,7 @@ class Settings::DomainSubscribesController < Settings::BaseController
end end
def set_domain_subscribes def set_domain_subscribes
@domain_subscribes = current_account.domain_subscribes.includes(:list).order('list_id NULLS FIRST', :domain).reject(&:new_record?) @domain_subscribes = current_account.domain_subscribes.includes(:list).order('list_id NULLS FIRST', :domain).page(params[:page]).per(40)
end end
def set_lists def set_lists

View file

@ -50,7 +50,7 @@ class Settings::FollowTagsController < Settings::BaseController
end end
def set_follow_tags def set_follow_tags
@follow_tags = current_account.follow_tags.order('list_id NULLS FIRST', :updated_at).reject(&:new_record?) @follow_tags = current_account.follow_tags.order('list_id NULLS FIRST', :updated_at).page(params[:page]).per(40)
end end
def set_lists def set_lists

View file

@ -50,7 +50,7 @@ class Settings::KeywordSubscribesController < ApplicationController
end end
def set_keyword_subscribes def set_keyword_subscribes
@keyword_subscribes = current_account.keyword_subscribes.includes(:list).order('list_id NULLS FIRST', :name).reject(&:new_record?) @keyword_subscribes = current_account.keyword_subscribes.includes(:list).order('list_id NULLS FIRST', :name).page(params[:page]).per(40)
end end
def set_lists def set_lists

View file

@ -54,6 +54,11 @@
white-space: nowrap; white-space: nowrap;
} }
th.symbol,
td.symbol {
text-align: center;
}
&.inline-table { &.inline-table {
& > tbody > tr:nth-child(odd) { & > tbody > tr:nth-child(odd) {
& > td, & > td,

View file

@ -407,15 +407,11 @@
} }
thead th { thead th {
text-align: center; text-align: left;
text-transform: uppercase; text-transform: uppercase;
color: $darker-text-color; color: $darker-text-color;
font-weight: 700; font-weight: 700;
padding: 10px; padding: 10px;
&:first-child {
text-align: left;
}
} }
tbody td { tbody td {

View file

@ -0,0 +1,16 @@
%tr
%td
= account_link_to account_subscribe.target_account
%td.nowrap.symbol
- if account_subscribe.show_reblogs
= fa_icon('check')
%td.nowrap
- if account_subscribe.list_id
= fa_icon 'list-ul'
= account_subscribe.list&.title
- else
= fa_icon 'home'
= t 'lists.home'
%td.nowrap
= table_link_to 'pencil', t('account_subscribes.edit.title'), edit_settings_account_subscribe_path(account_subscribe)
= table_link_to 'trash', t('filters.index.delete'), settings_account_subscribe_path(account_subscribe), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }

View file

@ -3,34 +3,22 @@
%p= t('account_subscribes.hint_html') %p= t('account_subscribes.hint_html')
= link_to t('account_subscribes.new.title'), new_settings_account_subscribe_path, class: 'button'
%hr.spacer/ %hr.spacer/
.table-wrapper - if @account_subscribings.empty?
%table.table = nothing_here 'nothing-here--under-tabs'
%thead - else
%tr .table-wrapper
%th= t('simple_form.labels.form_account_subscribe.acct') %table.table.accounts-table
%th.nowrap= t('simple_form.labels.form_account_subscribe.reblog') %thead
%th.nowrap= t('simple_form.labels.form_account_subscribe.timeline')
%th.nowrap
%tbody
- @account_subscribings.each do |account_subscribe|
%tr %tr
%td %th= t('simple_form.labels.form_account_subscribe.acct')
= fa_icon 'user' %th.nowrap.symbol= t('simple_form.labels.form_account_subscribe.reblog')
= account_subscribe.target_account.acct %th.nowrap= t('simple_form.labels.form_account_subscribe.timeline')
%td.nowrap %th.nowrap
- if account_subscribe.show_reblogs %tbody
= fa_icon('check') = render partial: 'account_subscribe', collection: @account_subscribings
%td.nowrap
- if account_subscribe.list_id
= fa_icon 'list-ul'
= account_subscribe.list&.title
- else
= fa_icon 'home'
= t 'lists.home'
%td.nowrap
= table_link_to 'pencil', t('account_subscribes.edit.title'), edit_settings_account_subscribe_path(account_subscribe)
= table_link_to 'trash', t('filters.index.delete'), settings_account_subscribe_path(account_subscribe), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
= link_to t('account_subscribes.new.title'), new_settings_account_subscribe_path, class: 'button' = paginate @account_subscribings

View file

@ -0,0 +1,16 @@
%tr
%td
= domain_subscribe.domain
%td.nowrap.symbol
- if domain_subscribe.exclude_reblog
= fa_icon('times')
%td.nowrap
- if domain_subscribe.list_id
= fa_icon 'list-ul'
= domain_subscribe.list&.title
- else
= fa_icon 'home'
= t 'lists.home'
%td.nowrap
= table_link_to 'pencil', t('domain_subscribes.edit.title'), edit_settings_domain_subscribe_path(domain_subscribe)
= table_link_to 'trash', t('filters.index.delete'), settings_domain_subscribe_path(domain_subscribe), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }

View file

@ -3,33 +3,22 @@
%p= t('domain_subscribes.hint_html') %p= t('domain_subscribes.hint_html')
= link_to t('domain_subscribes.new.title'), new_settings_domain_subscribe_path, class: 'button'
%hr.spacer/ %hr.spacer/
.table-wrapper - if @domain_subscribes.empty?
%table.table = nothing_here 'nothing-here--under-tabs'
%thead - else
%tr .table-wrapper
%th= t('simple_form.labels.domain_subscribe.domain') %table.table
%th.nowrap= t('simple_form.labels.domain_subscribe.reblog') %thead
%th.nowrap= t('simple_form.labels.domain_subscribe.timeline')
%th.nowrap
%tbody
- @domain_subscribes.each do |domain_subscribe|
%tr %tr
%td %th= t('simple_form.labels.domain_subscribe.domain')
= domain_subscribe.domain %th.nowrap.symbol= t('simple_form.labels.domain_subscribe.reblog')
%td.nowrap %th.nowrap= t('simple_form.labels.domain_subscribe.timeline')
- if domain_subscribe.exclude_reblog %th.nowrap
= fa_icon('times') %tbody
%td.nowrap = render partial: 'domain_subscribe', collection: @domain_subscribes
- if domain_subscribe.list_id
= fa_icon 'list-ul'
= domain_subscribe.list&.title
- else
= fa_icon 'home'
= t 'lists.home'
%td.nowrap
= table_link_to 'pencil', t('domain_subscribes.edit.title'), edit_settings_domain_subscribe_path(domain_subscribe)
= table_link_to 'trash', t('filters.index.delete'), settings_domain_subscribe_path(domain_subscribe), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
= link_to t('domain_subscribes.new.title'), new_settings_domain_subscribe_path, class: 'button' = paginate @domain_subscribes

View file

@ -0,0 +1,14 @@
%tr
%td
= fa_icon 'hashtag'
= follow_tag.name
%td.nowrap
- if follow_tag.list_id
= fa_icon 'list-ul'
= follow_tag.list&.title
- else
= fa_icon 'home'
= t 'lists.home'
%td.nowrap
= table_link_to 'pencil', t('follow_tags.edit.title'), edit_settings_follow_tag_path(follow_tag)
= table_link_to 'trash', t('filters.index.delete'), settings_follow_tag_path(follow_tag), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }

View file

@ -3,30 +3,19 @@
%p= t('follow_tags.hint_html') %p= t('follow_tags.hint_html')
= link_to t('follow_tags.new.title'), new_settings_follow_tag_path, class: 'button'
%hr.spacer/ %hr.spacer/
.table-wrapper - if @follow_tags.empty?
%table.table = nothing_here 'nothing-here--under-tabs'
%thead - else
%tr .table-wrapper
%th= t('simple_form.labels.follow_tag.name') %table.table
%th.nowrap= t('simple_form.labels.follow_tag.timeline') %thead
%th.nowrap
%tbody
- @follow_tags.each do |follow_tag|
%tr %tr
%td %th= t('simple_form.labels.follow_tag.name')
= fa_icon 'hashtag' %th.nowrap= t('simple_form.labels.follow_tag.timeline')
= follow_tag.name %th.nowrap
%td.nowrap %tbody
- if follow_tag.list_id = render partial: 'follow_tag', collection: @follow_tags
= fa_icon 'list-ul'
= follow_tag.list&.title
- else
= fa_icon 'home'
= t 'lists.home'
%td.nowrap
= table_link_to 'pencil', t('follow_tags.edit.title'), edit_settings_follow_tag_path(follow_tag)
= table_link_to 'trash', t('filters.index.delete'), settings_follow_tag_path(follow_tag), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
= link_to t('follow_tags.new.title'), new_settings_follow_tag_path, class: 'button'

View file

@ -0,0 +1,41 @@
%tr
%td.nowrap= keyword_subscribe.name
%td.nowrap
- if keyword_subscribe.regexp
= t 'keyword_subscribes.regexp.enabled'
- else
= t 'keyword_subscribes.regexp.disabled'
%td
.include-keyword
= keyword_subscribe.keyword
.exclude-keyword
= keyword_subscribe.exclude_keyword
%td.nowrap
- if keyword_subscribe.ignorecase
= t 'keyword_subscribes.ignorecase.enabled'
- else
= t 'keyword_subscribes.ignorecase.disabled'
%td.nowrap
- if keyword_subscribe.ignore_block
= t 'keyword_subscribes.ignore_block'
%td.nowrap
- if keyword_subscribe.list_id
= fa_icon 'list-ul'
= keyword_subscribe.list&.title
- else
= fa_icon 'home'
= t 'keyword_subscribe.home'
%td.nowrap
- if !keyword_subscribe.disabled
%span.positive-hint
= fa_icon('check')
= ' '
= t 'keyword_subscribes.enabled'
- else
%span.negative-hint
= fa_icon('times')
= ' '
= t 'keyword_subscribes.disabled'
%td.nowrap
= table_link_to 'pencil', t('keyword_subscribes.edit.title'), edit_settings_keyword_subscribe_path(keyword_subscribe)
= table_link_to 'times', t('keyword_subscribes.index.delete'), settings_keyword_subscribe_path(keyword_subscribe), method: :delete

View file

@ -3,64 +3,26 @@
%p= t('keyword_subscribes.hint_html') %p= t('keyword_subscribes.hint_html')
= link_to t('keyword_subscribes.new.title'), new_settings_keyword_subscribe_path, class: 'button'
%hr.spacer/ %hr.spacer/
= render 'shared/error_messages', object: @keyword_subscribe = render 'shared/error_messages', object: @keyword_subscribe
.table-wrapper - if @keyword_subscribes.empty?
%table.table = nothing_here 'nothing-here--under-tabs'
%thead - else
%tr .table-wrapper
%th.nowrap= t('simple_form.labels.keyword_subscribes.name') %table.table
%th.nowrap= t('simple_form.labels.keyword_subscribes.regexp') %thead
%th= t('simple_form.labels.keyword_subscribes.keyword')
%th.nowrap= t('simple_form.labels.keyword_subscribes.ignorecase')
%th.nowrap= t('simple_form.labels.keyword_subscribes.ignore_block')
%th.nowrap= t('simple_form.labels.keyword_subscribes.timeline')
%th.nowrap= t('simple_form.labels.keyword_subscribes.disabled')
%th.nowrap
%tbody
- @keyword_subscribes.each do |keyword_subscribe|
%tr %tr
%td.nowrap= keyword_subscribe.name %th.nowrap= t('simple_form.labels.keyword_subscribes.name')
%td.nowrap %th.nowrap= t('simple_form.labels.keyword_subscribes.regexp')
- if keyword_subscribe.regexp %th= t('simple_form.labels.keyword_subscribes.keyword')
= t 'keyword_subscribes.regexp.enabled' %th.nowrap= t('simple_form.labels.keyword_subscribes.ignorecase')
- else %th.nowrap= t('simple_form.labels.keyword_subscribes.ignore_block')
= t 'keyword_subscribes.regexp.disabled' %th.nowrap= t('simple_form.labels.keyword_subscribes.timeline')
%td %th.nowrap= t('simple_form.labels.keyword_subscribes.disabled')
.include-keyword %th.nowrap
= keyword_subscribe.keyword %tbody
.exclude-keyword = render partial: 'keyword_subscribe', collection: @keyword_subscribes
= keyword_subscribe.exclude_keyword
%td.nowrap
- if keyword_subscribe.ignorecase
= t 'keyword_subscribes.ignorecase.enabled'
- else
= t 'keyword_subscribes.ignorecase.disabled'
%td.nowrap
- if keyword_subscribe.ignore_block
= t 'keyword_subscribes.ignore_block'
%td.nowrap
- if keyword_subscribe.list_id
= fa_icon 'list-ul'
= keyword_subscribe.list&.title
- else
= fa_icon 'home'
= t 'keyword_subscribe.home'
%td.nowrap
- if !keyword_subscribe.disabled
%span.positive-hint
= fa_icon('check')
= ' '
= t 'keyword_subscribes.enabled'
- else
%span.negative-hint
= fa_icon('times')
= ' '
= t 'keyword_subscribes.disabled'
%td.nowrap
= table_link_to 'pencil', t('keyword_subscribes.edit.title'), edit_settings_keyword_subscribe_path(keyword_subscribe)
= table_link_to 'times', t('keyword_subscribes.index.delete'), settings_keyword_subscribe_path(keyword_subscribe), method: :delete
= link_to t('keyword_subscribes.new.title'), new_settings_keyword_subscribe_path, class: 'button'