Class: Dradis::Plugins::HtmlExport::TemplatePresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Dradis::Plugins::HtmlExport::TemplatePresenter
- Defined in:
- app/presenters/dradis/plugins/html_export/template_presenter.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.each_template(&block) ⇒ Object
7 8 9 |
# File 'app/presenters/dradis/plugins/html_export/template_presenter.rb', line 7 def self.each_template(&block) templates.each(&block) end |
.templates ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/presenters/dradis/plugins/html_export/template_presenter.rb', line 11 def self.templates if defined?(Dradis::Pro) ReportTemplateProperties.all.where(plugin_name: :html_export).order(:title) else Dir["%s/*" % templates_dir].map { |t| File.basename(t) }.sort end end |
.templates_dir ⇒ Object
19 20 21 |
# File 'app/presenters/dradis/plugins/html_export/template_presenter.rb', line 19 def self.templates_dir File.join(::Configuration::paths_templates_reports, 'html_export') end |
Instance Method Details
#filename ⇒ Object
30 31 32 33 34 |
# File 'app/presenters/dradis/plugins/html_export/template_presenter.rb', line 30 def filename return template if template.is_a?(String) template.template_file end |
#title ⇒ Object
23 24 25 26 27 28 |
# File 'app/presenters/dradis/plugins/html_export/template_presenter.rb', line 23 def title return template if template.is_a?(String) content_tag(:span, "#{template.title} - ") + content_tag(:small, template.template_file) end |