diff options
Diffstat (limited to 'app/blog')
-rw-r--r-- | app/blog/models.py | 4 | ||||
-rw-r--r-- | app/blog/widgets.py | 7 |
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)) |