[openstreetmap/openstreetmap-website] Use turbo for pagination (PR #4646)

David Tsiklauri notifications at github.com
Tue Aug 20 07:32:24 UTC 2024


@nertc requested changes on this pull request.

The change is functional, only the needed parts are rendered, and pagination works properly with history advancing and optimizations. After these two lines will be corrected, I think, this PR will be ready for merging.

> +    <tr>
+      <td width="25%" class="<%= "text-body-secondary" unless comment.visible? %>"><%= link_to comment.diary_entry.title, diary_entry_path(comment.diary_entry.user, comment.diary_entry) %></td>
+      <td width="25%" class="<%= "text-body-secondary" unless comment.visible? %>">
+        <%= friendly_date_ago(comment.created_at) %>
+      </td>
+      <td width="50%" class="richtext text-break<%= " text-body-secondary" unless comment.visible? %>"><%= comment.body.to_html %></td>
+    </tr>
+    <% end -%>
+  </table>
+
+  <%= render "shared/pagination",
+             :newer_key => "diary_comments.page.newer_comments",
+             :older_key => "diary_comments.page.older_comments",
+             :newer_id => @newer_comments_id,
+             :older_id => @older_comments_id %>
+</frame>

`turbo-frame` tag was opened, but `frame` tag was closed. Instead of `</frame>` should be `</turbo-frame>`

> +             :older_key => "traces.page.older",
+             :newer_id => @newer_traces_id,
+             :older_id => @older_traces_id %>
+
+  <table id="trace_list" class="table table-borderless table-striped">
+    <tbody>
+      <%= render @traces %>
+    </tbody>
+  </table>
+
+  <%= render "shared/pagination",
+             :newer_key => "traces.page.newer",
+             :older_key => "traces.page.older",
+             :newer_id => @newer_traces_id,
+             :older_id => @older_traces_id %>
+</turbo-frame id="pagination">

Closing tag doesn't need `id`. Instead of `</turbo-frame id="pagination">` should be `</turbo-frame>`

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4646#pullrequestreview-2247165755
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4646/review/2247165755 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240820/cc914f33/attachment.htm>


More information about the rails-dev mailing list