From 213e79fb21d2d3f6cc629ba1899b5e0922b68f3f Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Wed, 18 Sep 2024 11:46:04 +0300 Subject: [PATCH] localize and style pagy fix --- app/assets/stylesheets/components/_pagy.scss | 40 +++++++++++++++ config/locales/pagy.en.yml | 52 +++++++++++++------ config/locales/pagy.et.yml | 53 ++++++++++++++------ 3 files changed, 114 insertions(+), 31 deletions(-) diff --git a/app/assets/stylesheets/components/_pagy.scss b/app/assets/stylesheets/components/_pagy.scss index 45323feb6..6d64b6366 100644 --- a/app/assets/stylesheets/components/_pagy.scss +++ b/app/assets/stylesheets/components/_pagy.scss @@ -1,3 +1,43 @@ +.dataTables_filter { + .pagy.nav { + display: flex; + justify-content: center; + align-items: center; + gap: rem(8px); + + a { + width: rem(32px); + height: rem(32px); + border-radius: rem(16px) !important; + border: 1px solid $grey-200-color !important; + display: flex !important; + justify-content: center; + align-items: center; + padding: 0 !important; + font-weight: 500; + font-size: rem(14px); + line-height: rem(24px); + text-decoration: none; + color: $black-color !important; + + &[aria-current="page"] { + background-color: $primary-green-color !important; + border-color: $primary-green-color !important; + color: $white-color !important; + } + + &[aria-disabled="true"] { + opacity: 0.5; + cursor: not-allowed; + } + + &:hover:not([aria-disabled="true"]) { + background-color: $grey-200-color !important; + } + } + } +} + .pagy-nav .page.prev, .pagy-nav .page.prev a, .pagy-nav .page.next, diff --git a/config/locales/pagy.en.yml b/config/locales/pagy.en.yml index 324b6d30c..927f6b070 100644 --- a/config/locales/pagy.en.yml +++ b/config/locales/pagy.en.yml @@ -1,22 +1,44 @@ -en: - pagy: +# en: +# pagy: + +# per_page: "Displaying items" + +# item_name: +# one: "item" +# other: "items" + +# nav: +# prev: 'Prev' +# next: 'Next' +# gap: "…" + +# info: +# no_items: "No %{item_name} found" +# single_page: "Displaying %{count} %{item_name}" +# multiple_pages: "Displaying %{item_name} %{from}-%{to} of %{count} in total" + +# combo_nav_js: "" - per_page: "Displaying items" +# items_selector_js: "" + +en: + pagy: + aria_label: + nav: + one: "Page" + other: "Pages" + prev: "Previous" + next: "Next" + prev: "<" + next: ">" + gap: "…" item_name: one: "item" other: "items" - - nav: - prev: 'Prev' - next: 'Next' - gap: "…" - info: no_items: "No %{item_name} found" - single_page: "Displaying %{count} %{item_name}" - multiple_pages: "Displaying %{item_name} %{from}-%{to} of %{count} in total" - - combo_nav_js: "" - - items_selector_js: "" \ No newline at end of file + single_page: "Displaying %{count} %{item_name}" + multiple_pages: "Displaying %{item_name} %{from}-%{to} of %{count} in total" + combo_nav_js: "Page %{page_input} of %{pages}" + limit_selector_js: "Show %{limit_input} %{item_name} per page" \ No newline at end of file diff --git a/config/locales/pagy.et.yml b/config/locales/pagy.et.yml index 2874a7052..037f17f07 100644 --- a/config/locales/pagy.et.yml +++ b/config/locales/pagy.et.yml @@ -1,22 +1,43 @@ -et: - pagy: +# et: +# pagy: - per_page: "Tulemusi lehel" +# per_page: "Tulemusi lehel" - item_name: - one: "kirje" - other: "kirjet" +# item_name: +# one: "kirje" +# other: "kirjet" - nav: - prev: 'Eelmised' - next: 'Järgmised' - gap: "…" +# nav: +# prev: 'Eelmised' +# next: 'Järgmised' +# gap: "…" - info: - no_items: "%{item_name} ei leitud" - single_page: "Kuvan %{count} %{item_name}" - multiple_pages: "Kuvan %{item_name} %{from}-%{to} / %{count}-st" +# info: +# no_items: "%{item_name} ei leitud" +# single_page: "Kuvan %{count} %{item_name}" +# multiple_pages: "Kuvan %{item_name} %{from}-%{to} / %{count}-st" + +# combo_nav_js: "" - combo_nav_js: "" +# items_selector_js: "" - items_selector_js: "" \ No newline at end of file +et: + pagy: + aria_label: + nav: + one: "Page" + other: "Pages" + prev: "Previous" + next: "Next" + prev: "<" + next: ">" + gap: "…" + item_name: + one: "item" + other: "items" + info: + no_items: "No %{item_name} found" + single_page: "Displaying %{count} %{item_name}" + multiple_pages: "Displaying %{item_name} %{from}-%{to} of %{count} in total" + combo_nav_js: "Page %{page_input} of %{pages}" + limit_selector_js: "Show %{limit_input} %{item_name} per page" \ No newline at end of file