diff options
-rw-r--r-- | app/blog/models.py | 1 | ||||
-rw-r--r-- | app/builder/base.py | 3 | ||||
-rw-r--r-- | design/sass/_writing_details.scss | 24 | ||||
-rw-r--r-- | design/templates/archives/homepage.html | 2 |
4 files changed, 28 insertions, 2 deletions
diff --git a/app/blog/models.py b/app/blog/models.py index d2fe954..8ab28b6 100644 --- a/app/blog/models.py +++ b/app/blog/models.py @@ -69,6 +69,7 @@ class Entry(models.Model): (5, 'bigimg-dark'), ) template_name = models.IntegerField(choices=TEMPLATES, default=0) + home_page_banner = models.BooleanField(default=False) class Meta: ordering = ('-pub_date',) diff --git a/app/builder/base.py b/app/builder/base.py index 59dcef8..97140e5 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -139,8 +139,9 @@ class BuildWriting(Build): self.write_file(fpath, t) def build_homepage(self): + banner = get_model('blog', 'entry').objects.filter(status__exact=1, home_page_banner=1)[:1] qs = get_model('blog', 'entry').objects.filter(status__exact=1)[:4] - c = Context({'object_list': qs, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) + c = Context({'object_list': qs, 'banner':banner, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) t = render_to_string('archives/homepage.html', c).encode('utf-8') self.write_file('', t) diff --git a/design/sass/_writing_details.scss b/design/sass/_writing_details.scss index db741b9..d0101ac 100644 --- a/design/sass/_writing_details.scss +++ b/design/sass/_writing_details.scss @@ -163,6 +163,30 @@ } } +.embed-wrapper { + @include breakpoint(gamma) { + width: 960px; + max-width: 960px; + margin-left: auto; + margin-right: auto; + border: 5px solid $brown; + } +} +.embed-container { + position: relative; + padding-bottom: 56.25%; + height: 0; + overflow: hidden; + max-width: 100%; + height: auto; +} +.embed-container iframe, .embed-container object, .embed-container embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} //### PAGE NAVIGATION ### #page-navigation { diff --git a/design/templates/archives/homepage.html b/design/templates/archives/homepage.html index cbdfdcc..1cd7347 100644 --- a/design/templates/archives/homepage.html +++ b/design/templates/archives/homepage.html @@ -3,7 +3,7 @@ {%block htmlclass%}class="black"{%endblock%} {%block bodyid%}id="home" class="has-hero"{%endblock%} -{% block primary %}<section class="banner">{% for object in object_list %}{% if forloop.counter == 1 %} +{% block primary %}<section class="banner">{% for object in banner %}{% if forloop.counter == 1 %} <article class="h-entry hentry {% cycle 'odd' 'even' %} {% cycle 'first' 'second' 'third' %}"> <div class="post--image"> <a href="{{object.get_absolute_url}}" title="{{object.title}}"> |