Commit 8d0a7b22 authored by Willard's avatar Willard

Initial styling of landing

parent 45cd4a41
This diff is collapsed.
......@@ -6,14 +6,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> {% block head %}
<title>Canteeneo - {% block title %}{% endblock%}</title>
{% endblock %}
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.css') }}">
</head>
<body>
<div class="flex-container">
<div class="container-fluid">
{% with messages = get_flashed_messages() %} {% if messages %} {% for message in messages %}
<span>{{ message }}</span><br> {% endfor %} {% endif %} {% endwith %} {% block content %} {% endblock %}
</div>
</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>
\ No newline at end of file
......@@ -3,6 +3,47 @@
{% block title %}Landing Page{% endblock %}
{% block content %}
<a href="/login"><button class="link-button">Login</button></a>
<a href="/register"><button class="link-button">Register</button></a>
<div class="row">
<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 %}
\ No newline at end of file
......@@ -18,6 +18,5 @@
</div>
<button type="submit">Login</button>
</div>
</form>
{% endblock %}
\ No newline at end of file
......@@ -37,7 +37,7 @@ class LoginView(FormView):
login_user(Owner.query.filter_by(username=self.get_form().username.data).first())
return redirect(url_for('stalls'))
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):
return OwnerLoginForm()
......@@ -50,7 +50,7 @@ class RegisterView(FormView):
db.session.commit()
return redirect(url_for('login'))
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):
return OwnerRegisterForm()
......@@ -60,7 +60,7 @@ app.add_url_rule('/register', view_func=RegisterView.as_view('register'))
@app.route('/')
@not_logged_in
def index():
return render_template('landing.html')
return render_template('landing.html', login_form=OwnerLoginForm(), register_form=OwnerRegisterForm())
@app.route('/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