From cc9d9469f1cb4102cda73213c1b98e515f784e09 Mon Sep 17 00:00:00 2001 From: Justin Miller <16829344+jmilljr24@users.noreply.github.com> Date: Tue, 7 Apr 2026 13:12:20 -0400 Subject: [PATCH] revert affiliation fields files --- .../_affiliation_fields.html.erb | 153 ++++++++---------- app/views/people/_affiliation_fields.html.erb | 134 +++++++-------- 2 files changed, 132 insertions(+), 155 deletions(-) diff --git a/app/views/organizations/_affiliation_fields.html.erb b/app/views/organizations/_affiliation_fields.html.erb index 9c545c151..c687886a6 100644 --- a/app/views/organizations/_affiliation_fields.html.erb +++ b/app/views/organizations/_affiliation_fields.html.erb @@ -1,96 +1,83 @@ <% if allowed_to?(:manage?, Organization) %> <% expired = f.object.inactive? || (f.object.end_date.present? && f.object.end_date < Date.current) %>
-
id="<%= dom_id(f.object) %>"<% end %> data-inactive-toggle-target="row"> -
-
- <% if f.object.persisted? && f.object.person.present? %> - - <% show_email = f.object.person.profile_show_email? || allowed_to?(:manage?, Person) %> - <%= person_profile_button(f.object.person, truncate_at: 25, subtitle: (f.object.person.preferred_email if show_email)) %> - <%= f.hidden_field :person_id %> - <% else %> - -
- <%= f.input :person_id, - include_blank: true, - required: true, - wrapper_html: { class: "mb-0 h-full" }, - input_html: { - class: "h-full border-0", - data: { - controller: "remote-select", - remote_select_model_value: "person" - } - }, - label: false - %> -
- <% end %> -
+
+ <% if f.object.persisted? && f.object.person.present? %> + + <% show_email = f.object.person.profile_show_email? || allowed_to?(:manage?, Person) %> + <%= person_profile_button(f.object.person, truncate_at: 30, subtitle: (f.object.person.preferred_email if show_email)) %> + <%= f.hidden_field :person_id %> + <% else %> + <%= f.input :person_id, + include_blank: true, + required: true, + input_html: { + data: { + controller: "remote-select", + remote_select_model_value: "person" + } + }, + label: "Person" + %> + <% end %> +
+ +
+ <%= f.input :title, + as: :text, + input_html: { + rows: 1, + value: f.object&.title || "Facilitator", + style: "height: 42px; min-height: 42px;", + data: { + inactive_toggle_target: "title", + action: "affiliation-dates#recalculate inactive-toggle#updateBorder" + } + } %> +
-
- <%= f.input :title, - as: :text, - wrapper_html: { class: "mb-0" }, - input_html: { - rows: 1, - value: f.object&.title || "Facilitator", - style: "height: 56px; min-height: 56px; padding-top: 14px;", - data: { - inactive_toggle_target: "title", - action: "affiliation-dates#recalculate inactive-toggle#updateBorder" - } - } %> -
+
+ <%= f.input :start_date, + as: :string, + label: "Start", + input_html: { + type: "date", + value: (f.object.start_date || (Date.current unless f.object.persisted?))&.strftime("%Y-%m-%d"), + class: "rounded-md border-gray-300 focus:ring-blue-500 focus:border-blue-500 text-sm", + data: { action: "change->affiliation-dates#recalculate" } + } %> +
-
- <%= f.input :start_date, - as: :string, - label: "Start", - wrapper_html: { class: "mb-0" }, - input_html: { - type: "date", - value: (f.object.start_date || (Date.current unless f.object.persisted?))&.strftime("%Y-%m-%d"), - class: "rounded-md border-gray-300 focus:ring-blue-500 focus:border-blue-500 text-sm", - style: "height: 56px;", - data: { action: "change->affiliation-dates#recalculate" } - } %> -
+
+ <%= f.input :end_date, + as: :string, + label: "End", + input_html: { + type: "date", + value: f.object.end_date&.strftime("%Y-%m-%d"), + class: "rounded-md border-gray-300 focus:ring-blue-500 focus:border-blue-500 text-sm", + data: { + inactive_toggle_target: "endDate", + action: "change->inactive-toggle#toggle change->affiliation-dates#recalculate" + } + } %> +
-
- <%= f.input :end_date, - as: :string, - label: "End", - wrapper_html: { class: "mb-0" }, - input_html: { - type: "date", - value: f.object.end_date&.strftime("%Y-%m-%d"), - class: "rounded-md border-gray-300 focus:ring-blue-500 focus:border-blue-500 text-sm", - style: "height: 56px;", - data: { - inactive_toggle_target: "endDate", - action: "change->inactive-toggle#toggle change->affiliation-dates#recalculate" - } - } %> -
+
+ + <%= f.check_box :primary_contact, + checked: f.object.primary_contact? || !f.object.persisted?, + class: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" %> +
-
- -
- <%= f.check_box :primary_contact, - checked: f.object.primary_contact? || !f.object.persisted?, - class: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" %> -
-
- <%= link_to_remove_association "Remove", - f, - class: "text-sm text-gray-400 hover:text-red-600 underline whitespace-nowrap" %> -
-
+
+ <%= link_to_remove_association "Remove", + f, + class: "text-sm text-gray-400 hover:text-red-600 underline whitespace-nowrap admin-only bg-blue-100 rounded px-2 py-1" %>
diff --git a/app/views/people/_affiliation_fields.html.erb b/app/views/people/_affiliation_fields.html.erb index c2cf55bfb..06e801e29 100644 --- a/app/views/people/_affiliation_fields.html.erb +++ b/app/views/people/_affiliation_fields.html.erb @@ -1,95 +1,85 @@ <% if allowed_to?(:manage?, Person) %> <% expired = f.object.inactive? || (f.object.end_date.present? && f.object.end_date < Date.current) %>
-
-
-
- <% if f.object.persisted? && f.object.organization.present? %> - - <%= organization_profile_button(f.object.organization, truncate_at: 25) %> - <%= f.hidden_field :organization_id %> - <% else %> - -
- <%= f.input :organization_id, - include_blank: true, - required: true, - wrapper_html: { class: "mb-0 h-full" }, - input_html: { - class: "h-full border-0", - data: { - controller: "remote-select", - remote_select_model_value: "organization" - } - }, - error: "Organization can't be blank", - prompt: "Search by name", - label: false %> -
- <% end %> -
+
+ <% if f.object.persisted? && f.object.organization.present? %> + + <%= organization_profile_button(f.object.organization, truncate_at: 30) %> + <%= f.hidden_field :organization_id %> + <% else %> + <%= f.input :organization_id, + include_blank: true, + required: true, + input_html: { + data: { + controller: "remote-select", + remote_select_model_value: "organization" + } + }, + error: "Organization can't be blank", + prompt: "Search by name", + label: "Organization", + label_html: { class: "block text-sm font-medium text-gray-700 mb-1 " } %> + <% end %> +
-
+
+
<%= f.input :title, as: :text, - wrapper_html: { class: "mb-0" }, input_html: { rows: 1, value: f.object.title || "Facilitator", - style: "height: 56px; min-height: 56px; padding-top: 14px;", + style: "height: 42px; min-height: 42px;", data: { inactive_toggle_target: "title", action: "affiliation-dates#recalculate inactive-toggle#updateBorder" } } %>
+
-
- <%= f.input :start_date, - as: :string, - label: "Start", - wrapper_html: { class: "mb-0" }, - input_html: { - type: "date", - value: (f.object.start_date || (Date.current unless f.object.persisted?))&.strftime("%Y-%m-%d"), - class: "rounded-md border-gray-300 focus:ring-blue-500 focus:border-blue-500 text-sm", - style: "height: 56px;", - data: { action: "change->affiliation-dates#recalculate" } - } %> -
+
+ <%= f.input :start_date, + as: :string, + label: "Start", + input_html: { + type: "date", + value: (f.object.start_date || (Date.current unless f.object.persisted?))&.strftime("%Y-%m-%d"), + class: "rounded-md border-gray-300 focus:ring-blue-500 focus:border-blue-500 text-sm", + data: { action: "change->affiliation-dates#recalculate" } + } %> +
-
- <%= f.input :end_date, - as: :string, - label: "End", - wrapper_html: { class: "mb-0" }, - input_html: { - type: "date", - value: f.object.end_date&.strftime("%Y-%m-%d"), - class: "rounded-md border-gray-300 focus:ring-blue-500 focus:border-blue-500 text-sm", - style: "height: 56px;", - data: { - inactive_toggle_target: "endDate", - action: "change->inactive-toggle#toggle change->affiliation-dates#recalculate" - } - } %> -
+
+ <%= f.input :end_date, + as: :string, + label: "End", + input_html: { + type: "date", + value: f.object.end_date&.strftime("%Y-%m-%d"), + class: "rounded-md border-gray-300 focus:ring-blue-500 focus:border-blue-500 text-sm", + data: { + inactive_toggle_target: "endDate", + action: "change->inactive-toggle#toggle change->affiliation-dates#recalculate" + } + } %> +
-
- -
- <%= f.check_box :primary_contact, - checked: f.object.primary_contact? || !f.object.persisted?, - class: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" %> -
-
- <%= link_to_remove_association "Remove", - f, - class: "text-sm text-gray-400 hover:text-red-600 underline whitespace-nowrap" %> -
-
+
+ + <%= f.check_box :primary_contact, + checked: f.object.primary_contact? || !f.object.persisted?, + class: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" %> +
+ +
+ <%= link_to_remove_association "Remove", + f, + class: "text-sm text-gray-400 hover:text-red-600 underline whitespace-nowrap admin-only bg-blue-100 rounded px-2 py-1" %>