diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb index 5d57fe3618b7f0e53c490fec60b3e4f1f55915d9..f155543ce2333ee6202d555b1d3089ed0ca6045d 100644 --- a/app/controllers/admin/accounts_controller.rb +++ b/app/controllers/admin/accounts_controller.rb @@ -94,8 +94,8 @@ module Admin :local, :remote, :by_domain, + :active, :silenced, - :alphabetic, :suspended, :username, :display_name, diff --git a/app/helpers/admin/account_moderation_notes_helper.rb b/app/helpers/admin/account_moderation_notes_helper.rb index 4d8f0352e4daf35ae508f8b534d9a8799b89129b..40b2a5289224bec355be02624dcb8d44843f2394 100644 --- a/app/helpers/admin/account_moderation_notes_helper.rb +++ b/app/helpers/admin/account_moderation_notes_helper.rb @@ -24,7 +24,7 @@ module Admin::AccountModerationNotesHelper def name_tag_classes(account, inline = false) classes = [inline ? 'inline-name-tag' : 'name-tag'] - classes << 'suspended' if account.suspended? + classes << 'suspended' if account.suspended? || (account.local? && account.user.nil?) classes.join(' ') end end diff --git a/app/helpers/admin/filter_helper.rb b/app/helpers/admin/filter_helper.rb index 60e5142e33a7be02680090424a241408f9af4a8c..9a663051c632dd4759361e59c4095e6309465ca6 100644 --- a/app/helpers/admin/filter_helper.rb +++ b/app/helpers/admin/filter_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Admin::FilterHelper - ACCOUNT_FILTERS = %i(local remote by_domain silenced suspended alphabetic username display_name email ip staff).freeze + ACCOUNT_FILTERS = %i(local remote by_domain active silenced suspended username display_name email ip staff).freeze REPORT_FILTERS = %i(resolved account_id target_account_id).freeze INVITE_FILTER = %i(available expired).freeze CUSTOM_EMOJI_FILTERS = %i(local remote by_domain shortcode).freeze diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb index ac655f6227d7b4d800f7aebf602b1204035b9117..033d435c49780920e2902d23ab06491bb61de2bd 100644 --- a/app/helpers/stream_entries_helper.rb +++ b/app/helpers/stream_entries_helper.rb @@ -34,12 +34,14 @@ module StreamEntriesHelper end end - def account_badge(account) + def account_badge(account, all: false) if account.bot? content_tag(:div, content_tag(:div, t('accounts.roles.bot'), class: 'account-role bot'), class: 'roles') - elsif Setting.show_staff_badge && account.user_staff? + elsif (Setting.show_staff_badge && account.user_staff?) || all content_tag(:div, class: 'roles') do - if account.user_admin? + if all && !account.user_staff? + content_tag(:div, t('admin.accounts.roles.user'), class: 'account-role') + elsif account.user_admin? content_tag(:div, t('accounts.roles.admin'), class: 'account-role admin') elsif account.user_moderator? content_tag(:div, t('accounts.roles.moderator'), class: 'account-role moderator') diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 3b02b7c39e2157ac359a9f3060087d6b1205fbed..36b1fd26b8da4f4ea9d9a990c4fa4799413725f9 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -63,7 +63,7 @@ function main() { content.textContent = timeAgoString({ formatMessage: ({ id, defaultMessage }, values) => (new IntlMessageFormat(messages[id] || defaultMessage, locale)).format(values), formatDate: (date, options) => (new Intl.DateTimeFormat(locale, options)).format(date), - }, datetime, now, datetime.getFullYear()); + }, datetime, now, now.getFullYear()); }); const reactComponents = document.querySelectorAll('[data-component]'); diff --git a/app/models/account.rb b/app/models/account.rb index 593ee29f768115e3409e4261f8d1fa29e6f551c0..46d32a36ef418dc9dad8fa906c11e179d7af2b54 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -123,6 +123,7 @@ class Account < ApplicationRecord scope :suspended, -> { where(suspended: true) } scope :without_suspended, -> { where(suspended: false) } scope :recent, -> { reorder(id: :desc) } + scope :bots, -> { where(actor_type: %w(Application Service)) } scope :alphabetic, -> { order(domain: :asc, username: :asc) } scope :by_domain_accounts, -> { group(:domain).select(:domain, 'COUNT(*) AS accounts_count').order('accounts_count desc') } scope :matches_username, ->(value) { where(arel_table[:username].matches("#{value}%")) } diff --git a/app/models/account_filter.rb b/app/models/account_filter.rb index 84364bf1b73300b212acac98a7863611cdab89c1..b10f50db778b100e1aa477dcd6ac8ad01c7b4a7e 100644 --- a/app/models/account_filter.rb +++ b/app/models/account_filter.rb @@ -5,13 +5,14 @@ class AccountFilter def initialize(params) @params = params + set_defaults! end def results - scope = Account.recent + scope = Account.recent.includes(:user) params.each do |key, value| - scope.merge!(scope_for(key, value)) if value.present? + scope.merge!(scope_for(key, value.to_s.strip)) if value.present? end scope @@ -19,6 +20,11 @@ class AccountFilter private + def set_defaults! + params['local'] = '1' if params['remote'].blank? + params['active'] = '1' if params['suspended'].blank? && params['silenced'].blank? + end + def scope_for(key, value) case key.to_s when 'local' @@ -27,10 +33,10 @@ class AccountFilter Account.remote when 'by_domain' Account.where(domain: value) + when 'active' + Account.without_suspended when 'silenced' Account.silenced - when 'alphabetic' - Account.reorder(nil).alphabetic when 'suspended' Account.suspended when 'username' @@ -40,11 +46,7 @@ class AccountFilter when 'email' accounts_with_users.merge User.matches_email(value) when 'ip' - if valid_ip?(value) - accounts_with_users.merge User.with_recent_ip_address(value) - else - Account.default_scoped - end + valid_ip?(value) ? accounts_with_users.where('users.current_sign_in_ip <<= ?', value) : Account.none when 'staff' accounts_with_users.merge User.staff else @@ -57,8 +59,7 @@ class AccountFilter end def valid_ip?(value) - IPAddr.new(value) - true + IPAddr.new(value) && true rescue IPAddr::InvalidAddressError false end diff --git a/app/models/user.rb b/app/models/user.rb index 69fa0688a301baf0d51cc85ae82d927f2793e44f..453ffa8b07e782bf9708cb51a023a12bbf0a170a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -83,7 +83,6 @@ class User < ApplicationRecord scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) } scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended: false }) } scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) } - scope :with_recent_ip_address, ->(value) { where(arel_table[:current_sign_in_ip].eq(value).or(arel_table[:last_sign_in_ip].eq(value))) } before_validation :sanitize_languages diff --git a/app/views/admin/accounts/_account.html.haml b/app/views/admin/accounts/_account.html.haml index c6e63152d5c7d8e3158bc0d9be0cb23a7f09611c..0fadaae1e71b7ca53309c876ad81329c9c448aae 100644 --- a/app/views/admin/accounts/_account.html.haml +++ b/app/views/admin/accounts/_account.html.haml @@ -1,18 +1,15 @@ %tr - %td.username - = account.username %td - - unless account.local? - = link_to account.domain, admin_accounts_path(by_domain: account.domain) + = admin_account_link_to(account) %td - - if account.local? - - if account.user.nil? - = t("admin.accounts.moderation.suspended") - - else - = t("admin.accounts.roles.#{account.user.role}") + %div{ style: 'margin: -2px 0' }= account_badge(account, all: true) + %td + - if account.user_current_sign_in_ip + %samp= account.user_current_sign_in_ip - else - = account.protocol.humanize + \- %td - = table_link_to 'circle', t('admin.accounts.web'), web_path("accounts/#{account.id}") - = table_link_to 'globe', t('admin.accounts.public'), TagManager.instance.url_for(account) - = table_link_to 'pencil', t('admin.accounts.edit'), admin_account_path(account.id) + - if account.user_current_sign_in_at + %time.time-ago{ datetime: account.user_current_sign_in_at.iso8601, title: l(account.user_current_sign_in_at) }= l account.user_current_sign_in_at + - else + \- diff --git a/app/views/admin/accounts/index.html.haml b/app/views/admin/accounts/index.html.haml index 4bee73adcad59086c46c094cd03545b423039d3a..0d31eee36700f43704c65a854d38b5f311d82e8f 100644 --- a/app/views/admin/accounts/index.html.haml +++ b/app/views/admin/accounts/index.html.haml @@ -5,41 +5,19 @@ .filter-subset %strong= t('admin.accounts.location.title') %ul - %li= filter_link_to t('admin.accounts.location.all'), local: nil, remote: nil - %li - - if selected? local: '1', remote: nil - = filter_link_to t('admin.accounts.location.local'), {local: nil, remote: nil}, {local: '1', remote: nil} - - else - = filter_link_to t('admin.accounts.location.local'), local: '1', remote: nil - %li - - if selected? remote: '1', local: nil - = filter_link_to t('admin.accounts.location.remote'), {remote: nil, local: nil}, {remote: '1', local: nil} - - else - = filter_link_to t('admin.accounts.location.remote'), remote: '1', local: nil + %li= filter_link_to t('admin.accounts.location.local'), remote: nil + %li= filter_link_to t('admin.accounts.location.remote'), remote: '1' .filter-subset %strong= t('admin.accounts.moderation.title') %ul - %li= filter_link_to t('admin.accounts.moderation.all'), silenced: nil, suspended: nil - %li - - if selected? silenced: '1' - = filter_link_to t('admin.accounts.moderation.silenced'), {silenced: nil}, {silenced: '1'} - - else - = filter_link_to t('admin.accounts.moderation.silenced'), silenced: '1' - %li - - if selected? suspended: '1' - = filter_link_to t('admin.accounts.moderation.suspended'), {suspended: nil}, {suspended: '1'} - - else - = filter_link_to t('admin.accounts.moderation.suspended'), suspended: '1' + %li= filter_link_to t('admin.accounts.moderation.active'), silenced: nil, suspended: nil + %li= filter_link_to t('admin.accounts.moderation.silenced'), silenced: '1', suspended: nil + %li= filter_link_to t('admin.accounts.moderation.suspended'), suspended: '1', silenced: nil .filter-subset %strong= t('admin.accounts.role') %ul %li= filter_link_to t('admin.accounts.moderation.all'), staff: nil %li= filter_link_to t('admin.accounts.roles.staff'), staff: '1' - .filter-subset - %strong= t('admin.accounts.order.title') - %ul - %li= filter_link_to t('admin.accounts.order.most_recent'), alphabetic: nil - %li= filter_link_to t('admin.accounts.order.alphabetic'), alphabetic: '1' = form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do .fields-group @@ -60,9 +38,9 @@ %thead %tr %th= t('admin.accounts.username') - %th= t('admin.accounts.domain') - %th - %th + %th= t('admin.accounts.role') + %th= t('admin.accounts.most_recent_ip') + %th= t('admin.accounts.most_recent_activity') %tbody = render @accounts diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml index 17f1f224d460ecb994dcea1346f7c55f070da789..c1a5fc1bd39a9068ef4575a080720128666fc9d3 100644 --- a/app/views/admin/accounts/show.html.haml +++ b/app/views/admin/accounts/show.html.haml @@ -68,7 +68,7 @@ %time.formatted{ datetime: @account.user_current_sign_in_at.iso8601, title: l(@account.user_current_sign_in_at) } = l @account.user_current_sign_in_at - else - Never + \- - else %tr %th= t('admin.accounts.profile_url') diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 095b1f584ba958744bf402d2df0c427167ed6ada..e9d9c03cdad25610ff0263cf90855a8a223f4b23 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -115,10 +115,6 @@ ar: most_recent_ip: Ø£Øدث عنوان إيبي no_limits_imposed: Ù…ÙÙ† دون Øدود مشروطة not_subscribed: غير مشترك - order: - alphabetic: أبجديًا - most_recent: الأØدث - title: الترتيب outbox_url: رابط صندوق الصادر perform_full_suspension: تعطيل profile_url: رابط المل٠الشخصي diff --git a/config/locales/ca.yml b/config/locales/ca.yml index b74d7a00b1517aef26f7c8e93b45ebe21c657705..29a75f13bd75f8fbb9bc5d2586e5396725d3e917 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -123,10 +123,6 @@ ca: most_recent_ip: IP més recent no_limits_imposed: Sense lÃmits imposats not_subscribed: No subscrit - order: - alphabetic: Alfabètic - most_recent: Més recent - title: Ordre outbox_url: URL de la bústia de sortida perform_full_suspension: Suspèn profile_url: URL del perfil diff --git a/config/locales/co.yml b/config/locales/co.yml index 9306c6c33f9ba1aa48208d1d0c0ab60bb9446e7d..8c68aff69bc7582fc5e0e7e0babc3aadd322d4a2 100644 --- a/config/locales/co.yml +++ b/config/locales/co.yml @@ -123,10 +123,6 @@ co: most_recent_ip: IP più ricente no_limits_imposed: Nisuna limita imposta not_subscribed: Micca abbunatu - order: - alphabetic: Alfabeticu - most_recent: Più ricente - title: Urdine outbox_url: URL di l’outbox perform_full_suspension: Suspende profile_url: URL di u prufile diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 05f65653b94d222b519fb0453bd9401ab5befacb..9e749a9517ead048d5737d5e0c41b776c049ee72 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -115,10 +115,6 @@ cs: most_recent_ip: NejnovÄ›jÅ¡Ã IP no_limits_imposed: Nejsou nastavena žádná omezenà not_subscribed: NeodebÃrá - order: - alphabetic: AbecednÄ› - most_recent: NejnovÄ›jÅ¡Ã - title: PoÅ™adà outbox_url: URL odchozÃch zpráv perform_full_suspension: Suspendovat profile_url: URL profilu diff --git a/config/locales/cy.yml b/config/locales/cy.yml index a4df28b6197edc92e8ac44a52753dffc8d0e9183..e238abc37701f53aaf9cd582a22594d2a8ab1947 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -115,10 +115,6 @@ cy: most_recent_ip: IP diweddaraf no_limits_imposed: Dim terfynau wedi'i gosod not_subscribed: Heb danysgrifio - order: - alphabetic: Allfabetig - most_recent: Diweddaraf - title: Trefnu outbox_url: Allflwch URL perform_full_suspension: Atal profile_url: URL proffil diff --git a/config/locales/da.yml b/config/locales/da.yml index d9ce9d55d0527d4c4c6002e6bc35b99fb513b1d3..fb6cac828e068c1ee125f9d56e7f1bd2e7bc0eed 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -122,10 +122,6 @@ da: most_recent_activity: Seneste aktivitet most_recent_ip: Senest IP not_subscribed: Ikke abonneret - order: - alphabetic: Alfabetisk - most_recent: Seneste - title: Rækkefølge outbox_url: Link til udgÃ¥ende perform_full_suspension: Udeluk profile_url: Link til profil diff --git a/config/locales/de.yml b/config/locales/de.yml index 587b9dfc91d699db403988cb92e2e5582ea0348f..51b4818bdadad5cc31f59686a3de9fc522539122 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -123,10 +123,6 @@ de: most_recent_ip: Letzte IP-Adresse no_limits_imposed: Keine Limits eingesetzt not_subscribed: Nicht abonniert - order: - alphabetic: Alphabetisch - most_recent: Neueste - title: Sortierung outbox_url: Postausgangs-URL perform_full_suspension: Sperren profile_url: Profil-URL diff --git a/config/locales/el.yml b/config/locales/el.yml index 8f718a849c34ac8959e6f06b7737e9933311b9b9..757133c9b2eeecf80f548f0d98622b1d739a7c81 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -123,10 +123,6 @@ el: most_recent_ip: Πιο Ï€Ïόσφατη IP no_limits_imposed: ΧωÏίς ÏŒÏια not_subscribed: Άνευ συνδÏομής - order: - alphabetic: Αλφαβητικά - most_recent: Πιο Ï€Ïόσφατα - title: Ταξινόμηση outbox_url: URL εξεÏχομÎνων perform_full_suspension: Κάνε πλήÏη αναστολή profile_url: URL Ï€Ïοφίλ diff --git a/config/locales/en.yml b/config/locales/en.yml index a2859aa5d8e0a8c5a10daae211c3bce2c470ed85..2d27a4ac7c05124cedd856022746aa7778f94366 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -123,10 +123,6 @@ en: most_recent_ip: Most recent IP no_limits_imposed: No limits imposed not_subscribed: Not subscribed - order: - alphabetic: Alphabetic - most_recent: Most recent - title: Order outbox_url: Outbox URL perform_full_suspension: Suspend profile_url: Profile URL diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 72628a9440091b4704e60a6108143e770c12aed5..eddefab059ea52806069293d7c021844cf1bc2f9 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -112,10 +112,6 @@ eo: most_recent_activity: Lasta ago most_recent_ip: Lasta IP not_subscribed: Ne abonita - order: - alphabetic: LaÅalfabete - most_recent: Plej lastatempa - title: Ordo outbox_url: Elira URL perform_full_suspension: Tute haltigi profile_url: Profila URL diff --git a/config/locales/es.yml b/config/locales/es.yml index f7531161c28d25fa6399276f6e68b7cd81588a4b..4cd1e2a38069ad31fa4d0e7d89bedade07edd60d 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -123,10 +123,6 @@ es: most_recent_ip: IP más reciente no_limits_imposed: Sin lÃmites impuestos not_subscribed: No se está suscrito - order: - alphabetic: Alfabético - most_recent: Más reciente - title: Orden outbox_url: URL de bandeja de salida perform_full_suspension: Suspender profile_url: URL del perfil diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 206b439b0f2e3aef28c1eaa6a6bac52f14c86518..122b074eb69d57047eca02549c0c09f85061132e 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -123,10 +123,6 @@ eu: most_recent_ip: Azken IP-a no_limits_imposed: Ez da mugarik ezarri not_subscribed: Harpidetu gabe - order: - alphabetic: Alfabetikoa - most_recent: Azkena - title: Ordena outbox_url: Irteera ontziaren URL-a perform_full_suspension: Kanporatu profile_url: Profilaren URL-a diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 4209a2c0072d150ed07aadd5f2e42d82a6ff818e..769b3a0fdf8934d208d1a1254ace4e5825ea6c36 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -123,10 +123,6 @@ fa: most_recent_ip: آخرین IP ها no_limits_imposed: بدون Ù…Øدودیت not_subscribed: عضو نیست - order: - alphabetic: الÙبایی - most_recent: تازه‌ترین‌ها - title: ترتیب outbox_url: نشانی صندوق خروجی perform_full_suspension: تعلیق profile_url: نشانی نمایه diff --git a/config/locales/fi.yml b/config/locales/fi.yml index c904902122c36c045e527887726c49917cd92b80..77fca8decb54dcd720e4bec414e1a18c1af0d795 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -102,10 +102,6 @@ fi: most_recent_activity: Viimeisin toiminta most_recent_ip: Viimeisin IP not_subscribed: Ei tilaaja - order: - alphabetic: Aakkosjärjestys - most_recent: Uusin - title: Järjestys outbox_url: Lähtevän postilaatikon osoite perform_full_suspension: Siirrä kokonaan jäähylle profile_url: Profiilin osoite diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e3128b569bb19257ea8995629ad8c3c4e204be4f..51b4fb1f84364c500815e226a22ee91b57273c45 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -123,10 +123,6 @@ fr: most_recent_ip: Adresse IP la plus récente no_limits_imposed: Aucune limite imposée not_subscribed: Non abonné - order: - alphabetic: Alphabétique - most_recent: Plus récent - title: Tri outbox_url: URL de sortie perform_full_suspension: Suspendre profile_url: URL du profil diff --git a/config/locales/gl.yml b/config/locales/gl.yml index b9b9a37ad1e169edb02ceb4f56771395726145be..726b6e400959dd0fd99f88688729a7e02ad9f3a6 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -123,10 +123,6 @@ gl: most_recent_ip: IP máis recente no_limits_imposed: Sen lÃmites impostos not_subscribed: Non suscrita - order: - alphabetic: Alfabética - most_recent: Máis recente - title: Orde outbox_url: URL caixa de saÃda perform_full_suspension: Suspender profile_url: URL do perfil diff --git a/config/locales/he.yml b/config/locales/he.yml index 79b1ed82255ee0e3eb7ee9a2606cbc4d63b53cee..65ca617b22e23ec18aa6e081682da075b2134262 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -95,10 +95,6 @@ he: most_recent_activity: פעילות ×¢×“×›× ×™×ª most_recent_ip: כתובות ××—×¨×•× ×•×ª not_subscribed: ×œ× ×¨×©×•× - order: - alphabetic: ×לפביתי - most_recent: ×¢×“×›× ×™ - title: סידור outbox_url: כתובת תיבת דו×ר ×™×•×¦× perform_full_suspension: ביצוע השעייה מל××” profile_url: כתובת פרופיל diff --git a/config/locales/hu.yml b/config/locales/hu.yml index faa52fabc70f1d5e801b186ad6237463411e4b92..cf2c5f1e49722e08645563d8e08b526cfd6b634d 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -92,10 +92,6 @@ hu: most_recent_activity: Legutóbbi tevékenységek most_recent_ip: Legutóbbi IP-cÃm not_subscribed: Nincs feliratkozás - order: - alphabetic: Alfabetikus - most_recent: Legutóbbi - title: Rendezés outbox_url: KimenÅ‘ üzenetek URL perform_full_suspension: Teljes felfüggesztés profile_url: Profil URL diff --git a/config/locales/id.yml b/config/locales/id.yml index 38b08a257e22fa02c08fb05afff7b54a811f096a..235bc0bcb50dfe2d1244b419a10495d99dcd8a44 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -50,10 +50,6 @@ id: most_recent_activity: Aktivitas terbaru most_recent_ip: IP terbaru not_subscribed: Tidak berlangganan - order: - alphabetic: Alfabetik - most_recent: Terbaru - title: Urutan perform_full_suspension: Lakukan suspen penuh profile_url: URL profil public: Publik diff --git a/config/locales/io.yml b/config/locales/io.yml index 0c1e6520b85e21a88808c10bc53ef4c1c5c2a626..342fcbc28ea953be247e775ae82a57705cf67c44 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -44,10 +44,6 @@ io: most_recent_activity: Most recent activity most_recent_ip: Most recent IP not_subscribed: Not subscribed - order: - alphabetic: Alphabetic - most_recent: Most recent - title: Order perform_full_suspension: Perform full suspension profile_url: Profile URL public: Public diff --git a/config/locales/it.yml b/config/locales/it.yml index 4fffded5fd63b3fdc19ba3c08916fd0544690219..dc62b1beaacdecf689368000d8a1c94f61737686 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -123,10 +123,6 @@ it: most_recent_ip: IP più recenti no_limits_imposed: Nessun limite imposto not_subscribed: Non sottoscritto - order: - alphabetic: Alfabetico - most_recent: Più recente - title: Ordine outbox_url: URL outbox perform_full_suspension: Sospendi profile_url: URL profilo diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 90ff66acb2423c1aadd62bf343ba7846130258a9..41566594458827ffcd79a8f4d27f1a837c992781 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -123,10 +123,6 @@ ja: most_recent_ip: ç›´è¿‘ã®IP no_limits_imposed: 制é™ãªã— not_subscribed: è³¼èªã—ã¦ã„ãªã„ - order: - alphabetic: ã‚¢ãƒ«ãƒ•ã‚¡ãƒ™ãƒƒãƒˆé † - most_recent: ç›´è¿‘ã®æ´»å‹•é † - title: é †åº outbox_url: Outbox URL perform_full_suspension: 完全ã«æ´»å‹•åœæ¢ã•ã›ã‚‹ profile_url: プãƒãƒ•ã‚£ãƒ¼ãƒ«URL diff --git a/config/locales/ka.yml b/config/locales/ka.yml index 1b74405d27aa9f3e34d4529096ed589ba8a038f0..b0d1087c3d729b8027e18020fa668fe07f9009e8 100644 --- a/config/locales/ka.yml +++ b/config/locales/ka.yml @@ -112,10 +112,6 @@ ka: most_recent_activity: უáƒáƒ®áƒšáƒ”სი áƒáƒ¥áƒ¢áƒ˜áƒ•áƒáƒ‘რmost_recent_ip: უáƒáƒ®áƒšáƒ”სი áƒáƒ˜-პი not_subscribed: გáƒáƒ›áƒáƒ£áƒ¬áƒ”რელი - order: - alphabetic: áƒáƒœáƒ‘áƒáƒœáƒ£áƒ ი - most_recent: უáƒáƒ®áƒšáƒ”სი - title: წესრიგი outbox_url: áƒáƒ£áƒ—ბáƒáƒ¥áƒ¡áƒ˜áƒ¡ ურლ perform_full_suspension: მáƒáƒáƒ®áƒ“ინეთ სრული შეჩერებრprofile_url: პრáƒáƒ¤áƒ˜áƒšáƒ˜áƒ¡ ურლ diff --git a/config/locales/ko.yml b/config/locales/ko.yml index e1cb350d1ad25c0bb5159487cc7a97ef8c5c3618..7c948e8bab49b531bbeacddd072fa97bbb56f1a0 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -123,10 +123,6 @@ ko: most_recent_ip: 최근 IP no_limits_imposed: ì œí•œ ì—†ìŒ not_subscribed: 구ë…하지 ì•ŠìŒ - order: - alphabetic: 알파벳 순 - most_recent: 최근 순 - title: 순서 outbox_url: ë°œì‹ í•¨ URL perform_full_suspension: ì •ì§€ì‹œí‚¤ê¸° profile_url: 프로필 URL diff --git a/config/locales/nl.yml b/config/locales/nl.yml index ab5a72a66a98df63dfd9ba83b0e9609892b92118..3c101fd770be96585f6cba47165034328a4027f0 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -123,10 +123,6 @@ nl: most_recent_ip: Laatst gebruikt IP-adres no_limits_imposed: Geen limieten ingesteld not_subscribed: Niet geabonneerd - order: - alphabetic: Alfabetisch - most_recent: Meest recent - title: Sorteren outbox_url: Outbox-URL perform_full_suspension: Opschorten profile_url: Profiel-URL diff --git a/config/locales/no.yml b/config/locales/no.yml index 61466fa20ea471c69728dfd8769de6115caf9853..5e06564ac554a269e95329923f4f74283320e431 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -92,10 +92,6 @@ most_recent_activity: Nyligste aktivitet most_recent_ip: Nyligste IP not_subscribed: Ikke abonnért - order: - alphabetic: Alfabetisk - most_recent: Nyligst - title: Rekkefølge outbox_url: Utboks URL perform_full_suspension: Utfør full utvisning profile_url: Profil-URL diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 428bbfffe880e7fca4781a97bb21f81eb56a05ed..36d5ddda4d14cdb48e8fa5367b60ed4199f708ab 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -123,10 +123,6 @@ oc: most_recent_ip: IP mai recenta no_limits_imposed: Cap de limit impausat not_subscribed: Pas seguidor - order: - alphabetic: Alfabetic - most_recent: Mai recent - title: Ordre outbox_url: URL Outbox perform_full_suspension: Suspendre profile_url: URL del perfil diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 9c893b60565ead8dbe7fac2f716dfd4eef2a5b56..2f79f5f6b6588a47bda84e0547351b0e9e874743 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -131,10 +131,6 @@ pl: most_recent_ip: Ostatnie IP no_limits_imposed: Nie naÅ‚ożono ograniczeÅ„ not_subscribed: Nie zasubskrybowano - order: - alphabetic: Alfabetycznie - most_recent: Najnowsze - title: Kolejność outbox_url: Adres skrzynki nadawczej perform_full_suspension: ZawieÅ› profile_url: Adres profilu diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 2b9bf747de343d27b9ec762f9c5e35c45db2b2d3..1d778e60f4dd1f77aa07a3cc3864b43960c3ee9f 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -123,10 +123,6 @@ pt-BR: most_recent_ip: IP mais recente no_limits_imposed: Nenhum limite imposto not_subscribed: Não está inscrito - order: - alphabetic: Alfabética - most_recent: Mais recente - title: Ordem outbox_url: URL da caixa de saÃda perform_full_suspension: Suspender profile_url: URL do perfil diff --git a/config/locales/pt.yml b/config/locales/pt.yml index b68ffbd7f336f66b4e3819567022dbc26306d798..4c23c9cf41f844a7f22273010e01ec8562ef73c4 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -92,10 +92,6 @@ pt: most_recent_activity: Actividade mais recente most_recent_ip: IP mais recente not_subscribed: Não inscrito - order: - alphabetic: Alfabética - most_recent: Mais recente - title: Ordem outbox_url: URL da caixa de saÃda perform_full_suspension: Fazer suspensão completa profile_url: URL do perfil diff --git a/config/locales/ru.yml b/config/locales/ru.yml index a3ac754f2f2f3efc721c64333f5309379d2a159c..9fa85b7c2f316669d3f024ce88099582f00230ca 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -128,10 +128,6 @@ ru: most_recent_activity: ПоÑледнÑÑ Ð°ÐºÑ‚Ð¸Ð²Ð½Ð¾ÑÑ‚ÑŒ most_recent_ip: ПоÑледний IP not_subscribed: Ðе подпиÑаны - order: - alphabetic: По алфавиту - most_recent: По дате - title: ПорÑдок outbox_url: URL иÑходÑщих perform_full_suspension: ÐŸÐ¾Ð»Ð½Ð°Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ° profile_url: URL Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 2b928169ae6847d39eef11ee7fdaa5a01bbd17d2..cc06b2d6c180c5409700eb3be2a7cf5e33bea876 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -113,10 +113,6 @@ sk: most_recent_activity: Posledná aktivita most_recent_ip: Posledná IP not_subscribed: Nezaregistrované - order: - alphabetic: Abecedne - most_recent: Podľa Äasu - title: ZoradiÅ¥ outbox_url: URL poslaných perform_full_suspension: SuspendovaÅ¥ profile_url: URL profilu diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 0e9d7d3aa77a2af6947a86dbd683de424c3743e4..46f83876c197287338ca9bfa1899d959cb74a964 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -102,10 +102,6 @@ sl: moderation_notes: Opombe moderiranja most_recent_activity: Zadnja aktivnost most_recent_ip: Zadnji IP - order: - alphabetic: Po abecedi - most_recent: NajnovejÅ¡e - title: Red promote: Spodbujanje remote_interaction: prompt: 'Želite interakcijo s tem trobom:' diff --git a/config/locales/sr-Latn.yml b/config/locales/sr-Latn.yml index 1e32190ccfbf90ad14b36edb3e10ba74fd72325e..50802945f3550b373b456f12a412ce0630d414f9 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -92,10 +92,6 @@ sr-Latn: most_recent_activity: Najskorija aktivnost most_recent_ip: Najskorija IP adresa not_subscribed: Nije pretplaćen - order: - alphabetic: Abecedni - most_recent: Najskoriji - title: Redosled outbox_url: Odlazno sanduÄe perform_full_suspension: IzvrÅ¡i kompletno iskljuÄenje profile_url: Adresa profila diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 1ade87f9e9db870975e9ed6963f9d7a757f861c7..14354f8a682eca8636ddedc4536add9b6594880c 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -113,10 +113,6 @@ sr: most_recent_activity: ÐајÑкорија активноÑÑ‚ most_recent_ip: ÐајÑкорија IP адреÑа not_subscribed: Ðије претплаћен - order: - alphabetic: Ðбецедни - most_recent: ÐајÑкорији - title: РедоÑлед outbox_url: Одлазно Ñандуче perform_full_suspension: Изврши комплетно иÑкључење profile_url: ÐдреÑа профила diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 465a9b127731705cfd0a415b59a260e74c8e5f4a..55ab9b2ba5343ec048aae71c6e38ed26c1cdb41c 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -103,10 +103,6 @@ sv: most_recent_activity: Senaste aktivitet most_recent_ip: Senaste IP not_subscribed: Inte prenumererat - order: - alphabetic: Alfabetiskt - most_recent: Senaste - title: Ordning outbox_url: Utkorg URL perform_full_suspension: Utför full avstängning profile_url: Profil URL diff --git a/config/locales/th.yml b/config/locales/th.yml index b0b8e9ba064670cd00b5785eeab7e44442568bc3..42d52af261509074250e0fa6b86373090bc8cd69 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -49,10 +49,6 @@ th: most_recent_activity: à¸à¸´à¸ˆà¸à¸£à¸£à¸¡à¸¥à¹ˆà¸²à¸ªà¸¸à¸” most_recent_ip: IP ล่าสุด not_subscribed: Not subscribed - order: - alphabetic: ตามตัวà¸à¸±à¸à¸©à¸£ - most_recent: ล่าสุด - title: จัดเรียง perform_full_suspension: Perform full suspension profile_url: Profile URL public: สาธารณะ diff --git a/config/locales/tr.yml b/config/locales/tr.yml index bc0a558e1432e823f53c93eacd662350edaf1a1b..14d356eef995cb8d96aad1ab68d964e9a84fe575 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -48,10 +48,6 @@ tr: most_recent_activity: Son aktivite most_recent_ip: Son IP not_subscribed: Abone edilmedi - order: - alphabetic: Alfabetik - most_recent: En son - title: Sıralama perform_full_suspension: Tamamen uzaklaÅŸtır profile_url: Profil linki public: Herkese açık diff --git a/config/locales/uk.yml b/config/locales/uk.yml index e4ea774ecc686afa7880f924023844c28d6a338e..28dd7f57907634e2531753116d499f99cdf85191 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -108,10 +108,6 @@ uk: most_recent_activity: ОÑÑ‚Ð°Ð½Ð½Ñ Ð°ÐºÑ‚Ð¸Ð²Ð½Ñ–ÑÑ‚ÑŒ most_recent_ip: ОÑтанній IP not_subscribed: Ðе підпиÑані - order: - alphabetic: За алфавітом - most_recent: За датою - title: ПорÑдок outbox_url: Вихідний URL perform_full_suspension: Повне Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ profile_url: URL профілю diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index a32f36e32b5675dde55bc37451f5f9ce368f10b9..744648921b659bbee0665735c69f2905b9e9f94f 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -114,10 +114,6 @@ zh-CN: most_recent_activity: 最åŽä¸€æ¬¡æ´»è·ƒçš„时间 most_recent_ip: 最åŽä¸€æ¬¡æ´»è·ƒçš„ IP åœ°å€ not_subscribed: 未订阅 - order: - alphabetic: 按å—æ¯ - most_recent: 按时间 - title: æŽ’åº outbox_url: å‘件箱(Outbox)URL perform_full_suspension: 永久å°ç¦ profile_url: ä¸ªäººèµ„æ–™é¡µé¢ URL diff --git a/config/locales/zh-HK.yml b/config/locales/zh-HK.yml index 7296587a38e369bc0be69ffeec5e6a8ba5885627..abbaa77d607f9bb769bf7046e473105f92190e7c 100644 --- a/config/locales/zh-HK.yml +++ b/config/locales/zh-HK.yml @@ -103,10 +103,6 @@ zh-HK: most_recent_activity: 最新活動 most_recent_ip: 最新 IP ä½åŸŸ not_subscribed: 未訂閱 - order: - alphabetic: 按å—æ¯ - most_recent: 按時間 - title: æŽ’åº outbox_url: 寄件箱(Outbox)URL perform_full_suspension: 完全åœæ¬Š profile_url: 個人檔案 URL diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 9a7c2b293dc20500baa696fb1ec08e369381df5b..b4c15f6f1bb08a6a1d0c918f79464c8f5de177aa 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -108,10 +108,6 @@ zh-TW: most_recent_activity: 最近活動 most_recent_ip: 最近 IP ä½å€ not_subscribed: 未訂閱 - order: - alphabetic: 按å—æ¯ - most_recent: 按時間 - title: æŽ’åº outbox_url: 寄件箱 (Outbox) URL perform_full_suspension: 進行åœæ¬Š profile_url: 個人檔案 URL diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb index ae9e058c86d1b3591c17dbf178161a6d8571357d..dbcad3c2d217ac529918cd342fa4d75384a06805 100644 --- a/spec/controllers/admin/accounts_controller_spec.rb +++ b/spec/controllers/admin/accounts_controller_spec.rb @@ -24,8 +24,8 @@ RSpec.describe Admin::AccountsController, type: :controller do expect(h[:local]).to eq '1' expect(h[:remote]).to eq '1' expect(h[:by_domain]).to eq 'domain' + expect(h[:active]).to eq '1' expect(h[:silenced]).to eq '1' - expect(h[:alphabetic]).to eq '1' expect(h[:suspended]).to eq '1' expect(h[:username]).to eq 'username' expect(h[:display_name]).to eq 'display name' @@ -39,8 +39,8 @@ RSpec.describe Admin::AccountsController, type: :controller do local: '1', remote: '1', by_domain: 'domain', + active: '1', silenced: '1', - alphabetic: '1', suspended: '1', username: 'username', display_name: 'display name', diff --git a/spec/models/account_filter_spec.rb b/spec/models/account_filter_spec.rb index 0a025264213bf2cf489553a1abc27e7f9d55fa99..176a0eeacd0ce055c8f71f664a689b2553eec8a5 100644 --- a/spec/models/account_filter_spec.rb +++ b/spec/models/account_filter_spec.rb @@ -2,10 +2,10 @@ require 'rails_helper' describe AccountFilter do describe 'with empty params' do - it 'defaults to recent account list' do + it 'defaults to recent local not-suspended account list' do filter = described_class.new({}) - expect(filter.results).to eq Account.recent + expect(filter.results).to eq Account.local.recent.without_suspended end end @@ -17,23 +17,6 @@ describe AccountFilter do end end - describe 'when an IP address is provided' do - it 'filters with IP when valid' do - filter = described_class.new(ip: '127.0.0.1') - allow(User).to receive(:with_recent_ip_address).and_return(User.none) - - filter.results - expect(User).to have_received(:with_recent_ip_address).with('127.0.0.1') - end - - it 'skips IP when invalid' do - filter = described_class.new(ip: '345.678.901.234') - expect(User).not_to receive(:with_recent_ip_address) - - filter.results - end - end - describe 'with valid params' do it 'combines filters on Account' do filter = described_class.new( @@ -60,13 +43,13 @@ describe AccountFilter do end describe 'that call account methods' do - %i(local remote silenced alphabetic suspended).each do |option| + %i(local remote silenced suspended).each do |option| it "delegates the #{option} option" do allow(Account).to receive(option).and_return(Account.none) filter = described_class.new({ option => true }) filter.results - expect(Account).to have_received(option) + expect(Account).to have_received(option).at_least(1) end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 8c6778edc1ccb66e065a33598d9fb307332c7d01..c829195972ec4cfdb92befd94a350de37ee60b25 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -89,18 +89,6 @@ RSpec.describe User, type: :model do expect(User.matches_email('specified')).to match_array([specified]) end end - - describe 'with_recent_ip_address' do - it 'returns a relation of users who is, or was at last time, online with the given IP address' do - specifieds = [ - Fabricate(:user, current_sign_in_ip: '0.0.0.42', last_sign_in_ip: '0.0.0.0'), - Fabricate(:user, current_sign_in_ip: nil, last_sign_in_ip: '0.0.0.42') - ] - Fabricate(:user, current_sign_in_ip: '0.0.0.0', last_sign_in_ip: '0.0.0.0') - - expect(User.with_recent_ip_address('0.0.0.42')).to match_array(specifieds) - end - end end let(:account) { Fabricate(:account, username: 'alice') }