mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-28 15:26:21 +00:00
Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl
This commit is contained in:
commit
cb21f233f6
5 changed files with 17 additions and 5 deletions
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
module ModerationQueueHelper
|
module ModerationQueueHelper
|
||||||
def filter_states(**args)
|
def filter_states(**args)
|
||||||
params.permit(:state, :actor_state, :activity_pub_state).merge(**args)
|
params.permit(:instance_state, :actor_state, :activity_pub_state).merge(**args)
|
||||||
|
end
|
||||||
|
|
||||||
|
def active?(states, state_name, state)
|
||||||
|
if params[state_name].present?
|
||||||
|
params[state_name] == state.to_s
|
||||||
|
else
|
||||||
|
states.first == state
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
- ActivityPub.states.each do |state|
|
- ActivityPub.states.each do |state|
|
||||||
= render 'components/dropdown_item',
|
= render 'components/dropdown_item',
|
||||||
text: t(".submenu_#{state}", count: activity_pubs.unscope(where: :aasm_state).public_send(state).count),
|
text: t(".submenu_#{state}", count: activity_pubs.unscope(where: :aasm_state).public_send(state).count),
|
||||||
path: filter_states(activity_pub_state: state)
|
path: filter_states(activity_pub_state: state),
|
||||||
|
class: ('active' if active?(ActivityPub.states, :activity_pub_state, state))
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
-#
|
-#
|
||||||
@param :text [String] Contenido del link
|
@param :text [String] Contenido del link
|
||||||
@param :path [String,Hash] Link
|
@param :path [String,Hash] Link
|
||||||
= link_to text, path, class: 'dropdown-item', data: { target: 'dropdown.item' }
|
- local_assigns[:class] = "dropdown-item #{local_assigns[:class]}"
|
||||||
|
= link_to text, path, class: local_assigns[:class], data: { target: 'dropdown.item' }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
- InstanceModeration.states.each do |state|
|
- InstanceModeration.states.each do |state|
|
||||||
= render 'components/dropdown_item',
|
= render 'components/dropdown_item',
|
||||||
text: t(".submenu_#{state}", count: instance_moderations.unscope(where: :aasm_state).public_send(state).count),
|
text: t(".submenu_#{state}", count: instance_moderations.unscope(where: :aasm_state).public_send(state).count),
|
||||||
path: filter_states(instance_state: state)
|
path: filter_states(instance_state: state),
|
||||||
|
class: ('active' if active?(InstanceModeration.states, :instance_state, state))
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
- ActorModeration.states.each do |actor_state|
|
- ActorModeration.states.each do |actor_state|
|
||||||
= render 'components/dropdown_item',
|
= render 'components/dropdown_item',
|
||||||
text: t(".submenu_#{actor_state}", count: actor_moderations.unscope(where: :aasm_state).public_send(actor_state).count),
|
text: t(".submenu_#{actor_state}", count: actor_moderations.unscope(where: :aasm_state).public_send(actor_state).count),
|
||||||
path: filter_states(actor_state: actor_state)
|
path: filter_states(actor_state: actor_state),
|
||||||
|
class: ('active' if active?(ActorModeration.states, :actor_state, actor_state))
|
||||||
|
|
Loading…
Reference in a new issue