Module: Tawork::ApplicationHelper

Defined in:
app/helpers/tawork/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#body_layoutObject



40
41
42
43
44
45
46
# File 'app/helpers/tawork/application_helper.rb', line 40

def body_layout
  if params[:controller] == "wiki/pages" && params[:action] == "compare"
    return "layouts/compare_layout"
  end

  "layouts/default_layout"
end

#icon_for(thing) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/helpers/tawork/application_helper.rb', line 27

def icon_for(thing)
  case thing
  when Space
    icon = "bullseye"
  when Page
    icon = "file"
  when Attachment
    icon = "paperclip"
  end

  tag(:i, class: "fa fa-#{icon}")
end

#ticket_typesObject



13
14
15
16
17
18
19
20
# File 'app/helpers/tawork/application_helper.rb', line 13

def ticket_types
  Ticket::ALLOWED_TYPES.each_with_object({}) do |type, hash|
    hash[type] = Ticket.filtered_type_class(type).new(
      creator: current_user,
      parent_id: params[:parent_id]
    )
  end
end

#title(page_title) ⇒ Object



22
23
24
25
# File 'app/helpers/tawork/application_helper.rb', line 22

def title(page_title)
  content_for(:title) { page_title }
  page_title
end