app/views/shared/_pagination.html.erb in tybo-0.0.40 vs app/views/shared/_pagination.html.erb in tybo-0.1.0

- old
+ new

@@ -1,27 +1,29 @@ <% link = pagy_link_proc(pagy) -%> <nav class="mx-auto mt-6 flex max-w-7xl justify-between px-4 text-sm font-medium text-gray-700 sm:px-6 lg:px-8" role="navigation"> - <% if pagy.prev -%> + + <% if pagy.prev -%> <div class="min-w-0 flex-1"> <%== link.call(pagy.prev, I18n.t('bo.nav.prev'), 'aria-label="previous" class="inline-flex h-10 items-center rounded-md border border-gray-300 bg-white px-4 hover:bg-gray-100 focus:border-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600""') %> </div> - <% else -%> + <% else -%> <div class="min-w-0 flex-1"> <%== link.call(pagy.prev, I18n.t('bo.nav.prev'), 'aria-label="previous" class="hidden"') %> </div> <% end -%> - <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%> - <% if item.is_a?(Integer) -%> - <%== link.call(item, item, 'class="inline-flex h-10 items-center rounded-md border border-gray-300 bg-white px-4 hover:bg-gray-100 focus:border-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600"') %> - <% elsif item.is_a?(String) -%> - <%== link.call(item, item, 'class="toto inline-flex h-10 items-center rounded-md border border-tybo-600 bg-white px-4 ring-1 ring-tybo-600 hover:bg-gray-100 focus:border-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600"') %> - <% elsif item == :gap -%> - <span class="inline-flex h-10 items-center px-1.5 text-gray-500"> - <%== I18n.t('bo.nav.gap') %> - </span> + <% if pagy.next -%> + <% pagy.series.each do |item| + # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%> + <% if item.is_a?(Integer) -%> + <%== link.call(item, item, 'class="inline-flex h-10 items-center rounded-md border border-gray-300 bg-white px-4 hover:bg-gray-100 focus:border-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600"') %> + <% elsif item.is_a?(String) -%> + <%== link.call(item, item, 'class="inline-flex h-10 items-center rounded-md border border-tybo-600 bg-white px-4 ring-1 ring-tybo-600 hover:bg-gray-100 focus:border-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600"') %> + <% elsif item == :gap -%> + <span class="inline-flex h-10 items-center px-1.5 text-gray-500"> + <%== I18n.t('bo.nav.gap') %> + </span> + <% end -%> <% end -%> - <% end -%> - <% if pagy.next -%> <div class="flex min-w-0 flex-1 justify-end"> <%== link.call(pagy.next, I18n.t('bo.nav.next'), 'aria-label="next" class="inline-flex h-10 items-center rounded-md border border-gray-300 bg-white px-4 hover:bg-gray-100 focus:border-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600"') %> </div> <% else -%> <div class="flex min-w-0 flex-1 justify-end">