summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2015-01-05 00:11:58 +0000
committerluxagraf <sng@luxagraf.net>2015-01-05 00:11:58 +0000
commit8be4b5e7d95b4b32967fb256d7ce9ef8f0dff1d0 (patch)
tree9c58eb238c43ca3783cc1eacbe6ff8abd98ca588 /app
parent7d48c53b8daca447fc7f9d98e058a1388e47e3cd (diff)
added image dimensions to admin because I always forget, also fixed to two mixed content bugs changing to https
Diffstat (limited to 'app')
-rw-r--r--app/blog/models.py4
-rw-r--r--app/blog/widgets.py7
2 files changed, 8 insertions, 3 deletions
diff --git a/app/blog/models.py b/app/blog/models.py
index afa7158..513ce05 100644
--- a/app/blog/models.py
+++ b/app/blog/models.py
@@ -57,8 +57,8 @@ class Entry(models.Model):
)
status = models.IntegerField(choices=PUB_STATUS, default=0)
photo_gallery = models.ForeignKey(PhotoGallery, blank=True, null=True, verbose_name='photo set')
- image = models.FileField(upload_to=get_upload_path, null=True, blank=True)
- thumbnail = models.FileField(upload_to=get_tn_path, null=True, blank=True)
+ image = models.FileField(upload_to=get_upload_path, null=True, blank=True, help_text="should be 205px high")
+ thumbnail = models.FileField(upload_to=get_tn_path, null=True, blank=True, help_text="should be 160 wide")
meta_description = models.CharField(max_length=256, null=True, blank=True)
TEMPLATES = (
(0, 'single'),
diff --git a/app/blog/widgets.py b/app/blog/widgets.py
index ec1bd1d..9295641 100644
--- a/app/blog/widgets.py
+++ b/app/blog/widgets.py
@@ -18,9 +18,14 @@ class AdminImageWidget(AdminFileWidget):
def render(self, name, value, attrs=None):
output = []
file_name = str(value)
+ help_text = ''
if file_name:
file_path = '%s' % (file_name)
- output.append('<a target="_blank" href="%s">%s</a>' % (file_path, thumbnail(file_name)))
+ if attrs['id'] == 'id_thumbnail':
+ help_text = '160 wide'
+ if attrs['id'] == 'id_image':
+ help_text = '205px high'
+ output.append('<span>%s</span><a target="_blank" href="%s">%s</a>' % (help_text, file_path, thumbnail(file_name)))
output.append(super(AdminFileWidget, self).render(name, value, attrs))
return mark_safe(''.join(output))