From c838263a2e3d2547fb10bcfb22bd9e3111df993b Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 2 Jul 2022 12:42:57 +0200 Subject: [PATCH] Allow for ban history to be seen while banned --- app/views/modal/_ban.haml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/app/views/modal/_ban.haml b/app/views/modal/_ban.haml index e91fd8c7..0ef09414 100644 --- a/app/views/modal/_ban.haml +++ b/app/views/modal/_ban.haml @@ -10,22 +10,25 @@ %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' } + - 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-tab', aria: { controls: 'ban-controls-tab' }, 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-tab' } + - if current_ban.nil? = 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 + = 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 - else - = render 'modal/ban/unban', user: user + - 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