From 6256335ef802e2823ac0118c01c7fe31e38e7287 Mon Sep 17 00:00:00 2001 From: blendoit Date: Wed, 22 Jan 2020 18:17:38 -0800 Subject: Second commit. --- website/app/forms.py | 28 ------------------ website/app/routes.py | 54 ----------------------------------- website/app/static/styles/default.css | 25 ---------------- website/app/static/styles/home.css | 50 -------------------------------- website/app/static/styles/no.css | 54 ----------------------------------- website/app/static/styles/yes.css | 54 ----------------------------------- website/app/templates/base.html | 25 ---------------- website/app/templates/home.html | 24 ---------------- website/app/templates/login.html | 34 ---------------------- website/app/templates/no.html | 23 --------------- website/app/templates/register.html | 31 -------------------- website/app/templates/yes.html | 17 ----------- 12 files changed, 419 deletions(-) delete mode 100644 website/app/forms.py delete mode 100644 website/app/routes.py delete mode 100644 website/app/static/styles/default.css delete mode 100644 website/app/static/styles/home.css delete mode 100644 website/app/static/styles/no.css delete mode 100644 website/app/static/styles/yes.css delete mode 100644 website/app/templates/base.html delete mode 100644 website/app/templates/home.html delete mode 100644 website/app/templates/login.html delete mode 100644 website/app/templates/no.html delete mode 100644 website/app/templates/register.html delete mode 100644 website/app/templates/yes.html (limited to 'website/app') diff --git a/website/app/forms.py b/website/app/forms.py deleted file mode 100644 index ae6a2dc..0000000 --- a/website/app/forms.py +++ /dev/null @@ -1,28 +0,0 @@ -from flask_wtf import FlaskForm -from wtforms import StringField, PasswordField, SubmitField, BooleanField -from wtforms.validators import DataRequired, Length, EqualTo - - -class RegistrationForm(FlaskForm): - alias = StringField('Alias', - validators=[DataRequired(), - Length(min=2, max=20)]) - password = PasswordField('Password', validators=[DataRequired()]) - password_confirm = PasswordField( - 'Confirm Password', validators=[DataRequired(), - EqualTo('password')]) - submit = SubmitField('Create Alias') - - -class LoginForm(FlaskForm): - alias = StringField('Alias', - validators=[DataRequired(), - Length(min=2, max=20)]) - password = PasswordField('Password', validators=[DataRequired()]) - remember = BooleanField('Remember Alias') - submit = SubmitField('Login Alias') - - -class NewMessage(FlaskForm): - recipient = StringField('Recipient', validators=[DataRequired()]) - message = StringField('message', validators=[DataRequired()]) diff --git a/website/app/routes.py b/website/app/routes.py deleted file mode 100644 index f1497b8..0000000 --- a/website/app/routes.py +++ /dev/null @@ -1,54 +0,0 @@ -from flask import Flask, render_template, flash, redirect, url_for -from forms import RegistrationForm, LoginForm - -app = Flask(__name__) -app.config['SECRET_KEY'] = 'foobarblendoitfoobar!' - -posts = [{ - 'author': - 'Marius', - 'date': - 'Dec. 26th, 2019', - 'content': - "this is a test where I write a message that isn't too short, it isn't too long, it's just the right size." -}, { - 'author': 'Achille', - 'date': 'Dec. 25th, 2019', - 'content': "this is a second test!" -}, { - 'author': 'Jeanne', - 'date': 'Dec. 24th, 2019', - 'content': "this is a third test!" -}] - - -@app.route("/") -@app.route("/home") -def home(): - return render_template('home.html', posts=posts) - -@app.route("/yes") -def yes(): - return render_template("yes.html") - -@app.route("/no") -def no(): - return render_template("no.html") - -@app.route("/register", methods=['GET', 'POST']) -def register(): - form = RegistrationForm() - if form.validate_on_submit(): - flash(f"Alias created for {form.alias.data}.", 'success') - return redirect(url_for('home')) - return render_template('register.html', title="Register", form=form) - - -@app.route("/login") -def login(): - form = LoginForm() - return render_template('login.html', title="Login", form=form) - - -if __name__ == '__main__': - app.run(debug=True) diff --git a/website/app/static/styles/default.css b/website/app/static/styles/default.css deleted file mode 100644 index 47ba29d..0000000 --- a/website/app/static/styles/default.css +++ /dev/null @@ -1,25 +0,0 @@ -:root { - --primary-color: #003B5C; - --secondary-color: #C3D7EE; - --home: rgba(200, 200, 200, 0.7); - --yes: rgba(0, 255, 0, 0.7); - --no: rgba(255, 0, 0, 0.7); -} - -* { - margin: 0; - padding: 0; -} - -body { - font-family: 'Liberation Sans', sans-serif; - line-height: 1.2; -} - -h1 { - -} - -h2 { - -} diff --git a/website/app/static/styles/home.css b/website/app/static/styles/home.css deleted file mode 100644 index 262b40c..0000000 --- a/website/app/static/styles/home.css +++ /dev/null @@ -1,50 +0,0 @@ -.main { - height: 100%; - position: absolute; - left: 3%; - right: 3%; - background: linear-gradient(to top, var(--secondary-color), var(--primary-color)) fixed; -} - -.tab-yes { - height: 100%; - width: 10%; - float: left; - position: fixed; - z-index: -1; - background: var(--yes); -} -.tab-no { - height: 100%; - width: 10%; - float: right; - position: fixed; - z-index: -1; - right: 0; - background: var(--no); -} - -.tab-yes:hover ~ .main { - left: 5%; - transition: 0.2s; -} - -.tab-no:hover ~ .main { - right: 5%; - transition: 0.2s; -} - -.post { - background: white; - border-radius: 14px; - padding: 1rem; - margin: 1rem; - width: 20%; -} - -.post:hover { - background: linear-gradient(to left, var(--no) 50%, var(--yes) 50%); - cursor: pointer; - transition: 0.8s; - color: white; -} diff --git a/website/app/static/styles/no.css b/website/app/static/styles/no.css deleted file mode 100644 index 09171a6..0000000 --- a/website/app/static/styles/no.css +++ /dev/null @@ -1,54 +0,0 @@ -.main { - height: 100%; - right: 0; - left: 6%; - position: absolute; - z-index: 1; - background: linear-gradient(to top, var(--secondary-color), var(--primary-color)) fixed; -} - -.tab-home { - height: 100%; - width: 3%; - float: left; - position: relative; - z-index: 0; - background: var(--home); -} - -.tab-yes { - height: 100%; - width: 3%; - float: left; - position: relative; - z-index: -1; - background: var(--yes); -} - -.tab-home:hover ~ .main { - left: 9%; - transition: 0.2s; -} - -.tab-home:hover { - width: 6%; - transition: 0.2s; -} - -.tab-yes:hover ~ .main { - left: 9%; - transition: 0.2s; -} - -.tab-yes:hover { - width: 6%; - transition: 0.2s; -} - -.post { - background: white; - border-radius: 14px; - padding: 1rem; - margin: 1rem; - width: 20%; -} diff --git a/website/app/static/styles/yes.css b/website/app/static/styles/yes.css deleted file mode 100644 index 96443e1..0000000 --- a/website/app/static/styles/yes.css +++ /dev/null @@ -1,54 +0,0 @@ -.main { - height: 100%; - right: 6%; - left: 0; - position: absolute; - z-index: 1; - background: linear-gradient(to top, var(--secondary-color), var(--primary-color)) fixed; -} - -.tab-home { - height: 100%; - width: 3%; - float: right; - position: relative; - z-index: 0; - background: var(--home); -} - -.tab-no { - height: 100%; - width: 3%; - float: right; - position: relative; - z-index: -1; - background: var(--no); -} - -.tab-home:hover ~ .main { - right: 9%; - transition: 0.2s; -} - -.tab-home:hover { - width: 6%; - transition: 0.2s; -} - -.tab-no:hover ~ .main { - right: 9%; - transition: 0.2s; -} - -.tab-no:hover { - width: 6%; - transition: 0.2s; -} - -.post { - background: white; - border-radius: 14px; - padding: 1rem; - margin: 1rem; - width: 20%; -} diff --git a/website/app/templates/base.html b/website/app/templates/base.html deleted file mode 100644 index 5520493..0000000 --- a/website/app/templates/base.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - {% if title %} - {{ title }} - {% else %} - Blendoit - {% endif %} - - - {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} - {% for message in messages %} -
- {{ message }} -
- {% endfor %} - {% endif %} - {% endwith %} - - {% block content %}{% endblock %} - - diff --git a/website/app/templates/home.html b/website/app/templates/home.html deleted file mode 100644 index 89984eb..0000000 --- a/website/app/templates/home.html +++ /dev/null @@ -1,24 +0,0 @@ - - - -{% extends "base.html" %} - -{% block content %} - -
- - - -
- {% for post in posts %} -
-

{{post.author}}

-

{{post.date}}

-

{{post.content}}

-
- {% endfor %} -
-
- - -{% endblock content %} diff --git a/website/app/templates/login.html b/website/app/templates/login.html deleted file mode 100644 index 63217e1..0000000 --- a/website/app/templates/login.html +++ /dev/null @@ -1,34 +0,0 @@ -{% extends "base.html" %} -{% block content %} - -
-
- {{ form.hidden_tag() }} -
- Join Today -
- {{ form.alias.label }} - {{ form.alias }} -
-
- {{ form.password.label }} - {{ form.password }} -
-
- {{ form.password_confirm.label }} - {{ form.password_confirm }} -
-
-
- {{ form.submit(class="btn") }} -
-
-
- -
- - Already have an account? Sign In - -
- -{% endblock content %} diff --git a/website/app/templates/no.html b/website/app/templates/no.html deleted file mode 100644 index e1b9238..0000000 --- a/website/app/templates/no.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -{% extends "base.html" %} -{% block content %} - -
- - - -
- {% for post in posts %} -
-

{{post.author}}

-

{{post.date}}

-

{{post.content}}

-
- {% endfor %} -
-
- - -{% endblock content %} diff --git a/website/app/templates/register.html b/website/app/templates/register.html deleted file mode 100644 index 456b8f7..0000000 --- a/website/app/templates/register.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "base.html" %} -{% block content %} - -
-
- {{ form.hidden_tag() }} -
- Create a new alias -
- {{ form.alias.label(class="form-control-label") }} - {{ form.alias(class="form-control") }} -
-
- {{ form.password.label(class="form-control-label") }} - {{ form.password(class="form-control") }} -
-
- {{ form.password_confirm.label(class="form-control-label") }} - {{ form.password_confirm(class="form-control") }} -
-
-
- {{ form.submit(class="btn") }} -
-
-
-
- Sign in with existing alias? Sign In -
- -{% endblock content %} diff --git a/website/app/templates/yes.html b/website/app/templates/yes.html deleted file mode 100644 index b915221..0000000 --- a/website/app/templates/yes.html +++ /dev/null @@ -1,17 +0,0 @@ - - - -{% extends "base.html" %} -{% block content %} - -
- - - -
-

yes, no?

-
-
- - -{% endblock content %} -- cgit v1.2.3