Update announcement styling and adjust announcement views

This commit is contained in:
Andreas Nedbal 2020-05-07 19:30:13 +02:00
parent 501a2cce42
commit 5d63d0ba27
4 changed files with 83 additions and 61 deletions

View File

@ -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;
}
}

View File

@ -1,5 +1,7 @@
- provide(:title, generate_title("Edit announcement"))
.container.container--main
.card
.card-body
= bootstrap_form_for(@announcement, url: {action: "update"}, method: "PATCH") do |f|
- if @announcement.errors.any?
.row
@ -18,12 +20,12 @@
.col-md-6
= f.url_field :link_href, label: "Link URL"
.col-md-6
= f.datetime_field :link_text, label: "Link text"
= f.text_field :link_text, label: "Link text"
.row
.col-md-6
= f.datetime_field :starts_at, label: "Start time"
= 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"
= 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"

View File

@ -1,5 +1,7 @@
- provide(:title, generate_title("Add new announcement"))
.container.container--main
.card
.card-body
= bootstrap_form_for(@announcement, url: {action: "create"}) do |f|
- if @announcement.errors.any?
.row
@ -18,12 +20,12 @@
.col-md-6
= f.url_field :link_href, label: "Link URL"
.col-md-6
= f.datetime_field :link_text, label: "Link text"
= f.text_field :link_text, label: "Link text"
.row
.col-md-6
= f.datetime_field :starts_at, label: "Start time"
= 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"
= 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"

View File

@ -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 } }
.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
%p
= announcement.content
- if announcement.link_present?
%a.alert-link{ href: announcement.link_href }= announcement.link_text