Deleted all the defunct venv stuff and moved project dir to root.

This commit is contained in:
2020-07-29 09:30:01 +02:00
parent 8e25d5dff2
commit bf3a7d5c35
892 changed files with 0 additions and 147427 deletions

View File

View File

@@ -0,0 +1,16 @@
"""
ASGI config for lostplaces project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lostplaces.settings')
application = get_asgi_application()

View File

@@ -0,0 +1,135 @@
"""
Django settings for lostplaces project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'n$(bx8(^)*wz1ygn@-ekt7rl^1km*!_c+fwwjiua8m@-x_rpl0'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'lostplaces_app',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_thumbs'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'lostplaces.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'lostplaces.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static")
]
MEDIA_URL = '/uploads/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')
# Use custom user model
AUTH_USER_MODEL = 'lostplaces_app.Explorer'
# Templates to use for authentication
LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'home'

View File

@@ -0,0 +1,27 @@
"""lostplaces URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from django.urls import path, include
from django.views.generic.base import TemplateView
urlpatterns = [
path('', TemplateView.as_view(template_name='home.html'), name='home'),
path('admin/', admin.site.urls),
path('explorers/', include('django.contrib.auth.urls')),
path('', include('lostplaces_app.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@@ -0,0 +1,16 @@
"""
WSGI config for lostplaces project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lostplaces.settings')
application = get_wsgi_application()

View File

View File

@@ -0,0 +1,20 @@
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .models import *
from .forms import ExplorerCreationForm, ExplorerChangeForm
from .models import Explorer
# Register your models here.
class ExplorerAdmin(UserAdmin):
add_form = ExplorerCreationForm
form = ExplorerChangeForm
model = Explorer
list_display = ['email', 'username',]
admin.site.register(Explorer, ExplorerAdmin)
admin.site.register(Place)
admin.site.register(PlaceImage)

View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class LostplacesAppConfig(AppConfig):
name = 'lostplaces_app'

View File

@@ -0,0 +1,15 @@
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import Explorer
class ExplorerCreationForm(UserCreationForm):
class Meta:
model = Explorer
fields = ('username', 'email')
class ExplorerChangeForm(UserChangeForm):
class Meta:
model = Explorer
fields = ('username', 'email')

View File

