From 91c888db8ff6275f35c315f76f666840b58e9b45 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 2 Sep 2020 00:22:42 +0200 Subject: [PATCH 01/44] Handle HomeView for unauthenticated users with separate template. --- lostplaces/lostplaces_app/views/views.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lostplaces/lostplaces_app/views/views.py b/lostplaces/lostplaces_app/views/views.py index 28f7f25..552ca7a 100644 --- a/lostplaces/lostplaces_app/views/views.py +++ b/lostplaces/lostplaces_app/views/views.py @@ -8,6 +8,7 @@ from django.shortcuts import render, redirect from lostplaces_app.forms import ExplorerCreationForm from lostplaces_app.models import Place, PhotoAlbum +from lostplaces_app.views import IsAuthenticated from lostplaces_app.views.base_views import ( PlaceAssetCreateView, @@ -19,7 +20,7 @@ class SignUpView(SuccessMessageMixin, CreateView): template_name = 'signup.html' success_message = 'User created.' -class HomeView(View): +class HomeView(IsAuthenticated, View): def get(self, request, *args, **kwargs): place_list = Place.objects.all().order_by('-submitted_when')[:10] place_map_center = Place.average_latlon(place_list) @@ -29,6 +30,13 @@ class HomeView(View): } return render(request, 'home.html', context) + def handle_no_permission(self): + place_list = Place.objects.all().order_by('-submitted_when')[:10] + context = { + 'place_list': place_list + } + return render(self.request, 'home_unauth.html', context) + class PhotoAlbumCreateView(PlaceAssetCreateView): model = PhotoAlbum fields = ['url', 'label'] From b95e565bef30cfb958b933dded9fbe276fd66f96 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 2 Sep 2020 00:26:03 +0200 Subject: [PATCH 02/44] Stripped down unauth_home template, limited places to 5. --- .../lostplaces_app/templates/home_unauth.html | 31 +++++++++++++++++++ lostplaces/lostplaces_app/views/views.py | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 lostplaces/lostplaces_app/templates/home_unauth.html diff --git a/lostplaces/lostplaces_app/templates/home_unauth.html b/lostplaces/lostplaces_app/templates/home_unauth.html new file mode 100644 index 0000000..9c6054e --- /dev/null +++ b/lostplaces/lostplaces_app/templates/home_unauth.html @@ -0,0 +1,31 @@ +{% extends 'global.html'%} + +# {% block title %}Start{% endblock %} + +{% block maincontent %} + +
+

Our latest locations

+ +
+ +{% endblock maincontent %} \ No newline at end of file diff --git a/lostplaces/lostplaces_app/views/views.py b/lostplaces/lostplaces_app/views/views.py index 552ca7a..030b21c 100644 --- a/lostplaces/lostplaces_app/views/views.py +++ b/lostplaces/lostplaces_app/views/views.py @@ -31,7 +31,7 @@ class HomeView(IsAuthenticated, View): return render(request, 'home.html', context) def handle_no_permission(self): - place_list = Place.objects.all().order_by('-submitted_when')[:10] + place_list = Place.objects.all().order_by('-submitted_when')[:5] context = { 'place_list': place_list } From b7b3c5b89b8c64cc978859062bcb843be2e8dca1 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 2 Sep 2020 22:46:10 +0200 Subject: [PATCH 03/44] Added welcome message to home for authed and unauthed users. --- lostplaces/lostplaces_app/templates/home.html | 3 +++ lostplaces/lostplaces_app/templates/home_unauth.html | 2 ++ 2 files changed, 5 insertions(+) diff --git a/lostplaces/lostplaces_app/templates/home.html b/lostplaces/lostplaces_app/templates/home.html index 615b6e3..c47eac6 100644 --- a/lostplaces/lostplaces_app/templates/home.html +++ b/lostplaces/lostplaces_app/templates/home.html @@ -1,4 +1,5 @@ {% extends 'global.html'%} + {% load static %} {% block additional_head %} @@ -9,6 +10,8 @@ {% block maincontent %} +{% include 'partials/welcome.html' %} + {% include 'partials/osm_map.html' %}

Explore the latest locations

