Module: Card::Set::All::Html::Head::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb
Instance Method Summary collapse
-
#head_stylesheet_path ⇒ Object
-
#param_or_rule_card(setting) ⇒ Object
-
#rss_link? ⇒ Boolean
-
#view: favicon_tag ⇒ Object
-
#view: head ⇒ Object
-
#view: meta_tags ⇒ Object
-
#view: page_title_tag ⇒ Object
-
#view: rss_links ⇒ Object
TODO: move to rss mod.
-
#view: stylesheet_tags ⇒ Object
these should render a view of the rule card it would then be safe to cache if combined with param handling (but note that machine clearing would need to reset card cache…).
-
#view: universal_edit_button ⇒ Object
TODO: move to mod.
Instance Method Details
#head_stylesheet_path ⇒ Object
65 66 67 68 69 70 71 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 65 def head_stylesheet_path @head_stylesheet_path ||= tag "link", media: "all", rel: "stylesheet", type: "text/css", href: nest(param_or_rule_card(:style), view: :stylesheet_path) end |
#param_or_rule_card(setting) ⇒ Object
73 74 75 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 73 def param_or_rule_card setting params[setting]&.card || root.card.rule_card(setting) end |
#rss_link? ⇒ Boolean
77 78 79 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 77 def rss_link? Card.config.rss_enabled && respond_to?(:rss_link_tag) end |
#view: favicon_tag ⇒ Object
41 42 43 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 41 view :favicon_tag, unknown: true, perms: :none do nest :favicon, view: :link_tag end |
#view: head ⇒ Object
31 32 33 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 31 view :head, unknown: true, perms: :none, cache: :yes do basket[:head_views].map { |viewname| render viewname }.flatten.compact.join "\n" end |
#view: meta_tags ⇒ Object
35 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 35 view :meta_tags, unknown: true, perms: :none, template: :haml |
#view: page_title_tag ⇒ Object
37 38 39 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 37 view :page_title_tag, unknown: true, perms: :none do content_tag(:title) { render :page_title } end |
#view: rss_links ⇒ Object
TODO: move to rss mod
54 55 56 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 54 view :rss_links, unknown: true, perms: :none do render :rss_link_tag if rss_link? end |
#view: stylesheet_tags ⇒ Object
these should render a view of the rule card it would then be safe to cache if combined with param handling (but note that machine clearing would need to reset card cache…)
61 62 63 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 61 view :stylesheet_tags, cache: :never, unknown: true, perms: :none do [nest(:style_mods, view: :remote_style_tags), head_stylesheet_path] end |
#view: universal_edit_button ⇒ Object
TODO: move to mod
46 47 48 49 50 51 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 46 view :universal_edit_button, unknown: :blank, denial: :blank, perms: :update do return if card.new? tag "link", rel: "alternate", type: "application/x-wiki", title: "Edit this page!", href: path(view: :edit) end |