From 0f240692d295aa55e961adfe8fe7941e55bcf4d6 Mon Sep 17 00:00:00 2001 From: Sharad Ahlawat Date: Tue, 10 Mar 2020 15:21:18 -0700 Subject: [PATCH] final --- producthunt/templates/base.html | 56 ++++++++++++------------- products/templates/products/create.html | 6 +-- products/templates/products/detail.html | 13 +++--- products/views.py | 4 +- 4 files changed, 38 insertions(+), 41 deletions(-) diff --git a/producthunt/templates/base.html b/producthunt/templates/base.html index cbac2be..00b2bdc 100644 --- a/producthunt/templates/base.html +++ b/producthunt/templates/base.html @@ -5,9 +5,9 @@ - - - + + + Product Hunt @@ -44,39 +44,39 @@
-
- {% block content %} +
+ {% block content %} - {% endblock %} -
+ {% endblock %} +
diff --git a/products/templates/products/create.html b/products/templates/products/create.html index fdf33a2..56023da 100644 --- a/products/templates/products/create.html +++ b/products/templates/products/create.html @@ -2,8 +2,8 @@ {% block content %} {% if error %} {{ error }} -
-
+
+
{% endif %}

Create

@@ -27,7 +27,7 @@ Body:
-

+

{% endblock %} diff --git a/products/templates/products/detail.html b/products/templates/products/detail.html index c10c6b8..0d65861 100644 --- a/products/templates/products/detail.html +++ b/products/templates/products/detail.html @@ -13,8 +13,7 @@

{{ product.title }}

-
-
+
@@ -25,17 +24,15 @@
-
-
+
-

Hunted by: {{ product.hunter.username }}

+

Hunted by: {{ product.hunter.username }}

-

{{ product.pubdate_pretty }}

+

{{ product.pubdate_pretty }}

-
-
+

{{ product.body }}

diff --git a/products/views.py b/products/views.py index a99c5f1..24c0cb9 100644 --- a/products/views.py +++ b/products/views.py @@ -9,7 +9,7 @@ def home(request): return render(request, 'products/home.html', {'products': products}) -@login_required() +@login_required(login_url='/accounts/signup') def create(request): if request.method == 'POST': if request.POST['title'] and request.POST['url'] and request.FILES['image'] and request.FILES['icon'] and \ @@ -38,7 +38,7 @@ def detail(request, product_id): return render(request, 'products/detail.html', {'product': product}) -@login_required() +@login_required(login_url='/accounts/signup') def upvote(request, product_id): if request.method == 'POST': product = get_object_or_404(Product, pk=product_id)