diff --git a/lostplaces/lostplaces_app/templates/home_unauth.html b/lostplaces/lostplaces_app/templates/home_unauth.html index 9c6054e..cad902c 100644 --- a/lostplaces/lostplaces_app/templates/home_unauth.html +++ b/lostplaces/lostplaces_app/templates/home_unauth.html @@ -4,6 +4,8 @@ {% block maincontent %} +{% include 'partials/welcome.html' %} +

Our latest locations

    From b755f7f45ef1bb19d732d642de7b25b820bb19b3 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 2 Sep 2020 22:46:37 +0200 Subject: [PATCH 04/44] Added basic lorem ipsum welcome message. --- .../templates/partials/welcome.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lostplaces/lostplaces_app/templates/partials/welcome.html diff --git a/lostplaces/lostplaces_app/templates/partials/welcome.html b/lostplaces/lostplaces_app/templates/partials/welcome.html new file mode 100644 index 0000000..cd04285 --- /dev/null +++ b/lostplaces/lostplaces_app/templates/partials/welcome.html @@ -0,0 +1,18 @@ +
    +
    +

    Start

    +
    + +
    +

    + Welcome + {% if user.is_authenticated %} + {{ user.username }} + {% else %} + explorer + {% endif %} + !

    + +

    {% lorem %}

    +
    +
    From 20a735d2ecca17e045d9a4e567350864952d6779 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 2 Sep 2020 23:13:54 +0200 Subject: [PATCH 05/44] Added 0.75em margin-bottom to LP-Paragraph. --- lostplaces/lostplaces_app/static/main.css | 3 ++- lostplaces/lostplaces_app/templates/partials/welcome.html | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lostplaces/lostplaces_app/static/main.css b/lostplaces/lostplaces_app/static/main.css index c35f299..f797e44 100644 --- a/lostplaces/lostplaces_app/static/main.css +++ b/lostplaces/lostplaces_app/static/main.css @@ -556,7 +556,8 @@ body { font-family: Crimson, Times, serif; font-size: 1.2rem; padding: 0; - margin: 0; } + margin: 0; + margin-bottom: 0.75em; } .LP-Icon { height: 20px; diff --git a/lostplaces/lostplaces_app/templates/partials/welcome.html b/lostplaces/lostplaces_app/templates/partials/welcome.html index cd04285..97b0f88 100644 --- a/lostplaces/lostplaces_app/templates/partials/welcome.html +++ b/lostplaces/lostplaces_app/templates/partials/welcome.html @@ -4,15 +4,15 @@
    -

    - Welcome +

    Welcome {% if user.is_authenticated %} {{ user.username }} {% else %} explorer {% endif %} - !

    + !

    {% lorem %}

    +

    {% lorem %}

    From c28cc3ac3c3a6420c9b35b4649f97c5b3f8f7d2b Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 2 Sep 2020 23:56:19 +0200 Subject: [PATCH 06/44] Removed lorem dummy content from welcome message. --- .../templates/partials/welcome.html | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/lostplaces/lostplaces_app/templates/partials/welcome.html b/lostplaces/lostplaces_app/templates/partials/welcome.html index 97b0f88..548f4d6 100644 --- a/lostplaces/lostplaces_app/templates/partials/welcome.html +++ b/lostplaces/lostplaces_app/templates/partials/welcome.html @@ -1,18 +1,13 @@ -
    -
    -

    Start

    -
    +
    +

    Start

    +
    -
    -

    Welcome - {% if user.is_authenticated %} - {{ user.username }} - {% else %} - explorer - {% endif %} - !

    - -

    {% lorem %}

    -

    {% lorem %}

    -
    -
    +
    +

    Welcome to our Urban Exploration community catalogue, + {% if user.is_authenticated %} + {{ user.username }} + {% else %} + explorer + {% endif %} + !

    +
    From ae41f539a19bfd7f30c8c4fd980048e7b1feebc8 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 2 Sep 2020 23:57:29 +0200 Subject: [PATCH 07/44] Added empty article on home for logged-in users. --- lostplaces/lostplaces_app/templates/home.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lostplaces/lostplaces_app/templates/home.html b/lostplaces/lostplaces_app/templates/home.html index c47eac6..726fbf5 100644 --- a/lostplaces/lostplaces_app/templates/home.html +++ b/lostplaces/lostplaces_app/templates/home.html @@ -11,6 +11,8 @@ {% block maincontent %} {% include 'partials/welcome.html' %} +
    +
    {% include 'partials/osm_map.html' %}
    From c722830e664153d385f907399a2a4cd0d8e75964 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 3 Sep 2020 00:02:28 +0200 Subject: [PATCH 08/44] Added unauthed introduction. --- lostplaces/lostplaces_app/templates/home_unauth.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lostplaces/lostplaces_app/templates/home_unauth.html b/lostplaces/lostplaces_app/templates/home_unauth.html index cad902c..2686f10 100644 --- a/lostplaces/lostplaces_app/templates/home_unauth.html +++ b/lostplaces/lostplaces_app/templates/home_unauth.html @@ -5,6 +5,18 @@ {% block maincontent %} {% include 'partials/welcome.html' %} +
    +

    + You can create, view and share your favorite lost places with other + members of this site. You can upload photos, place links to your + web galleries and contribute your knowledge by tagging other places or + commenting on them. You will find detailed information on where these + locations are, how to get there and what to expect from them. This might + even include information on how to overcome security measures or where + to watch for cameras or security personnel. +

    +

    {% lorem %}

    +

    Our latest locations

    From 6bf8eb7083cc6fb8e3815ae14a34adb6c92a7ba6 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 3 Sep 2020 00:05:37 +0200 Subject: [PATCH 09/44] Deleted hello_world template :-$ --- lostplaces/lostplaces_app/templates/hello_world.html | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 lostplaces/lostplaces_app/templates/hello_world.html diff --git a/lostplaces/lostplaces_app/templates/hello_world.html b/lostplaces/lostplaces_app/templates/hello_world.html deleted file mode 100644 index 371ca96..0000000 --- a/lostplaces/lostplaces_app/templates/hello_world.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Document - - - {{text}} - - \ No newline at end of file From 81a5e8246a8b3359b17bd343af4f88287f9a88cb Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 3 Sep 2020 00:11:08 +0200 Subject: [PATCH 10/44] Added CodexView, template missing. --- lostplaces/lostplaces_app/urls.py | 6 ++++-- lostplaces/lostplaces_app/views/views.py | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lostplaces/lostplaces_app/urls.py b/lostplaces/lostplaces_app/urls.py index b319793..d10e67b 100644 --- a/lostplaces/lostplaces_app/urls.py +++ b/lostplaces/lostplaces_app/urls.py @@ -8,7 +8,8 @@ from .views import ( PlaceUpdateView, PlaceDeleteView, PhotoAlbumCreateView, - PhotoAlbumDeleteView + PhotoAlbumDeleteView, + CodexView ) urlpatterns = [ @@ -20,5 +21,6 @@ urlpatterns = [ path('photo_album/delete/', PhotoAlbumDeleteView.as_view(), name='photo_album_delete'), path('place/update//', PlaceUpdateView.as_view(), name='place_edit'), path('place/delete//', PlaceDeleteView.as_view(), name='place_delete'), - path('place/', PlaceListView.as_view(), name='place_list') + path('place/', PlaceListView.as_view(), name='place_list'), + path('codex/', CodexView, name='codex') ] diff --git a/lostplaces/lostplaces_app/views/views.py b/lostplaces/lostplaces_app/views/views.py index 030b21c..1970bee 100644 --- a/lostplaces/lostplaces_app/views/views.py +++ b/lostplaces/lostplaces_app/views/views.py @@ -47,4 +47,7 @@ class PhotoAlbumDeleteView(PlaceAssetDeleteView): model = PhotoAlbum pk_url_kwarg = 'pk' success_message = 'Photo Album deleted' - permission_denied_messsage = 'You do not have permissions to alter this photo album' \ No newline at end of file + permission_denied_messsage = 'You do not have permissions to alter this photo album' + +def CodexView(request): + return render(request, 'codex.html') From 5c3b68252e69cf5740737196b0ead50270efd393 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 3 Sep 2020 00:17:42 +0200 Subject: [PATCH 11/44] Added note and link to UrBex codex. --- .../templates/partials/welcome.html | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lostplaces/lostplaces_app/templates/partials/welcome.html b/lostplaces/lostplaces_app/templates/partials/welcome.html index 548f4d6..ea09419 100644 --- a/lostplaces/lostplaces_app/templates/partials/welcome.html +++ b/lostplaces/lostplaces_app/templates/partials/welcome.html @@ -4,10 +4,16 @@

    Welcome to our Urban Exploration community catalogue, - {% if user.is_authenticated %} - {{ user.username }} - {% else %} - explorer - {% endif %} - !

    + {% if user.is_authenticated %} + {{ user.username }} + {% else %} + explorer + {% endif %} + ! +

    +

    + We strictly follow our + UrBex codex + and expect you to do so, too. +

    From cba3fe436636ff4f14398d8446aa50fe310d4ccb Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 3 Sep 2020 00:26:26 +0200 Subject: [PATCH 12/44] Added codex link to sitebar. --- lostplaces/lostplaces_app/templates/global.html | 1 + 1 file changed, 1 insertion(+) diff --git a/lostplaces/lostplaces_app/templates/global.html b/lostplaces/lostplaces_app/templates/global.html index fa23d10..ae53e87 100644 --- a/lostplaces/lostplaces_app/templates/global.html +++ b/lostplaces/lostplaces_app/templates/global.html @@ -48,6 +48,7 @@
    - + + {% endfor %} +
+
+ {% endif %} + {% block maincontent %} + {% endblock maincontent %} + + +
+ + {% block footer %} + {% include 'partials/nav/footer.html' %} + {% endblock footer %} + + \ No newline at end of file From ae2c9ed956e36040c1e9f3089ff20cde85f99692 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sun, 6 Sep 2020 19:46:15 +0200 Subject: [PATCH 25/44] Added footer and pulled it 5em away from maincontent. --- lostplaces/lostplaces_app/static/main.css | 3 +- .../lostplaces_app/templates/global.html | 2 +- .../templates/partials/nav/footer.html | 66 +++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 lostplaces/lostplaces_app/templates/partials/nav/footer.html diff --git a/lostplaces/lostplaces_app/static/main.css b/lostplaces/lostplaces_app/static/main.css index fb70e4e..202e499 100644 --- a/lostplaces/lostplaces_app/static/main.css +++ b/lostplaces/lostplaces_app/static/main.css @@ -1258,7 +1258,8 @@ body { color: #f9f9f9; } .LP-Footer__Flex { display: flex; - flex-flow: row wrap; } + flex-flow: row wrap; + margin-top: 5em; } .LP-Footer__ListTop { text-align: center; width: 33.333%; } diff --git a/lostplaces/lostplaces_app/templates/global.html b/lostplaces/lostplaces_app/templates/global.html index 6214a19..ff5c31e 100644 --- a/lostplaces/lostplaces_app/templates/global.html +++ b/lostplaces/lostplaces_app/templates/global.html @@ -90,4 +90,4 @@ {% endblock footer %} - \ No newline at end of file + diff --git a/lostplaces/lostplaces_app/templates/partials/nav/footer.html b/lostplaces/lostplaces_app/templates/partials/nav/footer.html new file mode 100644 index 0000000..9776275 --- /dev/null +++ b/lostplaces/lostplaces_app/templates/partials/nav/footer.html @@ -0,0 +1,66 @@ + From 45dba4842135278f2d1f8e01c9f4666f49a9b28a Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sun, 6 Sep 2020 19:52:02 +0200 Subject: [PATCH 26/44] Added a few comment lines. --- .../lostplaces_app/templates/partials/nav/footer.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lostplaces/lostplaces_app/templates/partials/nav/footer.html b/lostplaces/lostplaces_app/templates/partials/nav/footer.html index 9776275..1142d28 100644 --- a/lostplaces/lostplaces_app/templates/partials/nav/footer.html +++ b/lostplaces/lostplaces_app/templates/partials/nav/footer.html @@ -1,5 +1,7 @@
-
From f2b6c3e1028b09b5514fd3252e1c50e64b05c6a7 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 7 Sep 2020 22:16:09 +0200 Subject: [PATCH 29/44] Created a stupid flatpage view and urlpattern. --- lostplaces/lostplaces_app/templates/global.html | 2 +- .../lostplaces_app/templates/partials/nav/footer.html | 4 ++-- lostplaces/lostplaces_app/urls.py | 4 ++-- lostplaces/lostplaces_app/views/views.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lostplaces/lostplaces_app/templates/global.html b/lostplaces/lostplaces_app/templates/global.html index ff5c31e..481704d 100644 --- a/lostplaces/lostplaces_app/templates/global.html +++ b/lostplaces/lostplaces_app/templates/global.html @@ -48,7 +48,7 @@