Skip to content

Commit

Permalink
Database: Add notes field to event
Browse files Browse the repository at this point in the history
  • Loading branch information
QbDesu committed Dec 29, 2024
1 parent 7607326 commit 9059127
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 48 deletions.
4 changes: 3 additions & 1 deletion app/admin/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
row :doi do
link_to e.doi, e.doi_url unless e.doi.nil?
end
row :notes
row :thumb_filename do
div show_event_folder e, :thumb_filename unless e.thumb_filename.nil?
end
Expand Down Expand Up @@ -117,6 +118,7 @@
f.input :date, hint: 'Actual date of the event'
f.input :release_date, hint: 'Release date for the video recordings'
f.input :doi, hint: 'Digital Object Identifier (DOI) e.g. 10.5446/19566 – prefixes are stripped automatically'
f.input :notes, hint: 'Notes to be shown as a notice on the event page'
end
f.inputs 'Files' do
f.input :slug
Expand Down Expand Up @@ -167,7 +169,7 @@
def permitted_params
params.permit event: [:guid, :thumb_filename, :poster_filename, :timeline_filename, :thumbnails_filename,
:conference_id, :title, :subtitle, :link, :slug,
:original_language, :doi, :promoted, :promotion_disabled,
:original_language, :doi, :notes, :promoted, :promotion_disabled,
:description, :persons_raw, :tags_raw, :date, :release_date, :event_id]
end
end
Expand Down
5 changes: 5 additions & 0 deletions app/views/frontend/events/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@
%a{href: @event.doi_url}
= truncate(@event.doi, length: 20, separator: ' ', omission: '…')

- if @event.notes
.alert.alert-info
%span.icon.icon-info-circle.mr-2
= @event.notes

- if @event.description.present?
/%h3 About
%p.description
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20241229193141_add_notes_field_to_events.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddNotesFieldToEvents < ActiveRecord::Migration[7.2]
def change
add_column :events, :notes, :string
end
end
94 changes: 47 additions & 47 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,67 @@
#
# It's strongly recommended that you check this file into your version control system.

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

create_table "active_admin_comments", force: :cascade do |t|
t.string "namespace", limit: 255
create_table "active_admin_comments", id: :serial, force: :cascade do |t|
t.string "namespace"
t.text "body"
t.string "resource_id", limit: 255, null: false
t.string "resource_type", limit: 255, null: false
t.string "resource_id", null: false
t.string "resource_type", null: false
t.string "author_type"
t.integer "author_id"
t.string "author_type", limit: 255
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.index ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id"
t.index ["namespace"], name: "index_active_admin_comments_on_namespace"
t.index ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id"
end

create_table "admin_users", force: :cascade do |t|
t.string "email", limit: 255, default: "", null: false
t.string "encrypted_password", limit: 255, default: "", null: false
t.string "reset_password_token", limit: 255
create_table "admin_users", id: :serial, force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at", precision: nil
t.datetime "remember_created_at", precision: nil
t.integer "sign_in_count", default: 0
t.datetime "current_sign_in_at", precision: nil
t.datetime "last_sign_in_at", precision: nil
t.string "current_sign_in_ip", limit: 255
t.string "last_sign_in_ip", limit: 255
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.index ["email"], name: "index_admin_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
end

create_table "api_keys", force: :cascade do |t|
t.string "key", limit: 255
t.string "description", limit: 255
create_table "api_keys", id: :serial, force: :cascade do |t|
t.string "key"
t.string "description"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
end

