Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
atdb-ldv
Commits
b5f98e8b
Commit
b5f98e8b
authored
1 year ago
by
Alissa Cheng
Browse files
Options
Downloads
Patches
Plain Diff
replace django-bootstrap-pagination
parent
83d4909c
Branches
Branches containing commit
No related tags found
1 merge request
!337
Upgrade to django 5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+5
-1
5 additions, 1 deletion
.gitignore
atdb/requirements/base.txt
+2
-2
2 additions, 2 deletions
atdb/requirements/base.txt
atdb/taskdatabase/templates/taskdatabase/pagination.html
+16
-10
16 additions, 10 deletions
atdb/taskdatabase/templates/taskdatabase/pagination.html
with
23 additions
and
13 deletions
.gitignore
+
5
−
1
View file @
b5f98e8b
/atdb/logs/
/atdb/logs/
\ No newline at end of file
**/venv/
**/.idea/
**/__pycache__/
*.sql
This diff is collapsed.
Click to expand it.
atdb/requirements/base.txt
+
2
−
2
View file @
b5f98e8b
astronauth==0.3.3
astronauth==0.3.3
Django==
4.1.3
Django==
5
django-allauth==0.57.0 # note allauth only supports Django >= 3.2
django-allauth==0.57.0 # note allauth only supports Django >= 3.2
django-bootstrap-pagination==1.7.1
django-bootstrap-pagination==1.7.1
django-bootstrap3==23.6
django-bootstrap3==23.6
...
@@ -8,7 +8,7 @@ django-extensions==3.1.0
...
@@ -8,7 +8,7 @@ django-extensions==3.1.0
django-filter==2.3.0
django-filter==2.3.0
#django-silk==5.0.3
#django-silk==5.0.3
django-tables2==2.3.4
django-tables2==2.3.4
djangorestframework==3.1
2.2
djangorestframework==3.1
4
fontawesome-free==5.15.2
fontawesome-free==5.15.2
oauthlib==3.2.2
oauthlib==3.2.2
psycopg2-binary==2.9.3
psycopg2-binary==2.9.3
...
...
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/templates/taskdatabase/pagination.html
+
16
−
10
View file @
b5f98e8b
{% if my_tasks %}
<div
class=
"btn-group"
role=
"group"
aria-label=
"Item pagination"
style=
"margin-bottom: 1rem"
>
{% if my_tasks.has_other_pages %}
<div
class=
"btn-group"
role=
"group"
aria-label=
"Item pagination"
>
{% if my_tasks.has_previous %}
{% if my_tasks.has_previous %}
<a
href=
"?page={{ my_tasks.previous_page_number }}"
class=
"btn btn-outline-primary"
>
«
</a>
<a
href=
"?page=1"
class=
"btn btn-outline-primary"
>
First
</a>
<a
href=
"?page={{ my_tasks.previous_page_number }}"
class=
"btn btn-outline-primary"
>
Prev
</a>
{% else %}
<button
class=
"btn btn-outline-primary"
disabled
>
First
</button>
<button
class=
"btn btn-outline-primary"
disabled
>
Prev
</button>
{% endif %}
{% endif %}
{% for page_number in my_tasks.paginator.page_range %}
{% for page_number in my_tasks.paginator.page_range %}
...
@@ -11,7 +13,11 @@
...
@@ -11,7 +13,11 @@
<button
class=
"btn btn-outline-primary active"
>
<button
class=
"btn btn-outline-primary active"
>
<span>
{{ page_number }}
<span
class=
"sr-only"
>
(current)
</span></span>
<span>
{{ page_number }}
<span
class=
"sr-only"
>
(current)
</span></span>
</button>
</button>
{% else %}
{% elif my_tasks.number
<
5
and
page_number
<
10
or
my_tasks.number
>
my_tasks.paginator.num_pages|add:"-5" and page_number > my_tasks.paginator.num_pages|add:"-9" %}
<a
href=
"?page={{ page_number }}"
class=
"btn btn-outline-primary"
>
{{ page_number }}
</a>
{% elif page_number
<
my_tasks.number
and
page_number
>
my_tasks.number|add:"-5" or page_number > my_tasks.number and page_number
<
my_tasks.number
|
add:5
%}
<
a
href=
"?page={{ page_number }}"
class=
"btn btn-outline-primary"
>
<
a
href=
"?page={{ page_number }}"
class=
"btn btn-outline-primary"
>
{{ page_number }}
{{ page_number }}
</a>
</a>
...
@@ -19,10 +25,10 @@
...
@@ -19,10 +25,10 @@
{% endfor %}
{% endfor %}
{% if my_tasks.has_next %}
{% if my_tasks.has_next %}
<a
href=
"?page={{ my_tasks.next_page_number }}"
class=
"btn btn-outline-primary"
>
»
</a>
<a
href=
"?page={{ my_tasks.next_page_number }}"
class=
"btn btn-outline-primary"
>
Next
</a>
<a
href=
"?page={{ my_tasks.paginator.num_pages }}"
class=
"btn btn-outline-primary"
>
Last
</a>
{% else %}
<button
class=
"btn btn-outline-primary"
disabled
>
Next
</button>
<button
class=
"btn btn-outline-primary"
disabled
>
Last
</button>
{% endif %}
{% endif %}
</div>
</div>
{% endif %}
{% else %}
<p>
No items found.
</p>
{% endif %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment