Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Refactor Plan.deep_copy(plan) [#3469](https://github.com/DMPRoadmap/roadmap/pull/3469)
- Fixed a bug in the deep copy of plans where the old identifier was being copied into the new plan. We now copy the generated id of the new plan to the identifier field.
- Fixed bar chart click function in the Usage dashboard (GitHub issue #3443)
- Retain "Published" etc. Filter Setting When Applying Search or "View All" on `/org_admin/templates/` Pages [#3475](https://github.com/DMPRoadmap/roadmap/pull/3475)


**Note this upgrade is mainly a migration from Bootstrap 3 to Bootstrap 5.**
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/concerns/paginable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def paginable_base_url(page = 1)
action: @args[:action],
page: page
)
# Retain :f if paginable/templates controller is using it to filter templates
url_params[:f] = @args[:f] if @args[:f].present? && @args[:controller] == 'paginable/templates'
url_for(url_params)
end

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/paginable/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def index
paginable_renderise(
partial: 'index',
scope: templates,
query_params: { sort_field: 'templates.title', sort_direction: :asc },
query_params: { sort_field: 'templates.title', sort_direction: :asc, f: params[:f] },
locals: { action: 'index' },
format: :json
)
Expand All @@ -50,7 +50,7 @@ def organisational
paginable_renderise(
partial: 'organisational',
scope: templates,
query_params: { sort_field: 'templates.title', sort_direction: :asc },
query_params: { sort_field: 'templates.title', sort_direction: :asc, f: params[:f] },
locals: { action: 'organisational' },
format: :json
)
Expand Down Expand Up @@ -78,7 +78,7 @@ def customisable
paginable_renderise(
partial: 'customisable',
scope: templates.joins(:org).includes(:org),
query_params: { sort_field: 'templates.title', sort_direction: :asc },
query_params: { sort_field: 'templates.title', sort_direction: :asc, f: params[:f] },
locals: { action: 'customisable', customizations: customizations },
format: :json
)
Expand Down
2 changes: 2 additions & 0 deletions app/views/shared/_search.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<%= label_tag(:filter_admin, _('Only Show Admins'), class: 'form-check-label') %>
</div>
<% end %>
<%# :f corresponds to the "Published" vs "Unpublished" etc. filters defined on the org_admin/templates pages %>
<%= hidden_field_tag :f, params[:f] if params[:f].present? %>
<%= submit_tag(_('Search'), class: 'btn btn-secondary ms-2') %>
</div>
</div>
Expand Down
Loading