From 4f139b09fd16cd0dd59788d1d37beae4cf184fb6 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 10 Oct 2016 08:03:52 -0400 Subject: started work on light version of homepage and made it possble for me to put links in comments --- app/jrnl/admin.py | 2 +- app/jrnl/migrations/0008_auto_20160906_0845.py | 33 +++++++ .../0009_homepagecurrator_image_offset_vertical.py | 21 +++++ app/jrnl/models.py | 7 +- design/sass/_homepage.scss | 21 ++++- design/templates/archives/homepage-light.html | 100 +++++++++++++++++++++ design/templates/archives/homepage.html | 6 +- design/templates/comments/list.html | 8 +- design/templates/details/photo_gallery.html | 2 +- 9 files changed, 187 insertions(+), 13 deletions(-) create mode 100644 app/jrnl/migrations/0008_auto_20160906_0845.py create mode 100644 app/jrnl/migrations/0009_homepagecurrator_image_offset_vertical.py create mode 100644 design/templates/archives/homepage-light.html 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 %} + + Luxagraf + {%endblock%} + + {%block extrahead%} + +{%endblock%} +{%block bodyid%}id="home" class="has-hero v082016"{%endblock%} + +{% block primary %} +
+

About Luxagraf

+

Luxagraf is my notebook. Something that, in an earlier age, I would have long ago lost in the backseat of a taxi.

+

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.

Whatever it is, whatever brought you here, I hope you enjoy it.

+
+
+
+

Most Popular

+ {% for object in homepage.popular.all %} + {% endfor %} +

Read More

+
+
+

Most Recent

+ {% for object in recent %}{% if object.pk != homepage.featured.pk %} + {%endif%}{% endfor %} +
+
+{% endblock %} + +{% block js %}{% comment %} {% 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 @@ {%endblock%} {%block bodyid%}id="home" class="has-hero"{%endblock%} -{% block primary %}