[openstreetmap/openstreetmap-website] Add sorting and filtering functionality to user notes page (PR #5255)

Anton Khorev notifications at github.com
Thu Oct 17 10:23:51 UTC 2024


@AntonKhorev commented on this pull request.



> @@ -6,41 +7,69 @@
            :commented => tag.span(t(".subheading_commented"), :class => "px-2 py-1 bg-body") %></p>
 <% end %>
 
-<% if @notes.empty? %>
-  <h4><%= t ".no_notes" %></h4>
+<%= form_tag(url_for("controller" => "notes", "action" => "index"), "method" => :get, "data" => { "turbo" => true, "turbo-frame" => "pagination", "turbo-action" => "advance" }) do %>
+  <div class="row gx-2">
+    <div class="col-md-auto mb-3">
+      <%= label_tag :status, t(".status") %>
+      <%= select_tag  :status,
+                      options_for_select([[t(".all"), "all"], [t(".open"), "open"], [t(".closed"), "closed"]], params[:status] || "all"),
+                      :class => "form-select",
+                      :onchange => "this.form.requestSubmit()" %>

`onchange` is not going to work with the `csp_enforce: true` setting.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5255/review/2374797957 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241017/7380919e/attachment.htm>


More information about the rails-dev mailing list