-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1726 from codebar/migrate-admin-announcements-pag…
…es-to-bootstrap Migrate admin edit announcements page to Bootstrap 5, add Edit buttons to announcements index page
- Loading branch information
Showing
3 changed files
with
39 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#container | ||
.row | ||
.large-12.columns | ||
.container-fluid | ||
.row.mb-4 | ||
.col | ||
%h1 Edit announcement | ||
.row.mb-4 | ||
.col | ||
= simple_form_for [:admin, @announcement] do |f| | ||
= f.association :groups, label_method: :to_s | ||
= f.input :message | ||
= f.input :expires_at, as: :string | ||
= f.submit :update, class: 'button tiny' | ||
= f.button :button, :update, class: 'btn btn-primary' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
.container-fluid | ||
.row.mb-3 | ||
.row.mb-4 | ||
.col | ||
%h1 Announcements | ||
.row | ||
.row.border-bottom.border-primary | ||
.col | ||
.row.border-bottom.border-primary | ||
.col-3 | ||
%p.mb-2 Created by | ||
.col-3 | ||
%p.mb-2 Message | ||
.col-3 | ||
%p.mb-2 Groups | ||
.col-3 | ||
%p.mb-2 Expires at | ||
- @announcements.each do |announcement| | ||
.row.mt-3 | ||
.col-3 | ||
.row | ||
.col-2 | ||
= image_tag(announcement.created_by.avatar(24), alt: announcement.created_by.full_name) | ||
.col-10 | ||
%p= announcement.created_by.full_name | ||
.col-3 | ||
= dot_markdown(announcement.message) | ||
.col-3 | ||
%ul | ||
- announcement.groups.each do |group| | ||
%li | ||
%p.mb-2= group.to_s | ||
.col-3 | ||
- if announcement.expires_at.present? | ||
%p=l(announcement.expires_at, format: :date) | ||
%p.mb-2 Created by | ||
.col-4 | ||
%p.mb-2 Message | ||
.col | ||
%p.mb-2 Groups | ||
.col | ||
%p.mb-2 Expires at | ||
.col | ||
%p.mb-2 Edit | ||
- @announcements.each do |announcement| | ||
.row.mt-3 | ||
.col | ||
.d-flex.align-items-start | ||
= image_tag(announcement.created_by.avatar(25), alt: announcement.created_by.full_name) | ||
%p.ml-2.mb-0= announcement.created_by.full_name | ||
.col-4 | ||
= dot_markdown(announcement.message) | ||
.col | ||
%ul | ||
- announcement.groups.each do |group| | ||
%li | ||
%p.mb-2= group.to_s | ||
.col | ||
- if announcement.expires_at.present? | ||
%p= l(announcement.expires_at, format: :date) | ||
.col | ||
= link_to 'Edit', edit_admin_announcement_path(announcement), class: 'border-0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
.container-fluid | ||
.row | ||
.row.mb-4 | ||
.col | ||
%h1 New Announcement | ||
%h1 New announcement | ||
.row.mb-4 | ||
.col | ||
= simple_form_for [:admin, @announcement] do |f| | ||
= f.association :groups, label_method: :to_s | ||
= f.input :message | ||
= f.input :expires_at, as: :string | ||
= f.submit :create, class: 'btn btn-primary' | ||
= f.button :button, :create, class: 'btn btn-primary' |