diff --git a/app/models/org.rb b/app/models/org.rb index 2a75797..a013eff 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -92,7 +92,7 @@ # defaults to none if no org type present # # @return [String] - def type + def org_type_to_s ret = [] ret << "Institution" if self.institution? ret << "Funder" if self.funder? diff --git a/app/policies/org_policy.rb b/app/policies/org_policy.rb index 039c40d..46fa09c 100644 --- a/app/policies/org_policy.rb +++ b/app/policies/org_policy.rb @@ -12,7 +12,6 @@ end def admin_edit? -puts "WTF!? #{user.can_modify_org_details?} #{user.org_id} == #{org.id}" user.can_modify_org_details? && (user.org_id == org.id || user.can_super_admin?) end diff --git a/app/views/orgs/_profile_form.html.erb b/app/views/orgs/_profile_form.html.erb index abadea8..1dc27d1 100644 --- a/app/views/orgs/_profile_form.html.erb +++ b/app/views/orgs/_profile_form.html.erb @@ -96,7 +96,7 @@ <% else %>
<%= _('Organisation type(s)') %>
-
<%= org.type %>
+
<%= org.org_type_to_s %>
<% end %> diff --git a/app/views/paginable/orgs/_index.html.erb b/app/views/paginable/orgs/_index.html.erb index b4aae61..9adb0c3 100644 --- a/app/views/paginable/orgs/_index.html.erb +++ b/app/views/paginable/orgs/_index.html.erb @@ -14,16 +14,8 @@ <%= org.name %> <%= org.contact_email %> - - <% types = [] %> - <% types << _('Organisation') if org.organisation? %> - <% types << _('Funder') if org.funder? %> - <% types << _('Institution') if org.institution? %> - <%= (types.length > 0 ? types.join(', ') : 'None') %> - - - <%= org.templates.collect(&:dmptemplate_id).uniq.length %> - + <%= org.org_type_to_s %> + <%= org.templates.collect(&:dmptemplate_id).uniq.length %>