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
|
2022-07-02 02:34:46 -07:00
|
|
|
= t '.title'
|
2023-01-04 04:26:27 -08:00
|
|
|
%button.btn-close{ data: { bs_dismiss: :modal }, type: :button }
|
2023-01-04 02:12:40 -08:00
|
|
|
%span.visually-hidden= t("voc.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
|
2022-07-02 03:42:57 -07:00
|
|
|
- if user.bans.count > 1
|
|
|
|
%div{ role: :tabpanel }
|
|
|
|
%ul.nav.nav-tabs.mt-1{ role: :tablist }
|
|
|
|
%li.nav-item{ role: 'presentation' }
|
2023-01-04 03:23:47 -08:00
|
|
|
%a.nav-link.active{ href: '#ban-controls-tab', aria: { controls: 'ban-controls-tab' }, data: { bs_toggle: :tab }, role: :tab }
|
2022-07-02 03:42:57 -07:00
|
|
|
= t '.tabs.controls'
|
|
|
|
%li.nav-item{ role: 'presentation' }
|
2023-01-04 03:23:47 -08:00
|
|
|
%a.nav-link{ href: '#ban-history', aria: { controls: 'ban-history' }, data: { bs_toggle: :tab }, role: :tab }
|
2022-07-02 03:42:57 -07:00
|
|
|
= t '.tabs.history'
|
|
|
|
.tab-content
|
|
|
|
.tab-pane.active{ role: :tabpanel, id: 'ban-controls-tab' }
|
|
|
|
- if current_ban.nil?
|
2022-07-02 03:03:07 -07:00
|
|
|
= render 'modal/ban/controls', f: f, user: user
|
2022-07-02 03:42:57 -07:00
|
|
|
- else
|
|
|
|
= render 'modal/ban/unban', f: f, user: user, current_ban: current_ban
|
|
|
|
.tab-pane{ role: :tabpanel, id: 'ban-history' }
|
|
|
|
= render 'modal/ban/history', user: user
|
2021-08-23 00:50:35 -07:00
|
|
|
- else
|
2022-07-02 03:42:57 -07:00
|
|
|
- if current_ban.nil?
|
|
|
|
= render 'modal/ban/controls', f: f, user: user
|
|
|
|
- else
|
|
|
|
= render 'modal/ban/unban', f: f, user: user, current_ban: current_ban
|