summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/builder/base.py7
-rw-r--r--app/builder/views.py3
-rw-r--r--design/templates/admin/buttons.html1
-rw-r--r--design/templates/archives/homepage.html21
-rw-r--r--design/templates/base.html6
5 files changed, 29 insertions, 9 deletions
diff --git a/app/builder/base.py b/app/builder/base.py
index 0b92832..b18e8be 100644
--- a/app/builder/base.py
+++ b/app/builder/base.py
@@ -140,8 +140,9 @@ 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]
template = obj.template_name
- c = Context({'homepage': obj, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL})
+ 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')
self.write_file('', t)
@@ -270,8 +271,8 @@ class BuildPages(Build):
t = render_to_string(["details/%s.html" % page.slug, 'details/page.html'],c).encode('utf-8')
s = render_to_string('details/page.txt',c).encode('utf-8')
fpath = '%s' %(page.slug)
- self.write_file(fpath,t)
- self.write_file(fpath,s,'txt')
+ self.write_file('', t, 'html', page.slug)
+ self.write_file('', t, 'txt', page.slug)
class BuildMap(Build):
def build(self):
diff --git a/app/builder/views.py b/app/builder/views.py
index 89fc92a..5b9536e 100644
--- a/app/builder/views.py
+++ b/app/builder/views.py
@@ -37,6 +37,9 @@ def do_build(request):
elif section == 'buildrss':
context = {'message': 'Writing RSS to Disk'}
BuildWritingFeed().build()
+ elif section == 'homepage':
+ context = {'message': 'Writing index to Disk'}
+ BuildWriting().build_homepage()
elif section == 'scrapeflickr':
from photos import retriever
retriever.sync_sets()
diff --git a/design/templates/admin/buttons.html b/design/templates/admin/buttons.html
index f800d1e..5046695 100644
--- a/design/templates/admin/buttons.html
+++ b/design/templates/admin/buttons.html
@@ -42,6 +42,7 @@
<ul class="grp-listing-small cust">
<li class="item"><a href="/admin/build/build?id=builddetails">Build Writing Details</a></li>
<li class="item"><a href="/admin/build/build?id=writingarchives">Build Writing Archives</a></li>
+ <li class="item"><a href="/admin/build/build?id=homepage">Build Homepage</a></li>
<li class="item"><a href="/admin/build/build?id=buildrss">Build RSS</a></li>
<li class="item"><a href="/admin/build/build?id=photo_galleries">Build Photo Galleries</a></li>
<li class="item"><a href="/admin/build/build?id=projects">Build Project Pages</a></li>
diff --git a/design/templates/archives/homepage.html b/design/templates/archives/homepage.html
index 12968aa..7ecd4de 100644
--- a/design/templates/archives/homepage.html
+++ b/design/templates/archives/homepage.html
@@ -57,9 +57,24 @@
</article> {% endfor %}
<p><a href="/" class="homepage--next">Read More</a></p>
</section>
- <section class="homepage--bright">
- <h1 class="homepage--arc-header">Join the Mailing List</h1>
- {% include 'mailing_list.html' %}
+ <section class="homepage--archives homepage--bright archive">
+ <h1 class="homepage--arc-header">Most Recent</h1>
+ {% for object in recent %}
+ <article class="h-entry hentry">
+ <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" /></a>
+ </div>
+ <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> &ndash;
+ </p>
+ </article> {% endfor %}
</section>
</div>
{% endblock %}
diff --git a/design/templates/base.html b/design/templates/base.html
index bc2ba42..4fba739 100644
--- a/design/templates/base.html
+++ b/design/templates/base.html
@@ -34,11 +34,11 @@
<nav role="navigation" class="bl">
<ul>
<li id="stories"><a href="/jrnl/" title="What we've been up to lately">Journal</a></li>
- <li id="adventura"><a href="/adventures/" title="Our past and current adventures">Adventures</a></li>
- <li id="field-notes"><a href="/field-notes/" title="Rough drafts and sketches">Field Notes</a></li>
+ <li id="adventura"><a href="/adventures" title="Our past and current adventures">Adventures</a></li>
+ <!--<li id="field-notes"><a href="/field-notes/" title="Rough drafts and sketches">Field Notes</a></li>-->
<li id="photos"><a href="/photos/" title="Photos from travels around the world">Photos</a></li>
<li id="maps"><a href="/map" title="Maps and miscellanea">Map</a></li>
- <!--<li id="projects" ><a href="/projects/" title="Luxagraf: Projects">Projects</a></li>-->
+ <li id="projects" ><a href="/projects/" title="Luxagraf: Projects">Projects</a></li>
<li id="etc" class="last"><a href="/about" title="About Luxagraf">About</a></li>
</ul>
</nav>