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

Instance Method Details

#head_stylesheet_pathObject



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

Returns:

  • (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_tagObject



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: headObject



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_tagsObject



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_tagObject



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
  (:title) { render :page_title }
end

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_tagsObject

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_buttonObject

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