Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Added missing Admin kaminari templates

Damian Legawiec5f5853388380
diff --git a/admin/app/views/kaminari/admin-twitter-bootstrap-4/_first_page.html.erb b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_first_page.html.erb
new file mode 100644
index 0000000000..18baabadab
--- /dev/null
+++ b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_first_page.html.erb
@@ -0,0 +1,13 @@
+<%# Link to the "First" page
+ - available local variables
+ url: url to the first page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote -%>
+
+<% unless current_page.first? %>
+ <li class="first page-item">
+ <%= link_to_unless current_page.first?, icon('double-chevron-left', class: 'mb-0'), url, remote: remote, class: 'page-link', 'aria-label': 'First page' %>
+ </li>
+<% end %>
diff --git a/admin/app/views/kaminari/admin-twitter-bootstrap-4/_gap.html.erb b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_gap.html.erb
new file mode 100644
index 0000000000..a7f00c7d12
--- /dev/null
+++ b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_gap.html.erb
@@ -0,0 +1,12 @@
+<%# Non-link tag that stands for skipped pages...
+ - available local variables
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote -%>
+
+<li class="page gap disabled page-item d-none d-lg-flex">
+ <a href="#" onclick="return false;" class="page-link">
+ <%= raw(t 'views.pagination.truncate') %>
+ </a>
+</li>
diff --git a/admin/app/views/kaminari/admin-twitter-bootstrap-4/_last_page.html.erb b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_last_page.html.erb
new file mode 100644
index 0000000000..3de7212584
--- /dev/null
+++ b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_last_page.html.erb
@@ -0,0 +1,13 @@
+<%# Link to the "Last" page
+ - available local variables
+ url: url to the last page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote -%>
+
+<% unless current_page.last? %>
+ <li class="last next page-item"><%# "next" class present for border styling in twitter bootstrap %>
+ <%= link_to_unless current_page.last?, icon('double-chevron-right', class: 'mb-0'), url, remote: remote, class: 'page-link', 'aria-label': 'Last page' %>
+ </li>
+<% end %>
diff --git a/admin/app/views/kaminari/admin-twitter-bootstrap-4/_next_page.html.erb b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_next_page.html.erb
new file mode 100644
index 0000000000..6e3b31efe5
--- /dev/null
+++ b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_next_page.html.erb
@@ -0,0 +1,13 @@
+<%# Link to the "Next" page
+ - available local variables
+ url: url to the next page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote -%>
+
+<% unless current_page.last? %>
+ <li class="next_page page-item">
+ <%= link_to_unless current_page.last?, icon('chevron-right', class: 'text-dark'), url, rel: 'next', remote: remote, class: 'page-link', 'aria-label': 'Next page' %>
+ </li>
+<% end %>
diff --git a/admin/app/views/kaminari/admin-twitter-bootstrap-4/_page.html.erb b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_page.html.erb
new file mode 100644
index 0000000000..a5d6ef1821
--- /dev/null
+++ b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_page.html.erb
@@ -0,0 +1,18 @@
+<%# Link showing page number
+ - available local variables
+ page: a page object for "this" page
+ url: url to this page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote -%>
+
+<li class="page<%= ' active' if page.current? %> page-item">
+ <%= link_to page,
+ url,
+ opts = {
+ remote: remote,
+ rel: page.next? ? 'next' : page.prev? ? 'prev' : nil,
+ class: 'page-link'
+ } %>
+</li>
diff --git a/admin/app/views/kaminari/admin-twitter-bootstrap-4/_paginator.html.erb b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_paginator.html.erb
new file mode 100644
index 0000000000..b4970c9fe1
--- /dev/null
+++ b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_paginator.html.erb
@@ -0,0 +1,17 @@
+<%# The container tag
+ - available local variables
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+ paginator: the paginator that renders the pagination tags inside -%>
+
+<% pagination_class ||= '' %>
+
+<%= paginator.render do %>
+ <ul class="pagination d-inline-flex <%= pagination_class %> mb-0">
+
+ <%= prev_page_tag %>
+ <%= next_page_tag unless current_page.last? %>
+ </ul>
+<% end %>
diff --git a/admin/app/views/kaminari/admin-twitter-bootstrap-4/_prev_page.html.erb b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_prev_page.html.erb
new file mode 100644
index 0000000000..b2e9e73654
--- /dev/null
+++ b/admin/app/views/kaminari/admin-twitter-bootstrap-4/_prev_page.html.erb
@@ -0,0 +1,13 @@
+<%# Link to the "Previous" page
+ - available local variables
+ url: url to the previous page
+ current_page: a page object for the currently displayed page
+ total_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote -%>
+
+<% unless current_page.first? %>
+ <li class="prev page-item">
+ <%= link_to_unless current_page.first?, icon('chevron-left', class: 'text-dark'), url, rel: 'prev', remote: remote, class: 'page-link', 'aria-label': 'Previous page' %>
+ </li>
+<% end %>