<p></p>
<p><b>@tomhughes</b> requested changes on this pull request.</p>
<p dir="auto">I think it might be better to split this into two commits - one that switches issues to use the common pagination helpers and a second to introduce turbo support.</p><hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5057#discussion_r1721013173">app/views/issues/_page.html.erb</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,40 @@
+<turbo-frame id="pagination" data-turbo-action="advance">
+ <% if @issues.length == 0 %>
+ <p><%= t(@user_not_found ? ".user_not_found" : ".issues_not_found") %></p>
+ <% else %>
</pre>
<p dir="auto">I think this first branch should be outside the pagination frame because it's not actually paginated - only the else clause should be inside the frame as that is the part that can be navigated to different pages.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5057#discussion_r1721013395">app/views/issues/_page.html.erb</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,40 @@
+<turbo-frame id="pagination" data-turbo-action="advance">
</pre>
<p dir="auto">This shouldn't have <code class="notranslate">data-turbo-action</code> but should have <code class="notranslate">target="_top"</code> and the advance action (and <code class="notranslate">pagination</code> as a target) should be on the next/previous buttons (which <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2223589340" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4646" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4646/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4646">#4646</a> takes care of) so that other links inside the pagination section will break out to a full page load.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5057#discussion_r1721014284">app/controllers/issues_controller.rb</a>:</p>
<pre style='color:#555'>> @@ -39,6 +44,10 @@ def index
last_updated_by = params[:last_updated_by].to_s == "nil" ? nil : params[:last_updated_by].to_i
@issues = @issues.where(:updated_by => last_updated_by)
end
+
+ @issues, @newer_issues_id, @older_issues_id = get_page_items(@issues, :limit => @params[:limit])
+
+ render :partial => "page" if turbo_frame_request_id == "pagination" || turbo_frame_request_id == "search"
</pre>
<p dir="auto">I think the second part of this condition is wrong (in fact it's not clear to be the <code class="notranslate">search</code> frame is needed at all) and instead the search form should have a <code class="notranslate">data-turbo-frame="pagination"</code> attribute to target loading of the pagination frame.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5057#discussion_r1721014311">app/views/issues/index.html.erb</a>:</p>
<pre style='color:#555'>> @@ -4,72 +4,42 @@
<p><%= t ".search_guidance" %></p>
-<%= form_tag(issues_path, :method => :get) do %>
- <div class="row gx-1">
- <div class="mb-3 col-md-auto">
- <%= select_tag :status,
- options_for_select(Issue.aasm.states.map(&:name).map { |state| [t(".states.#{state}"), state] }, params[:status]),
- :include_blank => t(".select_status"),
- :data => { :behavior => "category_dropdown" },
- :class => "form-select" %>
+<turbo-frame id="search">
</pre>
<p dir="auto">Do we actually need this frame? When does it get updated?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5057#pullrequestreview-2244353971">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOKBICB4CDPG7W6TNTZSDETXAVCNFSM6AAAAABMEAEFBKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDENBUGM2TGOJXGE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLJFUP6EXP2D3P4BHOTZSDETXA5CNFSM6AAAAABMEAEFBKWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUFYYP3G.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5057/review/2244353971</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5057#pullrequestreview-2244353971",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5057#pullrequestreview-2244353971",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>