From 261279b881294bc27df0b6c30b9b8d624b5ebab9 Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 10 Sep 2019 18:10:01 +0200 Subject: [PATCH] Added base templates --- news/__pycache__/urls.cpython-37.pyc | Bin 470 -> 506 bytes news/__pycache__/views.cpython-37.pyc | Bin 1910 -> 2051 bytes news/static/news/style.css | 3 +++ news/templates/base.html | 33 +++++++++++++++++++++++++ news/templates/news/createaccount.html | 24 ++++++++++++++++++ news/templates/news/index.html | 7 ++++-- news/templates/news/post.html | 7 ++++++ news/templates/news/submission.html | 10 +++++++- news/templates/news/submitted.html | 8 ++++++ news/urls.py | 1 + news/views.py | 3 +++ 11 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 news/static/news/style.css create mode 100644 news/templates/base.html create mode 100644 news/templates/news/createaccount.html diff --git a/news/__pycache__/urls.cpython-37.pyc b/news/__pycache__/urls.cpython-37.pyc index 51a5583ba2f0d6aea57d17a4957a856f573a4798..37fa9fe82dfa1fcbdac093ea7a4fa2350a3a7ef0 100644 GIT binary patch delta 153 zcmcb{{EJ!LiIMi>MDq>&c| diff --git a/news/__pycache__/views.cpython-37.pyc b/news/__pycache__/views.cpython-37.pyc index 568bcc11a3fe5e1f6e2032c3abf9c002be03c82d..6de96f21a10cdb405e90d36f643edd9a34662bf3 100644 GIT binary patch delta 365 zcmeyy*DS#6#LLUY00e$p%41t6@=7w!nW#R6S2RVeg&|5Tg(H|jQ+(rrgG`fUSrvuF z^HR%;^^=QI6H8JPlaupH^GYWBvMNjSq6motO)F*snaNlrv$>R6mr+0-$SG0)5sDx} zY4Ro(2YD$VvseU3Ffeg3iZSxQAr}(|Q<27GLDo!OO^_O>S(=k$m?S4JU=4_r1&S8Q z0SQgUA_)*%0Z3GFf?Q`+kY8M)$#{z;u_(P*lc$IqB&`Y}ctC_2h+qa0AWs)bf(T_0 zp#UP(CwsCP$!Pi_@% delta 231 zcmZn`_{PWU#LLUY00g3&%478=@=7vJnW#R6l_QuzQ*`5rgG`&*Sri!sUbChK&n|dSb> + +{% load static %} + + + + + {% block title %}My amazing site{% endblock %} + + + + +

Poker CC

+ +

+ {% if user.is_authenticated %} + Submit + {% else %} + Create account + {% endif %} +

+ +
+ +
+ {% block content %}{% endblock %} +
+
+
+ some footer +
+ + diff --git a/news/templates/news/createaccount.html b/news/templates/news/createaccount.html new file mode 100644 index 0000000..e6521a1 --- /dev/null +++ b/news/templates/news/createaccount.html @@ -0,0 +1,24 @@ +{% extends "base.html" %} + +{% block title %}My amazing blog{% endblock %} + +{% block content %} +

Create account

+
+ +

Username

+

+ +

+ +

Password

+

+ + +

+ + + +
+ +{% endblock content %} diff --git a/news/templates/news/index.html b/news/templates/news/index.html index 186e4bd..c3e8bc3 100644 --- a/news/templates/news/index.html +++ b/news/templates/news/index.html @@ -1,5 +1,8 @@ -

Poker CC

+{% extends "base.html" %} +{% block title %}My amazing blog{% endblock %} + +{% block content %} {% if latest_post_list %}
    {% for post in latest_post_list %} @@ -10,4 +13,4 @@

    No posts are available.

    {% endif %} -Submit +{% endblock content %} diff --git a/news/templates/news/post.html b/news/templates/news/post.html index 059d777..672a037 100644 --- a/news/templates/news/post.html +++ b/news/templates/news/post.html @@ -1,3 +1,8 @@ +{% extends "base.html" %} + +{% block title %}My amazing blog{% endblock %} + +{% block content %}

    {{ post.title }}

    written by {{ post.author.username }}

    ----Body----

    @@ -20,3 +25,5 @@
  • {{ comment.body }}
  • {% endfor %}
+ +{% endblock content %} diff --git a/news/templates/news/submission.html b/news/templates/news/submission.html index 0bd8b37..f7bfa51 100644 --- a/news/templates/news/submission.html +++ b/news/templates/news/submission.html @@ -1,3 +1,9 @@ +{% extends "base.html" %} + +{% block title %}My amazing blog{% endblock %} + +{% block content %} + {% if error_message %}

{{ error_message }}

{% endif %} {% if user.is_authenticated %} @@ -28,7 +34,7 @@

- + @@ -44,3 +50,5 @@ {% else %} Please log in {% endif %} + +{% endblock content %} diff --git a/news/templates/news/submitted.html b/news/templates/news/submitted.html index bf385ca..665eca4 100644 --- a/news/templates/news/submitted.html +++ b/news/templates/news/submitted.html @@ -1,3 +1,11 @@ +{% extends "base.html" %} + +{% block title %}My amazing blog{% endblock %} + +{% block content %} +

Thanks :)

Home

+ +{% endblock content %} diff --git a/news/urls.py b/news/urls.py index 487c1e7..485dbc4 100644 --- a/news/urls.py +++ b/news/urls.py @@ -10,5 +10,6 @@ urlpatterns = [ path('submit', views.submit, name='submit'), path('/comment', views.comment, name='comment'), path('submitted', views.submitted, name='submitted'), + path('createaccount', views.createaccount, name='createaccount'), ] diff --git a/news/views.py b/news/views.py index 6ffd660..90a5d50 100644 --- a/news/views.py +++ b/news/views.py @@ -20,6 +20,9 @@ def post(request, post_id): def submission(request): return render(request, 'news/submission.html', {}) +def createaccount(request): + return render(request, 'news/createaccount.html', {}) + def submit(request): if 'state' in request.POST: