From ea5b613796e2a933592697181d246227d77f2179 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 8 Jun 2026 09:05:27 +0200 Subject: [PATCH] Add ability to view individual newsletters in admin UI (#39271) --- .../accounts_controller.rb | 36 ++++++++ .../admin/email_subscriptions_controller.rb | 14 ++++ app/javascript/styles/mastodon/admin.scss | 58 +++++++++++++ app/javascript/styles/mastodon/tables.scss | 10 +++ app/policies/email_subscription_policy.rb | 4 + .../email_subscriptions/_accounts.html.haml | 9 +- .../email_subscriptions/_status.html.haml | 8 ++ .../accounts/show.html.haml | 84 +++++++++++++++++++ app/views/settings/privacy/show.html.haml | 6 +- config/locales/be.yml | 2 - config/locales/cs.yml | 1 - config/locales/cy.yml | 2 - config/locales/da.yml | 2 - config/locales/de.yml | 2 - config/locales/el.yml | 2 - config/locales/en.yml | 19 ++++- config/locales/es-AR.yml | 2 - config/locales/es-MX.yml | 2 - config/locales/es.yml | 2 - config/locales/et.yml | 2 - config/locales/fa.yml | 2 - config/locales/fi.yml | 2 - config/locales/fr-CA.yml | 2 - config/locales/fr.yml | 2 - config/locales/ga.yml | 2 - config/locales/gl.yml | 2 - config/locales/he.yml | 2 - config/locales/hu.yml | 2 - config/locales/is.yml | 2 - config/locales/it.yml | 2 - config/locales/kab.yml | 2 - config/locales/lad.yml | 1 - config/locales/nan-TW.yml | 2 - config/locales/nl.yml | 2 - config/locales/nn.yml | 2 - config/locales/pt-BR.yml | 2 - config/locales/ru.yml | 1 - config/locales/sq.yml | 2 - config/locales/sv.yml | 2 - config/locales/tr.yml | 2 - config/locales/vi.yml | 2 - config/locales/zh-CN.yml | 2 - config/locales/zh-TW.yml | 2 - config/routes/admin.rb | 9 +- 44 files changed, 248 insertions(+), 72 deletions(-) create mode 100644 app/controllers/admin/email_subscriptions/accounts_controller.rb create mode 100644 app/views/admin/email_subscriptions/_status.html.haml create mode 100644 app/views/admin/email_subscriptions/accounts/show.html.haml diff --git a/app/controllers/admin/email_subscriptions/accounts_controller.rb b/app/controllers/admin/email_subscriptions/accounts_controller.rb new file mode 100644 index 0000000000..a5ae9b3920 --- /dev/null +++ b/app/controllers/admin/email_subscriptions/accounts_controller.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class Admin::EmailSubscriptions::AccountsController < Admin::BaseController + before_action :require_enabled! + before_action :set_account + + def show + authorize :email_subscription, :show? + @email_subscriptions_count = EmailSubscription.where(account: @account).count + @email_subscriptions = EmailSubscription.where(account: @account).page(params[:page]) + end + + def enable + authorize :email_subscription, :enable? + @account.user.settings['email_subscriptions'] = true + @account.user.save! + redirect_to admin_email_subscriptions_account_path(@account.id) + end + + def disable + authorize :email_subscription, :disable? + @account.user.settings['email_subscriptions'] = false + @account.user.save! + redirect_to admin_email_subscriptions_account_path(@account.id) + end + + private + + def require_enabled! + raise ActionController::RoutingError, 'Feature disabled' unless Rails.application.config.x.email_subscriptions + end + + def set_account + @account = Account.find(params[:id]) + end +end diff --git a/app/controllers/admin/email_subscriptions_controller.rb b/app/controllers/admin/email_subscriptions_controller.rb index af71eb7012..dae7d452b8 100644 --- a/app/controllers/admin/email_subscriptions_controller.rb +++ b/app/controllers/admin/email_subscriptions_controller.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class Admin::EmailSubscriptionsController < Admin::BaseController + before_action :set_email_subscription, only: :destroy + def index authorize :email_subscription, :index? @@ -9,6 +11,12 @@ class Admin::EmailSubscriptionsController < Admin::BaseController @accounts = Account.local.where.associated(:email_subscriptions).includes(:user) end + def destroy + authorize :email_subscription, :destroy? + @email_subscription.destroy! + redirect_to admin_email_subscriptions_account_path(@email_subscription.account_id) + end + def disable authorize :email_subscription, :disable? Setting.email_subscriptions = false @@ -20,4 +28,10 @@ class Admin::EmailSubscriptionsController < Admin::BaseController Admin::EmailSubscriptionsPurgeWorker.perform_async redirect_to admin_email_subscriptions_path, notice: I18n.t('admin.email_subscriptions.purged_msg') end + + private + + def set_email_subscription + @email_subscription = EmailSubscription.find(params[:id]) + end end diff --git a/app/javascript/styles/mastodon/admin.scss b/app/javascript/styles/mastodon/admin.scss index 836c5c60ca..7e5798ae54 100644 --- a/app/javascript/styles/mastodon/admin.scss +++ b/app/javascript/styles/mastodon/admin.scss @@ -468,6 +468,22 @@ $content-width: 840px; background-color: var(--color-bg-brand-soft); } + &.variantWarning { + background-color: var(--color-bg-warning-softest); + + .icon { + background-color: var(--color-bg-warning-soft); + } + } + + &.variantError { + background-color: var(--color-bg-error-softest); + + .icon { + background-color: var(--color-bg-error-soft); + } + } + .content { display: flex; flex-direction: column; @@ -2451,4 +2467,46 @@ a.sparkline { background: var(--color-bg-success-softest); font-size: 13px; font-weight: 600; + + &.positive { + background: var(--color-bg-success-softest); + } + + &.negative { + background: var(--color-bg-error-softest); + } +} + +.metadata { + display: flex; + gap: 40px; + margin: 16px 0; + + & > div { + display: flex; + flex-direction: column; + gap: 4px; + flex-shrink: 0; + } + + dt { + font-size: 13px; + color: var(--color-text-secondary); + } + + dd { + font-size: 16px; + font-weight: 600; + line-height: 22.4px; + + .status-badge { + box-sizing: border-box; + padding: 4px; + font-size: inherit; + height: 24px; + display: flex; + align-items: center; + justify-content: center; + } + } } diff --git a/app/javascript/styles/mastodon/tables.scss b/app/javascript/styles/mastodon/tables.scss index 0023ea353c..ff2935a46a 100644 --- a/app/javascript/styles/mastodon/tables.scss +++ b/app/javascript/styles/mastodon/tables.scss @@ -129,6 +129,10 @@ color: var(--color-text-primary); font-weight: 600; } + + .status-badge { + padding: 0; + } } &.batch-table { @@ -194,6 +198,12 @@ a.table-action-link { justify-content: center; padding: 4px; aspect-ratio: 1; + + &.table-icon-link--danger { + border-radius: 8px; + border: 1px solid var(--color-border-primary); + color: var(--color-text-error); + } } .batch-table { diff --git a/app/policies/email_subscription_policy.rb b/app/policies/email_subscription_policy.rb index 201bd72c13..3da3eedb1d 100644 --- a/app/policies/email_subscription_policy.rb +++ b/app/policies/email_subscription_policy.rb @@ -10,4 +10,8 @@ class EmailSubscriptionPolicy < ApplicationPolicy alias disable? index? alias purge? index? + + alias show? index? + + alias destroy? index? end diff --git a/app/views/admin/email_subscriptions/_accounts.html.haml b/app/views/admin/email_subscriptions/_accounts.html.haml index 456455af4e..0722453a0c 100644 --- a/app/views/admin/email_subscriptions/_accounts.html.haml +++ b/app/views/admin/email_subscriptions/_accounts.html.haml @@ -32,14 +32,13 @@ %strong %bdi= display_name(account) %td.valign-middle - - if account.user_can?(:manage_email_subscriptions) && account.user_email_subscriptions_enabled? - %span.status-badge.positive= t('.active') - - else - %span.status-badge.negative= t('.inactive') + = render 'status', account: account %td.valign-middle = account.email_subscriptions.count %td.valign-middle - if account.last_status_at.present? = l account.last_status_at + - else + \- %td.valign-middle.align-end - = link_to material_symbol('chevron_right'), admin_account_path(account.id), class: 'table-icon-link' + = link_to material_symbol('chevron_right'), admin_email_subscriptions_account_path(account.id), class: 'table-icon-link' diff --git a/app/views/admin/email_subscriptions/_status.html.haml b/app/views/admin/email_subscriptions/_status.html.haml new file mode 100644 index 0000000000..d634a5d06b --- /dev/null +++ b/app/views/admin/email_subscriptions/_status.html.haml @@ -0,0 +1,8 @@ +- if account.user_can?(:manage_email_subscriptions) && account.user_email_subscriptions_enabled? + %span.status-badge.positive= t('email_subscriptions.active') +- elsif account.user_can?(:manage_email_subscriptions) && !account.user_email_subscriptions_enabled? + %span.status-badge.negative= t('email_subscriptions.disabled') +- elsif account.user_email_subscriptions_enabled? && !account.user_can?(:manage_email_subscriptions) + %span.status-badge.negative= t('email_subscriptions.no_access') +- else + %span.status-badge.negative= t('email_subscriptions.inactive') diff --git a/app/views/admin/email_subscriptions/accounts/show.html.haml b/app/views/admin/email_subscriptions/accounts/show.html.haml new file mode 100644 index 0000000000..8f22f82739 --- /dev/null +++ b/app/views/admin/email_subscriptions/accounts/show.html.haml @@ -0,0 +1,84 @@ +- content_for :page_title do + = t('.title', name: display_name(@account)) + +- content_for :heading do + .content__heading__row + .heading-with-lead + %h1= display_name(@account) + %p.lead= acct(@account) + .content__heading__actions + = link_to t('.view_account'), admin_account_path(@account.id), class: 'button button-secondary' + - if @account.user_can?(:manage_email_subscriptions) + - if @account.user_email_subscriptions_enabled? + = link_to t('.disable_feature'), + disable_admin_email_subscriptions_account_path(@account.id), + class: 'button button-secondary button--destructive', + data: { method: 'post', confirm: t('.confirm_disable_feature', name: display_name(@account)) } + - else + = link_to t('.enable_feature'), enable_admin_email_subscriptions_account_path(@account.id), class: 'button button-secondary', data: { method: 'post' } + +%dl.metadata + %div + %dt= t('email_subscriptions.status') + %dd= render 'admin/email_subscriptions/status', account: @account + %div + %dt= t('email_subscriptions.subscribers') + %dd= number_with_delimiter @email_subscriptions_count + %div + %dt= t('admin.email_subscriptions.accounts.last_email') + %dd + - if @account.last_status_at.present? + = l(@account.last_status_at) + - else + \- + +- if !@account.user_email_subscriptions_enabled? + %aside.callout.variantError + = material_symbol 'info' + .content + .body + %p= t('.disabled') +- elsif @account.user_email_subscriptions_enabled? && !@account.user_can?(:manage_email_subscriptions) + %aside.callout.variantError + = material_symbol 'info' + .content + .body + %p= t('.no_access_html', roles_path: admin_roles_path) +- else + %aside.callout.variantWarning + = material_symbol 'warning' + .content + .body + %p= t('.consent') + +.table-wrapper + - if @email_subscriptions.empty? + .empty-state + = emptyphaunt + + .empty-state__title-and-description + .empty-state__title-and-description__title + = t('.empty.no_subscribers_yet') + .empty-state__title-and-description__description + = t('.empty.hint') + - else + %table.table + %thead + %tr + %th= t('.email') + %th= t('.date') + %th + %tbody + - @email_subscriptions.each do |email_subscription| + %tr + %td.valign-middle + = email_subscription.email + %td.valign-middle + = l(email_subscription.created_at) + %td.valign-middle.align-end + = link_to material_symbol('delete'), + admin_email_subscription_path(email_subscription), + data: { method: 'delete', confirm: t('.confirm_remove_subscriber', email: email_subscription.email, name: display_name(@account)) }, + class: 'table-icon-link table-icon-link--danger' + += paginate @email_subscriptions diff --git a/app/views/settings/privacy/show.html.haml b/app/views/settings/privacy/show.html.haml index 6de1bdfca8..c64a135597 100644 --- a/app/views/settings/privacy/show.html.haml +++ b/app/views/settings/privacy/show.html.haml @@ -57,7 +57,11 @@ %tbody %tr %th= t('email_subscriptions.status') - %td= @account.user_email_subscriptions_enabled? ? t('email_subscriptions.active') : t('email_subscriptions.inactive') + %td + - if @account.user_email_subscriptions_enabled? + %span.status-badge.positive= t('email_subscriptions.active') + - else + %span.status-badge.negative= t('email_subscriptions.inactive') %tr %th= t('email_subscriptions.subscribers') %td= number_with_delimiter @email_subscriptions_count diff --git a/config/locales/be.yml b/config/locales/be.yml index 5193b6aae7..091bf2f465 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -520,11 +520,9 @@ be: email_subscriptions: accounts: account: Уліковы запіс - active: Актыўны empty: hint: У ніводнага ўліковага запісу няма падпісчыкаў. no_lists_yet: Пакуль няма спісаў - inactive: Неактыўны last_email: Апошняя электронная пошта lead: Уліковыя запісы, якія ўключылі гэту функцыю і маюць падпісчыкаў, будуць паказаныя знізу. status: Стан diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 803908b49e..5aa8b45b1e 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -508,7 +508,6 @@ cs: email_subscriptions: accounts: account: Účet - inactive: Neaktivní last_email: Poslední e-mail status: Status compliance_settings: diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 6c1ba5f89d..50a5fbd955 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -540,11 +540,9 @@ cy: email_subscriptions: accounts: account: Cyfrif - active: Gweithredol empty: hint: Does gan unrhyw gyfrifon ddim tanysgrifwyr eto. no_lists_yet: Dim rhestrau eto - inactive: Anweithredol last_email: E-bost diwethaf lead: Bydd cyfrifon sydd wedi galluogi'r nodwedd ac sydd â thanysgrifwyr yn ymddangos isod. status: Statws diff --git a/config/locales/da.yml b/config/locales/da.yml index 0ff65b712e..a60071bb5d 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -500,11 +500,9 @@ da: email_subscriptions: accounts: account: Konto - active: Aktive empty: hint: Ingen konti har abonnenter endnu. no_lists_yet: Ingen lister endnu - inactive: Inaktive last_email: Seneste e-mail lead: Nedenfor vises de konti, der har aktiveret funktionen og har abonnenter. status: Status diff --git a/config/locales/de.yml b/config/locales/de.yml index 27a49b4d79..33224000e8 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -500,11 +500,9 @@ de: email_subscriptions: accounts: account: Konto - active: Aktiviert empty: hint: Bisher wurden keine Konten abonniert. no_lists_yet: Noch keine Listen vorhanden - inactive: Deaktiviert last_email: Letzte E-Mail lead: Konten, die die Funktion aktiviert haben und abonniert wurden, werden unten angezeigt. status: Status diff --git a/config/locales/el.yml b/config/locales/el.yml index 355af8693b..1109377027 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -500,11 +500,9 @@ el: email_subscriptions: accounts: account: Λογαριασμός - active: Ενεργός empty: hint: Κανένας λογαριασμός δεν έχει συνδρομητές ακόμη. no_lists_yet: Καμία λίστα ακόμη - inactive: Ανενεργός last_email: Τελευταίο email lead: Λογαριασμοί που έχουν ενεργοποιήσει τη λειτουργία και έχουν συνδρομητές θα εμφανίζονται παρακάτω. status: Κατάσταση diff --git a/config/locales/en.yml b/config/locales/en.yml index 7bd0568fb9..95631bd86b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -500,13 +500,26 @@ en: email_subscriptions: accounts: account: Account - active: Active empty: hint: No accounts have subscribers yet. no_lists_yet: No lists yet - inactive: Inactive last_email: Last email lead: Accounts who have enabled the feature and have subscribers will show below. + show: + confirm_disable_feature: Disable email newsletters for %{name}? Email updates will no longer be sent for this account. The user will still be able to re-enable the feature in their account settings. To permanently remove access to this feature, edit the account’s permission in Roles. + confirm_remove_subscriber: "%{email} will no longer receive emails from %{name}. This action cannot be undone." + consent: Subscribers have only consented to receiving posts via email. Do not use this list for other purposes. + date: Date of sign-up + disable_feature: Disable feature + disabled: The feature was disabled and emails are no longer being sent to this list. + email: Email address + empty: + hint: Nobody has subscribed to this account yet. + no_subscribers_yet: No subscribers yet + enable_feature: Enable feature + no_access_html: This account no longer has the permissions required to enable the feature. Change this in Roles. + title: Email newsletters of %{name} + view_account: View account status: Status subscribers: Subscribers title: Mailing lists @@ -1534,7 +1547,9 @@ en: success_html: You'll now start receiving emails when %{name} publishes new posts. Add %{sender} to your contacts so these posts don't end up in your Spam folder. title: You're signed up unsubscribe: Unsubscribe + disabled: Disabled inactive: Inactive + no_access: No access status: Status subscribers: Subscribers emoji_styles: diff --git a/config/locales/es-AR.yml b/config/locales/es-AR.yml index be98ad08d8..4ce9d037bd 100644 --- a/config/locales/es-AR.yml +++ b/config/locales/es-AR.yml @@ -500,11 +500,9 @@ es-AR: email_subscriptions: accounts: account: Cuenta - active: Activa empty: hint: Aún no hay cuentas con suscriptores. no_lists_yet: Aún no hay listas - inactive: Inactiva last_email: Último correo electrónico lead: Las cuentas que habilitaron la función y tienen suscriptores se mostrarán a continuación. status: Estado diff --git a/config/locales/es-MX.yml b/config/locales/es-MX.yml index 746f64655b..fc13d70dbe 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -500,11 +500,9 @@ es-MX: email_subscriptions: accounts: account: Cuenta - active: Activa empty: hint: Ninguna cuenta tiene suscriptores todavía. no_lists_yet: No hay listas todavía - inactive: Inactiva last_email: Último correo electrónico lead: A continuación se mostrarán las cuentas que hayan activado la función y tengan suscriptores. status: Estado diff --git a/config/locales/es.yml b/config/locales/es.yml index 1740f42464..20d232b5e9 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -500,11 +500,9 @@ es: email_subscriptions: accounts: account: Cuenta - active: Activa empty: hint: Aún no hay cuentas con suscriptores. no_lists_yet: Aún no hay listas - inactive: Inactiva last_email: Último correo electrónico lead: Las cuentas que han habilitado la función y tienen suscriptores se mostrarán a continuación. status: Estado diff --git a/config/locales/et.yml b/config/locales/et.yml index 1c41ade363..c5654dce02 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -500,11 +500,9 @@ et: email_subscriptions: accounts: account: Konto - active: Aktiivne empty: hint: Ühelgi kontol pole veel tellijaid. no_lists_yet: Veel pole loetelusid - inactive: Mitteaktiivne last_email: Viimane e-post lead: Allpool kuvatakse kontod, kus see funktsioon on aktiveeritud ja millel on tellijaid. status: Olek diff --git a/config/locales/fa.yml b/config/locales/fa.yml index c9b2216a35..0f0e6c3e0d 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -499,11 +499,9 @@ fa: email_subscriptions: accounts: account: حساب - active: فعّال empty: hint: هنوز هیچ حسابی مشترک نشده. no_lists_yet: هنوز سیاهه‌ای وجود ندارد - inactive: غیرفعّال last_email: آخرین رایانامه status: وضعیت subscribers: مشترکان diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 536db62ae1..46117cb556 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -500,11 +500,9 @@ fi: email_subscriptions: accounts: account: Tili - active: Käytössä empty: hint: Millään tilillä ei ole vielä tilaajia. no_lists_yet: Ei vielä listoja - inactive: Poissa käytöstä last_email: Viimeisin sähköpostiviesti lead: Alla näkyvät tilit, jotka ovat ottaneet ominaisuuden käyttöön ja joilla on tilaajia. status: Tila diff --git a/config/locales/fr-CA.yml b/config/locales/fr-CA.yml index 385791c40c..afaa55e3ce 100644 --- a/config/locales/fr-CA.yml +++ b/config/locales/fr-CA.yml @@ -500,11 +500,9 @@ fr-CA: email_subscriptions: accounts: account: Compte - active: Actif empty: hint: Aucun compte n'a d'abonné·e·s pour l'instant. no_lists_yet: Aucune liste pour l'instant - inactive: Inactif last_email: Dernier courriel lead: Les comptes ayant activé la fonctionnalité et qui ont des abonné·e·s apparaîtront ci-dessous. status: État diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 7d2ab2e99a..325ba3382b 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -500,11 +500,9 @@ fr: email_subscriptions: accounts: account: Compte - active: Actif empty: hint: Aucun compte n'a d'abonné·e·s pour l'instant. no_lists_yet: Aucune liste pour l'instant - inactive: Inactif last_email: Dernier courriel lead: Les comptes ayant activé la fonctionnalité et qui ont des abonné·e·s apparaîtront ci-dessous. status: État diff --git a/config/locales/ga.yml b/config/locales/ga.yml index 437fcd3d94..efd086f686 100644 --- a/config/locales/ga.yml +++ b/config/locales/ga.yml @@ -530,11 +530,9 @@ ga: email_subscriptions: accounts: account: Cuntas - active: Gníomhach empty: hint: Níl aon síntiúsóirí ag aon chuntas go fóill. no_lists_yet: Gan aon liostaí fós - inactive: Neamhghníomhach last_email: Ríomhphost deireanach lead: Taispeánfar thíos cuntais a bhfuil an ghné cumasaithe acu agus a bhfuil síntiúsóirí acu. status: Stádas diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 1f6849df95..22df0fe8d6 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -500,11 +500,9 @@ gl: email_subscriptions: accounts: account: Conta - active: Activa empty: hint: Aínda non hai contas con subscritoras. no_lists_yet: Aínda non hai listas - inactive: Inactiva last_email: Último correo lead: Aquí móstranse as contas que activaron esta ferramenta e teñen subscritoras. status: Estado diff --git a/config/locales/he.yml b/config/locales/he.yml index c754a48df6..0d0d706409 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -520,11 +520,9 @@ he: email_subscriptions: accounts: account: חשבון - active: פעילים empty: hint: עדיין אין מנוי לאף חשבון. no_lists_yet: אין רשימות עדיין - inactive: לא פעילים last_email: הודעת דואל אחרונה lead: חשבונות שבהם הופעלה האפשרות ויש להם מנויים יופיעו להלן. status: מצב diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 8049aee3b9..9614ae8466 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -500,11 +500,9 @@ hu: email_subscriptions: accounts: account: Fiók - active: Aktív empty: hint: Egyik fióknak sincs feliratkozója. no_lists_yet: Még nincsenek listák - inactive: Inaktív last_email: Legutóbbi e-mail lead: A fiókok, melyek bekapcsolták a funkciót, és vannak feliratkozóik, itt fognak megjelenni alább. status: Állapot diff --git a/config/locales/is.yml b/config/locales/is.yml index 4099b1307e..540072beb6 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -500,11 +500,9 @@ is: email_subscriptions: accounts: account: Aðgangur - active: Virkur empty: hint: Engir aðgangar eru ennþá með neina áskrifendur. no_lists_yet: Ennþá engir listar - inactive: Óvirkur last_email: Síðasti tölvupóstur lead: Aðgangar sem hafa virkjað eiginleikann og eru með áskrifendur munu birtast hér fyrir neðan. status: Staða diff --git a/config/locales/it.yml b/config/locales/it.yml index 491a5e909f..c0c7df8175 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -500,11 +500,9 @@ it: email_subscriptions: accounts: account: Account - active: Attivo empty: hint: Non ci sono ancora account con iscritti. no_lists_yet: Non ci sono ancora liste - inactive: Inattivo last_email: Ultima email lead: Di seguito verranno visualizzati gli account che hanno attivato la funzionalità e che hanno degli iscritti. status: Stato diff --git a/config/locales/kab.yml b/config/locales/kab.yml index 7a90eab7ba..d16c4b65a6 100644 --- a/config/locales/kab.yml +++ b/config/locales/kab.yml @@ -290,8 +290,6 @@ kab: email_subscriptions: accounts: account: Amiḍan - active: D urmid - inactive: D arurmid last_email: Imayl aneggaru status: Addad compliance_settings: diff --git a/config/locales/lad.yml b/config/locales/lad.yml index 271bf909ef..01496e3607 100644 --- a/config/locales/lad.yml +++ b/config/locales/lad.yml @@ -471,7 +471,6 @@ lad: email_subscriptions: accounts: account: Kuento - active: Aktivo danger_zone: disable_feature: action: Inkapasita diff --git a/config/locales/nan-TW.yml b/config/locales/nan-TW.yml index 320c7db564..587cb4a49c 100644 --- a/config/locales/nan-TW.yml +++ b/config/locales/nan-TW.yml @@ -490,11 +490,9 @@ nan-TW: email_subscriptions: accounts: account: 口座 - active: 有效ê empty: hint: Iáu無半ê口座有訂ê lâng。 no_lists_yet: Iáu無列單 - inactive: 停止使用ah last_email: 上新ê電子phue箱 lead: 有啟用tsit ê功能koh有訂ê lâng ê口座ē展示佇下kha。 status: 狀態 diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 09e152237f..9a3c7a68df 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -500,11 +500,9 @@ nl: email_subscriptions: accounts: account: Account - active: Actief empty: hint: Geen enkel account heeft nog abonnees. no_lists_yet: Nog geen lijsten - inactive: Inactief last_email: Meest recente e-mail lead: Accounts die deze functionaliteit hebben ingeschakeld en abonnees hebben, worden hieronder getoond. status: Status diff --git a/config/locales/nn.yml b/config/locales/nn.yml index a599917d50..7c0bc6104b 100644 --- a/config/locales/nn.yml +++ b/config/locales/nn.yml @@ -500,11 +500,9 @@ nn: email_subscriptions: accounts: account: Konto - active: Aktiv empty: hint: Ingen brukarkontoar har abonnentar enno. no_lists_yet: Ingen lister enno - inactive: Ikkje aktiv last_email: Siste epost lead: Nedanfor vil du sjå brukarkontoar som har skrudd på dette og som har abonnentar. status: Status diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index d2decc5450..4fdf40888e 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -500,11 +500,9 @@ pt-BR: email_subscriptions: accounts: account: Conta - active: Ativas empty: hint: Não há contas com inscritos ainda. no_lists_yet: Não há listas ainda - inactive: Inativas last_email: Último email lead: Contas que ativaram o recurso e têm inscritos aparecerão abaixo. status: Estado diff --git a/config/locales/ru.yml b/config/locales/ru.yml index a5418c1378..ee3a8cfa96 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -506,7 +506,6 @@ ru: email_subscriptions: accounts: account: Аккаунт - active: Актив status: Статус subscribers: Подписчики danger_zone: diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 7fab3b09ee..243f9b8a10 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -500,11 +500,9 @@ sq: email_subscriptions: accounts: account: Llogari - active: Aktive empty: hint: Ende s’ka llogari me pajtimtarë. no_lists_yet: Ende pa lista - inactive: Joaktive last_email: Email-i i fundit lead: Llogaritë që kanë aktivizuar veçorinë dhe kanë pajtimtarë do të shfaqen më poshtë. status: Gjendje diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 2c33894f82..4434278bb0 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -500,11 +500,9 @@ sv: email_subscriptions: accounts: account: Konto - active: Aktiv empty: hint: Inga konton har prenumeranter ännu. no_lists_yet: Inga listor ännu - inactive: Inaktiv last_email: Senaste e-post lead: Konton som har aktiverat funktionen och har prenumeranter kommer att visas nedan. status: Status diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 96b924c0ad..6115fdbdf9 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -500,11 +500,9 @@ tr: email_subscriptions: accounts: account: Hesap - active: Etkin empty: hint: Henüz hiçbir hesabın abonesi yok. no_lists_yet: Henüz liste yok - inactive: Etkin değil last_email: Son e-posta lead: Bu özelliği etkinleştirmiş ve abonesi olan hesaplar aşağıda gösterilecektir. status: Durum diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 5476b43cf9..0363073bfb 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -490,11 +490,9 @@ vi: email_subscriptions: accounts: account: Tài khoản - active: Hoạt động empty: hint: Hiện chưa có tài khoản nào có người đăng ký đọc. no_lists_yet: Chưa có danh sách nào - inactive: Không hoạt động last_email: Email gần nhất lead: Các tài khoản đã kích hoạt tính năng này và có người đăng ký sẽ hiển thị bên dưới. status: Trạng thái diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 46bffcefb6..966dc99de2 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -490,11 +490,9 @@ zh-CN: email_subscriptions: accounts: account: 账号 - active: 已生效 empty: hint: 目前还没有账号拥有订阅者。 no_lists_yet: 尚无列表 - inactive: 未生效 last_email: 最新电子邮件 lead: 已启用此功能并拥有订阅者的账号会在下方显示。 status: 状态 diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index ebe16757b6..5f0b9fd7c8 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -492,11 +492,9 @@ zh-TW: email_subscriptions: accounts: account: 帳號 - active: 生效中 empty: hint: 尚無任何擁有訂閱者之帳號。 no_lists_yet: 尚無列表 - inactive: 已停用 last_email: 最新電子郵件地址 lead: 已啟用此功能並擁有訂閱者之帳號將於下方顯示。 status: 狀態 diff --git a/config/routes/admin.rb b/config/routes/admin.rb index a48defb3b9..ee2ec7c466 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -26,7 +26,7 @@ namespace :admin do resources :email_domain_blocks, only: [:index, :new, :create], concerns: :batch - resources :email_subscriptions, only: [:index] do + resources :email_subscriptions, only: [:index, :destroy] do collection do post :purge post :disable @@ -36,6 +36,13 @@ namespace :admin do namespace :email_subscriptions do resource :setup, only: [:show, :create] resource :additional_footer_text, only: [:show, :update] + + resources :accounts, only: :show do + member do + post :enable + post :disable + end + end end resources :action_logs, only: [:index]