Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing pagination links to index pages #10

Merged
merged 1 commit into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# CHANGELOG

### v1.0.0
### Unreleased - [View Diff](https://github.com/westonganger/rails_i18n_manager/compare/v1.0.0...master)
- [#10](https://github.com/westonganger/rails_i18n_manager/pull/10) - Add missing pagination links to index pages

### v1.0.0 - [View Diff](https://github.com/westonganger/rails_i18n_manager/compare/9c8305c...v1.0.0)
- Release to rubygems

### April 17, 2023
Expand Down
3 changes: 3 additions & 0 deletions app/views/rails_i18n_manager/kaminari/_first_page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<li class="page-item">
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' %>
</li>
3 changes: 3 additions & 0 deletions app/views/rails_i18n_manager/kaminari/_gap.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<li class='page-item disabled'>
<%= link_to raw(t 'views.pagination.truncate'), '#', class: 'page-link' %>
</li>
3 changes: 3 additions & 0 deletions app/views/rails_i18n_manager/kaminari/_last_page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<li class="page-item">
<%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, remote: remote, class: 'page-link' %>
</li>
3 changes: 3 additions & 0 deletions app/views/rails_i18n_manager/kaminari/_next_page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<li class="page-item">
<%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' %>
</li>
9 changes: 9 additions & 0 deletions app/views/rails_i18n_manager/kaminari/_page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<% if page.current? %>
<li class="page-item active">
<%= content_tag :a, page, data: { remote: remote }, rel: page.rel, class: 'page-link' %>
</li>
<% else %>
<li class="page-item">
<%= link_to page, url, remote: remote, rel: page.rel, class: 'page-link' %>
</li>
<% end %>
17 changes: 17 additions & 0 deletions app/views/rails_i18n_manager/kaminari/_paginator.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<%= paginator.render do %>
<nav>
<ul class="pagination">
<%= 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 %>
<% end %>
<% end %>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
</nav>
<% end %>
3 changes: 3 additions & 0 deletions app/views/rails_i18n_manager/kaminari/_prev_page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<li class="page-item">
<%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' %>
</li>
2 changes: 2 additions & 0 deletions app/views/rails_i18n_manager/translation_apps/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ table.table.table-striped.table-hover.space-above3.list-table
td = x.additional_locales_array.join(", ")
td
= link_to "Edit", {action: :edit, id: x.id}

= paginate @translation_apps, views_prefix: "rails_i18n_manager"
2 changes: 2 additions & 0 deletions app/views/rails_i18n_manager/translations/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ table.table.table-striped.table-hover.space-above3.list-table

- if x.any_missing_translations?
span.space-left2 = link_to "Translate with Google", translate_missing_translations_path(id: x.id), method: :post, "data-confirm" => "Are you sure you want to proceed with translating the missing translations for this entry?"

= paginate @translation_keys, views_prefix: "rails_i18n_manager"