Skip to content

Commit 4b1cb83

Browse files
authored
Reorganization of organization edit and view pages (#5116)
* Organization#show page: change display order * Organization#show page: ensure headings use consistent case * Organization#show page: use 'Not defined' as default * Organization#show page: clearly separate default email content in UI * Organization#show page: update specs * Organization#edit page: change display order * Organization#edit page: ensure headings are consistent with #show page * Organization#edit page: UI fixes * Organization#edit page: update specs * Update user guide for 'bank/getting_started_customization' * Organization edit & show pages: minor reorganization and copy changes
1 parent 91ebd12 commit 4b1cb83

File tree

9 files changed

+419
-406
lines changed

9 files changed

+419
-406
lines changed

app/views/organizations/_details.html.erb

Lines changed: 227 additions & 207 deletions
Large diffs are not rendered by default.

app/views/organizations/edit.html.erb

Lines changed: 67 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<!-- form start -->
5858
<div class="card-body">
5959
<div class="form-inputs">
60+
<h4>Basic information</h4>
6061
<%= f.input :name, required: true, autofocus: true, wrapper: :input_group do %>
6162
<span class="input-group-text"><i class="fa fa-user"></i></span>
6263
<%= f.input_field :name, class: "form-control" %>
@@ -65,49 +66,73 @@
6566
<span class="input-group-text"><i class="fa fa-desktop"></i></span>
6667
<%= f.input_field :short_name, disabled: true, class: "form-control" %>
6768
<% end %>
68-
<%= f.input :ndbn_member, label: 'NDBN Membership', wrapper: :input_group do %>
69-
<%= f.association :ndbn_member, label_method: :full_name, value_method: :id, label: false %>
69+
<%= f.input :ndbn_member, label: "NDBN membership ID", wrapper: :input_group do %>
70+
<div class="mb-n3"> <%# Removes "margin-bottom: 1rem" added by "form-group" class below %>
71+
<%= f.association :ndbn_member, label_method: :full_name, value_method: :id, label: false %>
72+
</div>
7073
<% end %>
71-
<%= f.input :url, as: :url, placeholder: "http://www.example.com", wrapper: :input_group do %>
74+
<%= f.input :url, label: "URL", wrapper: :input_group do %>
7275
<span class="input-group-text"><i class="fa fa-link"></i></span>
73-
<%= f.input_field :url, class: "form-control" %>
76+
<%= f.input_field :url, class: "form-control", placeholder: "http://www.example.com" %>
7477
<% end %>
7578
<%= f.input :email, wrapper: :input_group do %>
7679
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
7780
<%= f.input_field :email, class: "form-control" %>
7881
<% end %>
79-
8082
<%= f.input :address do %>
8183
<span class="input-group-text"><i class="fa fa-address-book"></i></span>
8284
<%= f.input_field :street, class: "form-control", placeholder: "street" %>
8385
<%= f.input_field :city, class: "form-control", placeholder: "city" %>
8486
<%= f.input_field :state, collection: us_states, class: "form-control", placeholder: "state" %>
8587
<%= f.input_field :zipcode, class: "form-control", placeholder: "zipcode" %>
8688
<% end %>
87-
88-
<%= render 'shared/deadline_day_fields', f: f %>
89-
90-
<% default_reminder_email_text_hint = "You can use the variable <code>%{partner_name}</code> to include the partner's name in the message." %>
91-
<%= f.input :reminder_email_text, label: "Additional text for reminder email", hint: default_reminder_email_text_hint.html_safe do %>
92-
<%= f.rich_text_area :reminder_email_text, placeholder: 'Enter reminder email content...' %>
89+
<%= f.input :logo do %>
90+
<% if current_organization.logo.attached? %>
91+
<div>
92+
<p>
93+
<%= image_tag current_organization.logo, class: "main_logo" %>
94+
</p>
95+
<p>
96+
<a href="#showTheLogo" class="btn btn-xs btn-info" data-bs-toggle="modal">
97+
View Original
98+
</a>
99+
</p>
100+
<div id="showTheLogo" class="modal fade">
101+
<div class="modal-dialog gap-2">
102+
<%= image_tag current_organization.logo, class: "thumbnail" %>
103+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
104+
</div>
105+
</div>
106+
</div>
107+
<label class="control-label mr-2">Update Logo</label>
108+
<% end %>
109+
<%= f.input_field :logo, as: :file %>
110+
<p class="help-block">
111+
Logo should be a 4:1 ratio of width / height (default image is 763 x 188 pixels).
112+
Only jpeg/png format is supported. Images should be under 1 MB in size.
113+
</p>
93114
<% end %>
115+
<hr>
94116

95-
<%= f.input :intake_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Intake Location", :include_blank => true, wrapper: :input_group %>
96-
97-
<%= f.label :partner_form_fields, 'Partner Profile Sections' %>
98-
99-
<%= f.select(:partner_form_fields, Organization::ALL_PARTIALS, { include_hidden: true }, { multiple: true, class: 'form-control custom-select', 'data-controller': 'select2', 'data-select2-config-value': '{}'}) %>
100-
101-
<br>
117+
<h4>Storage</h4>
118+
<%= f.input :intake_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default intake Storage Location (for Donations and Purchases)", :include_blank => true, wrapper: :input_group %>
102119
<%= f.input :default_storage_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Storage Location", :include_blank => true, wrapper: :input_group %>
120+
<hr>
103121

104-
<%= f.input :invitation_text, label: "Custom Partner Invitation Message", wrapper: :input_group do %>
122+
<h4>Partner approval process</h4>
123+
<%= f.input :one_step_partner_invite, label: 'Use one-step Partner invite and approve process?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
124+
<%= f.input :invitation_text, label: "Custom Partner invitation message", wrapper: :input_group do %>
105125
<%= f.text_area :invitation_text, class: "form-control" %>
106126
<% end %>
127+
<%= f.label :partner_form_fields, 'Partner Profile sections' %>
128+
<%= f.select(:partner_form_fields, Organization::ALL_PARTIALS, { include_hidden: true }, { multiple: true, class: 'form-control custom-select', 'data-controller': 'select2', 'data-select2-config-value': '{}'}) %>
129+
<br>
130+
<hr>
107131

108-
<%= f.input :repackage_essentials, label: 'Does your bank repackage essentials?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
109-
<%= f.input :distribute_monthly, label: 'Does your bank distribute monthly?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
110-
132+
<h4>What kind of Requests can approved Partners make?</h4>
133+
<%= f.input :enable_child_based_requests, label: 'Enable Partners to make child-based Requests?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
134+
<%= f.input :enable_individual_requests, label: 'Enable Partners to make Requests by indicating number of individuals needing each Item?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
135+
<%= f.input :enable_quantity_based_requests, label: 'Enable Partners to make quantity-based Requests?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
111136
<% if Flipper.enabled?(:enable_packs) %>
112137
<%= label_tag "organization[request_unit_names]", 'Custom request units used. Please use singular form -- e.g. pack, not packs. There will be a default "unit" entry provided.' %>
113138
<%= select_tag(
@@ -127,52 +152,30 @@
127152
}
128153
) %>
129154
<% end %>
155+
<hr>
130156