@@ -0,0 +1,67 @@
# Generated by Django 3.0.8 on 2020-07-28 19:00
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_thumbs.fields
import lostplaces_app.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='Place',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('location', models.CharField(max_length=50)),
('latitude', models.FloatField()),
('longitude', models.FloatField()),
('description', models.TextField()),
],
),
migrations.CreateModel(
name='PlaceImage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('filename', django_thumbs.fields.ImageThumbsField(max_length=50, sizes=({'code': 'thumbnail', 'wxh': '390x390'}, {'code': 'hero', 'wxh': '700x700'}, {'code': 'large', 'wxh': '1920x1920'}), upload_to=lostplaces_app.models.generate_image_upload_path)),
('description', models.TextField(blank=True)),
('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='lostplaces_app.Place')),
],
),
migrations.CreateModel(
name='Explorer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]

View File

@@ -0,0 +1,79 @@
import os
import uuid
from django.db import models
from django.dispatch import receiver
from django.contrib.auth.models import AbstractUser
from django_thumbs.fields import ImageThumbsField
# Create your models here.
# Custom user model
class Explorer(AbstractUser):
# add additional fields in here
def __str__(self):
return self.username
# Place defines a lost place (location, name, description etc.).
class Place (models.Model):
name = models.CharField(max_length=50)
location = models.CharField(max_length=50)
latitude = models.FloatField()
longitude = models.FloatField()
description = models.TextField()
def __str__(self):
return self.name
# Define callback that generates /path/to/image.ext as filename.
def generate_image_upload_path(instance, filename):
return 'places/' + str(uuid.uuid4())+'.'+filename.split('.')[-1]
class PlaceImage (models.Model):
filename = ImageThumbsField(
upload_to=generate_image_upload_path,
max_length=50,
sizes=(
{'code': 'thumbnail', 'wxh': '390x390'},
{'code': 'hero', 'wxh': '700x700'},
{'code': 'large', 'wxh': '1920x1920'}
)
)
place = models.ForeignKey(Place, on_delete=models.CASCADE, related_name='images')
description = models.TextField(blank=True)
def __str__(self):
return ' '.join([self.place.name, str(self.pk)])
# These two auto-delete files from filesystem when they are unneeded:
@receiver(models.signals.post_delete, sender=PlaceImage)
def auto_delete_file_on_delete(sender, instance, **kwargs):
"""
Deletes file from filesystem
when corresponding `PlaceImage` object is deleted.
"""
if instance.filename:
if os.path.isfile(instance.filename.path):
os.remove(instance.filename.path)
@receiver(models.signals.pre_save, sender=PlaceImage)
def auto_delete_file_on_change(sender, instance, **kwargs):
"""
Deletes old file from filesystem
when corresponding `PlaceImage` object is updated
with new file.
"""
if not instance.pk:
return False
try:
old_file = PlaceImage.objects.get(pk=instance.pk).filename
except PlaceImage.DoesNotExist:
return False
new_file = instance.filename
if not old_file == new_file:
if os.path.isfile(old_file.path):
os.remove(old_file.path)

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

View File

@@ -0,0 +1 @@
<svg id="Capa_1" enable-background="new 0 0 512.07 512.07" height="512" viewBox="0 0 512.07 512.07" width="512" xmlns="http://www.w3.org/2000/svg"><g><path d="m509.759 194.639c-6.152-18.858-22.945-31.043-42.781-31.043h-127.918l-40.282-122.33c-6.192-18.805-22.95-30.926-42.729-30.926-.063 0-.128 0-.191.001-19.86.078-36.611 12.349-42.674 31.262l-39.108 121.993h-128.983c-19.886 0-36.692 12.226-42.814 31.146-6.123 18.92.335 38.674 16.453 50.324l104.361 75.434-40.17 121.991c-6.217 18.88.133 38.662 16.177 50.396 8.058 5.894 17.307 8.842 26.562 8.842 9.171-.001 18.347-2.897 26.365-8.693l104.542-75.563 103.3 75.436c16.026 11.704 36.781 11.76 52.873.147s22.575-31.328 16.518-50.227l-39.218-122.329 103.474-75.563c16.02-11.698 22.396-31.441 16.243-50.298zm-33.935 26.07-120.959 88.332 45.825 142.946c3.085 9.621-3.435 15.247-5.506 16.742s-9.465 5.91-17.625-.05l-120.901-88.289-122.206 88.333c-8.201 5.927-15.576 1.461-17.642-.05-2.065-1.511-8.558-7.187-5.392-16.8l47.033-142.833-122.145-88.287c-8.206-5.932-6.272-14.34-5.484-16.775s4.146-10.382 14.271-10.382h150.87l45.79-142.835c3.087-9.629 11.668-10.41 14.225-10.421h.052c2.62 0 11.113.769 14.255 10.309l47.07 142.947h149.624c10.1 0 13.469 7.92 14.261 10.348s2.74 10.81-5.416 16.765z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1 @@
<svg id="Capa_1" enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><g><path d="m512 165v-15h-166v-30c0-33.084-26.916-60-60-60h-196v-60h-90v512h90v-150h136v30c0 33.084 26.916 60 60 60h226v-15c0-37.162-8.647-56.762-16.276-74.055-7.365-16.691-13.724-31.107-13.724-61.945s6.359-45.254 13.724-61.945c7.629-17.293 16.276-36.893 16.276-74.055zm-452 317h-30v-452h30zm30-392h196c16.542 0 30 13.458 30 30v220.072c-8.833-5.123-19.075-8.072-30-8.072h-196zm166 302v-30h30c16.542 0 30 13.458 30 30s-13.458 30-30 30-30-13.458-30-30zm212.276-16.945c6.054 13.723 11.43 25.908 13.15 46.945h-143.498c5.123-8.833 8.072-19.075 8.072-30v-212h135.427c-1.721 21.037-7.097 33.223-13.15 46.945-7.63 17.293-16.277 36.893-16.277 74.055s8.647 56.762 16.276 74.055z"/></g></svg>

After

Width:  |  Height:  |  Size: 816 B

View File

@@ -0,0 +1 @@
<svg id="Capa_1" enable-background="new 0 0 511 511" height="512" viewBox="0 0 511 511" width="512" xmlns="http://www.w3.org/2000/svg"><g><path d="m255.5 59c-91.533 0-166 74.468-166 166s74.467 166 166 166 166-74.468 166-166-74.467-166-166-166zm0 302c-74.991 0-136-61.01-136-136s61.009-136 136-136 136 61.01 136 136-61.009 136-136 136z"/><path d="m415.306 66.193c-42.685-42.685-99.439-66.193-159.806-66.193s-117.121 23.508-159.806 66.193c-42.686 42.687-66.194 99.44-66.194 159.807 0 106.499 74.454 198.443 177.887 220.849l48.113 64.151 48.114-64.152c103.432-22.406 177.886-114.349 177.886-220.848 0-60.367-23.508-117.12-66.194-159.807zm-123.064 352.355-5.716 1.083-31.026 41.369-31.026-41.368-5.716-1.083c-92.28-17.495-159.258-98.474-159.258-192.549 0-108.075 87.925-196 196-196s196 87.925 196 196c0 94.074-66.978 175.053-159.258 192.548z"/></g></svg>

After

Width:  |  Height:  |  Size: 850 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -0,0 +1,298 @@
.LP-Link {
color: #565656;
text-decoration: none;
font-family: Roboto, Arial, sans-serif; }
.LP-Link:hover {
color: #C09F80; }
.LP-Link .LP-Text {
font-family: Roboto, Arial, sans-serif; }
.LP-Link .LP-Text:hover {
color: #C09F80; }
.LP-Link__IconWrapper {
display: inline; }
.LP-Headline {
font-family: "Trebuchet MS", Helvetica, sans-serif;
color: #565656;
font-size: 1.7rem;
padding-top: 0px;
margin-top: 0px;
padding-bottom: 0px;
margin-bottom: 0px; }
.LP-Headline--main {
position: relative;
top: 2rem;
font-size: 2rem; }
.LP-Headline--inline {
display: inline; }
.LP-Text {
color: black;
font-family: "Times New Roman", Times, serif;
font-size: 1.2rem; }
.LP-Icon {
height: 20px;
width: 20px; }
.LP-Icon__List {
list-style-type: none;
display: inline-flex;
justify-content: space-between;
justify-items: stretch;
padding: 0; }
.LP-Icon__List .LP-Icon__Item {
padding: 0 3px; }
.LP-Logo {
max-width: 100%;
max-height: 100%;
width: auto;
object-fit: contain; }
.LP-Content {
padding: 35px; }
@media (max-width: 1290px) {
.LP-Content {
padding: 15px; } }
.LP-TextSection .LP-Text {
line-height: 1.4rem; }
.LP-Place .LP-Place__Image {
width: 280px;
height: 165px;
object-fit: cover; }
.LP-Place .LP-Place__Assets {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 0.8rem;
padding: 0 10px;
padding-bottom: 10px; }
.LP-Place .LP-Place__Info .LP-Place__Title {
font-family: "Trebuchet MS", Helvetica, sans-serif;
color: #565656;
font-size: 1rem;
padding: 0px;
margin: 0px; }
.LP-Place .LP-Place__Info .LP-Place__Description {
font-family: Roboto, Arial, sans-serif;
color: #565656; }
.LP-Place .LP-Place__Info .LP-Place__Detail {
font-family: "Trebuchet MS", Helvetica, sans-serif;
padding: 0;
margin: 0;
margin-top: 5px;
font-size: 0.9rem; }
.LP-SecurityMeasure__List {
list-style-type: none;
display: flex;
flex-wrap: wrap;
padding: 0;
margin: 0; }
.LP-SecurityMeasure__List .LP-SecurityMeasure__Item {
margin: 5px 5px;
padding: 5px 8px;
background-color: #D7CEC7;
border-radius: 2px; }
.LP-SecurityMeasure__List .LP-SecurityMeasure__Item .LP-Text {
font-family: "Trebuchet MS", Helvetica, sans-serif;
font-size: 1.2rem; }
.LP-Header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 70px; }
.LP-Header__Logo {
max-width: 300px;
width: 35%;
object-fit: contain; }
.LP-Header .LP-Header__Logo {
margin: 25px; }
.LP-Menu__List {
list-style-type: none;
display: inline-flex;
justify-content: space-around; }
.LP-Menu__Item {
padding: 10px 15px;
margin: 0 15px;
width: 100px;
text-align: center;
background-color: transparent; }
.LP-Menu .LP-Link__Text {
color: #565656;
font-weight: bold;
text-shadow: 0px 0px 20px white; }
.LP-Menu .LP-Link__Text:hover {
color: #76323F; }
.LP-Introduction .LP-Headline {
font-size: 2rem; }
.LP-Introduction .LP-Text {
font-size: 1.3rem; }
.LP-Place__Grid {
margin: 0;
padding: 0;
list-style-type: none;
display: flex;
flex-direction: row;
flex-wrap: wrap; }
.LP-Place__Grid > .LP-Place__Item {
margin: 0 15px;
margin-bottom: 50px; }
.LP-Place__Grid .LP-Link .LP-Place__Description {
display: none; }
.LP-Place__Grid .LP-Link .LP-Place:hover {
box-shadow: 0 0 8px #565656; }
.LP-Place__List {
list-style-type: none; }
.LP-Place__List .LP-Place__Item {
max-width: 900px;
min-width: 450px;
margin: 25px 0; }
.LP-Place__List .LP-Place__Item .LP-Place {
display: flex;
flex-direction: row;
width: auto;
padding-right: 25px; }
.LP-Place__List .LP-Place__Item .LP-Place .LP-Place__Assets {
margin: 0;
padding: 0;
padding-left: 25px;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start; }
.LP-Place__List .LP-Place__Item .LP-Place .LP-Place__Assets .LP-Place__Info .LP-Place__Title {
font-size: 28px; }
.LP-Place__List .LP-Place__Item .LP-Place .LP-Place__Assets .LP-Icon__List {
justify-self: flex-end; }
.LP-Place__List .LP-Place__Item .LP-Place > .LP-Place__Image {
height: 168px;
width: 280px; }
.LP-LinkList__List {
list-style-type: none;
display: grid;
grid-template-columns: repeat(auto-fit, 300px);
margin: 0;
padding: 0; }
.LP-LinkList__List .LP-LinkList__Item {
border-left: 1px solid #C09F80;
width: 100%;
margin-top: 12px;
height: 55px; }
.LP-LinkList__List .LP-LinkList__Item .LP-Link {
padding: 1em 0 1em 1em;
width: calc(100% - $-link-padding);
display: block;
color: #565656; }
.LP-LinkList__List .LP-LinkList__Item .LP-Link--iconized {
padding-top: 0;
padding-bottom: 1.1em; }
.LP-LinkList__List .LP-LinkList__Item .LP-Link--iconized:hover {
background-color: #ccc !important; }
.LP-LinkList__List .LP-LinkList__Item .LP-Link--iconized .LP-Text {
padding-top: .1em; }
.LP-LinkList__List .LP-LinkList__Item .LP-Link:hover {
background-color: #f9f9f9;
color: #76323F; }
.LP-LinkList__List .LP-LinkList__Item .LP-Link .LP-Text {
color: inherit; }
.LP-Link__Icon {
width: 2em;
height: 2em;
fill: #76323F;
line-height: 5em; }
.LP-LinkList__Item .LP-Link__Icon {
position: relative;
top: .7em;
margin-right: .6em; }
.LP-Footer {
margin-top: 75px;
width: 100%;
background-color: #565656;
padding: 25px; }
.LP-Footer .LP-LinkList__List {
display: flex;
align-items: center;
justify-content: center; }
.LP-Footer .LP-LinkList__List .LP-LinkList__Item {
border: none;
padding: 5px;
width: auto; }
.LP-Footer .LP-LinkList__List .LP-LinkList__Item .LP-Text {
color: #f9f9f9;
font-size: 17px; }
.LP-Footer .LP-LinkList__List .LP-LinkList__Item .LP-Link {
display: inline; }
.LP-Footer .LP-LinkList__List .LP-LinkList__Item .LP-Link:hover {
background-color: inherit; }
.LP-MainContainer {
margin: 0 auto;
max-width: 1280px; }
.LP-HorizontalLine {
color: #565656; }
.LP-PlaceOverview .LP-PlaceOverview__Info .LP-PlaceOveriew__Image {
width: 700px;
height: 450px;
box-shadow: 0 0 10px #565656;
object-fit: cover;
float: right;
margin-left: 35px;
margin-bottom: 35px; }
.LP-PlaceOverview .LP-PlaceOverview__Info .LP-PlaceOverView__Description {
padding: 0px;
position: relative;
top: -15px; }
.LP-PlaceOverview .LP-PlaceOverView__ImageList {
list-style-type: none;
display: grid;
grid-template-columns: repeat(auto-fit, 300px);
margin: 0px;
padding: 0px; }
.LP-PlaceOverview .LP-PlaceOverView__ImageList .LP-PlaceOverView__ImageItem img {
box-shadow: 0 0 5px #565656;
height: 200px;
width: 290px;
object-fit: cover;
margin-top: 10px; }
@media (max-width: 1290px) {
.LP-PlaceOverview .LP-PlaceOverview__Info .LP-TextSection {
margin-top: -100px; }
.LP-PlaceOverview .LP-PlaceOverview__Info .LP-Headline {
position: relative;
top: -400px;
margin-bottom: 100px;
width: 100vw;
display: block; }
.LP-PlaceOverview .LP-PlaceOverview__Info .LP-PlaceOveriew__Image {
float: none;
width: calc(100vw - 30px);
margin: 0;
padding: 0;
margin-left: 7px; } }

View File

@@ -0,0 +1,36 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="{% static 'main.css' %}">
<link rel="icon" type="image/png" href="{% static 'favicon.ico' %}">
<title>
{% block title %}Urban Exploration{% endblock %}
</title>
</head>
<body>
<header class="LP-Header">
<div class="LP-Header__Logo">
<a class="LP-Link" href="#">
<img class="LP-Logo" src="{% static 'logo.png' %}" />
</a>
</div>
<div class="LP-Header__Navigation">
<nav class="LP-Menu">
<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="" class="LP-Link"><span class="LP-Link__Text">About</span></a></li>
<li class="LP-Menu__Item"><a href="" class="LP-Link"><span class="LP-Link__Text">Contact</span></a></li>
</ul>
</nav>
</div>
</header>
<article class="LP-MainContainer">
{% block maincontent %}
{% endblock maincontent %}
</article>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
{{text}}
</body>
</html>

View File

@@ -0,0 +1,35 @@
{% extends 'global.html'%}
{% load static %}
{% block title %}Lost Places{% endblock %}
{% block maincontent %}
<ul class="LP-Place__List">
{% for place in place_list %}
<li class="LP-Place__Item">
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
<article class="LP-Place">
<div class="LP-Place__ImageContainer">
<img class="LP-Place__Image" src="{{ place.images.first.filename.url_thumbnail }}" />
</div>
<div class="LP-Place__Assets">
<div class="LP-Place__Info">
<h3 class="LP-Place__Title">{{place.name}}</h3>
<p class="LP-Place__Detail">{{place.location}}</p>
</div>
<p class="LP-TextSection LP-Place__Description">
{{place.description|truncatechars:210|truncatewords:-1}}
</p>
<ul class="LP-Icon__List">
<li class="LP-Icon__Item"><img class="LP-Icon" src="{% static 'icons/favourite.svg' %}" /></li>
<li class="LP-Icon__Item"><img class="LP-Icon" src="{% static 'icons/location.svg' %}" /></li>
<li class="LP-Icon__Item"><img class="LP-Icon" src="{% static 'icons/flag.svg' %}" /></li>
</ul>
</div>
</article>
</a>
</li>
{% endfor %}
</ul>
{% endblock maincontent %}

View File

@@ -0,0 +1,75 @@
{% extends 'global.html'%}
{% load static %}
{% block title %}{{place.name}}{% endblock %}
{% block maincontent %}
<article class="LP-PlaceOverview">
<div class="LP-PlaceOverview__Info">
<img class="LP-PlaceOveriew__Image" src="{{ place.images.first.filename.url_hero }}">
<article class="LP-PlaceOverView__Description">
<div class="LP-TextSection">
<h1 class="LP-Headline LP-Headline--main">{{place.name}}</h1>
<p class="LP-Text LP-Content">{{place.description}}</p>
</div>
</article>
</div>
<article style="clear:both;">
<h2 class="LP-Headline LP-Headline">Sicherheitsmaßnahmen</h2>
<div class="LP-Content">
<ul class="LP-SecurityMeasure__List">
<li class="LP-SecurityMeasure__Item"><span class="LP-Text">Kameras</span></li>
<li class="LP-SecurityMeasure__Item"><span class="LP-Text">Zaun</span></li>
<li class="LP-SecurityMeasure__Item"><span class="LP-Text">Wachhund</span></li>
<li class="LP-SecurityMeasure__Item"><span class="LP-Text">Alarmanlage</span></li>
<li class="LP-SecurityMeasure__Item"><span class="LP-Text">Selbstschussanlage</span></li>
</ul>
</div>
</article>
<article>
<h2 class="LP-Headline LP-Headline">Karten</h2>
<div class="LP-Content">
<ul class="LP-LinkList__List">
<li class="LP-LinkList__Item"><a target="_blank" href="https://www.google.com/maps?q={{place.latitude}},{{place.longitude}}" class="LP-Link"><span class="LP-Text">Google Maps</span></a></li>
<li class="LP-LinkList__Item"><a target="_blank" href="https://www.tim-online.nrw.de/tim-online2/?center={{place.latitude}},{{place.longitude}}&icon=true&bg=dop" class="LP-Link"><span class="LP-Text">TIM Online</span></a></li>
<li class="LP-LinkList__Item"><a target="_blank" href="http://www.openstreetmap.org/?mlat={{place.latitude}}&mlon={{place.longitude}}&zoom=16" class="LP-Link"><span class="LP-Text">OSM</span></a></li>
</ul>
</div>
</article>
<article>
<h2 class="LP-Headline LP-Headline">Fotoalben</h2>
<div class="LP-Content">
<ul class="LP-LinkList__List">
<li class="LP-LinkList__Item"><a target="_blank" href="https://gallery.commander1024.de/index.php?/category/verlassenes-wohnhaus-mesum" class="LP-Link"><span class="LP-Text">Commander1024</span></a></li>
<li class="LP-LinkList__Item"><a href="#" class="LP-Link LP-Link--iconized">
<div class="LP-Link__IconWrapper">
<svg class="LP-Link__Icon" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512"
xml:space="preserve">
<g>
<path d="M492,236H276V20c0-11.046-8.954-20-20-20c-11.046,0-20,8.954-20,20v216H20c-11.046,0-20,8.954-20,20s8.954,20,20,20h216
v216c0,11.046,8.954,20,20,20s20-8.954,20-20V276h216c11.046,0,20-8.954,20-20C512,244.954,503.046,236,492,236z" />
</g>
</svg>
</div>
<span class="LP-Text">Album hinzufügen</span></a></li>
</ul>
</div>
</article>
<article class="">
<h2 class="LP-Headline LP-Headline">Bilder</h2>
<div class=" LP-Content">
<ul class="LP-PlaceOverView__ImageList">
{% for place_image in place.images.all %}
<li class="LP-PlaceOverView__ImageItem">
<a href="{{ place_image.filename.url_large }}"> <img src="{{ place_image.filename.url_thumbnail }}"></a>
</li>
{% endfor %}
</ul>
</div>
</article>
</article>
{% endblock maincontent %}

View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@@ -0,0 +1,9 @@
from django.urls import path
from .views import hello_world, place_detail_view, place_list_view, SignUpView
urlpatterns = [
path('hello_world/', hello_world), # You know what this is :P
path('signup/', SignUpView.as_view(), name='signup'),
path('place/<int:pk>/', place_detail_view, name='place_detail'),
path('places/', place_list_view)
]

View File

@@ -0,0 +1,22 @@
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic.edit import CreateView
from .forms import ExplorerCreationForm
from .models import Place
# Create your views here.
class SignUpView(CreateView):
form_class = ExplorerCreationForm
success_url = reverse_lazy('login')
template_name = 'signup.html'
def place_list_view(request,):
return render(request, 'placeList.html', {'place_list':Place.objects.all()})
def place_detail_view(request, pk):
return render(request, 'placeOverview.html', {'place':Place.objects.get(pk=pk)})
def hello_world(request):
return render(request, 'hello_world.html', {'text':'Hello World!'})

21
lostplaces/manage.py Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lostplaces.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,17 @@
{% extends 'global.html'%}
{% load static %}
# {% block title %}Start{% endblock %}
{% block maincontent %}
{% if user.is_authenticated %}
Hi {{ user.username }}!
<p><a href="{% url 'logout' %}">logout</a></p>
{% else %}
<p>Du bist nicht eingeloggt.</p>
<a href="{% url 'login' %}">login</a> |
<a href="{% url 'signup' %}">signup</a>
{% endif %}
{% endblock maincontent %}

View File

@@ -0,0 +1,15 @@
{% extends 'global.html'%}
{% load static %}
# {% block title %}Login{% endblock %}
{% block maincontent %}
<h2>Login</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
</form>
{% endblock maincontent %}

View File

@@ -0,0 +1,15 @@
{% extends 'global.html'%}
{% load static %}
# {% block title %}Registrierung{% endblock %}
{% block maincontent %}
<h2>Registrierung</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Sign up</button>
</form>
{% endblock maincontent %}