Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Talk priorities #196

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/talk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# speaker_twitter :string
# preferred_month_talk :string
# time_position :datetime
# priority :string
#
# Indexes
#
Expand Down Expand Up @@ -65,6 +66,9 @@ def self.propose_upcoming_months
end

ALL_MONTHS = months_iterator(1..12)

enumerize :priority,
in: [:low, :normal, :high], default: :normal

enumerize :preferred_month_talk,
in: ALL_MONTHS.keys.map(&:to_sym)
Expand Down
1 change: 1 addition & 0 deletions config/initializers/rails_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
end
field :title
field :speaker_name
field :priority
field :speaker_twitter
field :preferred_month_talk
field :time_position
Expand Down
10 changes: 10 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ fr:

site_name: Paris.rb

admin:
help:
talk:
priority: Optionnel. Une priorité 'basse' peut servir à mettre de côté un talk pour combler un programme, une priorité 'haute' pour les invités spéciaux.

activerecord:
attributes:
user:
Expand All @@ -20,6 +25,7 @@ fr:
happened_at: Date
level: Difficulté
lineup: Ajouter au lineup
priority: Priorité
slides: Slides
speaker_email: Email
speaker_name: Speaker
Expand Down Expand Up @@ -65,6 +71,10 @@ fr:
easy: Débutant
intermediate: Moyen
expert: Expert
priority:
low: Basse
normal: Normale
high: Haute

helpers:
submit:
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20231118111323_add_priority_to_talks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddPriorityToTalks < ActiveRecord::Migration[7.0]
def change
add_column :talks, :priority, :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.0].define(version: 2023_03_22_213633) do
ActiveRecord::Schema[7.0].define(version: 2023_11_18_111323) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -50,6 +50,7 @@
t.string "speaker_twitter"
t.string "preferred_month_talk"
t.datetime "time_position", precision: nil
t.string "priority"
t.index ["happened_at"], name: "index_talks_on_happened_at"
end

Expand Down