From 8be4b5e7d95b4b32967fb256d7ce9ef8f0dff1d0 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 5 Jan 2015 00:11:58 +0000 Subject: added image dimensions to admin because I always forget, also fixed to two mixed content bugs changing to https --- app/blog/models.py | 4 ++-- app/blog/widgets.py | 7 ++++++- design/templates/details/entry.html | 2 +- design/templates/gis/admin/osm_extra.js | 2 +- 4 files changed, 10 insertions(+), 5 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('%s' % (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('%s%s' % (help_text, file_path, thumbnail(file_name))) output.append(super(AdminFileWidget, self).render(name, value, attrs)) return mark_safe(''.join(output)) diff --git a/design/templates/details/entry.html b/design/templates/details/entry.html index 02dcbe6..0018928 100644 --- a/design/templates/details/entry.html +++ b/design/templates/details/entry.html @@ -6,7 +6,7 @@ {% block metadescription %}{{object.meta_description|striptags|safe}}{% endblock %} {%block extrahead%} - + diff --git a/design/templates/gis/admin/osm_extra.js b/design/templates/gis/admin/osm_extra.js index 774be47..478f78c 100644 --- a/design/templates/gis/admin/osm_extra.js +++ b/design/templates/gis/admin/osm_extra.js @@ -1,4 +1,4 @@ {% extends "gis/admin/openlayers.js" %} {% block base_layer %} -new OpenLayers.Layer.XYZ( "ESRI", "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}", {sphericalMercator: true} ); +new OpenLayers.Layer.XYZ( "ESRI", "https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}", {sphericalMercator: true} ); {% endblock %} -- cgit v1.2.3