Skip to content

Commit

Permalink
Add global event notes to conference
Browse files Browse the repository at this point in the history
  • Loading branch information
QbDesu committed Dec 30, 2024
1 parent 10f2b66 commit 4e7b02f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions app/admin/conference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
row :logo
row :description
row :link
row :global_event_notes
row :aspect_ratio
row :schedule_url
row :schedule_xml do
Expand Down Expand Up @@ -62,6 +63,7 @@
f.input :slug
f.input :description #, input_html: { class: 'tinymce' }
f.input :link
f.input :global_event_notes, hint: 'Notes to be shown as a notice on the page of every lecture in this conference'
end
f.inputs "Paths" do
f.input :recordings_path, hint: conference.get_recordings_url
Expand Down Expand Up @@ -104,6 +106,7 @@ def permitted_params
:title,
:description,
:link,
:global_event_notes,
:schedule_url,
:recordings_path,
:images_path,
Expand Down
5 changes: 1 addition & 4 deletions app/assets/stylesheets/frontend/pages/_show.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ body.page-show {

.event-notes {
font-size: 1.2em;
margin-top: 12px;

.icon {
margin-right: $padding-xs-horizontal;
Expand All @@ -69,10 +70,6 @@ body.page-show {
margin-top: 12px;
}

.event-notes {
margin-top: 12px;
}

ul.share {
list-style-type: none;
margin: 0;
Expand Down
7 changes: 6 additions & 1 deletion app/views/frontend/events/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@
%a{href: @event.doi_url}
= truncate(@event.doi, length: 20, separator: ' ', omission: '…')

- if @conference.global_event_notes.present?
.alert.alert-info.event-notes.conference--global-event-notes
%span.icon.icon-info-circle
= @conference.global_event_notes

- if @event.notes.present?
.alert.alert-info.event-notes
.alert.alert-info.event-notes.event--notes
%span.icon.icon-info-circle
= @event.notes

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddGlobalEventNotesFieldToConference < ActiveRecord::Migration[7.2]
def change;
add_column :conferences, :global_event_notes, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2024_12_29_193141) do
ActiveRecord::Schema[7.2].define(version: 2024_12_30_111051) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -72,6 +72,7 @@
t.text "description"
t.string "link"
t.text "custom_css"
t.string "global_event_notes"
t.index ["acronym"], name: "index_conferences_on_acronym"
t.index ["streaming"], name: "index_conferences_on_streaming", using: :gin
end
Expand Down

0 comments on commit 4e7b02f

Please sign in to comment.