Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
DIGIPUS
Commits
53ef1c54
Commit
53ef1c54
authored
Oct 30, 2020
by
Azhar Rais
Browse files
[REFACTOR] Move redundant pagination for Home and Detail to forum_pagination.html
parent
1e49ee1b
Pipeline
#59984
passed with stages
in 12 minutes and 32 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
forum/templates/forum/forum_discussion_detail.html
View file @
53ef1c54
...
...
@@ -132,37 +132,7 @@
</div>
</div>
</div>
<nav
aria-label=
"Discussion Detail Pagination"
>
<ul
class=
"pagination justify-content-center"
>
{% if page_obj.has_previous %}
<li
class=
"page-item"
>
<a
class=
"page-link"
href=
"?page={{ page_obj.previous_page_number }}"
tabindex=
"-1"
>
Previous
</a>
</li>
{% else %}
<li
class=
"page-item disabled"
>
<a
class=
"page-link"
href=
""
tabindex=
"-1"
>
Previous
</a>
</li>
{% endif %}
{% for page in pages %}
{% if page == "..." %}
<li
class=
"page-item disabled"
><a
class=
"page-link"
href=
""
>
{{ page }}
</a></li>
{% else %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"?page={{ page }}"
>
{{ page }}
</a></li>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<li
class=
"page-item"
>
<a
class=
"page-link"
href=
"?page={{ page_obj.next_page_number }}"
tabindex=
"-1"
>
Next
</a>
</li>
{% else %}
<li
class=
"page-item disabled"
>
<a
class=
"page-link"
href=
""
tabindex=
"-1"
>
Next
</a>
</li>
{% endif %}
</ul>
</nav>
{% include 'forum/forum_pagination.html' %}
</div>
{% endblock content %}
{% block extra_scripts %}
...
...
forum/templates/forum/forum_home.html
View file @
53ef1c54
...
...
@@ -31,36 +31,6 @@
{% empty %}
<h4
id=
"no-discussion"
>
There is no discussion at the moment
</h4>
{% endfor %}
<nav
aria-label=
"Page navigation example"
>
<ul
class=
"pagination justify-content-center"
>
{% if page_obj.has_previous %}
<li
class=
"page-item"
>
<a
class=
"page-link"
href=
"?page={{ page_obj.previous_page_number }}"
tabindex=
"-1"
>
Previous
</a>
</li>
{% else %}
<li
class=
"page-item disabled"
>
<a
class=
"page-link"
href=
""
tabindex=
"-1"
>
Previous
</a>
</li>
{% endif %}
{% for page in pages %}
{% if page == "..." %}
<li
class=
"page-item disabled"
><a
class=
"page-link"
href=
""
>
{{ page }}
</a></li>
{% else %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"?page={{ page }}"
>
{{ page }}
</a></li>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<li
class=
"page-item"
>
<a
class=
"page-link"
href=
"?page={{ page_obj.next_page_number }}"
tabindex=
"-1"
>
Next
</a>
</li>
{% else %}
<li
class=
"page-item disabled"
>
<a
class=
"page-link"
href=
""
tabindex=
"-1"
>
Next
</a>
</li>
{% endif %}
</ul>
</nav>
{% include 'forum/forum_pagination.html' %}
</div>
{% endblock content %}
\ No newline at end of file
forum/templates/forum/forum_pagination.html
0 → 100644
View file @
53ef1c54
<nav
aria-label=
"Page navigation example"
>
<ul
class=
"pagination justify-content-center"
>
{% if page_obj.has_previous %}
<li
class=
"page-item"
>
<a
class=
"page-link"
href=
"?page={{ page_obj.previous_page_number }}"
tabindex=
"-1"
>
Previous
</a>
</li>
{% else %}
<li
class=
"page-item disabled"
>
<a
class=
"page-link"
href=
""
tabindex=
"-1"
>
Previous
</a>
</li>
{% endif %}
{% for page in pages %}
{% if page == "..." %}
<li
class=
"page-item disabled"
><a
class=
"page-link"
href=
""
>
{{ page }}
</a></li>
{% else %}
<li
class=
"page-item"
><a
class=
"page-link"
href=
"?page={{ page }}"
>
{{ page }}
</a></li>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<li
class=
"page-item"
>
<a
class=
"page-link"
href=
"?page={{ page_obj.next_page_number }}"
tabindex=
"-1"
>
Next
</a>
</li>
{% else %}
<li
class=
"page-item disabled"
>
<a
class=
"page-link"
href=
""
tabindex=
"-1"
>
Next
</a>
</li>
{% endif %}
</ul>
</nav>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment