Module: Card::Set::All::Bridge::TabViews::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod023-edit/all/bridge/tab_views.rb
Constant Summary collapse
- RELATED_ITEMS =
[["children", :children], # ["mates", "bed", "*mates"], # FIXME: optimize and restore ["references out", :refers_to], ["references in", :referred_to_by]].freeze
Instance Method Summary collapse
- #account_items ⇒ Object
- #bridge_pill_items(data, breadcrumb) ⇒ Object
- #bridge_pills(items) ⇒ Object
- #discussion_section ⇒ Object
Instance Method Details
#account_items ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'tmpsets/set/mod023-edit/all/bridge/tab_views.rb', line 51 def account_items %i[account roles created edited follow].map do |item| if item == :account [tr(:details), item, { view: :edit, hide: %i[edit_name_row edit_type_row] }] else [tr(item), item] end end end |
#bridge_pill_items(data, breadcrumb) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'tmpsets/set/mod023-edit/all/bridge/tab_views.rb', line 68 def bridge_pill_items data, data.map do |text, field, extra_opts| opts = bridge_link_opts.merge("data-toggle": "pill") opts.merge! () if extra_opts classes = extra_opts.delete :class add_class opts, classes if classes opts.deep_merge! extra_opts end opts["data-cy"] = "#{text.to_name.key}-pill" add_class opts, "nav-link" link_to_card [card, field], text, opts end end |
#bridge_pills(items) ⇒ Object
61 62 63 64 65 66 |
# File 'tmpsets/set/mod023-edit/all/bridge/tab_views.rb', line 61 def bridge_pills items list_tag class: "nav nav-pills _auto-single-select bridge-pills flex-column", items: { class: "nav-item" } do items end end |
#discussion_section ⇒ Object
44 45 46 47 48 49 |
# File 'tmpsets/set/mod023-edit/all/bridge/tab_views.rb', line 44 def discussion_section return unless show_discussion? field_nest(:discussion, view: :titled, title: "Discussion", show: :comment_box, hide: [:menu]) end |