42 lines
2.2 KiB
Plaintext
42 lines
2.2 KiB
Plaintext
- 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?
|
||
- if user.bans.count > 1
|
||
%div{ role: :tabpanel }
|
||
%ul.nav.nav-tabs.mt-1{ role: :tablist }
|
||
%li.nav-item{ role: 'presentation' }
|
||
%a.nav-link.active{ href: '#ban-controls', aria: { controls: 'ban-controls' }, data: { toggle: :tab }, role: :tab }
|
||
= t '.tabs.controls'
|
||
%li.nav-item{ role: 'presentation' }
|
||
%a.nav-link{ href: '#ban-history', aria: { controls: 'ban-history' }, data: { toggle: :tab }, role: :tab }
|
||
= t '.tabs.history'
|
||
.tab-content
|
||
.tab-pane.active{ role: :tabpanel, id: 'ban-controls' }
|
||
= render 'modal/ban/controls', f: f, user: user
|
||
.tab-pane{ role: :tabpanel, id: 'ban-history' }
|
||
= render 'modal/ban/history', user: user
|
||
- else
|
||
= render 'modal/ban/controls', f: f, user: user
|
||
- 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'
|