From 26c33e819ccd8db91932ed5342c9c45aa297707b Mon Sep 17 00:00:00 2001 From: Burathar Date: Tue, 23 Mar 2021 22:36:19 +0100 Subject: [PATCH] Fix homepage css --- biscd/biscd/routes.py | 13 ++-- biscd/biscd/static/css/custom.css | 17 ++++- biscd/biscd/templates/base.html | 95 +++++++++++++-------------- biscd/biscd/templates/index.html | 17 ++--- installation-files/users_example.yaml | 2 +- 5 files changed, 76 insertions(+), 68 deletions(-) diff --git a/biscd/biscd/routes.py b/biscd/biscd/routes.py index 6fbbe95..fea342d 100644 --- a/biscd/biscd/routes.py +++ b/biscd/biscd/routes.py @@ -7,15 +7,12 @@ from .froms import NewProjectForm, LoginForm, RegistrationForm @app.route('/', methods=['GET', 'POST']) @app.route('/index', methods=['GET', 'POST']) -@login_required def index(): - form = NewProjectForm() - if form.validate_on_submit(): - project = Project.first_or_404(name=form.projectname.data) - project.save() - flash('You added a project!') - project_names = Project.list_names() - return render_template('index.html', form=form, project_names=project_names) + if current_user.is_authenticated: + project_names = Project.list_names() + else: + project_names = None + return render_template('index.html', project_names=project_names) @app.route('/login', methods=['GET', 'POST']) def login(): diff --git a/biscd/biscd/static/css/custom.css b/biscd/biscd/static/css/custom.css index 04ce980..1aa6b55 100644 --- a/biscd/biscd/static/css/custom.css +++ b/biscd/biscd/static/css/custom.css @@ -1,3 +1,14 @@ -.container { - padding-top: 30px -} \ No newline at end of file +body { + padding-top: 120px +} + +/* +.page-header h1 { + padding: 2rem 0; + font-size: 3rem; +} + +h2 { + padding: 2rem 0; +} +*/ \ No newline at end of file diff --git a/biscd/biscd/templates/base.html b/biscd/biscd/templates/base.html index c60eec9..0e12f0a 100644 --- a/biscd/biscd/templates/base.html +++ b/biscd/biscd/templates/base.html @@ -12,56 +12,55 @@ -
- -
+ +
diff --git a/biscd/biscd/templates/index.html b/biscd/biscd/templates/index.html index f2d3ff1..16da500 100644 --- a/biscd/biscd/templates/index.html +++ b/biscd/biscd/templates/index.html @@ -1,5 +1,4 @@ {% extends "base.html" %} -{% import 'bootstrap/wtf.html' as wtf %} {% block app_content %}
- + {% if project_names %} + +
+

Your Projects

+
@@ -22,10 +25,8 @@
- -
-
- {{ wtf.quick_form(form, button_map={'submit': 'primary'}) }} -
-
+ {% else %} +

Welcome!

+

Please login, or sign up!

+ {% endif %} {% endblock %} diff --git a/installation-files/users_example.yaml b/installation-files/users_example.yaml index 3575c8e..0381181 100644 --- a/installation-files/users_example.yaml +++ b/installation-files/users_example.yaml @@ -4,4 +4,4 @@ users: password_hash: pbkdf2:sha256:150000$uuFRyvLs$ee9863f169db786e82b9e2abe0c2cf3434e925479d0919f3b4046ebbfa0aeb28 - Carl: email: carl@mail.com - password_hash: pbkdf2:sha256:150000$v4UyXVie$898ba71cdf3adefd7c1b6ed611897a3c8ca3151bd2628b490a052f554bae113e + password_hash: pbkdf2:sha256:150000$v4UyXVie$898ba71cdf3adefd7c1b6ed611897a3c8ca3151bd2628b490a052f554bae113e \ No newline at end of file