diff options
author | luxagraf <sng@luxagraf.net> | 2015-01-25 21:13:18 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-01-25 21:13:18 -0500 |
commit | 83233b9a4c6f29a65d2a337f89951e8d25190ee9 (patch) | |
tree | 283c4b518c07847925c86251525feee3bc265487 | |
parent | 07dc722b5b244a21fbb8aa4e0bdafb53e1598330 (diff) |
fixed homepage layout and builder
-rw-r--r-- | app/blog/views.py | 2 | ||||
-rw-r--r-- | app/builder/base.py | 2 | ||||
-rw-r--r-- | design/sass/_homepage.scss | 38 | ||||
-rw-r--r-- | 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 @@ </section>{%endcomment%} <div class="homepage--about homepage--section"> <h3 class="homepage--arc-header">About Luxagraf</h3> - <p>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.</p> + <p>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.</p> <p>It could just be a website though. Except that I don’t do lists. And I’m not trying to make money.</p><p>Luxagraf is a collection of field notes, a record of some of my time on earth. Enjoy.</p> </div> <div class="homepage--section"> @@ -55,9 +55,9 @@ <data itemprop="longitude" class="p-longitude" value="{{object.longitude}}"></data> </p> </article> {% endfor %} - <p><a href="/" class="homepage--next">Read More</a></p> + <p><a href="/jrnl/" class="homepage--next">Read More</a></p> </section> - <section class="homepage--archives homepage--bright archive"> + <section class="homepage--bright archive"> <h1 class="homepage--arc-header">Most Recent</h1> {% for object in recent %} <article class="h-entry hentry"> @@ -67,12 +67,10 @@ <h1 class="p-name entry-title post--title"><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></h1> <p class="p-author author hide">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> - <span class="p-location h-adr adr post--location"> - {% if object.country.name == "United States" %}<span class="p-locality locality" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">{{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%} - <data itemprop="latitude" class="p-latitude" value="{{object.latitude}}"></data> - <data itemprop="longitude" class="p-longitude" value="{{object.longitude}}"></data> - </span> – + <p class="p-location h-adr adr post--location"> + {% if object.country.name == "United States" %}<span class="p-locality locality" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">{{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%} + <data itemprop="latitude" class="p-latitude" value="{{object.latitude}}"></data> + <data itemprop="longitude" class="p-longitude" value="{{object.longitude}}"></data> </p> </article> {% endfor %} </section> |