diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 075371b..749d989 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -9,7 +9,8 @@ def admin_index authorize Template #institutional templates - @dmptemplates_own = Template.own_institutional_templates(current_user.org_id) + #@dmptemplates_own = Template.own_institutional_templates(current_user.org_id) + @dmptemplates_own = Template.where(org_id: current_user.org_id) #funders templates @dmptemplates_funders = Template.funders_templates end diff --git a/app/views/templates/admin_index.html.erb b/app/views/templates/admin_index.html.erb index 9af877a..76edad8 100644 --- a/app/views/templates/admin_index.html.erb +++ b/app/views/templates/admin_index.html.erb @@ -16,13 +16,13 @@
<%= link_to t("org_admin.templates.create_template"), admin_new_template_path, - :class => 'btn btn-primary' %> + class: 'btn btn-primary' %>
-<% if @dmptemplates_own.count > 0 then %> +<% if @dmptemplates_own.length > 0 then %> @@ -80,7 +80,7 @@ - <% if @dmptemplates_funders.count > 0 then %> + <% if @dmptemplates_funders.length > 0 then %>
@@ -112,15 +112,6 @@
<% last_updated = org_template.updated_at %> - <% org_template.phases.each do |phase|%> - <% if phase.versions.any? then%> - <% phase.versions.each do |version| %> - <% if org_template.updated_at.to_date < version.updated_at.to_date then %> - <% last_updated = version.updated_at %> - <%end%> - <%end%> - <%end%> - <%end%> <%= l last_updated.to_date, :formats => :short %>