From 83233b9a4c6f29a65d2a337f89951e8d25190ee9 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 25 Jan 2015 21:13:18 -0500 Subject: fixed homepage layout and builder --- app/blog/views.py | 2 ++ app/builder/base.py | 2 +- design/sass/_homepage.scss | 38 +++++++++++++++++++++++++++++++++ design/templates/archives/homepage.html | 16 ++++++-------- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/app/blog/views.py b/app/blog/views.py index 0e887bd..498926c 100644 --- a/app/blog/views.py +++ b/app/blog/views.py @@ -12,8 +12,10 @@ from photos.models import Photo def home(request): obj = HomepageCurrator.objects.get(pk=1) template = obj.template_name + recent = Entry.objects.filter(status__exact=1)[:4] context = { 'homepage': obj, + 'recent': recent, } return render_to_response(template, context, context_instance=RequestContext(request)) diff --git a/app/builder/base.py b/app/builder/base.py index b18e8be..a706261 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -140,7 +140,7 @@ class BuildWriting(Build): def build_homepage(self): obj = get_model('blog', 'homepagecurrator').objects.get(pk=1) - recent = get_model('blog', 'entry').objects.filter(status__exact=1)[:3] + recent = get_model('blog', 'entry').objects.filter(status__exact=1)[:4] template = obj.template_name c = Context({'homepage': obj, 'recent': recent, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) t = render_to_string(template, c).encode('utf-8') diff --git a/design/sass/_homepage.scss b/design/sass/_homepage.scss index 0e30d1c..423b349 100644 --- a/design/sass/_homepage.scss +++ b/design/sass/_homepage.scss @@ -44,9 +44,47 @@ } .homepage--bright { + article { + margin-top: 0; + margin-bottom: 20px; + width: 100%; + } + @include breakpoint(alpha) { + max-width: 100%; + margin-left: 0; + article { + float: left; + width: 47%; + margin-left: 1em; + } + } @include breakpoint(gamma) { float: left; width: 250px; + margin-top: 0; + article { + float: none; + width: 100%; + margin-left: 0; + } + } + @include breakpoint(delta) { + width: 340px; + } + .post--image { + margin-left: 0 !important; + margin-bottom: .5em; + max-height: 130px; + overflow: hidden; + img { + max-width: 100%; + display: block; + /* just in case, to force correct aspect ratio */ + height: auto !important; + width: auto\9; /* ie8+9 */ + /* lt ie8 */ + -ms-interpolation-mode: bicubic; + } } } .homepage--next { diff --git a/design/templates/archives/homepage.html b/design/templates/archives/homepage.html index 7ecd4de..9b8b1af 100644 --- a/design/templates/archives/homepage.html +++ b/design/templates/archives/homepage.html @@ -35,7 +35,7 @@ {%endcomment%}

About Luxagraf

-

I like to think of luxagraf as the notebook you might have found, something I might have accidentally dropped between the cushions of a jostling, camel-powered taxi winding its way through the narrow, bumpy, dusty streets of Tangier circa 1910.

+

I like to think of luxagraf as the notebook you might have found, something I might have accidentally dropped between the cushions of a jostling camel taxi winding its way through the narrow, dusty streets of Tangier circa 1910.

It could just be a website though. Except that I don’t do lists. And I’m not trying to make money.

Luxagraf is a collection of field notes, a record of some of my time on earth. Enjoy.

@@ -55,9 +55,9 @@

{% endfor %} -

Read More

+

Read More

-
+

Most Recent

{% for object in recent %}
@@ -67,12 +67,10 @@

{{object.title|safe|smartypants|widont}}

Scott Gilbertson

-

- - {% if object.country.name == "United States" %}{{object.location.name|smartypants|safe}}, {{object.state.name}}, U.S.{%else%}{{object.location.name|smartypants|safe}}, {{object.country.name}}{%endif%} - - - – +

+ {% if object.country.name == "United States" %}{{object.location.name|smartypants|safe}}, {{object.state.name}}, U.S.{%else%}{{object.location.name|smartypants|safe}}, {{object.country.name}}{%endif%} + +

{% endfor %}
-- cgit v1.2.3