Files
gollum/lib/gollum/views/pagination.rb
T
benjamin wil 738d6f6ec4 Start localizing the views (#1797)
* Internationalize `Views::Compare` templates

* Internationalize `Views::Error` templates

* Internationalize `Views::History` templates

* Internationalize `Views::LatestChanges` templates

* Internationalize `Views::Layout` templates

* Internationalize `Views::Overview` templates

* Internationalize `Views::Search` templates

* Reset I18n load path after I18n helper tests

* Create locale helper for global translations

There are some translation strings we should use across multiple views.
Instead of duplicating the translations, we can use a different locale
helper method, `#tt`, to get a hash of all available translations.

Then, in a partial view like `pagination.mustache`, we can render
translations regardless of what the current view class is.

This commit adds the necessary helper, tests, and uses the new method to
render translations on the `pagination.mustache` template, which is used
by many other view classes (latest changes, history, and search).
2022-07-30 17:01:05 -07:00

14 lines
254 B
Ruby

module Precious
module Pagination
def next_page
result_set = @versions || results
result_set.length < @max_count ? nil : (@page_num + 1).to_s
end
def previous_page
@page_num == 1 ? nil : (@page_num - 1).to_s
end
end
end