Module: Card::Set::All::Base::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod004-format/all/base.rb
Instance Method Summary collapse
-
#date_view(date) ⇒ Object
-
#link_view(opts = {}) ⇒ Object
-
#name_variant(name) ⇒ Object
-
#safe_name ⇒ Object
-
#show(view, args) ⇒ Object
-
#specify_type_in_link!(opts) ⇒ Object
-
#structure_card ⇒ Object
-
#view: acted_at ⇒ Object
-
#view: blank ⇒ Object
-
#view: closed ⇒ Object
-
#view: codename ⇒ Object
-
#view: content ⇒ Object
-
#view: core ⇒ Object
-
#view: created_at ⇒ Object
DATE VIEWS.
-
#view: id ⇒ Object
-
#view: id_url ⇒ Object
-
#view: key ⇒ Object
-
#view: labeled ⇒ Object
-
#view: labeled_content ⇒ Object
-
#view: link ⇒ Object
-
#view: linkname ⇒ Object
-
#view: name ⇒ Object
NAME VIEWS.
-
#view: nav_link ⇒ Object
-
#view: one_line_content ⇒ Object
-
#view: open ⇒ Object
-
#view: open_content ⇒ Object
-
#view: raw ⇒ Object
CONTENT VIEWS.
-
#view: titled ⇒ Object
NAME + CONTENT VIEWS.
-
#view: titled_content ⇒ Object
-
#view: type ⇒ Object
-
#view: updated_at ⇒ Object
-
#view: url ⇒ Object
-
#view: url_link ⇒ Object
Instance Method Details
#date_view(date) ⇒ Object
72 73 74 75 76 77 78 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 72 def date_view date if voo.variant date.strftime voo.variant else time_ago_in_words date end end |
#link_view(opts = {}) ⇒ Object
50 51 52 53 54 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 50 def link_view opts={} opts[:known] = card.known? specify_type_in_link! opts link_to_card card.name, _render_title, opts end |
#name_variant(name) ⇒ Object
29 30 31 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 29 def name_variant name voo.variant ? name.to_name.vary(voo.variant) : name end |
#safe_name ⇒ Object
25 26 27 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 25 def safe_name card&.name end |
#show(view, args) ⇒ Object
14 15 16 17 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 14 def show view, args view ||= :core render! view, args.merge() end |
#specify_type_in_link!(opts) ⇒ Object
56 57 58 59 60 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 56 def specify_type_in_link! opts return if opts[:known] || !voo.type opts[:path] = { card: { type: voo.type } } end |
#structure_card ⇒ Object
86 87 88 89 90 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 86 def structure_card return nil if voo.structure == true voo.structure ? Card[voo.structure] : card end |
#view: acted_at ⇒ Object
70 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 70 view(:acted_at, compact: true) { date_view card.acted_at } |
#view: blank ⇒ Object
116 117 118 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 116 view :blank, compact: true, perms: :none do "" end |
#view: closed ⇒ Object
135 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 135 view :closed, :labeled |
#view: codename ⇒ Object
62 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 62 view(:codename, compact: true) { card.codename.to_s } |
#view: content ⇒ Object
96 97 98 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 96 view :content do _render_core end |
#view: core ⇒ Object
92 93 94 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 92 view :core, compact: true do process_content _render_raw end |
#view: created_at ⇒ Object
DATE VIEWS
68 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 68 view(:created_at, compact: true) { date_view card.created_at } |
#view: id ⇒ Object
63 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 63 view(:id, compact: true) { card.id } |
#view: id_url ⇒ Object
36 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 36 view(:id_url, compact: true) { card_url "~#{card.id}" } |
#view: key ⇒ Object
33 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 33 view(:key, compact: true, perms: :none) { card.key } |
#view: labeled ⇒ Object
132 133 134 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 132 view :labeled do "#{card.name}: #{_render_labeled_content}" end |
#view: labeled_content ⇒ Object
108 109 110 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 108 view :labeled_content, unknown: :mini_unknown do render_core end |
#view: link ⇒ Object
42 43 44 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 42 view :link, compact: true, perms: :none do link_view end |
#view: linkname ⇒ Object
34 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 34 view(:linkname, compact: true, perms: :none) { card.name.url_key } |
#view: name ⇒ Object
NAME VIEWS
21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 21 view :name, compact: true, perms: :none do name_variant safe_name end |
#view: nav_link ⇒ Object
46 47 48 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 46 view :nav_link, compact: true, perms: :none do link_view class: "nav-link" end |
#view: one_line_content ⇒ Object
104 105 106 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 104 view :one_line_content, compact: true do with_nest_mode(:compact) { truncate render_core } end |
#view: open ⇒ Object
130 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 130 view :open, :titled |
#view: open_content ⇒ Object
100 101 102 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 100 view :open_content do _render_core end |
#view: raw ⇒ Object
CONTENT VIEWS
82 83 84 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 82 view :raw do structure_card&.content || _render_blank end |
#view: titled ⇒ Object
NAME + CONTENT VIEWS
127 128 129 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 127 view :titled do "#{card.name}\n\n#{_render_core}" end |
#view: titled_content ⇒ Object
112 113 114 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 112 view :titled_content, unknown: :blank do render_core end |
#view: type ⇒ Object
64 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 64 view(:type, compact: true) { card.type_name } |
#view: updated_at ⇒ Object
69 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 69 view(:updated_at, compact: true) { date_view card.updated_at } |
#view: url ⇒ Object
35 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 35 view(:url, compact: true, perms: :none) { card_url _render_linkname } |
#view: url_link ⇒ Object
38 39 40 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/base.rb', line 38 view :url_link, compact: true, perms: :none do link_to_resource card_url(_render_linkname) end |