Update announcement styling and adjust announcement views
This commit is contained in:
parent
501a2cce42
commit
5d63d0ba27
|
@ -0,0 +1,16 @@
|
|||
.announcement {
|
||||
width: 100%;
|
||||
border-radius: 0;
|
||||
text-align: center;
|
||||
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&__container {
|
||||
position: fixed;
|
||||
top: $navbar-height;
|
||||
width: 100%;
|
||||
z-index: 1024;
|
||||
}
|
||||
}
|
|
@ -1,29 +1,31 @@
|
|||
- provide(:title, generate_title("Edit announcement"))
|
||||
.container.container--main
|
||||
= bootstrap_form_for(@announcement, url: {action: "update"}, method: "PATCH") do |f|
|
||||
- if @announcement.errors.any?
|
||||
.row
|
||||
.col-md-12
|
||||
.alert.alert-danger
|
||||
%strong
|
||||
= pluralize(@announcement.errors.count, "error")
|
||||
prohibited this announcement from being saved:
|
||||
%ul
|
||||
- @announcement.errors.full_messages.each do |err|
|
||||
%li= err
|
||||
.row
|
||||
.col-md-12
|
||||
= f.text_area :content, label: "Content"
|
||||
.row
|
||||
.col-md-6
|
||||
= f.url_field :link_href, label: "Link URL"
|
||||
.col-md-6
|
||||
= f.datetime_field :link_text, label: "Link text"
|
||||
.row
|
||||
.col-md-6
|
||||
= f.datetime_field :starts_at, label: "Start time"
|
||||
.col-md-6
|
||||
= f.datetime_field :ends_at, label: "End time"
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= f.submit class: "btn btn-primary"
|
||||
.card
|
||||
.card-body
|
||||
= bootstrap_form_for(@announcement, url: {action: "update"}, method: "PATCH") do |f|
|
||||
- if @announcement.errors.any?
|
||||
.row
|
||||
.col-md-12
|
||||
.alert.alert-danger
|
||||
%strong
|
||||
= pluralize(@announcement.errors.count, "error")
|
||||
prohibited this announcement from being saved:
|
||||
%ul
|
||||
- @announcement.errors.full_messages.each do |err|
|
||||
%li= err
|
||||
.row
|
||||
.col-md-12
|
||||
= f.text_area :content, label: "Content"
|
||||
.row
|
||||
.col-md-6
|
||||
= f.url_field :link_href, label: "Link URL"
|
||||
.col-md-6
|
||||
= f.text_field :link_text, label: "Link text"
|
||||
.row
|
||||
.col-md-6
|
||||
= f.datetime_field :starts_at, label: "Start time", class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#announcement_starts_at", "date-format": "YYYY-MM-DD hh:mm A" }
|
||||
.col-md-6
|
||||
= f.datetime_field :ends_at, label: "End time", class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#announcement_ends_at", "date-format": "YYYY-MM-DD hh:mm A" }
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= f.submit class: "btn btn-primary"
|
||||
|
|
|
@ -1,29 +1,31 @@
|
|||
- provide(:title, generate_title("Add new announcement"))
|
||||
.container.container--main
|
||||
= bootstrap_form_for(@announcement, url: {action: "create"}) do |f|
|
||||
- if @announcement.errors.any?
|
||||
.row
|
||||
.col-md-12
|
||||
.alert.alert-danger
|
||||
%strong
|
||||
= pluralize(@announcement.errors.count, "error")
|
||||
prohibited this announcement from being saved:
|
||||
%ul
|
||||
- @announcement.errors.full_messages.each do |err|
|
||||
%li= err
|
||||
.row
|
||||
.col-md-12
|
||||
= f.text_area :content, label: "Content"
|
||||
.row
|
||||
.col-md-6
|
||||
= f.url_field :link_href, label: "Link URL"
|
||||
.col-md-6
|
||||
= f.datetime_field :link_text, label: "Link text"
|
||||
.row
|
||||
.col-md-6
|
||||
= f.datetime_field :starts_at, label: "Start time"
|
||||
.col-md-6
|
||||
= f.datetime_field :ends_at, label: "End time"
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= f.submit class: "btn btn-primary"
|
||||
.card
|
||||
.card-body
|
||||
= bootstrap_form_for(@announcement, url: {action: "create"}) do |f|
|
||||
- if @announcement.errors.any?
|
||||
.row
|
||||
.col-md-12
|
||||
.alert.alert-danger
|
||||
%strong
|
||||
= pluralize(@announcement.errors.count, "error")
|
||||
prohibited this announcement from being saved:
|
||||
%ul
|
||||
- @announcement.errors.full_messages.each do |err|
|
||||
%li= err
|
||||
.row
|
||||
.col-md-12
|
||||
= f.text_area :content, label: "Content"
|
||||
.row
|
||||
.col-md-6
|
||||
= f.url_field :link_href, label: "Link URL"
|
||||
.col-md-6
|
||||
= f.text_field :link_text, label: "Link text"
|
||||
.row
|
||||
.col-md-6
|
||||
= f.datetime_field :starts_at, label: "Start time", class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#announcement_starts_at", "date-format": "YYYY-MM-DD hh:mm A" }
|
||||
.col-md-6
|
||||
= f.datetime_field :ends_at, label: "End time", class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#announcement_ends_at", "date-format": "YYYY-MM-DD hh:mm A" }
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= f.submit class: "btn btn-primary"
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
.container.announcements
|
||||
.announcement__container
|
||||
- @active_announcements.each do |announcement|
|
||||
.alert.alert-announcement.alert-info.alert-dismissable.hidden{ data: { 'announcement-id': announcement.id } }
|
||||
%button.close{ type: "button", "data-dismiss" => "alert" }
|
||||
%span{ "aria-hidden" => "true" } ×
|
||||
%p= announcement.content
|
||||
- if announcement.link_present?
|
||||
%a.alert-link{ href: announcement.link_href }= announcement.link_text
|
||||
.alert.announcement.alert-info.alert-dismissable.hidden{ data: { 'announcement-id': announcement.id } }
|
||||
.container
|
||||
%button.close{ type: "button", "data-dismiss" => "alert" }
|
||||
%span{ "aria-hidden" => "true" } ×
|
||||
%p
|
||||
= announcement.content
|
||||
- if announcement.link_present?
|
||||
%a.alert-link{ href: announcement.link_href }= announcement.link_text
|
||||
|
|
Loading…
Reference in New Issue