diff options
author | luxagraf <sng@luxagraf.net> | 2016-10-10 08:03:52 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-10-10 08:03:52 -0400 |
commit | 4f139b09fd16cd0dd59788d1d37beae4cf184fb6 (patch) | |
tree | 5221620658537523089b6c05fa825c5fd768fba2 | |
parent | 3982aeb761dabbf7ec84e51813bf9b07531d332a (diff) |
started work on light version of homepage and made it possble for me to
put links in comments
-rw-r--r-- | app/jrnl/admin.py | 2 | ||||
-rw-r--r-- | app/jrnl/migrations/0008_auto_20160906_0845.py | 33 | ||||
-rw-r--r-- | app/jrnl/migrations/0009_homepagecurrator_image_offset_vertical.py | 21 | ||||
-rw-r--r-- | app/jrnl/models.py | 7 | ||||
-rw-r--r-- | design/sass/_homepage.scss | 21 | ||||
-rw-r--r-- | design/templates/archives/homepage-light.html | 100 | ||||
-rw-r--r-- | design/templates/archives/homepage.html | 6 | ||||
-rw-r--r-- | design/templates/comments/list.html | 8 | ||||
-rw-r--r-- | design/templates/details/photo_gallery.html | 2 |
9 files changed, 187 insertions, 13 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py index 54a1046..b49837a 100644 --- a/app/jrnl/admin.py +++ b/app/jrnl/admin.py @@ -80,7 +80,7 @@ class EntryAdmin(OSMGeoAdmin): class HomepageCurratorAdmin(admin.ModelAdmin): form = GalleryForm - filter_horizontal = ('entry_list',) + filter_horizontal = ('popular',) pass diff --git a/app/jrnl/migrations/0008_auto_20160906_0845.py b/app/jrnl/migrations/0008_auto_20160906_0845.py new file mode 100644 index 0000000..4ac5ebf --- /dev/null +++ b/app/jrnl/migrations/0008_auto_20160906_0845.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-09-06 08:45 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('jrnl', '0007_delete_postimage'), + ] + + operations = [ + migrations.RenameField( + model_name='homepagecurrator', + old_name='banner', + new_name='featured', + ), + migrations.RenameField( + model_name='homepagecurrator', + old_name='entry_list', + new_name='popular', + ), + migrations.RemoveField( + model_name='homepagecurrator', + name='alt_text', + ), + migrations.RemoveField( + model_name='homepagecurrator', + name='image_base_url', + ), + ] diff --git a/app/jrnl/migrations/0009_homepagecurrator_image_offset_vertical.py b/app/jrnl/migrations/0009_homepagecurrator_image_offset_vertical.py new file mode 100644 index 0000000..5dfbbad --- /dev/null +++ b/app/jrnl/migrations/0009_homepagecurrator_image_offset_vertical.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-09-06 09:01 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('jrnl', '0008_auto_20160906_0845'), + ] + + operations = [ + migrations.AddField( + model_name='homepagecurrator', + name='image_offset_vertical', + field=models.CharField(default='160px', help_text='add negative top margin to shift image (include css unit)', max_length=20), + preserve_default=False, + ), + ] diff --git a/app/jrnl/models.py b/app/jrnl/models.py index 844db12..ceaefa6 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -228,12 +228,11 @@ class EntryAside(models.Model): class HomepageCurrator(models.Model): - alt_text = models.CharField(max_length=200) - image_base_url = models.CharField(max_length=200) + image_offset_vertical = models.CharField(max_length=20, help_text="add negative top margin to shift image (include css unit)") images = models.ManyToManyField(LuxImage) tag_line = models.CharField(max_length=200) - banner = models.ForeignKey(Entry, related_name="banner") - entry_list = models.ManyToManyField(Entry) + featured = models.ForeignKey(Entry, related_name="banner") + popular = models.ManyToManyField(Entry) template_name = models.CharField(max_length=200, help_text="full path") diff --git a/design/sass/_homepage.scss b/design/sass/_homepage.scss index 1a3df6a..6582da5 100644 --- a/design/sass/_homepage.scss +++ b/design/sass/_homepage.scss @@ -2,7 +2,7 @@ @include constrain_wide; @extend %clearfix; &:before { - @include faded_line_after; + margin-top: 3em; } } .homepage--arc-header { @@ -107,7 +107,6 @@ position: relative; z-index: 1; } - .post--image { margin-left: 5px;} .hero--wrapper { @include constrain_wide; position: relative; @@ -183,3 +182,21 @@ @include lighter_faded_line_after; } } +.v082016 { + .header-wrapper { + @include breakpoint(beta) { + border-bottom: none; + } + } + .banner .post--image { + @include breakpoint(gamma) { + max-height: 600px; + overflow: hidden; + } + } + .hero--wrapper { + @include breakpoint(gamma) { + margin-top: -222px; + } + } +} diff --git a/design/templates/archives/homepage-light.html b/design/templates/archives/homepage-light.html new file mode 100644 index 0000000..fe41b25 --- /dev/null +++ b/design/templates/archives/homepage-light.html @@ -0,0 +1,100 @@ +{% extends 'base.html' %} +{% load get_image_by_size %} +{% load typogrify_tags %} +{% block sitename %} +<head itemscope itemtype="http://schema.org/WebSite"> + <title itemprop='name'>Luxagraf</title> + <link rel="canonical" href="https://luxagraf.net/" itemprop="url">{%endblock%} + + {%block extrahead%} +<style> + .homepage--hero { + margin-top: {{homepage.image_offset_vertical}}; + } +</style> +{%endblock%} +{%block bodyid%}id="home" class="has-hero v082016"{%endblock%} + +{% block primary %}<section class="banner">{% with object=homepage.featured %} + <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%} + <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 %} {{size}}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 %}"{%endif%}{%endfor%} alt="{{image.alt}} photographed by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}luxagraf{%endif%}">{%endfor%} + </a> + </div> + <div class="hero--wrapper"> + <h2 class="p-name entry-title post--title main--header" itemprop="headline"><a href="{{object.get_absolute_url}}" class="u-url" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">{{object.title|safe|smartypants}}</a></h2> + <p class="p-author author hide" itemprop="author">Scott Gilbertson</p> + <time class="dt-published published dt-updated post--date" datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time> + <p class="post--location main--location"> + <span class="p-location h-adr adr" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"> + {% if object.country.name == "United States" %}<span class="p-locality locality">{{object.location.name|smartypants|safe}}</span>, <a class="p-region region" href="/jrnl/united-states/" title="travel writing from the United States">{{object.state.name}}</a>, <span class="p-country-name">U.S.</span>{%else%}<span class="p-region">{{object.location.name|smartypants|safe}}</span>, <a class="p-country-name country-name" href="/jrnl/{{object.country.slug}}/" title="travel writing from {{object.country.name}}">{{object.country.name}}</a>{%endif%} + <span style="display: none;" itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> + <data itemprop="latitude" class="p-latitude" value="{{object.latitude}}">{{object.latitude}}</data> + <data itemprop="longitude" class="p-longitude" value="{{object.longitude}}">{{object.longitude}}</data> + </span> + </span> + </p> + <p class="p-summary main--tag"> + {{homepage.tag_line}} + </p> + <a href="{{object.get_absolute_url}}" class="u-url btn" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">Read</a> + </div> + </article>{% endwith %} + </section> + <div class="homepage--about homepage--section"> + <h3 class="homepage--arc-header">About Luxagraf</h3> + <p>Luxagraf is my notebook. Something that, in an earlier age, I would have long ago lost in the backseat of a taxi. </p> + <p>Or something like that. It could just be a website. Except that I don’t do lists. And I’m not trying to make money off of it.</p><p>Whatever it is, whatever brought you here, I hope you enjoy it.</p> + </div> + <div class="homepage--section"> + <section class="archive homepage--archives"> + <h1 class="homepage--arc-header">Most Popular</h1> + {% for object in homepage.popular.all %} + <article class="h-entry hentry" itemscope itemType="http://schema.org/Article"> + <div class="post--image"> + <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.get_image_wide_url}}" alt="{{ object.title }}" class="u-photo post-image" itemprop="image" /></a> + </div> + <h2 class="p-name entry-title post--title" itemprop="headline"><a href="{{object.get_absolute_url}}" class="u-url" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">{{object.title|safe|smartypants|widont}}</a></h2> + <p class="p-author author hide" itemprop="author">Scott Gilbertson</p> + <time class="dt-published published dt-updated post--date" datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time> + <p class="post--location"> + <span class="p-location h-adr adr" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"> + {% if object.country.name == "United States" %}<span class="p-locality locality">{{object.location.name|smartypants|safe}}</span>, <a class="p-region region" href="/jrnl/united-states/" title="travel writing from the United States">{{object.state.name}}</a>, <span class="p-country-name">U.S.</span>{%else%}<span class="p-region">{{object.location.name|smartypants|safe}}</span>, <a class="p-country-name country-name" href="/jrnl/{{object.country.slug}}/" title="travel writing from {{object.country.name}}">{{object.country.name}}</a>{%endif%} + <span style="display: none;" itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> + <data itemprop="latitude" class="p-latitude" value="{{object.latitude}}">{{object.latitude}}</data> + <data itemprop="longitude" class="p-longitude" value="{{object.longitude}}">{{object.longitude}}</data> + </span> + </span> + </p> + </article> {% endfor %} + <p><a href="/jrnl/" class="homepage--next">Read More</a></p> + </section> + <section class="homepage--bright archive"> + <h1 class="homepage--arc-header">Most Recent</h1> + {% for object in recent %}{% if object.pk != homepage.featured.pk %} + <article class="h-entry hentry" itemscope itemType="http://schema.org/Article"> + <div class="post--image"> + <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.get_image_url}}" alt="{{ object.title }}" class="u-photo post-image" itemprop="image" /></a> + </div> + <h2 class="p-name entry-title post--title" itemprop="headline"><a href="{{object.get_absolute_url}}" class="u-url" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">{{object.title|safe|smartypants|widont}}</a></h2> + <p class="p-author author hide" itemprop="author">Scott Gilbertson</p> + <time class="dt-published published dt-updated post--date" datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time> + <p class="post--location"> + <span class="p-location h-adr adr" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"> + {% if object.country.name == "United States" %}<span class="p-locality locality">{{object.location.name|smartypants|safe}}</span>, <a class="p-region region" href="/jrnl/united-states/" title="travel writing from the United States">{{object.state.name}}</a>, <span class="p-country-name">U.S.</span>{%else%}<span class="p-region">{{object.location.name|smartypants|safe}}</span>, <a class="p-country-name country-name" href="/jrnl/{{object.country.slug}}/" title="travel writing from {{object.country.name}}">{{object.country.name}}</a>{%endif%} + <span style="display: none;" itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> + <data itemprop="latitude" class="p-latitude" value="{{object.latitude}}">{{object.latitude}}</data> + <data itemprop="longitude" class="p-longitude" value="{{object.longitude}}">{{object.longitude}}</data> + </span> + </span> + </p> + </article> {%endif%}{% endfor %} + </section> + </div> +{% endblock %} + +{% block js %}{% comment %} <script async src="/media/js/hyphenate.min.js" type="text/javascript"></script>{% endcomment%}{% endblock%} diff --git a/design/templates/archives/homepage.html b/design/templates/archives/homepage.html index 573cf23..2741232 100644 --- a/design/templates/archives/homepage.html +++ b/design/templates/archives/homepage.html @@ -8,7 +8,7 @@ <link rel="canonical" href="https://luxagraf.net/" itemprop="url">{%endblock%} {%block bodyid%}id="home" class="has-hero"{%endblock%} -{% block primary %}<section class="banner">{% with object=homepage.banner %} +{% block primary %}<section class="banner">{% with object=homepage.featured %} <article class="h-entry hentry" itemscope itemType="http://schema.org/Article"> <div class="post--image"> <a href="{{object.get_absolute_url}}" title="{{object.title}}"> @@ -46,7 +46,7 @@ srcset="{% for size in image.sizes.all%}{% get_image_by_size image size %} {{siz <div class="homepage--section"> <section class="archive homepage--archives"> <h1 class="homepage--arc-header">Most Popular</h1> - {% for object in homepage.entry_list.all %} + {% for object in homepage.popular.all %} <article class="h-entry hentry" itemscope itemType="http://schema.org/Article"> <div class="post--image"> <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.get_image_wide_url}}" alt="{{ object.title }}" class="u-photo post-image" itemprop="image" /></a> @@ -68,7 +68,7 @@ srcset="{% for size in image.sizes.all%}{% get_image_by_size image size %} {{siz </section> <section class="homepage--bright archive"> <h1 class="homepage--arc-header">Most Recent</h1> - {% for object in recent %}{% if object.pk != homepage.banner.pk %} + {% for object in recent %}{% if object.pk != homepage.featured.pk %} <article class="h-entry hentry" itemscope itemType="http://schema.org/Article"> <div class="post--image"> <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.get_image_url}}" alt="{{ object.title }}" class="u-photo post-image" itemprop="image" /></a> diff --git a/design/templates/comments/list.html b/design/templates/comments/list.html index e8057dc..c311a7c 100644 --- a/design/templates/comments/list.html +++ b/design/templates/comments/list.html @@ -7,8 +7,8 @@ <div class="comments--wrapper"> {% for comment in comment_list %} <div id="comment-{{ comment.id }}" class="comment"> - <noscript class="datahashloader" data-hash="{% if comment.user_email = "sng@luxagraf.net" %}d64f4854965b2b1c3ecafee4b2a66fac{%else%}{%if comment.user_email|has_grav %}{%gravatar_hash comment.user_email %}{%else%}default{%endif%}{%endif%}"> - <img class="gravatar" {% if comment.user_email = "sng@luxagraf.net" %}src="https://images.luxagraf.net/gravcache/d64f4854965b2b1c3ecafee4b2a66fac.jpg" {%else%} {%if comment.user_email|has_grav %} src="https://images.luxagraf.net/gravcache/{%gravatar_hash comment.email %}.jpg"{%else%}src="https://images.luxagraf.net/gravcache/default.jpg"{%endif%}{%endif%} alt="gravatar icon for {{comment.name}}" /> + <noscript class="datahashloader" data-hash="{% if comment.user_email == "sng@luxagraf.net" %}d64f4854965b2b1c3ecafee4b2a66fac{%else%}{%if comment.user_email|has_grav %}{%gravatar_hash comment.user_email %}{%else%}default{%endif%}{%endif%}"> + <img class="gravatar" {% if comment.user_email == "sng@luxagraf.net" %}src="https://images.luxagraf.net/gravcache/d64f4854965b2b1c3ecafee4b2a66fac.jpg" {%else%} {%if comment.user_email|has_grav %} src="https://images.luxagraf.net/gravcache/{%gravatar_hash comment.email %}.jpg"{%else%}src="https://images.luxagraf.net/gravcache/default.jpg"{%endif%}{%endif%} alt="gravatar icon for {{comment.name}}" /> </noscript> <div class="comment--head"> <span class="who"><b>{%if comment.url %}<a href="{{comment.url}}" rel="nofollow" target="_blank">{{comment.name}}</a>{% else %}{{comment.name}}{%endif%}</b></span> @@ -16,7 +16,11 @@ </div> <div class="comment--body"> + {% if comment.user_email == "sng@luxagraf.net" %} + {{comment.comment|removetags:"p"|markdown|safe|smartypants}} + {%else%} {{comment.comment|removetags:"p"|markdown|bleach|nofollow|safe|smartypants}} + {%endif%} </div> </div> {% endfor %} diff --git a/design/templates/details/photo_gallery.html b/design/templates/details/photo_gallery.html index b452f35..bf2db6d 100644 --- a/design/templates/details/photo_gallery.html +++ b/design/templates/details/photo_gallery.html @@ -43,7 +43,7 @@ <div class="caption" id="id-{{photo.id}}"> <h3 class="figcaption--title">{{photo.title}}</h3> <time class="figcaption--date" datetime="{{photo.exif_date|date:'c'}}">{{photo.exif_date|date:"M j, Y"}}</time> - {% if object.is_public %}<a class="map-link" href="#" data-latitude="{{photo.lat}}" data-longitude="{{photo.lon}}" data-imgid="id-{{photo.id}}">Map</a>{%endif%} + {% if object.is_public %}<a class="map-link" href="#" data-latitude="{{photo.latitude}}" data-longitude="{{photo.longitude}}" data-imgid="id-{{photo.id}}">Map</a>{%endif%} {%if photo.caption%}<p class="figcaption--desc">{{photo.caption|safe}}</p> {%endif%} </div> <div class="photo-options"> |