Improved pagination and renaming main-style.css

selenium-screenshot-testing
CodeKevin 2016-02-05 20:59:47 -05:00
parent 9c1f1696ec
commit ad3c3c13b1
6 changed files with 12 additions and 5 deletions

View File

@ -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'])

View File

@ -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'>

View File

@ -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 }}">&lt;&lt;&lt;</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 }}">&gt;&gt;&gt;</a>{% endif %}
</div> </div>
{% endif %} {% endif %}
</div> </div>

View File

@ -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'>

View File

@ -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 }}">&lt;&lt;&lt;</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 }}">&gt;&gt;&gt;</a>{% endif %}
<a href=""> <a href="">
</div> </div>
{% endif %} {% endif %}