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
-
#debug_or_machine_path(setting, debug_lambda, machine_path_lambda) ⇒ Object
-
#debug_path(setting, asset_card) {|asset_card| ... } ⇒ Object
-
#head_stylesheet_path ⇒ Object
-
#param_or_rule_card(setting) ⇒ Object
-
#remote_style_tags ⇒ Object
-
#rss_link? ⇒ Boolean
-
#view: favicon_tag ⇒ Object
-
#view: head ⇒ Object
-
#view: head_remote_stylesheets ⇒ Object
-
#view: head_stylesheet ⇒ 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: meta_tags ⇒ Object
-
#view: page_title_tag ⇒ Object
-
#view: rss_links ⇒ Object
TODO: move to rss mod.
-
#view: universal_edit_button ⇒ Object
Instance Method Details
#debug_or_machine_path(setting, debug_lambda, machine_path_lambda) ⇒ Object
65 66 67 68 69 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 65 def debug_or_machine_path setting, debug_lambda, machine_path_lambda return unless (asset_card = param_or_rule_card setting) debug_path(setting, asset_card, &debug_lambda) || machine_path_lambda.call(asset_card.asset_output_url) end |
#debug_path(setting, asset_card) {|asset_card| ... } ⇒ Object
71 72 73 74 75 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 71 def debug_path setting, asset_card return unless params[:debug] == setting.to_s yield asset_card end |
#head_stylesheet_path ⇒ Object
94 95 96 97 98 99 100 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 94 def head_stylesheet_path debug_or_machine_path( :style, ->(style_card) { path mark: style_card.name, item: :import, format: :css }, ->(machine_path) { machine_path } ) end |
#param_or_rule_card(setting) ⇒ Object
57 58 59 60 61 62 63 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 57 def param_or_rule_card setting if params[setting] Card[params[setting]] else root.card.rule_card setting end end |
#remote_style_tags ⇒ Object
86 87 88 89 90 91 92 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 86 def return unless (asset_card = Card[:style_mods]) asset_card.item_cards.map do |mod_style_card| nest mod_style_card, view: :remote_include_tags end.select(&:present?) end |
#rss_link? ⇒ Boolean
82 83 84 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 82 def rss_link? Card.config.rss_enabled && respond_to?(:rss_link_tag) end |
#view: favicon_tag ⇒ Object
33 34 35 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 33 view :favicon_tag, unknown: true, perms: :none do nest :favicon, view: :link_tag end |
#view: head ⇒ Object
23 24 25 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 23 view :head, unknown: true, perms: :none do basket[:head_views].map { |viewname| render viewname }.flatten.compact.join "\n" end |
#view: head_remote_stylesheets ⇒ Object
53 54 55 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 53 view :head_remote_stylesheets, unknown: true, cache: :never, perms: :none do end |
#view: head_stylesheet ⇒ 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…)
47 48 49 50 51 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 47 view :head_stylesheet, unknown: true, cache: :never, perms: :none do return unless (href = head_stylesheet_path) tag("link", href: href, media: "all", rel: "stylesheet", type: "text/css") end |
#view: meta_tags ⇒ Object
27 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 27 view :meta_tags, unknown: true, perms: :none, template: :haml |
#view: page_title_tag ⇒ Object
29 30 31 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 29 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
78 79 80 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 78 view :rss_links, unknown: true, perms: :none do render :rss_link_tag if rss_link? end |
#view: universal_edit_button ⇒ Object
37 38 39 40 41 42 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/head.rb', line 37 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 |