Class: Matestack::Ui::Bootstrap::Apps::AdminTemplate
- Inherits:
-
App
- Object
- App
- Matestack::Ui::Bootstrap::Apps::AdminTemplate
- Defined in:
- app/concepts/matestack/ui/bootstrap/apps/admin_template.rb
Instance Method Summary collapse
- #content_background_class ⇒ Object
- #loading_state_slot ⇒ Object
- #navbar_brand_config ⇒ Object
- #navbar_items ⇒ Object
- #response ⇒ Object
- #should_show_navbar? ⇒ Boolean
- #should_show_sidebar? ⇒ Boolean
- #sidebar_navigation_items ⇒ Object
- #sidebar_top_slot ⇒ Object
- #toasts_partial ⇒ Object
Instance Method Details
#content_background_class ⇒ Object
80 81 82 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 80 def content_background_class "bg-light" end |
#loading_state_slot ⇒ Object
60 61 62 63 64 65 66 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 60 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
76 77 78 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 76 def end |
#navbar_items ⇒ Object
68 69 70 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 68 def [] end |
#response ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 3 def response div class: "d-flex flex-row" do if sidebar_navigation_items: , slots: { sidebar_top: } 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 should_show_sidebar?}", collapse_class: "text-end text-lg-start pe-3" do # div class: "d-flex" do # navbar_end_partial if self.respond_to?(:navbar_end_partial) # end end end end bs_container class: "my-5 px-4 pt-5" do yield_page slots: { loading_state: loading_state_slot } end end end toasts_partial end |
#should_show_navbar? ⇒ Boolean
34 35 36 37 38 39 40 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 34 def if .nil? && !self.respond_to?(:navbar_end_partial) && .empty? false else true end end |
#should_show_sidebar? ⇒ Boolean
26 27 28 29 30 31 32 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 26 def if !self.respond_to?(:sidebar_top_partial) && .empty? false else true end end |
#sidebar_navigation_items ⇒ Object
72 73 74 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 72 def [] end |
#sidebar_top_slot ⇒ Object
42 43 44 45 46 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 42 def slot do if self.respond_to?(:sidebar_top_partial) end end |
#toasts_partial ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/concepts/matestack/ui/bootstrap/apps/admin_template.rb', line 48 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 |