2021-08-23 00:50:35 -07:00
|
|
|
|
- current_ban = user.bans.current.first
|
2020-05-10 03:53:30 -07:00
|
|
|
|
.modal.fade#modal-ban{ aria: { hidden: true, labelledby: 'modal-ban-label' }, role: :dialog, tabindex: -1 }
|
2015-04-22 17:56:29 -07:00
|
|
|
|
.modal-dialog
|
2021-12-29 15:20:09 -08:00
|
|
|
|
.modal-content#ban-control-super
|
2015-04-22 17:56:29 -07:00
|
|
|
|
.modal-header
|
2020-05-10 03:53:30 -07:00
|
|
|
|
%h5.modal-title#modal-ban-label
|
2020-04-19 14:26:29 -07:00
|
|
|
|
= t 'views.modal.bancontrol.title'
|
2020-05-10 03:53:30 -07:00
|
|
|
|
%button.close{ data: { dismiss: :modal }, type: :button }
|
|
|
|
|
%span{ aria: { hidden: true } } ×
|
2015-04-22 17:56:29 -07:00
|
|
|
|
%span.sr-only Close
|
2020-05-10 13:27:39 -07:00
|
|
|
|
= bootstrap_form_tag(url: '/mod/ban', html: { method: :post, novalidate: :novalidate }) do |f|
|
2020-05-10 03:53:30 -07:00
|
|
|
|
= f.hidden_field :user, value: user.screen_name
|
2021-08-23 00:50:35 -07:00
|
|
|
|
- if current_ban.nil?
|
2021-12-29 15:20:09 -08:00
|
|
|
|
.modal-body
|
2021-08-23 00:50:35 -07:00
|
|
|
|
= f.check_box :ban, label: t('views.modal.bancontrol.ban'), checked: user.banned?
|
|
|
|
|
#ban-controls{ style: user.banned? ? '' : 'display: none' }
|
|
|
|
|
= f.check_box :permaban, label: t('views.modal.bancontrol.permanent'), checked: user.permanently_banned?
|
|
|
|
|
#ban-controls-time{ style: user.permanently_banned? ? 'display: 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'
|
2021-12-29 15:20:09 -08:00
|
|
|
|
= f.text_field :reason, placeholder: t('views.modal.bancontrol.reason'), value: user.bans.current.first&.reason
|
2021-08-23 00:50:35 -07:00
|
|
|
|
.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'
|
|
|
|
|
- else
|
|
|
|
|
= f.hidden_field :ban, value: '0'
|
2021-12-29 15:20:09 -08:00
|
|
|
|
.modal-body
|
2021-08-23 00:50:35 -07:00
|
|
|
|
- if current_ban.expires_at.nil?
|
|
|
|
|
This user is currently permanently banned for
|
|
|
|
|
%strong= current_ban.reason
|
|
|
|
|
- else
|
|
|
|
|
This user is currently banned until
|
|
|
|
|
%strong= current_ban.expires_at
|
|
|
|
|
for
|
|
|
|
|
%strong= current_ban.reason
|
|
|
|
|
- if current_ban.banned_by.present?
|
|
|
|
|
%br
|
|
|
|
|
This ban was instated by
|
2021-12-29 15:20:09 -08:00
|
|
|
|
%strong= current_ban.banned_by.profile.safe_name
|
2021-08-23 00:50:35 -07:00
|
|
|
|
on
|
|
|
|
|
%strong= current_ban.created_at
|
|
|
|
|
.modal-footer
|
|
|
|
|
= f.submit 'Unban', class: 'btn btn-primary', name: 'hammer-time'
|