diff options
-rw-r--r-- | app/jrnl/admin.py | 8 | ||||
-rw-r--r-- | design/templates/archives/homepage-light.html | 5 |
2 files changed, 4 insertions, 9 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py index 52ab083..1769ebe 100644 --- a/app/jrnl/admin.py +++ b/app/jrnl/admin.py @@ -100,15 +100,9 @@ class HomepageCurratorAdmin(admin.ModelAdmin): @admin.register(Home) class HomeAdmin(admin.ModelAdmin): + form = LGEntryForm filter_horizontal = ('popular',) - def formfield_for_dbfield(self, db_field, **kwargs): - if db_field.name == 'thumbnail' or db_field.name == 'image': - field = forms.FileField(widget=AdminImageWidget) - else: - field = super(EntryAdmin, self).formfield_for_dbfield(db_field, **kwargs) - return field - class Media: js = ('image-loader.js', 'next-prev-links.js') css = { diff --git a/design/templates/archives/homepage-light.html b/design/templates/archives/homepage-light.html index 36e15b7..1d02e86 100644 --- a/design/templates/archives/homepage-light.html +++ b/design/templates/archives/homepage-light.html @@ -19,10 +19,11 @@ <article class="h-entry hentry" itemscope itemType="http://schema.org/Article"> <div class="post--image"> <a href="{{object.get_absolute_url}}" title="{{object.title}}"> - {%for image in homepage.images.all%} + {%with image=homepage.featured_image%} <img class="u-photo post-image homepage--hero" itemprop="image" sizes="(max-width: 960px) 100vw" srcset="{% for size in image.sizes.all%}{% get_image_by_size image size.name %} {{size.width}}w{% if forloop.last%}"{%else%}, {%endif%}{%endfor%} - {% for size in image.sizes.all%}{%if not forloop.first and not forloop.last%}src="{% get_image_by_size image size.name %}"{%endif%}{%endfor%} alt="{{image.alt}} photographed by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}luxagraf{%endif%}">{%endfor%} + {% for size in image.sizes.all%}{%if not forloop.first and not forloop.last%}src="{% get_image_by_size image size.name %}"{%endif%}{%endfor%} alt="{{image.alt}} photographed by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}luxagraf{%endif%}"> + {%endwith%} </a> </div> <div class="hero--wrapper"> |