Class: Maquina::Dashboard::Tasks

Inherits:
Phlex::HTML
  • Object
show all
Includes:
ApplicationView
Defined in:
app/views/maquina/dashboard/tasks.rb

Instance Method Summary collapse

Methods included from ApplicationView

#attribute_human_name, #button_to, #image_tag, #link_to, #model_human_name, #svg_icon

Constructor Details

#initialize(translation_key: "maquina.dashboard.index.tasks") ⇒ Tasks

Returns a new instance of Tasks.



6
7
8
# File 'app/views/maquina/dashboard/tasks.rb', line 6

def initialize(translation_key: "maquina.dashboard.index.tasks")
  @translation_key = translation_key
end

Instance Method Details

#view_templateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'app/views/maquina/dashboard/tasks.rb', line 10

def view_template
  div(class: "mx-auto max-w-lg mt-12") do
    h2(class: "text-base font-semibold text-skin-base") do
      t("#{@translation_key}.title")
    end

    p(class: "mt-1 text-sm text-skin-dimmed") do
      t("#{@translation_key}.subtitle")
    end

    ul(
      role: "list",
      class: "mt-6 divide-y divide-gray-200 border-b border-t border-gray-200"
    ) do
      # Create Plan Task
      task_item(
        title: t("#{@translation_key}.create_plan.title"),
        description: t("#{@translation_key}.create_plan.description"),
        color: "bg-skin-accented",
        path: plans_path,
        icon: create_plan_icon
      )

      # Manage Users Task
      task_item(
        title: t("#{@translation_key}.manage_users.title"),
        description: t("#{@translation_key}.manage_users.description"),
        color: "bg-skin-alternate",
        path: users_path,
        icon: manage_users_icon
      )

      # Organization Settings Task
      task_item(
        title: t("#{@translation_key}.organization_settings.title"),
        description: t("#{@translation_key}.organization_settings.description"),
        color: "bg-skin-alternate-2",
        path: "#",
        icon: organization_settings_icon
      )
    end

    # TODO: Uncomment or remove this code later
    # div(class: "mt-6 flex") do
    #   a(href: "#", class: "text-sm font-medium text-indigo-600 hover:text-indigo-500") do
    #     t("#{@translation_key}.view_all")
    #     span(aria_hidden: "true") { " →" }
    #   end
    # end
  end
end