Skip to content

Commit 82d8787

Browse files
authored
Merge branch 'main' into 5231-cancel-requests-deactivated-partners
2 parents 9fb244a + fa48014 commit 82d8787

File tree

17 files changed

+129
-217
lines changed

17 files changed

+129
-217
lines changed

app/controllers/admin/organizations_controller.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
# [Super Admin] This is for administrating organizations at a global level. We can create, view, modify, etc.
22
class Admin::OrganizationsController < AdminController
3-
def edit
4-
@organization = Organization.find(params[:id])
5-
end
6-
7-
def update
8-
@organization = Organization.find(params[:id])
9-
10-
if OrganizationUpdateService.update(@organization, organization_params)
11-
redirect_to admin_organizations_path, notice: "Updated organization!"
12-
else
13-
flash.now[:error] = @organization.errors.full_messages.join("\n")
14-
render :edit
15-
end
16-
end
17-
183
def index
194
@filterrific = initialize_filterrific(
205
Organization.alphabetized,

app/models/user.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ def display_name
9595
name.presence || "Name Not Provided"
9696
end
9797

98+
def preferred_name
99+
name.presence || email
100+
end
101+
98102
def formatted_email
99103
email.present? ? "#{name} <#{email}>" : ""
100104
end

app/views/adjustments/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
</div>
3939
<div class="form-group col-lg-4 col-md-4 col-sm-6 col-xs-12">
40-
<%= filter_select(scope: :by_user, collection: @users, key: :id, value: :name, selected: @selected_user) %>
40+
<%= filter_select(scope: :by_user, collection: @users, key: :id, value: :preferred_name, selected: @selected_user) %>
4141
</div>
4242
<div class="form-group col-lg-4 col-md-4 col-sm-6 col-xs-12">
4343
<%= label_tag "Date Range" %>

app/views/admin/organizations/_list.html.erb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<td class="date"><%= organization.display_last_distribution_date %></td>
2020
<td class="text-right">
2121
<%= view_button_to admin_organization_path(organization.id) %>
22-
<%= edit_button_to edit_admin_organization_path(organization.id) %>
2322
<%= delete_button_to(admin_organization_path(organization.id), { confirm: confirm_delete_msg(organization.name) }) unless (Organization.count <= 1) %>
2423
</td>
2524
</tr>

app/views/admin/organizations/edit.html.erb

Lines changed: 0 additions & 115 deletions
This file was deleted.

app/views/distribution_mailer/partner_mailer.html.erb

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,6 @@
217217
margin-bottom: 0;
218218
}
219219

220-
.preheader {
221-
color: transparent;
222-
display: none;
223-
height: 0;
224-
max-height: 0;
225-
max-width: 0;
226-
opacity: 0;
227-
overflow: hidden;
228-
mso-hide: all;
229-
visibility: hidden;
230-
width: 0;
231-
}
232-
233220
.powered-by a {
234221
text-decoration: none;
235222
}
@@ -328,7 +315,6 @@
328315
<div class="content">
329316

330317
<!-- START CENTERED WHITE CONTAINER -->
331-
<span class="preheader">You have a new distribution from <%= @partner.organization.name %>. Please refer to the attachment for details.</span>
332318
<table role="presentation" class="main">
333319

334320
<!-- START MAIN CONTENT AREA -->
@@ -339,10 +325,15 @@
339325
<td>
340326
From: <a href="mailto:<%= @from_email %>"><%= @from_email %></a>
341327
</td>
342-
</tr>
328+
</tr>
343329
<tr>
344330
<td>
345-
<%= @default_email_text_interpolated.html_safe %>
331+
<% if @default_email_text.present? %>
332+
<%= @default_email_text_interpolated.html_safe %>
333+
<% elsif @distribution_changes.blank? %>
334+
You have a new distribution from <%= @partner.organization.name %>.
335+
Please refer to the attachment for details.
336+
<% end %>
346337
</td>
347338
</tr>
348339
<% if @distribution_changes.present? %>

app/views/reports/_distribution.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
<% end %>
77
</div>
88
<div class="pull-right">
9-
<%= distance_of_time_in_words_to_now distribution.created_at %> ago
9+
<%= distance_of_time_in_words_to_now distribution.issued_at %> ago
1010
</div>

app/views/reports/_donation.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
<% end %>
66
</div>
77
<div class="pull-right">
8-
<%= distance_of_time_in_words_to_now donation.created_at %> ago
8+
<%= distance_of_time_in_words_to_now donation.issued_at %> ago
99
</div>

app/views/reports/_purchase.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
<% end %>
66
</div>
77
<div class="pull-right">
8-
<%= distance_of_time_in_words_to_now purchase.created_at %> ago
8+
<%= distance_of_time_in_words_to_now purchase.issued_at %> ago
99
</div>

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def set_up_flipper
6060
namespace :admin do
6161
get :dashboard
6262
resources :base_items
63-
resources :organizations
63+
resources :organizations, except: %i[edit update]
6464
resources :partners, except: %i[new create]
6565
resources :users do
6666
delete :remove_role

0 commit comments

Comments
 (0)