Add translations for ban modal

This commit is contained in:
Karina Kwiatek 2022-07-02 11:34:46 +02:00 committed by Karina Kwiatek
parent b32e67d01b
commit bb23f6b3f0
4 changed files with 28 additions and 27 deletions

View File

@ -4,44 +4,37 @@
.modal-content#ban-control-super
.modal-header
%h5.modal-title#modal-ban-label
= t 'views.modal.bancontrol.title'
= t '.title'
%button.close{ data: { dismiss: :modal }, type: :button }
%span{ aria: { hidden: true } } ×
%span.sr-only Close
%span.sr-only= t 'views.actions.close'
= bootstrap_form_tag(url: '/mod/ban', html: { method: :post, novalidate: :novalidate }) do |f|
= f.hidden_field :user, value: user.screen_name
- if current_ban.nil?
.modal-body
= f.check_box :ban, label: t('views.modal.bancontrol.ban'), checked: user.banned?
= f.check_box :ban, label: t('.is_banned'), checked: user.banned?
#ban-controls{ class: user.banned? ? '' : 'd-none' }
= f.check_box :permaban, label: t('views.modal.bancontrol.permanent'), checked: user.permanently_banned?
= f.check_box :permaban, label: t('.is_permanent'), checked: user.permanently_banned?
#ban-controls-time{ class: user.permanently_banned? ? 'd-none' : '' }
= f.text_field :duration, label: '', required: true
.form-check.form-check-inline
= f.radio_button :duration_unit, 'hours', label: 'Hours', checked: true
= f.radio_button :duration_unit, 'days', label: 'Days'
= f.radio_button :duration_unit, 'weeks', label: 'Weeks'
= f.radio_button :duration_unit, 'months', label: 'Months'
= f.text_field :reason, placeholder: t('views.modal.bancontrol.reason'), value: user.bans.current.first&.reason
= f.radio_button :duration_unit, t('time.hours'), label: 'Hours', checked: true
= f.radio_button :duration_unit, t('time.days'), label: 'Days'
= f.radio_button :duration_unit, t('time.weeks'), label: 'Weeks'
= f.radio_button :duration_unit, t('time.months'), label: 'Months'
= f.text_field :reason, placeholder: t('.reason'), value: user.bans.current.first&.reason
.modal-footer
%button.btn.btn-default{ name: 'stop-time', type: :button, data: { dismiss: :modal } }= t 'views.actions.close'
= f.submit t('views.modal.bancontrol.hammertime'), class: 'btn btn-primary', name: 'hammer-time'
= f.submit t('.hammertime'), class: 'btn btn-primary', name: 'hammer-time'
- else
= f.hidden_field :ban, value: '0'
.modal-body
- if current_ban.expires_at.nil?
This user is currently permanently banned for
%strong= current_ban.reason
= t '.banned_permanently_html', reason: current_ban.reason
- else
This user is currently banned until
%strong= current_ban.expires_at
for
%strong= current_ban.reason
= t '.banned_temporarily_html', reason: current_ban.reason, until: current_ban.expires_at.strftime('%Y-%m-%d %H:%M:%S')
- if current_ban.banned_by.present?
%br
This ban was instated by
%strong= current_ban.banned_by.profile.safe_name
on
%strong= current_ban.created_at
= t '.banned_by_html', user: current_ban.banned_by.screen_name, on: current_ban.created_at.strftime('%Y-%m-%d %H:%M:%S')
.modal-footer
= f.submit 'Unban', class: 'btn btn-primary', name: 'hammer-time'
= f.submit t '.unban', class: 'btn btn-primary', name: 'hammer-time'

View File

@ -295,12 +295,6 @@ en:
title: "Ask your followers"
choose: "Choose list:"
loading: "Asking..."
bancontrol:
title: "Ban Control Center"
ban: "Ban?"
permanent: "Permanently?"
reason: "Reason"
hammertime: "Hammer Time"
list:
title: "Manage list memberships"
tabs:

View File

@ -81,6 +81,16 @@ en:
modal:
password:
title: "Save account changes"
ban:
title: "Ban Control Center"
reason: "Reason"
is_banned: "Ban?"
is_permanent: "Permanently?"
hammertime: "Hammer Time"
unban: "Unban"
banned_permanently_html: "This user is currently permanently banned for <strong>%{reason}</strong>"
banned_temporarily_html: "This user is currently banned until <strong>%{until}</strong> for <strong>%{reason}</strong>"
banned_by_html: "This ban was instated by <strong>%{user}</strong> on <strong>%{on}</strong>"
services:
index:
title: "Service Settings"

View File

@ -18,3 +18,7 @@ en:
noauth: "You must be signed in to do this."
time:
distance_ago: "%{time} ago"
hours: "hours"
days: "days"
weeks: "weeks"
months: "months"