mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-18 00:13:11 -06:00
added templates
This commit is contained in:
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
from flask import Blueprint
|
from flask import Blueprint, render_template
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from . import db
|
from . import db
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,59 @@
|
|||||||
|
<!-- templates/base.html -->
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html>
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
<head>
|
||||||
<title>Runnerspace</title>
|
<meta charset="utf-8">
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
</head>
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<body>
|
<title>Flask Auth Example</title>
|
||||||
</body>
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.min.css" />
|
||||||
</html>
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<section class="hero is-primary is-fullheight">
|
||||||
|
|
||||||
|
<div class="hero-head">
|
||||||
|
<nav class="navbar">
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<div id="navbarMenuHeroA" class="navbar-menu">
|
||||||
|
<div class="navbar-end">
|
||||||
|
<a href="{{ url_for('main.index') }}" class="navbar-item">
|
||||||
|
Home
|
||||||
|
</a>
|
||||||
|
{% if current_user.is_authenticated %}
|
||||||
|
<a href="{{ url_for('main.profile') }}" class="navbar-item">
|
||||||
|
Profile
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if not current_user.is_authenticated %}
|
||||||
|
<a href="{{ url_for('auth.login') }}" class="navbar-item">
|
||||||
|
Login
|
||||||
|
</a>
|
||||||
|
<a href="{{ url_for('auth.signup') }}" class="navbar-item">
|
||||||
|
Sign Up
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if current_user.is_authenticated %}
|
||||||
|
<a href="{{ url_for('auth.logout') }}" class="navbar-item">
|
||||||
|
Logout
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hero-body">
|
||||||
|
<div class="container has-text-centered">
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -1,4 +1,12 @@
|
|||||||
{% extends 'base.html' %}
|
<!-- templates/index.html -->
|
||||||
|
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
<h1 class="title">
|
||||||
|
Flask Login Example
|
||||||
|
</h1>
|
||||||
|
<h2 class="subtitle">
|
||||||
|
Easy authentication and authorization in Flask.
|
||||||
|
</h2>
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<!-- templates/login.html -->
|
||||||
|
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="column is-4 is-offset-4">
|
||||||
|
<h3 class="title">Login</h3>
|
||||||
|
<div class="box">
|
||||||
|
{% with messages = get_flashed_messages() %}
|
||||||
|
{% if messages %}
|
||||||
|
<div class="notification is-danger">
|
||||||
|
{{ messages[0] }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
<form method="POST" action="/login">
|
||||||
|
<div class="field">
|
||||||
|
<div class="control">
|
||||||
|
<input class="input is-large" type="email" name="email" placeholder="Your Email" autofocus="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<div class="control">
|
||||||
|
<input class="input is-large" type="password" name="password" placeholder="Your Password">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label class="checkbox">
|
||||||
|
<input type="checkbox">
|
||||||
|
Remember me
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<button class="button is-block is-info is-large is-fullwidth">Login</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<!-- templates/profile.html -->
|
||||||
|
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1 class="title">
|
||||||
|
Welcome, {{ name }}!
|
||||||
|
</h1>
|
||||||
|
{% endblock %}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<!-- templates/signup.html -->
|
||||||
|
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="column is-4 is-offset-4">
|
||||||
|
<h3 class="title">Sign Up</h3>
|
||||||
|
<div class="box">
|
||||||
|
{% with messages = get_flashed_messages() %}
|
||||||
|
{% if messages %}
|
||||||
|
<div class="notification is-danger">
|
||||||
|
{{ messages[0] }}. Go to <a href="{{ url_for('auth.login') }}">login page</a>.
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
<form method="POST" action="/signup">
|
||||||
|
<div class="field">
|
||||||
|
<div class="control">
|
||||||
|
<input class="input is-large" type="email" name="email" placeholder="Email" autofocus="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<div class="control">
|
||||||
|
<input class="input is-large" type="text" name="name" placeholder="Name" autofocus="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<div class="control">
|
||||||
|
<input class="input is-large" type="password" name="password" placeholder="Password">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="button is-block is-info is-large is-fullwidth">Sign Up</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user