Use new layout in announcements views

This commit is contained in:
Andreas Nedbal 2022-11-20 17:59:24 +01:00 committed by Andreas Nedbal
parent 4504d5ebac
commit d0654d7d9d
3 changed files with 66 additions and 63 deletions

View File

@ -1,23 +1,24 @@
.card
.card-body
= bootstrap_form_for(@announcement, url: { action: "update" }, method: "PATCH") do |f|
.row
.col-md-12
= f.text_area :content
.row
.col-md-6
= f.url_field :link_href
.col-md-6
= f.text_field :link_text
.row
.col-md-6
= f.datetime_field :starts_at,
data: { target: "#announcement_starts_at", "date-format": "YYYY-MM-DD hh:mm A" }
.col-md-6
= f.datetime_field :ends_at,
data: { target: "#announcement_ends_at", "date-format": "YYYY-MM-DD hh:mm A" }
.row
.col-md-12.text-right
= f.submit class: "btn btn-primary"
- provide(:title, generate_title(t(".title")))
.container-lg.container--main
.card
.card-body
= bootstrap_form_for(@announcement, url: { action: "update" }, method: "PATCH") do |f|
.row
.col-md-12
= f.text_area :content
.row
.col-md-6
= f.url_field :link_href
.col-md-6
= f.text_field :link_text
.row
.col-md-6
= f.datetime_field :starts_at,
data: { target: "#announcement_starts_at", "date-format": "YYYY-MM-DD hh:mm A" }
.col-md-6
= f.datetime_field :ends_at,
data: { target: "#announcement_ends_at", "date-format": "YYYY-MM-DD hh:mm A" }
.row
.col-md-12.text-right
= f.submit class: "btn btn-primary"
- parent_layout "admin"

View File

@ -1,20 +1,21 @@
- @announcements.each do |announcement|
.card
.card-body
.d-flex.w-100.justify-content-between
%p.mb-3= announcement.content
%small.text-muted= announcement.starts_at
.d-flex.w-100
= link_to t("voc.edit"), announcement_edit_path(id: announcement.id), class: "btn btn-link text-primary"
= button_to t("voc.delete"),
announcement_destroy_path(id: announcement.id),
method: :delete,
class: "btn btn-link text-danger",
confirm: t(".confirm_delete")
.row
.col-md-12
= link_to t(".new"), :announcement_new, class: "btn btn-primary"
- provide(:title, generate_title(t(".title")))
.container-lg.container--main
- @announcements.each do |announcement|
.card
.card-body
.d-flex.w-100.justify-content-between
%p.mb-3= announcement.content
%small.text-muted= announcement.starts_at
.d-flex.w-100
= link_to t("voc.edit"), announcement_edit_path(id: announcement.id), class: "btn btn-link text-primary"
= button_to t("voc.delete"),
announcement_destroy_path(id: announcement.id),
method: :delete,
class: "btn btn-link text-danger",
confirm: t(".confirm_delete")
.row
.col-md-12
= link_to t(".new"), :announcement_new, class: "btn btn-primary"
- parent_layout "admin"

View File

@ -1,23 +1,24 @@
.card
.card-body
= bootstrap_form_for(@announcement, url: { action: "create" }) do |f|
.row
.col-md-12
= f.text_area :content
.row
.col-md-6
= f.url_field :link_href
.col-md-6
= f.text_field :link_text
.row
.col-md-6
= f.datetime_field :starts_at,
data: { target: "#announcement_starts_at", "date-format": "YYYY-MM-DD hh:mm A" }
.col-md-6
= f.datetime_field :ends_at,
data: { target: "#announcement_ends_at", "date-format": "YYYY-MM-DD hh:mm A" }
.row
.col-md-12.text-right
= f.submit class: "btn btn-primary"
- provide(:title, generate_title(t(".title")))
.container-lg.container--main
.card
.card-body
= bootstrap_form_for(@announcement, url: { action: "create" }) do |f|
.row
.col-md-12
= f.text_area :content
.row
.col-md-6
= f.url_field :link_href
.col-md-6
= f.text_field :link_text
.row
.col-md-6
= f.datetime_field :starts_at,
data: { target: "#announcement_starts_at", "date-format": "YYYY-MM-DD hh:mm A" }
.col-md-6
= f.datetime_field :ends_at,
data: { target: "#announcement_ends_at", "date-format": "YYYY-MM-DD hh:mm A" }
.row
.col-md-12.text-right
= f.submit class: "btn btn-primary"
- parent_layout "admin"