diff --git a/app.py b/app.py index 5cebb85..a654642 100644 --- a/app.py +++ b/app.py @@ -85,14 +85,16 @@ def is_safe_url(target): @login_manager.user_loader def load_user(user_id): if user_id == "admin": - return User("admin", app.config.get("ADMIN_TOKEN")) + user = User("admin", app.config.get("ADMIN_TOKEN")) + g.user = user + return user else: return None @app.route('/') def index(): - return 'Hello World!' + return redirect('/register') @app.route('/register', methods=('GET', 'POST')) diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..4437087 --- /dev/null +++ b/static/style.css @@ -0,0 +1,105 @@ +nav { + overflow: hidden; + padding: 0px 0px; +} + +nav h1 { + display: block; + float: left; +} + +nav ul { + display: block; + float: right; +} + +nav ul li { + display: block; + float: left; + padding-left: 1em; +} + +#activeRegistrationCodes { + display: block; + width: 100%; +} + +#activeRegistrationCodes table { + margin: 0 auto; /* or margin: 0 auto 0 auto */ +} + +#registeredUsers { + display: block; + width: 100%; +} + +#registeredUsers table { + margin: 0 auto; /* or margin: 0 auto 0 auto */ +} + +table { + border-collapse: collapse; +} + +table tr:nth-child(even) { + background: #CCC +} + +table th, td { + padding-left: 1em; + padding-right: 1em; + text-align: center; + height: 2.5em; +} + +table tbody td { + border: 1px solid black; +} + +table tbody tr .borderless { + border: none; + background: white; +} + +#register { + width: 100%; + text-align: center; +} + +#register form { + display: inline-block; +} + +form div .row { + display: table-cell; +} + +label { + display: inline-block; + float: left; + clear: left; + width: 250px; + text-align: right; + padding-right: 1em; + vertical-align: middle; +} + +input { + display: inline-block; + float: left; + vertical-align: middle; + width: auto; +} + +.formSubmit input { + float: right; +} + +.flashMessages { + padding: 1em; +} + +.flash { + width: 100%; + text-align: center; +} \ No newline at end of file diff --git a/templates/admin.html b/templates/admin.html index 273dfc3..55ad38d 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -28,7 +28,7 @@ {% if not registration_code.is_expired() and registration_code.has_available_uses() %} link {% endif %} -