style: adjust pagination button sizes
- Change button classes from `btn` to `btn btn-xs` for all pagination buttons - Ensure consistent styling across all pagination elements These changes standardize the button sizes in the pagination component, improving the visual uniformity. The adjustment enhances user experience by making the pagination buttons more appropriately sized within the interface, without affecting functionality.
This commit is contained in:
parent
05449d1e7f
commit
09b3f06ad4
@ -12,7 +12,7 @@
|
|||||||
<div class="join shadow-lg">
|
<div class="join shadow-lg">
|
||||||
<!-- 首页 -->
|
<!-- 首页 -->
|
||||||
<%= link_to url_for(page: 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
<%= link_to url_for(page: 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
||||||
class: "join-item btn #{collection.first_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
class: "join-item btn btn-xs #{collection.first_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7" />
|
||||||
</svg>
|
</svg>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<!-- 上一页 -->
|
<!-- 上一页 -->
|
||||||
<%= link_to url_for(page: collection.prev_page || 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
<%= link_to url_for(page: collection.prev_page || 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
||||||
class: "join-item btn #{collection.first_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
class: "join-item btn btn-xs #{collection.first_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||||
</svg>
|
</svg>
|
||||||
@ -33,35 +33,35 @@
|
|||||||
|
|
||||||
<% if start_page > 1 %>
|
<% if start_page > 1 %>
|
||||||
<%= link_to 1, url_for(page: 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
<%= link_to 1, url_for(page: 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
||||||
class: "join-item btn btn-ghost hover:bg-primary/5" %>
|
class: "join-item btn btn-xs btn-ghost hover:bg-primary/5" %>
|
||||||
<% if start_page > 2 %>
|
<% if start_page > 2 %>
|
||||||
<button class="join-item btn btn-ghost btn-disabled">...</button>
|
<button class="join-item btn btn-xs btn-ghost btn-disabled">...</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% (start_page..end_page).each do |page| %>
|
<% (start_page..end_page).each do |page| %>
|
||||||
<% if page == collection.current_page %>
|
<% if page == collection.current_page %>
|
||||||
<button class="join-item btn btn-ghost bg-primary/10 font-medium">
|
<button class="join-item btn btn-xs btn-ghost bg-primary/10 font-medium">
|
||||||
<%= page %>
|
<%= page %>
|
||||||
</button>
|
</button>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to page, url_for(page: page, region: params[:region], country: params[:country], sort: params[:sort]),
|
<%= link_to page, url_for(page: page, region: params[:region], country: params[:country], sort: params[:sort]),
|
||||||
class: "join-item btn btn-ghost hover:bg-primary/5" %>
|
class: "join-item btn btn-xs btn-ghost hover:bg-primary/5" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if end_page < collection.total_pages %>
|
<% if end_page < collection.total_pages %>
|
||||||
<% if end_page < collection.total_pages - 1 %>
|
<% if end_page < collection.total_pages - 1 %>
|
||||||
<button class="join-item btn btn-ghost btn-disabled">...</button>
|
<button class="join-item btn btn-xs btn-ghost btn-disabled">...</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to collection.total_pages,
|
<%= link_to collection.total_pages,
|
||||||
url_for(page: collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
url_for(page: collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
||||||
class: "join-item btn btn-ghost hover:bg-primary/5" %>
|
class: "join-item btn btn-xs btn-ghost hover:bg-primary/5" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- 下一页 -->
|
<!-- 下一页 -->
|
||||||
<%= link_to url_for(page: collection.next_page || collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
<%= link_to url_for(page: collection.next_page || collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
||||||
class: "join-item btn #{collection.last_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
class: "join-item btn btn-xs #{collection.last_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||||
</svg>
|
</svg>
|
||||||
@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
<!-- 末页 -->
|
<!-- 末页 -->
|
||||||
<%= link_to url_for(page: collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
<%= link_to url_for(page: collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
||||||
class: "join-item btn #{collection.last_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
class: "join-item btn btn-xs #{collection.last_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5l7 7-7 7M5 5l7 7-7 7" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5l7 7-7 7M5 5l7 7-7 7" />
|
||||||
</svg>
|
</svg>
|
||||||
|
Loading…
Reference in New Issue
Block a user