Class: InnerPlan::Groups::Row::HandleComponent

Inherits:
Phlex::HTML
  • Object
show all
Includes:
Phlex::Rails::Helpers::LinkTo
Defined in:
app/components/inner_plan/groups/row/handle_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ HandleComponent

Returns a new instance of HandleComponent.



5
6
7
# File 'app/components/inner_plan/groups/row/handle_component.rb', line 5

def initialize(list)
  @list = list
end

Instance Method Details

#templateObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/components/inner_plan/groups/row/handle_component.rb', line 9

def template
  div(class: "dropstart me-2", style: "margin-top:-0.15rem") {
    a(class: "align-top text-body-tertiary group-handle cm", data: { bs_toggle: :dropdown }) {
      render(Phlex::Icons::Tabler::GripVertical.new(width: 20, height: 20))
    }

    ul(class: 'dropdown-menu') {
      li {
        link_to(helpers.edit_group_path(list), class: "dropdown-item d-flex gap-2 align-items-center") {
          render(Phlex::Icons::Tabler::Pencil.new(width: 18, height: 18, class: 'text-secondary'))
          span { 'Edit group' }
        }
      }
    }
  }
end