Skip to content
Commit d57c86f0 authored by Azz-eddine BERRAMOU's avatar Azz-eddine BERRAMOU
Browse files

Remove pager theme functions and theme pager

parent b08cc694
Loading
Loading
Loading
Loading
  • Alex @aprogs ·
    Maintainer

    Overridden template renders pagination like « First ‹‹ 1 2 3 4 5 6 7 8 9 … ›› Last » and doesn't highlight current page. Original behavior looks like: <- 1 2 [3] 4 ... 15 -> (for the 3rd page). Please take a look at the comment at the top of the removed file (pager.inc).

  • Author Developer

    highlight current page

    Fixed.

    I changed default value of « First to <- and Last » to -> but user can change it from views ui.

    Edited by Azz-eddine BERRAMOU
  • Alex @aprogs ·
    Maintainer

    Thanks for the updates.

    Just to be clear about pagination logic. Here is how the pager looks like now:

    Screenshot_from_2019-11-25_16-47-01

    Code that has been cleaned up formatted pager like:

    Screenshot_from_2019-11-25_16-49-16

  • Author Developer

    The « First and Last » configured in the view ui, just remove them, pager will take the default ones <- and ->, i think we shouldn't remove that option and make them always <- and ->, user can set the label of the view. Screen_Shot_2019-11-25_at_17.34.36

    Edited by Azz-eddine BERRAMOU
  • Alex @aprogs ·
    Maintainer

    Thanks for explanation. Currently pagination shows 9 pages in a row and then three dots (which mean that there are some more pages). Second screenshot shows previous version of the pagination. The left and right arrows allow the user jump to the previous and next pages respectively. Also, here are:

    • First and last pages are represented as a number (it's possible to jump right to the first or last page).
    • Highlighted current, previous and next pages around the current one (in case when it's 4th page).

    Here is how the pagination worked for other count of pages:

    On page 1: [1] 2 ... 15 ->

    On page 2: <- 1 [2] 3 ... 15 ->

    On page 3: <- 1 2 [3] 4 ... 15 ->

    On page 4: <- 1 ... 3 [4] 5 ... 15 ->

    On page 15: <- 1 ... 14 [15]

    Here [x] means current highlighted page, <- and -> are represented as icons with .left.arrow and .right.arrow Fomantic UI classes.

    Please feel free to ask questions, if any.

  • Author Developer

    Hello i have fixed it. Now the output like the following: Screen_Shot_2019-12-01_at_20.46.13

    If there is any suggestions, you are welcome.

  • Alex @aprogs ·
    Maintainer

    Thanks for the update. Currently pagination looks like:

    Screenshot_from_2019-12-03_13-11-09

    It would be good to use original behavior, e.g. on the second page old pagination looks like:

    Screenshot_from_2019-12-03_13-13-54

  • Author Developer

    Actually it would be good to have something like <- 1 << ... 3 [4] 5 ... >> 15 ->

    • [] active page Highlighted
    • >> Go to next page
    • << Go to previous page
    • ... ellipsis if there are further next pages

    It doesn't make sense to represent previous and next page with ... I suggest let ... for ellipsis as Drupal did

        {% if ellipses.next %}
            <div class="pager__item pager__item--ellipsis disabled item" role="presentation">&hellip;</div>
          {% endif %}

    and represent Go to previous page by angle.double.left.icon and Go to next page by .angle.double .right.icon Result:

    Screen_Shot_2019-12-04_at_21.20.38

    What do you think? I didn't commit this yet.

    Edited by Azz-eddine BERRAMOU
  • Alex @aprogs ·
    Maintainer

    It doesn't make sense to represent previous and next page with ...

    Old pagination didn't use ... in navigation purposes. Menu item with ... had class .disabled and didn't receive pointer events (default behavior provided by Fomantic UI).

    and represent Go to previous page by angle.double.left.icon and Go to next page by .angle.double .right.icon

    Navigation to the previous and to the next pages is pretty simple: they surround current page. Also, it's possible to use related arrows at the beginning and at the end of the pager. For example, here is how old pagination looks like for the 4th page:

    Screenshot_from_2019-11-25_16-49-16

    Here the user may click 3rd and 5th pages before and after the current one respectively.

    Here is how the pagination worked for other pages:

    On page 1: [1] 2 ... 15 ->

    On page 2: <- 1 [2] 3 ... 15 ->

    On page 3: <- 1 2 [3] 4 ... 15 ->

    On page 4: <- 1 ... 3 [4] 5 ... 15 ->

    On page 15: <- 1 ... 14 [15]

    Please let me know if something is not clear.

  • Author Developer

    Check now: Here is the result now Screen_Shot_2019-12-06_at_00.00.37

  • Alex @aprogs ·
    Maintainer

    With recent changes pagination looks like:

    Screenshot_from_2019-12-06_18-28-33

    Some pages are doubled, first one in the previous example and last one here:

    Screenshot_from_2019-12-06_18-34-36

    For the 3rd page old pagination looked like:

    Screenshot_from_2019-12-06_18-37-00

    If a page with pagination has path like dev.site.com/content?page=37&foo=bar then there is a warning:

    Warning: A non-numeric value encountered in __TwigTemplate_ad7d09fb1d5af834983d36126012d0c35a52d0fbb186721e77d73a470ba6a7ae->doDisplay() (line 137 of sites/default/files/php/twig/5dea5ceba26e0_pager.html.twig_3aUPv7dAsKgu0LiqTfaS5LLs8/nF924rhrtYvMtR_t4CsBLPHK2RuVdm4SIRU3LrUOgtg.php).

    And pager looks like:

    Screenshot_from_2019-12-06_18-40-06

    Please let me know if something is not clear.

  • Author Developer

    Done! check please, if it's okay

    Edited by Azz-eddine BERRAMOU
  • Alex @aprogs ·
    Maintainer

    Thanks for the commit. On the 5th page current pagination looks like:

    Screenshot_from_2019-12-10_12-16-02

    Here is old variation:

    Screenshot_from_2019-12-10_12-22-13

    Here is left arrow which switches pagination to the previous page, first page, three dots (.disabled.item), previous page, current highlighted page, next page, three dots, last page and right arrow which switches pagination to the next page.

  • Author Developer

    This is the actual behavior take a look at the following screenshot.Screen_Shot_2019-12-10_at_19.00.01

  • Alex @aprogs ·
    Maintainer

    Looks like the pager has different behavior, here is how it looks like for the log records:

    Screenshot_from_2019-12-11_17-59-16

    In this example there are no text for the first, previous, next and last pages:

    Screenshot_from_2019-12-11_18-01-48

    Expected behavior for the 6th page would be:

    Screenshot_from_2019-12-11_18-02-36

    Please let me know if something is not clear.

  • Alex @aprogs ·
    Maintainer

    After cleaning up old code pagination looks like:

    Screenshot_from_2019-12-12_14-41-19

    Which is closer to behavior of the old variation. :-)

  • Alex @aprogs ·
    Maintainer

    Ok, looks like here is more than 2 weeks of inactivity. The pagination menu has been updated to use original behavior. Please let me know if you have any questions.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment