Class: InnerPlan::Lists::Row::HandleComponent

Inherits:
Phlex::HTML
  • Object
show all
Includes:
Phlex::Rails::Helpers::LinkTo
Defined in:
app/components/inner_plan/lists/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/lists/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
25
26
27
28
29
30
31
# File 'app/components/inner_plan/lists/row/handle_component.rb', line 9

def template
  div(class: "dropstart", style: "padding-top:1.5rem") {
    a(class: "align-top me-2 text-body-tertiary list-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_list_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 list' }
        }
      }

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