Skip to content

Commit

Permalink
Merge pull request #1798 from MushroomObserver/nimmo-cache-try2
Browse files Browse the repository at this point in the history
Fragment-cache matrix boxes on indexes: obs, rss_logs and identify
  • Loading branch information
nimmolo committed Jan 13, 2024
2 parents 0ccf711 + be26815 commit 4e663a4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ gem("turbo-rails")
# gem("redis", "~> 4.0")
# Compile SCSS for stylesheets
gem("sassc-rails")
# add locale to cache key
gem("cache_with_locale")

# Fix a version problem betw stimulus and sprockets. (not sprockets-rails)
# Delete this dependency declaration if the issue gets resolved:
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ GEM
bullet (7.1.5)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
cache_with_locale (0.0.3)
actionview
activesupport
railties
capybara (3.39.2)
addressable
matrix
Expand Down Expand Up @@ -349,6 +353,7 @@ DEPENDENCIES
browser
bullet
bundler
cache_with_locale
capybara (~> 3.37, >= 3.37.1)
cuprite
database_cleaner-active_record
Expand Down
6 changes: 2 additions & 4 deletions app/views/controllers/observations/identify/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ flash_error(@error) if @error && @objects.empty?
<%= tag.ul(class: "row list-unstyled mt-3",
data: { controller: "matrix-table",
action: "resize@window->matrix-table#rearrange" }) do %>
<%= render(partial: "shared/matrix_box",
<%= render(partial: "shared/matrix_box", layout: "shared/matrix_table",
locals: { link_method: :get, identify: true },
layout: "shared/matrix_table",
collection: @objects,
as: :object) %>
collection: @objects, as: :object, cached: true) %>
<div style="clear:left"></div>
<% end %>
<% end %>
Expand Down
3 changes: 1 addition & 2 deletions app/views/controllers/observations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ flash_error(@error) if @error && @objects.empty?
action: "resize@window->matrix-table#rearrange" }) do %>
<%= render(partial: "shared/matrix_box",
layout: "shared/matrix_table",
collection: @objects,
as: :object) %>
collection: @objects, as: :object, cached: true) %>
<div style="clear:left"></div>
<% end %>
<% end %>
6 changes: 2 additions & 4 deletions app/views/controllers/rss_logs/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ flash_error(@error) if @error && @objects.empty?
<%= tag.ul(class: "row list-unstyled mt-3",
data: { controller: "matrix-table",
action: "resize@window->matrix-table#rearrange" }) do %>
<%= render(partial: "shared/matrix_box",
layout: "shared/matrix_table",
collection: @objects,
as: :object) %>
<%= render(partial: "shared/matrix_box", layout: "shared/matrix_table",
collection: @objects, as: :object, cached: true) %>
<div style="clear:left"></div>
<% end %>
<% end %>

0 comments on commit 4e663a4

Please sign in to comment.