Permalink
Browse files

add inactive league list

  • Loading branch information...
1 parent 4190940 commit 39d68582d0baeb7a5fb4a6bd5eb56483c04a37fc @artnez committed May 14, 2012
@@ -24,6 +24,10 @@ def get_active_leagues(db):
return search_leagues(db, active=1)
@use_db
+def get_inactive_leagues(db):
+ return search_leagues(db, active=0)
+
+@use_db
def create_league(db, name, description=None, active=True):
name = name.strip()
return db.insert(
@@ -117,19 +117,19 @@ h2 {
display: none;
}
-#landing h1 {
+.league-list h1 {
margin: 0 0 10px 0;
}
-#landing ul.leagues {
+.league-list ul.leagues {
width: 100%;
overflow: hidden;
list-style: none;
padding: 0;
margin: 0 0 20px 0;
}
-#landing ul.leagues li {
+.league-list ul.leagues li {
position: relative;
float: left;
width: 173px;
@@ -139,11 +139,11 @@ h2 {
background: #333;
}
-#landing ul.leagues li:nth-child(3n) {
+.league-list ul.leagues li:nth-child(3n) {
margin-right: 0;
}
-#landing ul.leagues li a {
+.league-list ul.leagues li a {
display: block;
font-size: 18px;
height: 100%;
@@ -153,20 +153,20 @@ h2 {
text-align: center;
}
-#landing ul.leagues li a:hover {
+.league-list ul.leagues li a:hover {
text-decoration: none;
background: #005580;
}
-#landing ul.leagues li.create a {
+.league-list ul.leagues li.create a {
color: #999;
background: #ddd;
line-height: 72px;
text-shadow: 1px 1px 0 #eee;
text-transform: lowercase;
}
-#landing ul.leagues li .name {
+.league-list ul.leagues li .name {
display: block;
padding: 20px 8px 2px 8px;
}
@@ -0,0 +1,20 @@
+{% extends 'layouts/simple.html' %}
+{% set head_title = 'Inactive Leagues' %}
+{% set logo_url = url_for('landing') %}
+{% block content %}
+<h1>Inactive Leagues</h1>
+{% if inactive_leagues | length %}
+<div class='league-list'>
+ <ul class='leagues'>
+ {% for league in inactive_leagues %}
+ <li>
+ <a href='{{ url_for('dashboard', league=league.slug) }}'>{{ league.name }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p><em>There are no inactive leagues in the system.</em></p>
+ {% endif %}
+ <p><a href='{{ url_for('landing') }}'>&laquo; back to league selection</a></p>
+</div>
+{% endblock %}
@@ -2,7 +2,7 @@
{% set head_title = 'League Selection' %}
{% set logo_url = url_for('landing') %}
{% block content %}
-<div id="landing">
+<div class='league-list'>
<h1>Leagues</h1>
<ul class='leagues'>
{% for league in active_leagues %}
View
@@ -17,7 +17,8 @@
from faceoff.models.user import \
get_active_users, create_user, auth_login, auth_logout
from faceoff.models.league import \
- find_league, get_active_leagues, create_league, update_league
+ find_league, get_active_leagues, get_inactive_leagues, create_league, \
+ update_league
from faceoff.models.match import \
create_match, get_match_history, get_league_ranking, get_user_standing
from faceoff.models.setting import get_setting
@@ -122,6 +123,12 @@ def join():
def landing():
return dict(active_leagues=get_active_leagues())
+@app.route('/inactive')
+@templated()
+@authenticated
+def inactive():
+ return dict(inactive_leagues=get_inactive_leagues())
+
@app.route('/new', methods=['GET', 'POST'])
@templated()
@authenticated

0 comments on commit 39d6858

Please sign in to comment.