- current_ban = user.bans.current.first .modal.fade#modal-ban{ aria: { hidden: true, labelledby: 'modal-ban-label' }, role: :dialog, tabindex: -1 } .modal-dialog .modal-content#ban-control-super .modal-header %h5.modal-title#modal-ban-label = t '.title' %button.close{ data: { dismiss: :modal }, type: :button } %span{ aria: { hidden: true } } × %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('.is_banned'), checked: user.banned? #ban-controls{ class: user.banned? ? '' : 'd-none' } = 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, 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('.hammertime'), class: 'btn btn-primary', name: 'hammer-time' - else = f.hidden_field :ban, value: '0' .modal-body - if current_ban.expires_at.nil? = t '.banned_permanently_html', reason: current_ban.reason - else = 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 = 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 t '.unban', class: 'btn btn-primary', name: 'hammer-time'