Compare commits

...

6 Commits

6 changed files with 82 additions and 83 deletions

View File

@ -137,17 +137,6 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')
AUTH_USER_MODEL = 'lostplaces_app.Explorer'
# Templates to use for authentication
LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'home'
LOGIN_URL = reverse_lazy('login')
THUMBNAIL_ALIASES = {
'': {
'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')
LOGIN_REDIRECT_URL = reverse_lazy('lostplaces_home')
LOGOUT_REDIRECT_URL = reverse_lazy('lostplaces_home')

View File

@ -23,8 +23,11 @@ from django.conf.urls.static import static
from django.urls import path, include
from django.views.generic.base import TemplateView
from lostplaces_app.views import SignUpView
urlpatterns = [
path('admin/', admin.site.urls),
path('signup/', SignUpView.as_view(), name='signup'),
path('explorers/', include('django.contrib.auth.urls')),
path('', include('lostplaces_app.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -1,2 +1,11 @@
#!/usr/bin/env python
# -*- 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},
},
}

View File

@ -46,7 +46,7 @@
<aside class="LP-Main__Sidebar">
<nav class="LP-Menu LP-Menu--sidebar">
<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>
{% block additional_menu_items %}
@ -89,4 +89,5 @@
{% endblock footer %}
</body>
</html>

View File

@ -3,7 +3,6 @@ from .views import (
HomeView,
PlaceDetailView,
PlaceListView,
SignUpView,
PlaceCreateView,
PlaceUpdateView,
PlaceDeleteView,
@ -15,8 +14,7 @@ from .views import (
)
urlpatterns = [
path('', HomeView.as_view(), name='home'),
path('signup/', SignUpView.as_view(), name='signup'),
path('', HomeView.as_view(), name='lostplaces_home'),
path('place/<int:pk>/', PlaceDetailView.as_view(), name='place_detail'),
path('place/create/', PlaceCreateView.as_view(), name='place_create'),
path('photo_album/create/<int:place_id>', PhotoAlbumCreateView.as_view(), name='photo_album_create'),

View File

@ -17,7 +17,7 @@ class IsAuthenticated(LoginRequiredMixin, View):
If the user is not logged in, he gets redirected to
the login page.
'''
redirect_field_name = 'redirect_to'
login_url = reverse_lazy('login')
permission_denied_message = 'Please login to proceed'
def handle_no_permission(self):
@ -83,7 +83,6 @@ class PlaceAssetCreateView(IsAuthenticated, SuccessMessageMixin, CreateView):
class PlaceAssetDeleteView(IsAuthenticated, IsPlaceSubmitter, SingleObjectMixin, View):
model = None
pk_url_kwarg = 'pk'
success_message = ''
permission_denied_message = ''