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()
|
teams = Teams.query.slice(page_start, page_end).all()
|
||||||
count = db.session.query(db.func.count(Teams.id)).first()[0]
|
count = db.session.query(db.func.count(Teams.id)).first()[0]
|
||||||
pages = int(count / results_per_page) + (count % results_per_page > 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'])
|
@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="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="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="//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 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=Lato' rel='stylesheet' type='text/css'>
|
||||||
<link href='//fonts.googleapis.com/css?family=Raleway:500' 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 %}
|
{% if pages > 1 %}
|
||||||
<div class="text-center">Page
|
<div class="text-center">Page
|
||||||
<br>
|
<br>
|
||||||
|
{% if curr_page != 1 %}<a href="/admin/teams/{{ curr_page-1 }}"><<<</a>{% endif %}
|
||||||
{% for page in range(1, pages + 1) %}
|
{% for page in range(1, pages + 1) %}
|
||||||
|
{% if curr_page != page %}
|
||||||
<a href="/admin/teams/{{ page }}">{{ page }}</a>
|
<a href="/admin/teams/{{ page }}">{{ page }}</a>
|
||||||
|
{% else %}
|
||||||
|
<b>{{ page }}</b>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<a href="">
|
{% if curr_page != pages %}<a href="/admin/teams/{{ curr_page+1 }}">>>></a>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon">
|
<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="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="//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 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=Lato' rel='stylesheet' type='text/css'>
|
||||||
<link href='//fonts.googleapis.com/css?family=Raleway:500' 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 %}
|
{% if team_pages > 1 %}
|
||||||
<div class="text-center">Page
|
<div class="text-center">Page
|
||||||
<br>
|
<br>
|
||||||
|
{% if curr_page != 1 %}<a href="/admin/teams/{{ curr_page-1 }}"><<<</a>{% endif %}
|
||||||
{% for page in range(1, team_pages + 1) %}
|
{% for page in range(1, team_pages + 1) %}
|
||||||
{% if curr_page != page %}
|
{% if curr_page != page %}
|
||||||
<a href="/teams/{{ page }}">{{ page }}</a>
|
<a href="/teams/{{ page }}">{{ page }}</a>
|
||||||
|
@ -41,6 +42,7 @@
|
||||||
<b>{{page}}</b>
|
<b>{{page}}</b>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if curr_page != pages %}<a href="/admin/teams/{{ curr_page+1 }}">>>></a>{% endif %}
|
||||||
<a href="">
|
<a href="">
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue