Skip to content

Commit

Permalink
Fix bugs with organization templates listings
Browse files Browse the repository at this point in the history
When choosing an organization that had a customized version of the
default template, the system showed both the detault template and the
organization customized version.

The system now shows the institutional templates that were removed due
to the changes in new plan view.
  • Loading branch information
lagoan committed Jun 16, 2021
1 parent 619e47b commit 29fb3c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog
## [2.1.3+portage-1.0.10] - 2021-06-03

## Fixed
- Removed references to organizations customized template and to default template
- Restored missing institutional templates
## [2.1.3+portage-1.0.10] - 2021-06-03

## Added
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/template_options_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ def index

customization = Template.default unless customization

@templates.select! { |t| t.id != customization.id }
@templates.select! { |t| t.id != Template.default.id || t.id != customization.id}

# We want the default template to appear at the beggining of the list
@templates.unshift(customization)
end

end

private
Expand Down
2 changes: 2 additions & 0 deletions app/views/plans/new_plan.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
<%= f.hidden_field(:visibility, value: @is_test ? 'is_test' : Rails.application.config.default_plan_visibility) %>
<%= f.button(_('Create plan'), class: "btn btn-primary", type: "submit") %>
<%= link_to _('Cancel'), plans_path, class: 'btn btn-default' %>

<%= hidden_field(:plan, :funder_id, value: '') %>
<% end %>
</div>
</div>

0 comments on commit 29fb3c2

Please sign in to comment.