diff --git a/app/controllers/admin/schedule_items_controller.rb b/app/controllers/admin/schedule_items_controller.rb
index c17aaa4..9281092 100644
--- a/app/controllers/admin/schedule_items_controller.rb
+++ b/app/controllers/admin/schedule_items_controller.rb
@@ -84,7 +84,7 @@ def safe_return_to
# config/schedule.yml items and should never be set by hand.
def schedule_item_params
attrs = params.require(:schedule_item).permit(
- :day, :time_label, :sort_time, :title, :host,
+ :day, :time_label, :sort_time, :title, :host, :host_url,
:location, :map_url, :description, :kind, :flexible, :is_public, :audience,
:offers_new_passport, :offers_stamping, :offers_passport_pickup,
:new_passport_capacity, :stamping_capacity, :passport_pickup_capacity,
diff --git a/app/views/admin/schedule_items/_form.html.erb b/app/views/admin/schedule_items/_form.html.erb
index f0297ea..e88e3a5 100644
--- a/app/views/admin/schedule_items/_form.html.erb
+++ b/app/views/admin/schedule_items/_form.html.erb
@@ -71,6 +71,16 @@
class: "select" %>
+
+ <%= f.label :host_url, "Speaker profile URL", class: "label" %>
+ <%= f.url_field :host_url, class: "input",
+ placeholder: "https://blueridgeruby.com/speakers/..." %>
+
+ Optional. If set, the speaker's name links to this URL on /schedule and /plan.
+ Update this whenever you change the host so the link points to the right person.
+
+
+
<%= f.label :location, class: "label" %>
<%= f.text_field :location, class: "input" %>
diff --git a/test/controllers/admin/schedule_items_controller_test.rb b/test/controllers/admin/schedule_items_controller_test.rb
index 6520966..fbc1ed0 100644
--- a/test/controllers/admin/schedule_items_controller_test.rb
+++ b/test/controllers/admin/schedule_items_controller_test.rb
@@ -134,6 +134,37 @@ def valid_form_params(overrides = {})
end
end
+ test "admin edit form exposes a host_url field so name and link stay paired" do
+ item = ScheduleItem.create!(
+ day: "thu", title: "Keynote", host: "John Athayde",
+ host_url: "https://blueridgeruby.com/speakers/john-athayde/",
+ kind: :talk, is_public: true
+ )
+ sign_in_as users(:jeremy)
+ get edit_admin_schedule_item_path(item)
+
+ assert_select "input[name='schedule_item[host_url]'][value=?]",
+ "https://blueridgeruby.com/speakers/john-athayde/"
+ end
+
+ test "admin update persists host_url alongside host" do
+ item = ScheduleItem.create!(
+ day: "thu", title: "Keynote", host: "John Athayde",
+ host_url: "https://blueridgeruby.com/speakers/john-athayde/",
+ kind: :talk, is_public: true
+ )
+ sign_in_as users(:jeremy)
+
+ patch admin_schedule_item_path(item), params: valid_form_params(
+ title: "Keynote", host: "Joël Quenneville",
+ host_url: "https://blueridgeruby.com/speakers/joel-quenneville/"
+ )
+
+ item.reload
+ assert_equal "Joël Quenneville", item.host
+ assert_equal "https://blueridgeruby.com/speakers/joel-quenneville/", item.host_url
+ end
+
test "admin can create a volunteers_only public item" do
sign_in_as users(:jeremy)
post admin_schedule_items_path, params: valid_form_params(