Class: Matestack::Ui::Bootstrap::Layouts::AdminTemplate
- Inherits:
-
Layout
- Object
- Layout
- Matestack::Ui::Bootstrap::Layouts::AdminTemplate
- Defined in:
- lib/matestack/ui/bootstrap/layouts/admin_template.rb
Instance Method Summary collapse
- #body_response(&block) ⇒ Object
- #content_background_class ⇒ Object
- #loading_state_slot ⇒ Object
- #navbar_brand_config ⇒ Object
- #navbar_items ⇒ Object
- #response(&block) ⇒ Object
- #should_show_navbar? ⇒ Boolean
- #should_show_sidebar? ⇒ Boolean
- #sidebar_navigation_items ⇒ Object
- #sidebar_top_slot ⇒ Object
- #toasts_partial ⇒ Object
Instance Method Details
#body_response(&block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 11 def body_response(&block) div class: "d-flex flex-row" do if div id: "sidebar", class: "sidebar-wrapper" do sidebar_navigation_items: , slots: { sidebar_top: method(:sidebar_top_slot) } end end div id: "content", class: "content-wrapper w-100 #{content_background_class}" do if bs_container do brand: , items: , class: "pt-4 #{'ps-5' if }", collapse_class: "text-end text-lg-start pe-3" end end bs_container class: "my-5 px-4 pt-5" do page_switch do yield if block_given? end end end end toasts_partial end |
#content_background_class ⇒ Object
86 87 88 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 86 def content_background_class "bg-light" end |
#loading_state_slot ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 66 def loading_state_slot # slot do # div class: "d-flex justify-content-center" do # spinner class: "mt-5" # end # end end |
#navbar_brand_config ⇒ Object
82 83 84 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 82 def end |
#navbar_items ⇒ Object
74 75 76 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 74 def [] end |
#response(&block) ⇒ Object
5 6 7 8 9 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 5 def response(&block) matestack_vue_js_app do body_response(&block) end end |
#should_show_navbar? ⇒ Boolean
42 43 44 45 46 47 48 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 42 def if .nil? && !self.respond_to?(:navbar_end_partial) && .empty? false else true end end |
#should_show_sidebar? ⇒ Boolean
34 35 36 37 38 39 40 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 34 def if !self.respond_to?(:sidebar_top_partial) && .empty? false else true end end |
#sidebar_navigation_items ⇒ Object
78 79 80 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 78 def [] end |
#sidebar_top_slot ⇒ Object
50 51 52 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 50 def if self.respond_to?(:sidebar_top_partial) end |
#toasts_partial ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/matestack/ui/bootstrap/layouts/admin_template.rb', line 54 def toasts_partial toasts.each do |toast| bs_toast class: toast[:class], body: toast[:body].html_safe, placement: { position: 'bottom: 15px; right: 15px;', height: "200px" }, show_on: toast[:show_on], hide_on: toast[:hide_on], autohide: toast[:autohide] || true end end |