Skip to content

Commit

Permalink
Add first/last links in pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterPhilip authored and cdubz committed May 5, 2024
1 parent 31c6f5b commit c850d44
Show file tree
Hide file tree
Showing 40 changed files with 231 additions and 97 deletions.
24 changes: 24 additions & 0 deletions babybuddy/static_src/fontello/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,30 @@
"css": "tag",
"code": 59414,
"src": "fontawesome"
},
{
"uid": "f3f90c8c89795da30f7444634476ea4f",
"css": "angle-left",
"code": 61700,
"src": "fontawesome"
},
{
"uid": "7bf14281af5633a597f85b061ef1cfb9",
"css": "angle-right",
"code": 61701,
"src": "fontawesome"
},
{
"uid": "745f12abe1472d14f8f658de7e5aba66",
"css": "angle-double-left",
"code": 61696,
"src": "fontawesome"
},
{
"uid": "fdfbd1fcbd4cb229716a810801a5f207",
"css": "angle-double-right",
"code": 61697,
"src": "fontawesome"
}
]
}
4 changes: 4 additions & 0 deletions babybuddy/static_src/fontello/css/babybuddy-codes.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
.icon-tag:before { content: '\e816'; } /* '' */
.icon-height:before { content: '\f044'; } /* '' */
.icon-dashboard:before { content: '\f0e4'; } /* '' */
.icon-angle-double-left:before { content: '\f100'; } /* '' */
.icon-angle-double-right:before { content: '\f101'; } /* '' */
.icon-angle-left:before { content: '\f104'; } /* '' */
.icon-angle-right:before { content: '\f105'; } /* '' */
.icon-tummytime:before { content: '\f118'; } /* '' */
.icon-sad:before { content: '\f119'; } /* '' */
.icon-source:before { content: '\f126'; } /* '' */
Expand Down
16 changes: 10 additions & 6 deletions babybuddy/static_src/fontello/css/babybuddy-embedded.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions babybuddy/static_src/fontello/css/babybuddy-ie7-codes.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
.icon-tag { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-height { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-dashboard { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-double-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-double-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-tummytime { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-sad { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-source { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
Expand Down
4 changes: 4 additions & 0 deletions babybuddy/static_src/fontello/css/babybuddy-ie7.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
.icon-tag { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-height { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-dashboard { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-double-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-double-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-angle-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-tummytime { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-sad { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-source { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
Expand Down
18 changes: 11 additions & 7 deletions babybuddy/static_src/fontello/css/babybuddy.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@font-face {
font-family: 'babybuddy';
src: url('../font/babybuddy.eot?34829963');
src: url('../font/babybuddy.eot?34829963#iefix') format('embedded-opentype'),
url('../font/babybuddy.woff2?34829963') format('woff2'),
url('../font/babybuddy.woff?34829963') format('woff'),
url('../font/babybuddy.ttf?34829963') format('truetype'),
url('../font/babybuddy.svg?34829963#babybuddy') format('svg');
src: url('../font/babybuddy.eot?7641592');
src: url('../font/babybuddy.eot?7641592#iefix') format('embedded-opentype'),
url('../font/babybuddy.woff2?7641592') format('woff2'),
url('../font/babybuddy.woff?7641592') format('woff'),
url('../font/babybuddy.ttf?7641592') format('truetype'),
url('../font/babybuddy.svg?7641592#babybuddy') format('svg');
font-weight: normal;
font-style: normal;
}
Expand All @@ -15,7 +15,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'babybuddy';
src: url('../font/babybuddy.svg?34829963#babybuddy') format('svg');
src: url('../font/babybuddy.svg?7641592#babybuddy') format('svg');
}
}
*/
Expand Down Expand Up @@ -79,6 +79,10 @@
.icon-tag:before { content: '\e816'; } /* '' */
.icon-height:before { content: '\f044'; } /* '' */
.icon-dashboard:before { content: '\f0e4'; } /* '' */
.icon-angle-double-left:before { content: '\f100'; } /* '' */
.icon-angle-double-right:before { content: '\f101'; } /* '' */
.icon-angle-left:before { content: '\f104'; } /* '' */
.icon-angle-right:before { content: '\f105'; } /* '' */
.icon-tummytime:before { content: '\f118'; } /* '' */
.icon-sad:before { content: '\f119'; } /* '' */
.icon-source:before { content: '\f126'; } /* '' */
Expand Down
24 changes: 19 additions & 5 deletions babybuddy/static_src/fontello/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@
}
@font-face {
font-family: 'babybuddy';
src: url('./font/babybuddy.eot?22207665');
src: url('./font/babybuddy.eot?22207665#iefix') format('embedded-opentype'),
url('./font/babybuddy.woff?22207665') format('woff'),
url('./font/babybuddy.ttf?22207665') format('truetype'),
url('./font/babybuddy.svg?22207665#babybuddy') format('svg');
src: url('./font/babybuddy.eot?82997938');
src: url('./font/babybuddy.eot?82997938#iefix') format('embedded-opentype'),
url('./font/babybuddy.woff?82997938') format('woff'),
url('./font/babybuddy.ttf?82997938') format('truetype'),
url('./font/babybuddy.svg?82997938#babybuddy') format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down Expand Up @@ -302,6 +302,20 @@ <h1>
<div class="span3" title="Code: 0xf0e4">
<i class="demo-icon icon-dashboard">&#xf0e4;</i> <span class="i-name">icon-dashboard</span><span class="i-code">0xf0e4</span>
</div>
<div class="span3" title="Code: 0xf100">
<i class="demo-icon icon-angle-double-left">&#xf100;</i> <span class="i-name">icon-angle-double-left</span><span class="i-code">0xf100</span>
</div>
<div class="span3" title="Code: 0xf101">
<i class="demo-icon icon-angle-double-right">&#xf101;</i> <span class="i-name">icon-angle-double-right</span><span class="i-code">0xf101</span>
</div>
<div class="span3" title="Code: 0xf104">
<i class="demo-icon icon-angle-left">&#xf104;</i> <span class="i-name">icon-angle-left</span><span class="i-code">0xf104</span>
</div>
</div>
<div class="row">
<div class="span3" title="Code: 0xf105">
<i class="demo-icon icon-angle-right">&#xf105;</i> <span class="i-name">icon-angle-right</span><span class="i-code">0xf105</span>
</div>
<div class="span3" title="Code: 0xf118">
<i class="demo-icon icon-tummytime">&#xf118;</i> <span class="i-name">icon-tummytime</span><span class="i-code">0xf118</span>
</div>
Expand Down
Binary file modified babybuddy/static_src/fontello/font/babybuddy.eot
Binary file not shown.
8 changes: 8 additions & 0 deletions babybuddy/static_src/fontello/font/babybuddy.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified babybuddy/static_src/fontello/font/babybuddy.ttf
Binary file not shown.
Binary file modified babybuddy/static_src/fontello/font/babybuddy.woff
Binary file not shown.
Binary file modified babybuddy/static_src/fontello/font/babybuddy.woff2
Binary file not shown.
81 changes: 43 additions & 38 deletions babybuddy/static_src/scss/global.scss
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
@use 'sass:map';

// Baby Buddy site-wide custom styles.

// Remove extra margin below site breadcrumb.
.breadcrumb {
margin-bottom: 0;
}

// Extra-small button.
.btn-xs {
@include button-size(.2rem, .12rem, .75rem, .2rem);
}

// Right align main dropdown menu.
.dropdown-menu-end {
right: 0;
left: auto; // Reset the default from `.dropdown-menu`
}

// PullToRefresh elements.
.ptr--ptr {
background: map.get($theme-colors, 'dark');
.ptr--text, .ptr--icon {
// "!important" must be used to override inline styling from JS.
color: map.get($theme-colors, 'light') !important;
}
}

// Larger icon variant.
.icon-2x {
font-size: 1.65em;
}

// All modals
.modal-content {
color: map.get($theme-colors, 'dark');
}
@use 'sass:map';

// Baby Buddy site-wide custom styles.

// Remove extra margin below site breadcrumb.
.breadcrumb {
margin-bottom: 0;
}

// Extra-small button.
.btn-xs {
@include button-size(.2rem, .12rem, .75rem, .2rem);
}

// Right align main dropdown menu.
.dropdown-menu-end {
right: 0;
left: auto; // Reset the default from `.dropdown-menu`
}

// PullToRefresh elements.
.ptr--ptr {
background: map.get($theme-colors, 'dark');
.ptr--text, .ptr--icon {
// "!important" must be used to override inline styling from JS.
color: map.get($theme-colors, 'light') !important;
}
}

// Larger icon variant.
.icon-2x {
font-size: 1.65em;
}

// All modals
.modal-content {
color: map.get($theme-colors, 'dark');
}

// Pagination
.page-link-icon {
padding: var(--bs-pagination-padding-y) calc(var(--bs-pagination-padding-x) / 1.75);
}
83 changes: 49 additions & 34 deletions babybuddy/templates/babybuddy/paginator.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
{% load i18n babybuddy %}
{% if is_paginated %}
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
{% if page_obj.has_previous %}
<li class="page-item">
<a class="page-link"
href="{% relative_url 'page' page_obj.previous_page_number %}"
aria-label="Previous">
<i class="icon-angle-circled-left" aria-hidden="true"></i>
<span class="visually-hidden">{% trans "Previous" %}</span>
</a>
</li>
{% endif %}
{% for num in page_obj.paginator.page_range %}
{% if num > page_obj.number|add:"-3" and num < page_obj.number|add:"3" %}
<li class="page-item{% if num == page_obj.number %} active{% endif %}">
<a class="page-link" href="{% relative_url 'page' num %}">{{ num }}</a>
</li>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<li class="page-item">
<a class="page-link"
href="{% relative_url 'page' page_obj.next_page_number %}"
aria-label="Next">
<i class="icon-angle-circled-right" aria-hidden="true"></i>
<span class="visually-hidden">{% trans "Next" %}</span>
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
{% load i18n babybuddy %}
{% if is_paginated %}
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
{% if page_obj.has_previous %}
<li class="page-item">
<a class="page-link page-link-icon"
href="{% relative_url 'page' 1 %}"
aria-label="First">
<i class="icon-angle-double-left" aria-hidden="true"></i>
<span class="visually-hidden">{% trans "First" %}</span>
</a>
<li class="page-item">
<a class="page-link page-link-icon"
href="{% relative_url 'page' page_obj.previous_page_number %}"
aria-label="Previous">
<i class="icon-angle-left" aria-hidden="true"></i>
<span class="visually-hidden">{% trans "Previous" %}</span>
</a>
</li>
{% endif %}
{% for num in page_obj.paginator.page_range %}
{% if num > page_obj.number|add:"-3" and num < page_obj.number|add:"3" %}
<li class="page-item{% if num == page_obj.number %} active{% endif %}">
<a class="page-link" href="{% relative_url 'page' num %}">{{ num }}</a>
</li>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<li class="page-item">
<a class="page-link page-link-icon"
href="{% relative_url 'page' page_obj.next_page_number %}"
aria-label="Next">
<i class="icon-angle-right" aria-hidden="true"></i>
<span class="visually-hidden">{% trans "Next" %}</span>
</a>
</li>
<li class="page-item">
<a class="page-link page-link-icon"
href="{% relative_url 'page' page_obj.paginator.num_pages %}"
aria-label="Last">
<i class="icon-angle-double-right" aria-hidden="true"></i>
<span class="visually-hidden">{% trans "Last" %}</span>
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
22 changes: 19 additions & 3 deletions static/babybuddy/css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified static/babybuddy/css/app.css.gz
Binary file not shown.

0 comments on commit c850d44

Please sign in to comment.