Commit 8d0a7b22 authored by Willard's avatar Willard

Initial styling of landing

parent 45cd4a41
This diff is collapsed.
...@@ -6,14 +6,15 @@ ...@@ -6,14 +6,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> {% block head %} <meta name="viewport" content="width=device-width, initial-scale=1"> {% block head %}
<title>Canteeneo - {% block title %}{% endblock%}</title> <title>Canteeneo - {% block title %}{% endblock%}</title>
{% endblock %} {% endblock %}
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.css') }}">
</head> </head>
<body> <body>
<div class="flex-container"> <div class="container-fluid">
{% with messages = get_flashed_messages() %} {% if messages %} {% for message in messages %} {% with messages = get_flashed_messages() %} {% if messages %} {% for message in messages %}
<span>{{ message }}</span><br> {% endfor %} {% endif %} {% endwith %} {% block content %} {% endblock %} <span>{{ message }}</span><br> {% endfor %} {% endif %} {% endwith %} {% block content %} {% endblock %}
</div> </div>
</body> </body>
<script src="{{ url_for('static', filename='jquery-ajax.js') }}"></script> <script src="{{ url_for('static', filename='js/jquery-3.1.1.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
</html> </html>
\ No newline at end of file
...@@ -3,6 +3,47 @@ ...@@ -3,6 +3,47 @@
{% block title %}Landing Page{% endblock %} {% block title %}Landing Page{% endblock %}
{% block content %} {% block content %}
<a href="/login"><button class="link-button">Login</button></a> <div class="row">
<a href="/register"><button class="link-button">Register</button></a> <div class="col-md-4 col-md-offset-2">
<form method="POST" action="/login">
{{ login_form.csrf_token }}
<div class="form-group">
{{ login_form.username.label }}
{{ login_form.username(class_="form-control") }}
</div>
<div class="form-group">
{{ login_form.password.label }}
{{ login_form.password(class_="form-control") }}
</div>
<button class="btn btn-default btn-large" type="submit">Login</button>
</form>
</div>
<div class="col-md-4">
<form method="POST" action="/register">
{{ register_form.csrf_token }}
<div class="form-group">
{{ register_form.email.label}}
{{ register_form.email(class_="form-control") }}
</div>
<div class="form-group">
{{ register_form.name.label}}
{{ register_form.name(class_="form-control") }}
</div>
<div class="form-group">
{{ register_form.username.label}}
{{ register_form.username(class_="form-control") }}
</div>
<div class="form-group">
{{ register_form.password.label}}
{{ register_form.password(class_="form-control") }}
</div>
<div class="form-group">
{{ register_form.confirm_password.label}}
{{ register_form.confirm_password(class_="form-control") }}
</div>
<button class="btn btn-default btn-large" type="submit">Register</button>
</form>
</div>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -18,6 +18,5 @@ ...@@ -18,6 +18,5 @@
</div> </div>
<button type="submit">Login</button> <button type="submit">Login</button>
</div> </div>
</form> </form>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -37,7 +37,7 @@ class LoginView(FormView): ...@@ -37,7 +37,7 @@ class LoginView(FormView):
login_user(Owner.query.filter_by(username=self.get_form().username.data).first()) login_user(Owner.query.filter_by(username=self.get_form().username.data).first())
return redirect(url_for('stalls')) return redirect(url_for('stalls'))
def render_get(self): def render_get(self):
return render_template('login.html', form=self.get_form()) return render_template('landing.html', login_form=OwnerLoginForm(), register_form=OwnerRegisterForm())
def get_form(self): def get_form(self):
return OwnerLoginForm() return OwnerLoginForm()
...@@ -50,7 +50,7 @@ class RegisterView(FormView): ...@@ -50,7 +50,7 @@ class RegisterView(FormView):
db.session.commit() db.session.commit()
return redirect(url_for('login')) return redirect(url_for('login'))
def render_get(self): def render_get(self):
return render_template('register.html', form=form) return render_template('landing.html', login_form=OwnerLoginForm(), register_form=OwnerRegisterForm())
def get_form(self): def get_form(self):
return OwnerRegisterForm() return OwnerRegisterForm()
...@@ -60,7 +60,7 @@ app.add_url_rule('/register', view_func=RegisterView.as_view('register')) ...@@ -60,7 +60,7 @@ app.add_url_rule('/register', view_func=RegisterView.as_view('register'))
@app.route('/') @app.route('/')
@not_logged_in @not_logged_in
def index(): def index():
return render_template('landing.html') return render_template('landing.html', login_form=OwnerLoginForm(), register_form=OwnerRegisterForm())
@app.route('/logout') @app.route('/logout')
def logout(): def logout():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment