Class: Ecm::Downloads::DownloadCategoryDecorator

Inherits:
Draper::Decorator
  • Object
show all
Defined in:
app/decorators/ecm/downloads/download_category_decorator.rb

Instance Method Summary collapse

Instance Method Details

#display_codeObject



5
6
7
# File 'app/decorators/ecm/downloads/download_category_decorator.rb', line 5

def display_code
  "<%= render_download_category '#{name}' %>"
end

#ecm_downloads_downloads_count_labelObject



9
10
11
# File 'app/decorators/ecm/downloads/download_category_decorator.rb', line 9

def ecm_downloads_downloads_count_label
  h.(:span, ecm_downloads_downloads_count, class: 'badge')
end

#index_nameObject



21
22
23
24
25
26
27
# File 'app/decorators/ecm/downloads/download_category_decorator.rb', line 21

def index_name
  if self.root?
    "[#{locale}] #{name}"
  else
    "#{'&#160;&#160;&#160;&#160;' * level} |--&#160;#{name}".html_safe
  end
end

#locale_labelObject



13
14
15
# File 'app/decorators/ecm/downloads/download_category_decorator.rb', line 13

def locale_label
  h.(:span, locale, class: 'label label-default')
end

#tree_nameObject



17
18
19
# File 'app/decorators/ecm/downloads/download_category_decorator.rb', line 17

def tree_name
  name
end