131-
<%= f.input :enable_child_based_requests, label: 'Enable partners to make child-based requests?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
132-
<%= f.input :enable_individual_requests, label: 'Enable partners to make requests for individuals?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
133-
<%= f.input :enable_quantity_based_requests, label: 'Enable partners to make quantity-based requests?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
134-
<%= f.input :ytd_on_distribution_printout, label: 'Show Year-to-date values on distribution printout?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
135-
<%= f.input :signature_for_distribution_pdf, label: "Include Signature Lines on Distribution Printout?", as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
136-
<%= f.input :one_step_partner_invite, label: 'Use One Step Invite and Approve partner process?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
137-
<%= f.input :hide_value_columns_on_receipt, label: 'Hide both value columns on distribution receipts?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
138-
<%= f.input :hide_package_column_on_receipt, label: 'Hide the package column on distribution receipts?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
139-
<%= f.input :receive_email_on_requests, label: 'Receive email when partner makes a request?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
140-
157+
<h4>Other emails</h4>
158+
<%= render 'shared/deadline_day_fields', f: f %>
159+
<% default_reminder_email_text_hint = "You can use the variable <code>%{partner_name}</code> to include the partner's name in the message." %>
160+
<%= f.input :reminder_email_text, label: "Additional text for reminder email", hint: default_reminder_email_text_hint.html_safe do %>
161+
<%= f.rich_text_area :reminder_email_text, placeholder: 'Enter reminder email content...' %>
162+
<% end %>
141163
<% default_email_text_hint = "You can use the variables <code>%{partner_name}</code>, <code>%{delivery_method}</code>, <code>%{distribution_date}</code>, and <code>%{comment}</code> to include the partner's name, delivery method, distribution date, and comments sent in the request." %>
142-
<%= f.input :default_email_text, label: "Distribution Email Content", hint: default_email_text_hint.html_safe do %>
164+
<%= f.input :default_email_text, label: "Distribution email content", hint: default_email_text_hint.html_safe do %>
143165
<%= f.rich_text_area :default_email_text, placeholder: 'Enter distribution email content...' %>
144166
<% end %>
145-
146-
<%= f.input :logo, wrapper: :input_group do %>
147-
148-
<% if current_organization.logo.attached? %>
149-
<div>
150-
<p>
151-
<%= image_tag current_organization.logo, class: "main_logo" %>
152-
</p>
153-
<p>
154-
<a href="#showTheLogo" class="btn btn-xs btn-info" data-bs-toggle="modal">
155-
View Original
156-
</a>
157-
</p>
158-
<div id="showTheLogo" class="modal fade">
159-
<div class="modal-dialog">
160-
<%= image_tag current_organization.logo, class: "thumbnail" %>
161-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
162-
</div>
163-
</div>
164-
</div>
165-
<label class="control-label">Update Logo</label>
166-
<% end %>
167-
168-
<%= f.input_field :logo, as: :file %>
169-
<p class="help-block">
170-
Logo should be a 4:1 ratio of width / height (default image is 763 x 188 pixels).
171-
Only jpeg/png format is supported. Images should be under 1 MB in size.
172-
</p>
173-
174-
<% end %>
175-
167+
<%= f.input :receive_email_on_requests, label: 'Receive email when Partner makes a Request?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
168+
<hr>
169+
170+
<h4>Printing</h4>
171+
<%= f.input :ytd_on_distribution_printout, label: 'Show year-to-date values on Distribution printout?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
172+
<%= f.input :signature_for_distribution_pdf, label: "Include signature lines on Distribution printout?", as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
173+
<%= f.input :hide_value_columns_on_receipt, label: 'Hide value columns on Distribution and Donation printout?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
174+
<%= f.input :hide_package_column_on_receipt, label: 'Hide package column on Distribution printout?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
175+
176+
<h4>Annual Survey</h4>
177+
<%= f.input :repackage_essentials, label: 'Does your Bank repackage essentials?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
178+
<%= f.input :distribute_monthly, label: 'Does your Bank distribute monthly?', as: :radio_buttons, collection: [[true, 'Yes'], [false, 'No']], label_method: :second, value_method: :first %>
176179
</div>
177180
</div>
178181
<!-- /.card-body -->

app/views/shared/_deadline_day_fields.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}) do %>
99
<div class="deadline-day-pickers__reminder-container">
1010
<%= f.input :reminder_day, wrapper: :input_group, wrapper_html: { class: 'mb-0' },
11-
label: 'Reminder day (Day of month an e-mail reminder is sent to partners to submit requests)' do %>
11+
label: 'Default reminder day (day of month an email reminder to submit Requests is sent to Partners)' do %>
1212
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
1313
<%= f.number_field :reminder_day,
1414
class: "deadline-day-pickers__reminder-day form-control",
@@ -19,7 +19,7 @@
1919

2020
<div class="deadline-day-pickers__deadline-container">
2121
<%= f.input :deadline_day, wrapper: :input_group, wrapper_html: { class: 'mb-0' },
22-
label: 'Deadline day (Final day of month to submit requests)' do %>
22+
label: 'Default deadline day (final day of month to submit Requests)' do %>
2323
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
2424
<%= f.number_field :deadline_day,
2525
class: "deadline-day-pickers__deadline-day form-control",

0 commit comments

Comments
 (0)