Class: InnerPlan::Lists::ShowMenuComponent

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

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ ShowMenuComponent

Returns a new instance of ShowMenuComponent.



5
6
7
# File 'app/components/inner_plan/lists/show_menu_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/show_menu_component.rb', line 9

def template
  div(class: "dropdown") {
    button(class: "btn btn-link text-reset p-0 opacity-50", data_bs_toggle: "dropdown") {
      render(Phlex::Icons::Tabler::DotsCircleHorizontal.new(width: 35, height: 35))
    }

    ul(class: "dropdown-menu dropdown-menu-end") {
      li {
        link_to(helpers.edit_list_path(list), class: 'dropdown-item d-flex align-items-center gap-2', data: { turbo_frame: :_top }) {
          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 align-items-center gap-2', data: { turbo_frame: :_top }) {
          render(Phlex::Icons::Tabler::Apps.new(width: 18, height: 18, class: 'text-secondary'))
          span { "Add group" }
        }
      }
    }
  }
end