diff --git a/resources/views/yuuno/elements/pagination.twig b/resources/views/yuuno/elements/pagination.twig deleted file mode 100644 index 670d1d4..0000000 --- a/resources/views/yuuno/elements/pagination.twig +++ /dev/null @@ -1,24 +0,0 @@ -{% set paginationSeparator %}{% if '%3F' in paginationUrl|default('')|url_encode %}&{% else %}?{% endif %}{% endset %} -{% set paginationPage = get.page|default(1) %} - -
- {% if paginationPages is defined and paginationPages|length > 1 %} - {% if paginationPage > 1 %} - {% if paginationPages|length > 2 %} - - {% endif %} - - {% endif %} - {% for id,page in paginationPages %} - {% if (id + 1) > (paginationPage - 3) and (id + 1) < (paginationPage + 3) %} - {{ id + 1 }} - {% endif %} - {% endfor %} - {% if paginationPage < paginationPages|length %} - - {% if paginationPages|length > 2 %} - - {% endif %} - {% endif %} - {% endif %} -
diff --git a/resources/views/yuuno/profile/friends.twig b/resources/views/yuuno/profile/friends.twig index f317519..8d52877 100644 --- a/resources/views/yuuno/profile/friends.twig +++ b/resources/views/yuuno/profile/friends.twig @@ -1,7 +1,6 @@ -{% set friends = profile.friends(2)|batch(12) %} +{% from 'macros.twig' import pagination %} -{% set paginationPages = friends %} -{% set paginationUrl %}{{ route('user.profile', profile.id) }}{% endset %} +{% set friends = profile.friends(2)|batch(12) %}

Friends

@@ -23,6 +22,6 @@
{% if friends|length > 1 %}
- {% include 'elements/pagination.twig' %} + {{ pagination(route('user.profile', profile.id), friends, get.page|default(1)) }}
{% endif %} diff --git a/resources/views/yuuno/settings/friends/listing.twig b/resources/views/yuuno/settings/friends/listing.twig index 406b983..689a354 100644 --- a/resources/views/yuuno/settings/friends/listing.twig +++ b/resources/views/yuuno/settings/friends/listing.twig @@ -1,10 +1,8 @@ {% extends 'settings/friends/master.twig' %} +{% from 'macros.twig' import pagination %} {% set friends = user.friends(1)|batch(12) %} -{% set paginationPages = friends %} -{% set paginationUrl %}{{ route('settings.friends.listing') }}{% endset %} - {% set mode = 'Listing' %} {% block description %} @@ -29,7 +27,7 @@ {% if friends|length > 1 %}
- {% include 'elements/pagination.twig' %} + {{ pagination(route('settings.friends.listing'), friends, get.page|default(1)) }}
{% endif %} {% else %} diff --git a/resources/views/yuuno/settings/friends/requests.twig b/resources/views/yuuno/settings/friends/requests.twig index 6b44a95..7f7c182 100644 --- a/resources/views/yuuno/settings/friends/requests.twig +++ b/resources/views/yuuno/settings/friends/requests.twig @@ -1,10 +1,8 @@ {% extends 'settings/friends/master.twig' %} +{% from 'macros.twig' import pagination %} {% set friends = user.friends(-1)|batch(12) %} -{% set paginationPages = friends %} -{% set paginationUrl %}{{ route('settings.friends.requests') }}{% endset %} - {% set mode = 'Requests' %} {% block description %} @@ -30,7 +28,7 @@ {% if friends|length > 1 %}
- {% include 'elements/pagination.twig' %} + {{ pagination(route('settings.friends.requests'), friends, get.page|default(1)) }}
{% endif %} {% else %} diff --git a/resources/views/yuuno/user/members.twig b/resources/views/yuuno/user/members.twig index 8e833b9..63e2f55 100644 --- a/resources/views/yuuno/user/members.twig +++ b/resources/views/yuuno/user/members.twig @@ -1,4 +1,5 @@ {% extends 'master.twig' %} +{% from 'macros.twig' import pagination %} {% set sorts = ['boxes', 'rectangles', 'list'] %} {% set sort = get is defined and get.sort is defined and get.sort in sorts ? get.sort : sorts[0] %} @@ -11,9 +12,6 @@ {% set currPage = get.page|default(1) - 1 %} -{% set paginationPages = users %} -{% set paginationUrl %}{% if rank %}{{ route('members.rank', rank) }}{% else %}{{ route('members.index') }}{% endif %}{% endset %} - {% block content %}

{{ title }}

@@ -95,7 +93,7 @@ {% endif %}
{% if users|length > 1 %} - {% include 'elements/pagination.twig' %} + {{ pagination(rank ? route('members.rank', rank) : route('members.index'), users, get.page|default(1)) }} {% endif %} {% endif %}