create_table "conferences", force: :cascade do |t|
t.string "acronym", limit: 255
t.string "recordings_path", limit: 255
t.string "images_path", limit: 255
t.string "slug", limit: 255, default: ""
t.string "aspect_ratio", limit: 255
create_table "conferences", id: :serial, force: :cascade do |t|
t.string "acronym"
t.string "recordings_path"
t.string "images_path"
t.string "slug", default: ""
t.string "aspect_ratio"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.string "title", limit: 255
t.string "schedule_url", limit: 255
t.string "title"
t.string "schedule_url"
t.text "schedule_xml"
t.string "schedule_state", limit: 255, default: "not_present", null: false
t.string "logo", limit: 255
t.string "schedule_state", default: "not_present", null: false
t.string "logo"
t.integer "downloaded_events_count", default: 0, null: false
t.jsonb "metadata", default: {}
t.datetime "event_last_released_at", precision: nil
t.jsonb "streaming", default: {}
t.text "description"
t.string "link", limit: 255
t.string "link"
t.text "custom_css"
t.index ["acronym"], name: "index_conferences_on_acronym"
t.index ["streaming"], name: "index_conferences_on_streaming", using: :gin
Expand All @@ -80,20 +80,21 @@
t.datetime "last_updated_at", precision: nil
end

create_table "events", force: :cascade do |t|
t.string "guid", limit: 255
t.string "poster_filename", limit: 255
create_table "events", id: :serial, force: :cascade do |t|
t.string "guid"
t.string "poster_filename"
t.integer "conference_id"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.string "title", limit: 255
t.string "thumb_filename", limit: 255
t.string "title"
t.string "state", default: "new", null: false
t.string "thumb_filename"
t.datetime "date", precision: nil
t.text "description"
t.string "link", limit: 255
t.string "link"
t.text "persons"
t.string "slug", limit: 255
t.string "subtitle", limit: 255
t.string "slug"
t.string "subtitle"
t.text "tags"
t.datetime "release_date", precision: nil
t.boolean "promoted"
Expand All @@ -105,24 +106,26 @@
t.string "timeline_filename", default: ""
t.string "thumbnails_filename", default: ""
t.string "doi"
t.string "notes"
t.index ["conference_id"], name: "index_events_on_conference_id"
t.index ["guid"], name: "index_events_on_guid"
t.index ["metadata"], name: "index_events_on_metadata", using: :gin
t.index ["release_date"], name: "index_events_on_release_date"
t.index ["slug", "id"], name: "index_events_on_slug_and_id"
t.index ["slug"], name: "index_events_on_slug"
t.index ["state"], name: "index_events_on_state"
t.index ["title"], name: "index_events_on_title"
end

create_table "news", force: :cascade do |t|
t.string "title", limit: 255
create_table "news", id: :serial, force: :cascade do |t|
t.string "title"
t.text "body"
t.date "date"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
end

create_table "recording_views", force: :cascade do |t|
create_table "recording_views", id: :serial, force: :cascade do |t|
t.integer "recording_id"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
Expand All @@ -131,26 +134,24 @@
t.index ["recording_id"], name: "index_recording_views_on_recording_id"
end

create_table "recordings", force: :cascade do |t|
t.integer "size", comment: "approximate file size in megabytes"
t.integer "length", comment: "duration in seconds"
t.string "mime_type", limit: 255
create_table "recordings", id: :serial, force: :cascade do |t|
t.integer "size"
t.integer "length"
t.string "mime_type"
t.integer "event_id"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.string "filename", limit: 255
t.string "state", limit: 255, default: "new", null: false
t.string "folder", limit: 255
t.string "filename"
t.string "folder"
t.integer "width"
t.integer "height"
t.string "language", default: "eng"
t.boolean "high_quality", default: true, null: false
t.boolean "html5", default: false, null: false
t.string "state", limit: 255, default: "new", null: false
t.index ["event_id"], name: "index_recordings_on_event_id"
t.index ["filename"], name: "index_recordings_on_filename"
t.index ["mime_type"], name: "index_recordings_on_mime_type"
t.index ["state", "mime_type"], name: "index_recordings_on_state_and_mime_type"
t.index ["state"], name: "index_recordings_on_state"
end

create_table "web_feeds", force: :cascade do |t|
Expand All @@ -160,5 +161,4 @@
t.text "content"
t.index ["key", "kind"], name: "index_web_feeds_on_key_and_kind", unique: true
end

end

0 comments on commit 9059127

Please sign in to comment.