Class: Georgia::RevisionDecorator
Instance Method Summary
collapse
#pretty_created_at, #pretty_updated_at
Instance Method Details
#excerpt_or_text ⇒ Object
4
5
6
7
8
9
10
|
# File 'app/decorators/georgia/revision_decorator.rb', line 4
def excerpt_or_text
if content.excerpt.present?
h.raw(content.excerpt)
elsif content.text.present?
h.truncate(h.strip_tags(content.text), length: 255, separator: ' ').html_safe
end
end
|
12
13
14
15
16
17
18
|
# File 'app/decorators/georgia/revision_decorator.rb', line 12
def meta_description
if content.excerpt.present?
content.excerpt.squish
elsif content.text.present?
h.truncate(h.strip_tags(content.text).squish, length: 240, separator: ' ').html_safe
end
end
|
#status_tag(options = {}) ⇒ Object
20
21
22
23
24
25
|
# File 'app/decorators/georgia/revision_decorator.rb', line 20
def status_tag(options={})
options[:class] ||= ''
options[:class] << ' label'
options[:class] << " label-#{human_state_name}"
h.content_tag(:span, human_state_name, options)
end
|