Compare commits
6 Commits
ca0e1a48dc
...
b0ddf91677
Author | SHA1 | Date | |
---|---|---|---|
b0ddf91677 | |||
c30af40079 | |||
dd266f8cdf | |||
9c70da0b77 | |||
89bc00e5da | |||
72dc41ab79 |
@ -137,17 +137,6 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')
|
|||||||
AUTH_USER_MODEL = 'lostplaces_app.Explorer'
|
AUTH_USER_MODEL = 'lostplaces_app.Explorer'
|
||||||
|
|
||||||
# Templates to use for authentication
|
# Templates to use for authentication
|
||||||
LOGIN_REDIRECT_URL = 'home'
|
|
||||||
LOGOUT_REDIRECT_URL = 'home'
|
|
||||||
|
|
||||||
LOGIN_URL = reverse_lazy('login')
|
LOGIN_URL = reverse_lazy('login')
|
||||||
|
LOGIN_REDIRECT_URL = reverse_lazy('lostplaces_home')
|
||||||
THUMBNAIL_ALIASES = {
|
LOGOUT_REDIRECT_URL = reverse_lazy('lostplaces_home')
|
||||||
'': {
|
|
||||||
'thumbnail': {'size': (300, 200), 'crop': True},
|
|
||||||
'hero': {'size': (700, 466), 'crop': True},
|
|
||||||
'large': {'size': (1920, 1920), 'crop': False},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
SVG_ICONS_SOURCE_FILE = os.path.join(BASE_DIR, 'lostplaces_app', 'static', 'icons', 'icons.icomoon.json')
|
|
||||||
|
@ -23,8 +23,11 @@ from django.conf.urls.static import static
|
|||||||
from django.urls import path, include
|
from django.urls import path, include
|
||||||
from django.views.generic.base import TemplateView
|
from django.views.generic.base import TemplateView
|
||||||
|
|
||||||
|
from lostplaces_app.views import SignUpView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
|
path('signup/', SignUpView.as_view(), name='signup'),
|
||||||
path('explorers/', include('django.contrib.auth.urls')),
|
path('explorers/', include('django.contrib.auth.urls')),
|
||||||
path('', include('lostplaces_app.urls')),
|
path('', include('lostplaces_app.urls')),
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
@ -1,2 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
settings.THUMBNAIL_ALIASES = {
|
||||||
|
'': {
|
||||||
|
'thumbnail': {'size': (300, 200), 'crop': True},
|
||||||
|
'hero': {'size': (700, 466), 'crop': True},
|
||||||
|
'large': {'size': (1920, 1920), 'crop': False},
|
||||||
|
},
|
||||||
|
}
|
@ -16,77 +16,78 @@
|
|||||||
</title>
|
</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="LP-Wrapper__Site">
|
<div class="LP-Wrapper__Site">
|
||||||
<header class="LP-Header">
|
<header class="LP-Header">
|
||||||
<div class="LP-Header__Logo">
|
<div class="LP-Header__Logo">
|
||||||
<a class="LP-Link" href="/">
|
<a class="LP-Link" href="/">
|
||||||
<img src="{% static 'logo.png' %}" class="LP-Image" />
|
<img src="{% static 'logo.png' %}" class="LP-Image" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="LP-Header__UserInformation">
|
<div class="LP-Header__UserInformation">
|
||||||
<span class="LP-Paragraph">
|
<span class="LP-Paragraph">
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
Hi {{ user.username }}!
|
Hi {{ user.username }}!
|
||||||
<a class="LP-Link" href="{% url 'logout' %}"><span class="LP-Link__Text">logout</span></a>
|
<a class="LP-Link" href="{% url 'logout' %}"><span class="LP-Link__Text">logout</span></a>
|
||||||
{% if user.is_superuser %}
|
{% if user.is_superuser %}
|
||||||
<a class="LP-Link" href="{% url 'admin:index' %}" target="_blank"><span class="LP-Link__Text">admin</span></a>
|
<a class="LP-Link" href="{% url 'admin:index' %}" target="_blank"><span class="LP-Link__Text">admin</span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
You are not logged in.
|
You are not logged in.
|
||||||
<a class="LP-Link" href="{% url 'login' %}"><span class="LP-Link__Text">login</span></a> |
|
<a class="LP-Link" href="{% url 'login' %}"><span class="LP-Link__Text">login</span></a> |
|
||||||
<a class="LP-Link" href="{% url 'signup' %}"><span class="LP-Link__Text">signup</span></a>
|
<a class="LP-Link" href="{% url 'signup' %}"><span class="LP-Link__Text">signup</span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<input id="toggle_sidebar" class="LP-Menu__Trigger" type="checkbox" />
|
<input id="toggle_sidebar" class="LP-Menu__Trigger" type="checkbox" />
|
||||||
<label id="toggle_sidebar_label" for="toggle_sidebar" class="LP-Menu__TriggerLabel"></label>
|
<label id="toggle_sidebar_label" for="toggle_sidebar" class="LP-Menu__TriggerLabel"></label>
|
||||||
<aside class="LP-Main__Sidebar">
|
<aside class="LP-Main__Sidebar">
|
||||||
<nav class="LP-Menu LP-Menu--sidebar">
|
<nav class="LP-Menu LP-Menu--sidebar">
|
||||||
<ul class="LP-Menu__List">
|
<ul class="LP-Menu__List">
|
||||||
<li class="LP-Menu__Item"><a href="/" class="LP-Link"><span class="LP-Link__Text">Home</span></a></li>
|
<li class="LP-Menu__Item"><a href="{% url 'lostplaces_home' %}" class="LP-Link"><span class="LP-Link__Text">Home</span></a></li>
|
||||||
<li class="LP-Menu__Item"><a href="{% url 'flatpage' slug='codex' %}" class="LP-Link"><span class="LP-Link__Text">UrBex codex</span></a></li>
|
<li class="LP-Menu__Item"><a href="{% url 'flatpage' slug='codex' %}" class="LP-Link"><span class="LP-Link__Text">UrBex codex</span></a></li>
|
||||||
|
|
||||||
{% block additional_menu_items %}
|
{% block additional_menu_items %}
|
||||||
{% endblock additional_menu_items %}
|
{% endblock additional_menu_items %}
|
||||||
|
|
||||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_create'%}" class="LP-Link"><span class="LP-Link__Text">Create place</span></a></li>
|
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_create'%}" class="LP-Link"><span class="LP-Link__Text">Create place</span></a></li>
|
||||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_list'%}" class="LP-Link"><span class="LP-Link__Text">See all places</span></a></li>
|
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_list'%}" class="LP-Link"><span class="LP-Link__Text">See all places</span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
||||||
<main class="LP-Main__Content">
|
<main class="LP-Main__Content">
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
<div class="LP-MessageList">
|
<div class="LP-MessageList">
|
||||||
<ul class="LP-MessageList__List">
|
<ul class="LP-MessageList__List">
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<li class="LP-MessageList__Item">
|
<li class="LP-MessageList__Item">
|
||||||
<div class="LP-Message {% if message.tags %}LP-Message--{{ message.tags }}{% endif %}">
|
<div class="LP-Message {% if message.tags %}LP-Message--{{ message.tags }}{% endif %}">
|
||||||
<div>
|
<div>
|
||||||
<div class="LP-Message__Icon">
|
<div class="LP-Message__Icon">
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="LP-Message__Text">
|
|
||||||
{{ message }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
<div class="LP-Message__Text">
|
||||||
{% endfor %}
|
{{ message }}
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
{% endblock maincontent %}
|
{% endblock maincontent %}
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
{% include 'partials/nav/footer.html' %}
|
{% include 'partials/nav/footer.html' %}
|
||||||
{% endblock footer %}
|
{% endblock footer %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
|
||||||
|
</html>
|
@ -3,7 +3,6 @@ from .views import (
|
|||||||
HomeView,
|
HomeView,
|
||||||
PlaceDetailView,
|
PlaceDetailView,
|
||||||
PlaceListView,
|
PlaceListView,
|
||||||
SignUpView,
|
|
||||||
PlaceCreateView,
|
PlaceCreateView,
|
||||||
PlaceUpdateView,
|
PlaceUpdateView,
|
||||||
PlaceDeleteView,
|
PlaceDeleteView,
|
||||||
@ -15,8 +14,7 @@ from .views import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', HomeView.as_view(), name='home'),
|
path('', HomeView.as_view(), name='lostplaces_home'),
|
||||||
path('signup/', SignUpView.as_view(), name='signup'),
|
|
||||||
path('place/<int:pk>/', PlaceDetailView.as_view(), name='place_detail'),
|
path('place/<int:pk>/', PlaceDetailView.as_view(), name='place_detail'),
|
||||||
path('place/create/', PlaceCreateView.as_view(), name='place_create'),
|
path('place/create/', PlaceCreateView.as_view(), name='place_create'),
|
||||||
path('photo_album/create/<int:place_id>', PhotoAlbumCreateView.as_view(), name='photo_album_create'),
|
path('photo_album/create/<int:place_id>', PhotoAlbumCreateView.as_view(), name='photo_album_create'),
|
||||||
|
@ -17,7 +17,7 @@ class IsAuthenticated(LoginRequiredMixin, View):
|
|||||||
If the user is not logged in, he gets redirected to
|
If the user is not logged in, he gets redirected to
|
||||||
the login page.
|
the login page.
|
||||||
'''
|
'''
|
||||||
redirect_field_name = 'redirect_to'
|
login_url = reverse_lazy('login')
|
||||||
permission_denied_message = 'Please login to proceed'
|
permission_denied_message = 'Please login to proceed'
|
||||||
|
|
||||||
def handle_no_permission(self):
|
def handle_no_permission(self):
|
||||||
@ -83,7 +83,6 @@ class PlaceAssetCreateView(IsAuthenticated, SuccessMessageMixin, CreateView):
|
|||||||
|
|
||||||
class PlaceAssetDeleteView(IsAuthenticated, IsPlaceSubmitter, SingleObjectMixin, View):
|
class PlaceAssetDeleteView(IsAuthenticated, IsPlaceSubmitter, SingleObjectMixin, View):
|
||||||
model = None
|
model = None
|
||||||
pk_url_kwarg = 'pk'
|
|
||||||
success_message = ''
|
success_message = ''
|
||||||
permission_denied_message = ''
|
permission_denied_message = ''
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user