Add some toasts
This commit is contained in:
parent
84fc1d2d93
commit
934deddec4
10 changed files with 50 additions and 5 deletions
8
app/views/layouts/_toast.html.slim
Normal file
8
app/views/layouts/_toast.html.slim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
.toast class="#{alert ? "text-bg-danger" : ""}" role="alert" aria-live="assertive" aria-atomic="true" data={ controller: "toast" }
|
||||
.toast-header
|
||||
/img src="..." class="rounded me-2" alt="...">
|
||||
/strong.me-auto = heading
|
||||
.small.me-auto = l(Time.current.to_time)
|
||||
button.btn-close type="button" data-bs-dismiss="toast" aria-label="Schliessen"
|
||||
.toast-body
|
||||
= content
|
||||
|
|
@ -16,5 +16,12 @@ html data-bs-theme="#{cookies[:"modeTheme"] || "light"}" data-controller="set-th
|
|||
main.col.ps-md-2.pt-2
|
||||
#main-content[data-controller="rich-text-link-targets"]
|
||||
= yield
|
||||
|
||||
.toast-container.position-fixed.bottom-0.start-0.p-3 id="toasts"
|
||||
- if flash.alert
|
||||
= render partial: "layouts/toast", locals: { content: flash.alert, alert: true }
|
||||
- if flash.notice
|
||||
= render partial: "layouts/toast", locals: { content: flash.notice, alert: false }
|
||||
|
||||
/footer.container-fluid.mt-auto.border-top
|
||||
= Rails.configuration.build_version && "Version: #{Rails.configuration.build_version}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue