Class: Georgia::PageDecorator

Inherits:
ApplicationDecorator show all
Defined in:
app/decorators/georgia/page_decorator.rb

Instance Method Summary collapse

Methods inherited from ApplicationDecorator

#pretty_created_at, #pretty_updated_at

Instance Method Details

#stateObject



26
27
28
# File 'app/decorators/georgia/page_decorator.rb', line 26

def state
  public? ? 'public' : 'private'
end

#state_iconObject



11
12
13
14
15
16
17
# File 'app/decorators/georgia/page_decorator.rb', line 11

def state_icon
  if public?
    h.icon_tag('icon-ok icon-success')
  else
    h.icon_tag('icon-remove icon-failure')
  end
end

#status_tag(options = {}) ⇒ Object



19
20
21
22
23
24
# File 'app/decorators/georgia/page_decorator.rb', line 19

def status_tag(options={})
  options[:class] ||= ''
  options[:class] << ' label'
  options[:class] << " label-#{public? ? 'success' : 'warning'}"
  h.(:span, state, options)
end

#template_pathObject



7
8
9
# File 'app/decorators/georgia/page_decorator.rb', line 7

def template_path
  "pages/templates/#{current_revision.template}"
end