diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96403d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/* diff --git a/__pycache__/blog.cpython-36.pyc b/__pycache__/blog.cpython-36.pyc index 7ac76ec..8668e71 100644 Binary files a/__pycache__/blog.cpython-36.pyc and b/__pycache__/blog.cpython-36.pyc differ diff --git a/__pycache__/config.cpython-36.pyc b/__pycache__/config.cpython-36.pyc index 0ee9a30..dd63554 100644 Binary files a/__pycache__/config.cpython-36.pyc and b/__pycache__/config.cpython-36.pyc differ diff --git a/app/__pycache__/__init__.cpython-36.pyc b/app/__pycache__/__init__.cpython-36.pyc index 55d6087..1a6b9bf 100644 Binary files a/app/__pycache__/__init__.cpython-36.pyc and b/app/__pycache__/__init__.cpython-36.pyc differ diff --git a/app/__pycache__/auth.cpython-36.pyc b/app/__pycache__/auth.cpython-36.pyc index e37ab17..c794644 100644 Binary files a/app/__pycache__/auth.cpython-36.pyc and b/app/__pycache__/auth.cpython-36.pyc differ diff --git a/app/__pycache__/models.cpython-36.pyc b/app/__pycache__/models.cpython-36.pyc index 0aca102..e1f3b09 100644 Binary files a/app/__pycache__/models.cpython-36.pyc and b/app/__pycache__/models.cpython-36.pyc differ diff --git a/app/__pycache__/routes.cpython-36.pyc b/app/__pycache__/routes.cpython-36.pyc index 0522e51..981b8e4 100644 Binary files a/app/__pycache__/routes.cpython-36.pyc and b/app/__pycache__/routes.cpython-36.pyc differ diff --git a/app/auth.py b/app/auth.py index 7bf422e..2ef9338 100644 --- a/app/auth.py +++ b/app/auth.py @@ -6,7 +6,7 @@ bp = Blueprint('auth', __name__, url_prefix='/auth') -@bp.route('/register', methods=['POST', 'GET']) +@bp.route('/register', methods=['GET', 'POST']) def register(): if request.method == 'POST': username = request.form['username'] diff --git a/app/static/css/style.css b/app/static/css/style.css new file mode 100644 index 0000000..15fbf3a --- /dev/null +++ b/app/static/css/style.css @@ -0,0 +1,18 @@ +footer .container { + margin-top: 100px; +} + +.login { + padding: 10px 20px; + width: 40%; + margin: 30px auto; +} + +.login img { + display: block; + margin: auto; +} + +.login li { + color: red; +} diff --git a/app/static/images/feather.png b/app/static/images/feather.png new file mode 100644 index 0000000..60ce9a1 Binary files /dev/null and b/app/static/images/feather.png differ diff --git a/app/templates/auth/login.html b/app/templates/auth/login.html index e03fbff..e8afdff 100644 --- a/app/templates/auth/login.html +++ b/app/templates/auth/login.html @@ -1,17 +1,33 @@ -{%with messages = get_flashed_messages()%} - {%if messages%} - {%for message in messages%} - - {%endfor%} - {%endif%} -{%endwith%} -{{all_identical_users}} +{% extends "base.html" %} + +{% block title %}Blog{% endblock %} +{% block header %}{% endblock %} +{% block content %} +
- - - - - - -
- \ No newline at end of file + +
+
+ + +
+
+ + +
+
+ +
+ + {%with messages = get_flashed_messages()%} + {%if messages%} + + {%endif%} + {%endwith%} +
+{% endblock %} +{% block footer %}{% endblock %} diff --git a/app/templates/auth/register.html b/app/templates/auth/register.html index 352cfc1..8e3fe78 100644 --- a/app/templates/auth/register.html +++ b/app/templates/auth/register.html @@ -1,14 +1,7 @@ -{%if error%} - {{error}} -{%endif%} - - {% block content %} -
- - - - - -
- {% endblock %} - \ No newline at end of file + + +

asdasdsa

diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..cbf8047 --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,27 @@ + + + + {% block head %} + {% block title %}{% endblock %} + + + + + + {% endblock %} + + + +
{% block content %}{% endblock %}
+ + + + diff --git a/app/templates/detail.html b/app/templates/detail.html index 8250b85..6e4d737 100644 --- a/app/templates/detail.html +++ b/app/templates/detail.html @@ -1,6 +1,10 @@ -All posts -

{{ post.title }}

-

{{ post.date() }}

-

{{ post.body }}

-Edit -
+{% extends "base.html" %} + +{% block title %}{{ post.title }}{% endblock %} +{% block content %} + All postschevron_right +

{{ post.title }}

+

{{ post.date() }}

+

{{ post.body }}

+ Edit +{% endblock %} diff --git a/app/templates/edit.html b/app/templates/edit.html index 24c7b46..18ad88f 100644 --- a/app/templates/edit.html +++ b/app/templates/edit.html @@ -1,8 +1,5 @@ -
- -
- -
- - cancel -
+{% extends "new.html" %} + +{% block title %}{{ post.title }}{% endblock %} +{% block post_title%}{{ post.title }}{% endblock %} +{% block post_body%}{{ post.body }}{% endblock %} diff --git a/app/templates/index.html b/app/templates/index.html index 4ca32ad..30fbe58 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,10 +1,15 @@ -New post -{% if posts %} - -{% else %} -

No posts.

-{% endif %} +{% extends "base.html" %} + +{% block title %}Blog{% endblock %} +{% block content %} + New Post + {% if posts %} +
+ {% for post in posts %} + {{ post.title }}{{ post.date() }} + {% endfor %} +
+ {% else %} +

No posts.

+ {% endif %} +{% endblock %} diff --git a/app/templates/new.html b/app/templates/new.html index 25d6b0e..f6abddd 100644 --- a/app/templates/new.html +++ b/app/templates/new.html @@ -1,8 +1,25 @@ -
- -
- -
- - cancel -
+{% extends "base.html" %} + +{% block title %}New Post{% endblock %} +{% block content %} +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + cancel +
+
+
+{% endblock %}