Commit 6c1a7cb

mo khan <mo@mokhan.ca>
2017-02-12 01:44:01
update navigation.
1 parent ddd7f5c
app/views/kaminari/_gap.html.erb
@@ -1,1 +1,1 @@
-<li aria-hidden="true" class="ellipsis"></li>
+<li><span class="pagination-ellipsis">&hellip;</span></li>
app/views/kaminari/_next_page.html.erb
@@ -1,7 +1,5 @@
 <% if current_page.last? %>
-   <li class="pagination-next disabled"><%= raw(t 'views.pagination.next')%></li>
+  <%= link_to raw(t 'views.pagination.next'), url, :remote => remote, class: 'pagination-next disabled' %>
 <% else %>
-  <li class="pagination-next">
-    <%= link_to raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
-  </li>
+  <%= link_to raw(t 'views.pagination.next'), url, :remote => remote, class: 'pagination-next' %>
 <% end %>
app/views/kaminari/_page.html.erb
@@ -1,7 +1,3 @@
-<li class="<%= 'current' if page.current? %>">
-  <% if page.current? %>
-    <span class="show-for-sr">You're on page</span> <%= page %>
-  <% else %>
-    <%= link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
-  <% end %>
+<li>
+  <%= link_to page, url, remote: remote, class: "pagination-link #{'is-current' if page.current?}" %>
 </li>
app/views/kaminari/_paginator.html.erb
@@ -1,15 +1,15 @@
 <%= paginator.render do %>
-  <ul aria-label="Pagination" class="pagination text-center" role="navigation">
-    <% first_page_tag unless current_page.first? %>
-    <%= prev_page_tag unless current_page.first? %>
-    <% each_page do |page| %>
-      <% if page.left_outer? || page.right_outer? || page.inside_window? %>
-        <%= page_tag page %>
-      <% elsif !page.was_truncated? %>
-        <%= gap_tag %>
+  <nav class="pagination is-centered">
+    <%= prev_page_tag %>
+    <ul class="pagination-list">
+      <% each_page do |page| %>
+        <% if page.left_outer? || page.right_outer? || page.inside_window? %>
+          <%= page_tag page %>
+        <% elsif !page.was_truncated? %>
+          <%= gap_tag %>
+        <% end %>
       <% end %>
-    <% end %>
+    </ul>
     <%= next_page_tag %>
-    <% last_page_tag unless current_page.last? %>
-  </ul>
+  </nav>
 <% end %>
app/views/kaminari/_prev_page.html.erb
@@ -1,7 +1,5 @@
 <% if current_page.first? %>
-  <li class="pagination-previous disabled">Previous</li>
+  <%= link_to raw(t 'views.pagination.previous'), url, remote: remote, class: 'pagination-previous', disabled: 'disabled' %>
 <% else %>
-  <li class="pagination-previous">
-    <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
-  </li>
+  <%= link_to raw(t 'views.pagination.previous'), url, remote: remote, class: 'pagination-previous' %>
 <% end %>
app/views/layouts/application.html.erb
@@ -15,9 +15,8 @@
   <body class="<%= controller_name %> <%= action_name %>">
     <%= render partial: "navigation" %>
     <%= render partial: 'layouts/flash' %>
-
-    <%= yield %>
     <%= render partial: 'loading' %>
+    <%= yield %>
     <%= render partial: 'footer' %>
   </body>
 </html>