From 30a0347d6ccae3aa12bbd3ed6386d921363e55ad Mon Sep 17 00:00:00 2001 From: Martin Alge Date: Sun, 6 May 2018 15:27:15 +0200 Subject: [PATCH 1/4] small change needed for django 1.10+ --- alge/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alge/settings.py b/alge/settings.py index 93d7714..c9955a3 100644 --- a/alge/settings.py +++ b/alge/settings.py @@ -86,7 +86,7 @@ def filter_non_strings(items): 'django_extensions', ]) -MIDDLEWARE = filter_non_strings([ +MIDDLEWARE_CLASSES = filter_non_strings([ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', From fb1789a4581d47a1d96641895a433f6a473f4e82 Mon Sep 17 00:00:00 2001 From: Martin Alge Date: Sun, 6 May 2018 15:44:47 +0200 Subject: [PATCH 2/4] Added view for single quotes --- .../strecklista/components/quote.css | 39 +++++++++++++++++++ .../strecklista/components/quotecard.html | 3 ++ strecklista/templates/strecklista/quotes.html | 36 +---------------- .../templates/strecklista/single_quote.html | 34 ++++++++++++++++ strecklista/urls.py | 3 ++ strecklista/views.py | 9 +++++ 6 files changed, 90 insertions(+), 34 deletions(-) create mode 100644 strecklista/templates/strecklista/components/quote.css create mode 100644 strecklista/templates/strecklista/single_quote.html diff --git a/strecklista/templates/strecklista/components/quote.css b/strecklista/templates/strecklista/components/quote.css new file mode 100644 index 0000000..3d9bf2c --- /dev/null +++ b/strecklista/templates/strecklista/components/quote.css @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/strecklista/templates/strecklista/components/quotecard.html b/strecklista/templates/strecklista/components/quotecard.html index fee70aa..952f511 100644 --- a/strecklista/templates/strecklista/components/quotecard.html +++ b/strecklista/templates/strecklista/components/quotecard.html @@ -4,4 +4,7 @@
{{ quote.who }}
{{ quote.timestamp }}
+ diff --git a/strecklista/templates/strecklista/quotes.html b/strecklista/templates/strecklista/quotes.html index 7957e76..6ec89ad 100644 --- a/strecklista/templates/strecklista/quotes.html +++ b/strecklista/templates/strecklista/quotes.html @@ -1,39 +1,7 @@ {% extends 'strecklista/base.html' %} {% block content %} - +{% include 'strecklista/components/quote.css' %} + +{% include "strecklista/snippets/navbar.html" %} +
+

Citat

+ + +
+ {% include 'strecklista/components/quotecard.html' with quote=quote %} +
+ Visa alla citat +
+{% endblock %} diff --git a/strecklista/urls.py b/strecklista/urls.py index 35dd29c..ffebdee 100644 --- a/strecklista/urls.py +++ b/strecklista/urls.py @@ -24,7 +24,10 @@ url(r'^login', views.login, name='login'), url(r'^profile/(?P[0-9]+)', views.profile, name='profile'), url(r'^bulkTransactions/', views.bulkTransactions, name='bulkTransactions'), + + url(r'^quote/(?P[0-9]+)', views.singleQuote, name='singleQuote'), url(r'^quote/', views.quote, name='quote'), + url(r'^submitQuote/', views.submitQuote, name='submitQuote'), url(r'^heddaHopper/', views.heddaHopper, name='heddaHopper'), diff --git a/strecklista/views.py b/strecklista/views.py index f65ee89..5ff732b 100644 --- a/strecklista/views.py +++ b/strecklista/views.py @@ -323,6 +323,15 @@ def quote(request): 'quotes': Quote.objects.order_by('-id'), }) +@login_required +def singleQuote(request, quote_id): + return render(request, 'strecklista/single_quote.html', { + 'form': QuoteForm(), + 'quote': Quote.objects.filter(id=quote_id).first(), + }) + + + @login_required def product(request): From 3523e45eb74bd738f3ef0b6a1cd7f7195fe2e28f Mon Sep 17 00:00:00 2001 From: Martin Alge Date: Sun, 6 May 2018 16:19:03 +0200 Subject: [PATCH 3/4] Revert "small change needed for django 1.10+" This reverts commit 30a0347d6ccae3aa12bbd3ed6386d921363e55ad. --- alge/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alge/settings.py b/alge/settings.py index c9955a3..93d7714 100644 --- a/alge/settings.py +++ b/alge/settings.py @@ -86,7 +86,7 @@ def filter_non_strings(items): 'django_extensions', ]) -MIDDLEWARE_CLASSES = filter_non_strings([ +MIDDLEWARE = filter_non_strings([ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', From 5a8ba9dedf495460173cfd9246eb86e0d934eb17 Mon Sep 17 00:00:00 2001 From: Martin Alge Date: Sun, 6 May 2018 16:22:16 +0200 Subject: [PATCH 4/4] Made removed unused javascript and style tags from the quote css file --- .../strecklista/components/quote.css | 6 ++---- strecklista/templates/strecklista/quotes.html | 2 ++ .../templates/strecklista/single_quote.html | 21 ++----------------- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/strecklista/templates/strecklista/components/quote.css b/strecklista/templates/strecklista/components/quote.css index 3d9bf2c..aa1353a 100644 --- a/strecklista/templates/strecklista/components/quote.css +++ b/strecklista/templates/strecklista/components/quote.css @@ -1,4 +1,4 @@ - \ No newline at end of file +} \ No newline at end of file diff --git a/strecklista/templates/strecklista/quotes.html b/strecklista/templates/strecklista/quotes.html index 6ec89ad..a501196 100644 --- a/strecklista/templates/strecklista/quotes.html +++ b/strecklista/templates/strecklista/quotes.html @@ -1,6 +1,8 @@ {% extends 'strecklista/base.html' %} {% block content %} + {% include "strecklista/snippets/navbar.html" %}

Citat