mirror of https://github.com/JohnHammond/CTFd.git
Improved pagination and renaming main-style.css
parent
9c1f1696ec
commit
ad3c3c13b1
|
@ -332,7 +332,7 @@ def admin_teams(page):
|
|||
teams = Teams.query.slice(page_start, page_end).all()
|
||||
count = db.session.query(db.func.count(Teams.id)).first()[0]
|
||||
pages = int(count / results_per_page) + (count % results_per_page > 0)
|
||||
return render_template('admin/teams.html', teams=teams, pages=pages)
|
||||
return render_template('admin/teams.html', teams=teams, pages=pages, curr_page=page)
|
||||
|
||||
|
||||
@admin.route('/admin/team/<teamid>', methods=['GET', 'POST'])
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="/static/img/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/main-style.css">
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
|
||||
<link href='//fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Raleway:500' rel='stylesheet' type='text/css'>
|
||||
|
|
|
@ -149,10 +149,15 @@ input[type="checkbox"] { margin: 0px !important; position: relative; top: 5px; }
|
|||
{% if pages > 1 %}
|
||||
<div class="text-center">Page
|
||||
<br>
|
||||
{% if curr_page != 1 %}<a href="/admin/teams/{{ curr_page-1 }}"><<<</a>{% endif %}
|
||||
{% for page in range(1, pages + 1) %}
|
||||
{% if curr_page != page %}
|
||||
<a href="/admin/teams/{{ page }}">{{ page }}</a>
|
||||
{% else %}
|
||||
<b>{{ page }}</b>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<a href="">
|
||||
{% if curr_page != pages %}<a href="/admin/teams/{{ curr_page+1 }}">>>></a>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="/static/img/favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/main-style.css">
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
|
||||
<link href='//fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Raleway:500' rel='stylesheet' type='text/css'>
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
{% if team_pages > 1 %}
|
||||
<div class="text-center">Page
|
||||
<br>
|
||||
{% if curr_page != 1 %}<a href="/admin/teams/{{ curr_page-1 }}"><<<</a>{% endif %}
|
||||
{% for page in range(1, team_pages + 1) %}
|
||||
{% if curr_page != page %}
|
||||
<a href="/teams/{{ page }}">{{ page }}</a>
|
||||
|
@ -41,6 +42,7 @@
|
|||
<b>{{page}}</b>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if curr_page != pages %}<a href="/admin/teams/{{ curr_page+1 }}">>>></a>{% endif %}
|
||||
<a href="">
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue