add pagination to templates/users/submissions
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render 'shared/pagination', pagy: @pagy %>
|
||||
<% else %>
|
||||
<div class="card bg-base-200 h-96 mb-2">
|
||||
<div class="card-body text-center">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% 'input-error' %>
|
||||
<span class="label-text-alt text-red-400">
|
||||
<span class="label-text-alt text-red-400 mt-1">
|
||||
<%= message %>
|
||||
</span>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<% link = pagy_link_proc(@pagy) %>
|
||||
<% if @pagy.pages > 1 %>
|
||||
<div class="flex my-6 items-center justify-center md:justify-end">
|
||||
<div class="join">
|
||||
<% if @pagy.prev %>
|
||||
<%== link.call(@pagy.prev, "«", 'class="join-item btn btn-sm"') %>
|
||||
<% else %>
|
||||
<span class="join-item btn btn-sm btn-disabled !bg-base-200">«</span>
|
||||
<% end %>
|
||||
<span class="join-item btn btn-sm uppercase">
|
||||
Page <%= @pagy.page %>
|
||||
</span>
|
||||
<% if @pagy.next %>
|
||||
<%== link.call(@pagy.next, "»", 'class="join-item btn btn-sm"') %>
|
||||
<% else %>
|
||||
<span class="join-item btn btn-sm btn-disabled !bg-base-200">»</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -62,39 +62,41 @@
|
||||
<td>
|
||||
<% submission.submitters.each do |submitter| %>
|
||||
<%= submitter.email %>
|
||||
</br>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% submission.submitters.each do |submitter| %>
|
||||
<div>
|
||||
<span class="badge badge-info badge-outline">
|
||||
<%= submitter.status %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% submission.submitters.each do |submitter| %>
|
||||
<% share_link_input_id = "share-link-input_#{submitter.id}" %>
|
||||
<div class="join ">
|
||||
<input id="<%= share_link_input_id %>" autocomplete="off" type="text" class="input input-xs input-bordered join-item" value="<%= submit_form_url(slug: submitter.slug) %>" disabled>
|
||||
<clipboard-copy class="btn btn-xs btn-neutral btn-square join-item text-white font-bold swap swap-active" for="<%= share_link_input_id %>">
|
||||
<%= svg_icon('clipboard', class: 'w-3 h-3 swap-on text-white') %>
|
||||
<%= svg_icon('clipboard_copy', class: 'w-3 h-3 swap-off text-white') %>
|
||||
</clipboard-copy>
|
||||
</div>
|
||||
<br/>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="flex items-center space-x-2 justify-end">
|
||||
<%= link_to 'View', submission_path(submission), title: 'View', class: 'btn btn-outline btn-xs' %>
|
||||
<%= button_to 'Remove', submission_path(submission), class: 'btn btn-outline btn-error btn-xs', title: 'Delete', method: :delete, data: { turbo_confirm: 'Are you sure?' } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% submission.submitters.each do |submitter| %>
|
||||
<div>
|
||||
<span class="badge badge-info badge-outline">
|
||||
<%= submitter.status %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% submission.submitters.each do |submitter| %>
|
||||
<% share_link_input_id = "share-link-input_#{submitter.id}" %>
|
||||
<div class="join ">
|
||||
<input id="<%= share_link_input_id %>" autocomplete="off" type="text" class="input input-xs input-bordered join-item" value="<%= submit_form_url(slug: submitter.slug) %>" disabled>
|
||||
<clipboard-copy class="btn btn-xs btn-neutral btn-square join-item text-white font-bold swap swap-active" for="<%= share_link_input_id %>">
|
||||
<%= svg_icon('clipboard', class: 'w-3 h-3 swap-on text-white') %>
|
||||
<%= svg_icon('clipboard_copy', class: 'w-3 h-3 swap-off text-white') %>
|
||||
</clipboard-copy>
|
||||
</div>
|
||||
<br>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="flex items-center space-x-2 justify-end">
|
||||
<%= link_to 'View', submission_path(submission), title: 'View', class: 'btn btn-outline btn-xs' %>
|
||||
<%= button_to 'Remove', submission_path(submission), class: 'btn btn-outline btn-error btn-xs', title: 'Delete', method: :delete, data: { turbo_confirm: 'Are you sure?' } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%= render 'shared/pagination', pagy: @pagy %>
|
||||
<% else %>
|
||||
<%= render 'shared/no_data_banner' %>
|
||||
<% end %>
|
||||
|
||||
@@ -58,5 +58,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%= render 'shared/pagination', pagy: @pagy %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user