Compare commits
13 Commits
27-Favorit
...
e601b9bf6b
Author | SHA1 | Date | |
---|---|---|---|
e601b9bf6b | |||
6f6bd6376d | |||
dc2a703c39 | |||
063777ece4 | |||
4675e5814f | |||
35e0f912fe | |||
07fe1bc3ca | |||
d04e986419 | |||
cbbda88850 | |||
981c440ce3 | |||
c7368f5c44 | |||
20dd880a11 | |||
946c3091c0 |
@@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2020-10-11 21:53+0200\n"
|
"POT-Creation-Date: 2020-12-24 16:29+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: Commander1024 <commander@commander1024.de>\n"
|
"Last-Translator: Commander1024 <commander@commander1024.de>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@@ -30,7 +30,7 @@ msgstr "Ungültiger Voucher"
|
|||||||
msgid "Expired voucher"
|
msgid "Expired voucher"
|
||||||
msgstr "Abgelaufener Voucher"
|
msgstr "Abgelaufener Voucher"
|
||||||
|
|
||||||
#: models/abstract_models.py:29
|
#: models/abstract_models.py:29 templates/explorer/profile.html:19
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Name"
|
msgstr "Name"
|
||||||
|
|
||||||
@@ -74,6 +74,16 @@ msgstr "Adresse (URL)"
|
|||||||
msgid "link text"
|
msgid "link text"
|
||||||
msgstr "Linktext"
|
msgstr "Linktext"
|
||||||
|
|
||||||
|
#: models/models.py:46
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "Filename(s)"
|
||||||
|
msgid "Filename"
|
||||||
|
msgstr "Dateiname(n)"
|
||||||
|
|
||||||
|
#: models/models.py:47
|
||||||
|
msgid "Optional profile pic for display in explorer profile"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: models/place.py:21
|
#: models/place.py:21
|
||||||
msgid "Location"
|
msgid "Location"
|
||||||
msgstr "Ort"
|
msgstr "Ort"
|
||||||
@@ -110,38 +120,78 @@ msgstr "Du wirst in 5 Sekunden weitergeleitet"
|
|||||||
msgid "Go Back"
|
msgid "Go Back"
|
||||||
msgstr "Zurück"
|
msgstr "Zurück"
|
||||||
|
|
||||||
|
#: templates/explorer/profile.html:27
|
||||||
|
msgid "E-Mail"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/explorer/profile.html:35
|
||||||
|
msgid "Joined"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/explorer/profile.html:43
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "All Places"
|
||||||
|
msgid "Places"
|
||||||
|
msgstr "Alle Places"
|
||||||
|
|
||||||
|
#: templates/explorer/profile.html:51
|
||||||
|
msgid "Place Assets"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/explorer/profile.html:65
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "Image(s) submitted successfully"
|
||||||
|
msgid "Places submitted by"
|
||||||
|
msgstr "Bild(er) erfolgreich hinzugefügt"
|
||||||
|
|
||||||
|
#: templates/explorer/profile.html:82
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "Image(s) submitted successfully"
|
||||||
|
msgid "Images submitted by"
|
||||||
|
msgstr "Bild(er) erfolgreich hinzugefügt"
|
||||||
|
|
||||||
|
#: templates/explorer/profile.html:104
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "Photo album link submitted"
|
||||||
|
msgid "Photo albums submitted by"
|
||||||
|
msgstr "Fotoalbum-Link hinzugefügt"
|
||||||
|
|
||||||
#: templates/global.html:32
|
#: templates/global.html:32
|
||||||
msgid "Logout"
|
msgid "Logout"
|
||||||
msgstr "Ausloggen"
|
msgstr "Ausloggen"
|
||||||
|
|
||||||
#: templates/global.html:34
|
#: templates/global.html:33
|
||||||
|
msgid "Profile"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/global.html:35
|
||||||
msgid "Admin"
|
msgid "Admin"
|
||||||
msgstr "Admin"
|
msgstr "Admin"
|
||||||
|
|
||||||
#: templates/global.html:39 templates/registration/login.html:4
|
#: templates/global.html:40 templates/registration/login.html:4
|
||||||
#: templates/registration/login.html:10 templates/registration/login.html:23
|
#: templates/registration/login.html:10 templates/registration/login.html:23
|
||||||
msgid "Login"
|
msgid "Login"
|
||||||
msgstr "Anmelden"
|
msgstr "Anmelden"
|
||||||
|
|
||||||
#: templates/global.html:40 templates/registration/login.html:29
|
#: templates/global.html:41 templates/registration/login.html:29
|
||||||
#: templates/signup.html:6 templates/signup.html:12 templates/signup.html:41
|
#: templates/signup.html:6 templates/signup.html:12 templates/signup.html:41
|
||||||
msgid "Sign up"
|
msgid "Sign up"
|
||||||
msgstr "Registrieren"
|
msgstr "Registrieren"
|
||||||
|
|
||||||
#: templates/global.html:50 templates/home.html:10
|
#: templates/global.html:51 templates/home.html:10
|
||||||
msgid "Home"
|
msgid "Home"
|
||||||
msgstr "Startseite"
|
msgstr "Startseite"
|
||||||
|
|
||||||
#: templates/global.html:51
|
#: templates/global.html:52
|
||||||
msgid "UrBex Codex"
|
msgid "UrBex Codex"
|
||||||
msgstr "UrBex Codex"
|
msgstr "UrBex Codex"
|
||||||
|
|
||||||
#: templates/global.html:56 templates/place/place_create.html:5
|
#: templates/global.html:57 templates/place/place_create.html:5
|
||||||
#: templates/place/place_create.html:10
|
#: templates/place/place_create.html:10
|
||||||
msgid "Create place"
|
msgid "Create place"
|
||||||
msgstr "Place erstellen"
|
msgstr "Place erstellen"
|
||||||
|
|
||||||
#: templates/global.html:57
|
#: templates/global.html:58
|
||||||
msgid "All places"
|
msgid "All places"
|
||||||
msgstr "Alle Places"
|
msgstr "Alle Places"
|
||||||
|
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
# Generated by Django 3.1.1 on 2020-10-04 19:37
|
||||||
|
# Edited by reverend
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.utils.timezone
|
||||||
|
from django.utils.timezone import utc
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('lostplaces', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='Voucher'
|
||||||
|
),
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='Expireable'
|
||||||
|
)
|
||||||
|
]
|
@@ -1,25 +1,25 @@
|
|||||||
# Generated by Django 3.1.1 on 2020-10-04 19:52
|
# Generated by Django 3.1.1 on 2020-10-04 19:52
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('lostplaces', '0002_reomve_vouchers'),
|
('lostplaces', '0002_remove_vouchers'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Voucher',
|
name='Voucher',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('created_when', models.DateTimeField(auto_now_add=True)),
|
('created_when', models.DateTimeField(auto_now_add=True)),
|
||||||
('expires_when', models.DateTimeField()),
|
('expires_when', models.DateTimeField()),
|
||||||
('code', models.CharField(max_length=30, unique=True)),
|
('code', models.CharField(max_length=30, unique=True)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
@@ -6,16 +6,29 @@
|
|||||||
database.
|
database.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from lostplaces.models.abstract_models import Expireable
|
from lostplaces.models.abstract_models import Expireable
|
||||||
from lostplaces.models.place import Place
|
from lostplaces.models.place import Place
|
||||||
|
|
||||||
|
from easy_thumbnails.fields import ThumbnailerImageField
|
||||||
|
from easy_thumbnails.files import get_thumbnailer
|
||||||
|
|
||||||
|
def generate_profile_image_filename(instance, filename):
|
||||||
|
"""
|
||||||
|
Callback for generating filename for uploaded explorer profile images.
|
||||||
|
Returns filename as: explorer_pk-username.jpg
|
||||||
|
"""
|
||||||
|
|
||||||
|
return 'explorers/' + str(instance.explorer.pk) + '-' + str(instance.explorer.username) + '.' + filename.split('.')[-1]
|
||||||
|
|
||||||
class Explorer(models.Model):
|
class Explorer(models.Model):
|
||||||
"""
|
"""
|
||||||
Profile that is linked to the a User.
|
Profile that is linked to the a User.
|
||||||
@@ -27,6 +40,15 @@ class Explorer(models.Model):
|
|||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
related_name='explorer'
|
related_name='explorer'
|
||||||
)
|
)
|
||||||
|
profile_image = ThumbnailerImageField(
|
||||||
|
blank=True,
|
||||||
|
null=True,
|
||||||
|
upload_to=generate_profile_image_filename,
|
||||||
|
resize_source=dict(size=(400, 400),
|
||||||
|
sharpen=True),
|
||||||
|
verbose_name=_('Profile image'),
|
||||||
|
help_text=_('Optional profile pic for display in explorer profile')
|
||||||
|
)
|
||||||
|
|
||||||
favorite_places = models.ManyToManyField(
|
favorite_places = models.ManyToManyField(
|
||||||
Place,
|
Place,
|
||||||
@@ -49,11 +71,13 @@ def save_user_profile(sender, instance, **kwargs):
|
|||||||
|
|
||||||
class Voucher(Expireable):
|
class Voucher(Expireable):
|
||||||
"""
|
"""
|
||||||
Vouchers are authorization to created_when = models.DateTimeField(auto_now_add=True)
|
Vouchers are authorization tokens to allow the registration of new users.
|
||||||
expires_when = models.DateTimeField()kens to allow the registration of new users.
|
|
||||||
A voucher has a code, a creation and a deletion date, which are all
|
A voucher has a code, a creation and a deletion date, which are all
|
||||||
positional. Creation date is being set automatically during voucher
|
positional. Creation date is being set automatically during voucher
|
||||||
creation.
|
creation.
|
||||||
|
|
||||||
|
created_when = models.DateTimeField(auto_now_add=True)
|
||||||
|
expires_when = models.DateTimeField()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
code = models.CharField(unique=True, max_length=30)
|
code = models.CharField(unique=True, max_length=30)
|
||||||
@@ -64,4 +88,3 @@ class Voucher(Expireable):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Voucher " + str(self.code)
|
return "Voucher " + str(self.code)
|
||||||
|
|
||||||
|
@@ -49,10 +49,10 @@ class Place(Submittable, Taggable, Mapable):
|
|||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
def generate_image_upload_path(instance, filename):
|
def generate_place_image_filename(instance, filename):
|
||||||
"""
|
"""
|
||||||
Callback for generating path for uploaded images.
|
Callback for generating filename for uploaded place images.
|
||||||
Returns filename as: place_pk-placename{-rnd_string}.jpg
|
Returns filename as: place_pk-placename{-number}.jpg
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return 'places/' + str(instance.place.pk) + '-' + str(instance.place.name) + '.' + filename.split('.')[-1]
|
return 'places/' + str(instance.place.pk) + '-' + str(instance.place.name) + '.' + filename.split('.')[-1]
|
||||||
@@ -84,7 +84,7 @@ class PlaceImage (PlaceAsset):
|
|||||||
verbose_name=_('Description'),
|
verbose_name=_('Description'),
|
||||||
)
|
)
|
||||||
filename = ThumbnailerImageField(
|
filename = ThumbnailerImageField(
|
||||||
upload_to=generate_image_upload_path,
|
upload_to=generate_place_image_filename,
|
||||||
resize_source=dict(size=(2560, 2560),
|
resize_source=dict(size=(2560, 2560),
|
||||||
sharpen=True),
|
sharpen=True),
|
||||||
verbose_name=_('Filename(s)'),
|
verbose_name=_('Filename(s)'),
|
||||||
|
@@ -14,6 +14,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="LP-UserInfo__Meta">
|
<div class="LP-UserInfo__Meta">
|
||||||
<table>
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="LP-UserInfo__Key">
|
||||||
|
<span class="LP-Paragraph">{% trans 'Name' %}</span>
|
||||||
|
</td>
|
||||||
|
<td class="LP-UserInfo__Value">
|
||||||
|
<span class="LP-Paragraph">{{explorer.user.first_name}} {{explorer.user.last_name}}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="LP-UserInfo__Key">
|
||||||
|
<span class="LP-Paragraph">{% trans 'E-Mail' %}</span>
|
||||||
|
</td>
|
||||||
|
<td class="LP-UserInfo__Value">
|
||||||
|
<span class="LP-Paragraph">{{explorer.user.email}}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LP-UserInfo__Key">
|
<td class="LP-UserInfo__Key">
|
||||||
<span class="LP-Paragraph">{% trans 'Joined' %}</span>
|
<span class="LP-Paragraph">{% trans 'Joined' %}</span>
|
||||||
|
@@ -33,13 +33,9 @@ class ExplorerProfileView(IsAuthenticatedMixin, View):
|
|||||||
asset_count += objects.count()
|
asset_count += objects.count()
|
||||||
|
|
||||||
context['asset_count'] = asset_count
|
context['asset_count'] = asset_count
|
||||||
|
|
||||||
print(context['assets'])
|
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request=request,
|
request=request,
|
||||||
template_name='explorer/profile.html',
|
template_name='explorer/profile.html',
|
||||||
context=context
|
context=context
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user