Class: TinyAdmin::Views::Actions::Show
- Inherits:
-
DefaultLayout
- Object
- Phlex::HTML
- BasicLayout
- DefaultLayout
- TinyAdmin::Views::Actions::Show
- Defined in:
- lib/tiny_admin/views/actions/show.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#prepare_record ⇒ Object
Returns the value of attribute prepare_record.
-
#record ⇒ Object
Returns the value of attribute record.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#slug ⇒ Object
Returns the value of attribute slug.
Attributes inherited from DefaultLayout
#flash_component, #head_component, #messages, #navbar_component, #options, #title
Attributes inherited from BasicLayout
Instance Method Summary collapse
Methods inherited from BasicLayout
#label_for, #update_attributes
Methods included from Utils
#humanize, #params_to_s, #prepare_page, #to_class
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
7 8 9 |
# File 'lib/tiny_admin/views/actions/show.rb', line 7 def actions @actions end |
#fields ⇒ Object
Returns the value of attribute fields.
7 8 9 |
# File 'lib/tiny_admin/views/actions/show.rb', line 7 def fields @fields end |
#prepare_record ⇒ Object
Returns the value of attribute prepare_record.
7 8 9 |
# File 'lib/tiny_admin/views/actions/show.rb', line 7 def prepare_record @prepare_record end |
#record ⇒ Object
Returns the value of attribute record.
7 8 9 |
# File 'lib/tiny_admin/views/actions/show.rb', line 7 def record @record end |
#reference ⇒ Object
Returns the value of attribute reference.
7 8 9 |
# File 'lib/tiny_admin/views/actions/show.rb', line 7 def reference @reference end |
#slug ⇒ Object
Returns the value of attribute slug.
7 8 9 |
# File 'lib/tiny_admin/views/actions/show.rb', line 7 def slug @slug end |
Instance Method Details
#view_template ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/tiny_admin/views/actions/show.rb', line 14 def view_template super do div(class: 'show') { div(class: 'row') { div(class: 'col-4') { h1(class: 'title') { title } } div(class: 'col-8') { } } prepare_record.call(record).each do |key, value| field = fields[key] div(class: "field-#{field.name} row lh-lg") { if field div(class: 'field-header col-2') { field.[:header] || field.title } end div(class: 'field-value col-10') { render TinyAdmin.settings.components[:field_value].new(field, value, record: record) } } end render TinyAdmin::Views::Components::Widgets.new() } end end |