Commits

Tyler Butler committed e9007e5

Backup.

Comments (0)

Files changed (2)

 2012-01-17_23-26-44_r25+.diff
 more_themes.diff
+themes3.diff
 # Placed by Bitbucket
+# HG changeset patch
+# Parent c59bc1310cd1559fc55359cc63d8c1d2313b86ad
+diff --git a/engineer/context_processors.py b/engineer/context_processors.py
+--- a/engineer/context_processors.py
++++ b/engineer/context_processors.py
+@@ -1,5 +1,6 @@
+ from django.conf import settings
+ from path import path
++from potpourri.functions import get_class
+ 
+ __author__ = 'tyler@tylerbutler.com'
+ 
+@@ -24,6 +25,6 @@
+         }
+     return {
+         'engineer': engineer,
+-        'theme': settings.ENGINEER_THEME,
++        'theme': get_class(settings.ENGINEER_THEME),
+         }
+ 
+diff --git a/engineer/models.py b/engineer/models.py
+--- a/engineer/models.py
++++ b/engineer/models.py
+@@ -7,12 +7,12 @@
+ from django.template.context import Context
+ from django.template.loader import get_template
+ from markitup.fields import MarkupField
++from potpourri.functions import get_class
+ from taggit.managers import TaggableManager
+ from path import path
+ from yaml import dump
+ 
+ from engineer.managers import PublishedPostManager, DraftPostManager, LinkPostManager
+-from engineer import themes
+ 
+ __author__ = 'tyler@tylerbutler.com'
+ 
+@@ -34,13 +34,16 @@
+     FEED_DESCRIPTION = ""
+     FEED_MAX_ITEMS = 10
+ 
+-    THEME = themes.DarkRainbow
++    THEME = 'engineer.themes.DarkRainbow'
+ 
+-    SITE_TITLE = THEME['name']
++    SITE_TITLE = None
+     META_DESCRIPTION = None
+     META_AUTHOR = None
+ 
+     TYPEKIT_URL = None
++#
++#    def configure_theme(self, value):
++#        return get_class('engineer.themes.DarkRainbow') if value is None else value
+ 
+ 
+ class Series(models.Model):
+diff --git a/engineer/static/engineer/_base_mixins.less b/engineer/static/engineer/_base_mixins.less
+--- a/engineer/static/engineer/_base_mixins.less
++++ b/engineer/static/engineer/_base_mixins.less
+@@ -31,3 +31,21 @@
+ .link-color-single(@linkcolor) {
+ 	.link-color(@linkcolor, @linkcolor);
+ }
++
++.horizontal-list(@padding-right: 0, @padding-left: 0) {
++    ul {
++        padding: 0;
++        li {
++            display: inline;
++            padding-right: @padding-right;
++            padding-left: @padding-left;
++        }
++    }
++}
++
++.hide           { display: none; }
++.left           { float: left; }
++.right          { float: right; }
++.text-left      { text-align: left; }
++.text-right     { text-align: right; }
++.text-center    { text-align: center; }
+diff --git a/engineer/static/engineer/baseline.less b/engineer/static/engineer/baseline.less
+new file mode 100644
+--- /dev/null
++++ b/engineer/static/engineer/baseline.less
+@@ -0,0 +1,20 @@
++@import "reset.css.less";
++
++html {
++    font-size: 62.5%;
++}
++///////////
++// Links //
++///////////
++a { text-decoration: none; line-height: inherit; }
++/*a:hover { color: #11639d; }*/
++/*a:focus { color: #cc4714; outline: none; }*/
++/*p a, p a:visited { line-height: inherit; }*/
++
++strong {
++    font-weight: bold;
++}
++
++em {
++    font-style: italic;
++}
+diff --git a/engineer/static/engineer/reset.css b/engineer/static/engineer/reset.css.less
+rename from engineer/static/engineer/reset.css
+rename to engineer/static/engineer/reset.css.less
+--- a/engineer/static/engineer/reset.css
++++ b/engineer/static/engineer/reset.css.less
+@@ -19,10 +19,10 @@
+ 	margin: 0;
+ 	padding: 0;
+ 	border: 0;
+-	font-size: 100%;
+ 	font: inherit;
+ 	vertical-align: baseline;
+ }
++
+ /* HTML5 display-role reset for older browsers */
+ article, aside, details, figcaption, figure,
+ footer, header, hgroup, menu, nav, section {
+diff --git a/engineer/static/engineer/themes/dark_rainbow/scripts/highlight.js b/engineer/static/engineer/themes/dark_rainbow/scripts/highlight.js
+new file mode 100644
+--- /dev/null
++++ b/engineer/static/engineer/themes/dark_rainbow/scripts/highlight.js
+@@ -0,0 +1,22 @@
++$(document).ready(function () {
++    var header = $('header#top h1');
++    var headerText = header.text();
++    console.debug(headerText);
++    var headerTextArray = headerText.split(' ');
++    var headerTextArrayLength = headerTextArray.length;
++    var lastWord = headerTextArray[headerTextArrayLength - 1];
++    console.debug(lastWord);
++    headerTextArray.pop();
++    var firstWords = headerTextArray.join(' ');
++
++    header.text(firstWords);
++    //lastWord.wrap('<span class="highlight" />');
++    header.append(' <span class="highlight">' + lastWord + '</span>');
++    //header.append(lastWord);
++    //header.append('</span>');
++    //var spanLastName = $('<span/>');
++    //spanLastName.class('highlight');
++    //spanLastName.css('margin-left', '5px');
++    //spanLastName.appendTo(span);
++    //spanLastName.text(lastName);
++});
+diff --git a/engineer/static/engineer/themes/dark_rainbow/stylesheets/_mixins.less b/engineer/static/engineer/themes/dark_rainbow/stylesheets/_mixins.less
+new file mode 100644
+--- /dev/null
++++ b/engineer/static/engineer/themes/dark_rainbow/stylesheets/_mixins.less
+@@ -0,0 +1,16 @@
++@import "../../../_base_mixins.less";
++
++.bulleted-list(@bullet: "»") {
++    > ul li:before {
++        font-size: @font-size-default + 2;
++        content: @bullet;
++        padding-right: 11px;
++        margin-left: -10px;
++    }
++}
++
++.horizontal {
++    ul {
++        .horizontal-list()
++    }
++}
+diff --git a/engineer/static/engineer/themes/dark_rainbow/stylesheets/dark_rainbow.less b/engineer/static/engineer/themes/dark_rainbow/stylesheets/dark_rainbow.less
+--- a/engineer/static/engineer/themes/dark_rainbow/stylesheets/dark_rainbow.less
++++ b/engineer/static/engineer/themes/dark_rainbow/stylesheets/dark_rainbow.less
+@@ -1,4 +1,5 @@
+-@import "../../../_base_mixins.less";
++@import "../../../baseline.less";
++@import "_mixins.less";
+ @import "_colors.less";
+ @import "_typography.less";
+ @import "_solarized.less";
+@@ -29,18 +30,9 @@
+ 
+ ul {
+     padding-left: 21px;
+-}
+-
+-ul li {
+-    text-indent: -9px;
+-}
+-
+-li.current {
+-    .link-color( @orange-burnt, @orange );
+-}
+-
+-ol {
+-    padding-left: 22px;
++    li {
++        text-indent: -9px;
++    }
+ }
+ 
+ hr {
+@@ -53,14 +45,6 @@
+     width: 20%;
+ }
+ 
+-strong {
+-    font-weight: bold;
+-}
+-
+-em {
+-    font-style: italic;
+-}
+-
+ blockquote {
+     padding: 0 10px 0 20px;
+     margin-left: 15px;
+@@ -110,19 +94,11 @@
+     }
+ }
+ 
+-article {
+-    .link-color(@green, @orange);
++article, #sidebar div {
++    .bulleted-list();
+ }
+ 
+-article, .sidebar div {
+-    > ul li:before {
+-        font-size: @font-size-default + 2;
+-        content: "»";
+-        padding-right: 11px;
+-        margin-left: -10px;
+-    }
+-}
+-
++// TOP HEADER
+ header#top {
+     h1 {
+         .font-size-xxl(1, 0);
+@@ -131,14 +107,17 @@
+         float: left;
+     }
+ 
+-    nav.primary {
++    nav {
+         .font-size-xl(1, 0);
+         .margin-calc(@line-height-double, .9, .1, -1px, -5px);
++        .link-color(@strong-blue, @orange);
+         text-align: right;
+         float: right;
+-        ul li {
+-            display: inline;
+-            padding: 0 0 0 16px;
++        .horizontal-list(0, 16px);
++        ul {
++            li.current {
++                .link-color(@orange-burnt, @orange);
++            }
+         }
+     }
+ 
+@@ -150,6 +129,17 @@
+     border-bottom: @border;
+ }
+ 
++#sidebar {
++    nav {
++        .horizontal-list(5px, 0);
++        li:not(:last-child):after {
++            content: "/";
++            padding-left: 5px;
++        }
++    }
++}
++
++// FOOTER
+ footer {
+     text-align: center;
+ }
+diff --git a/engineer/templates/engineer/_base.html b/engineer/templates/engineer/_base.html
+--- a/engineer/templates/engineer/_base.html
++++ b/engineer/templates/engineer/_base.html
+@@ -37,9 +37,9 @@
+ 
+     {% if theme.use_foundation %}
+         {# FOUNDATION CSS #}
+-        {% compress css %}
+-            <link rel="stylesheet" href="{{ STATIC_URL }}engineer/reset.css">
+-        {% endcompress %}
++{#        {% compress css %}#}
++{#            <link rel="stylesheet" href="{{ STATIC_URL }}engineer/reset.css">#}
++{#        {% endcompress %}#}
+ 
+         {% compress css %}
+             <link rel="stylesheet" href="{{ engineer.foundation_url }}stylesheets/grid.css">
+@@ -63,7 +63,7 @@
+             <script src="{{ engineer.lesscss_url }}" type="text/javascript"></script>
+             <script type="text/javascript">
+                 //less = { env:'development' };
+-                //less.watch();
++                less.watch();
+             </script>
+         {% endif %}
+     {% endif %}
+diff --git a/engineer/templates/engineer/themes/dark_rainbow/_sidebar.html b/engineer/templates/engineer/themes/dark_rainbow/_sidebar.html
+--- a/engineer/templates/engineer/themes/dark_rainbow/_sidebar.html
++++ b/engineer/templates/engineer/themes/dark_rainbow/_sidebar.html
+@@ -1,18 +1,1 @@
+-<section class="sidebar">
+-    <header>
+-        <h1>{% block sidebar_title %}{% endblock %}</h1>
+-    </header>
+-    <div>
+-        {% block sidebar_content %}
+-            <p>I'm <a href="">Tyler Butler</a>: tinkerer, designer, developer, and lover of all things simple.
+-            </p>
+-            <ul>
+-                <li><a href="{% url 'archives' %}">archives</a></li>
+-                <li><a href="http://twitter.com/tylerbutler">twitter</a></li>
+-                <li><a href="http://bitbucket.org/tylerbutler">bitbucket</a></li>
+-                <li><a href="http://github.com/tylerbutler">github</a></li>
+-                <li><a href="http://forrst.me/tylerbutler">forrst</a></li>
+-            </ul>
+-        {% endblock %}
+-    </div>
+-</section>
++{% include "sidebar_content.html" %}
+diff --git a/engineer/templates/engineer/themes/dark_rainbow/_single_post.html b/engineer/templates/engineer/themes/dark_rainbow/_single_post.html
+--- a/engineer/templates/engineer/themes/dark_rainbow/_single_post.html
++++ b/engineer/templates/engineer/themes/dark_rainbow/_single_post.html
+@@ -26,7 +26,7 @@
+             </div>
+         {% endblock post_info %}
+         {% block post_content %}
+-            <article class="post-content seven columns">
++            <article class="post-content ten columns">
+                 <time datetime="{{ post.timestamp|date:"%Y-%m-%d" }}" pubdate=""></time>
+                 <header>
+                     <h1>
+diff --git a/engineer/templates/engineer/themes/dark_rainbow/base.html b/engineer/templates/engineer/themes/dark_rainbow/base.html
+--- a/engineer/templates/engineer/themes/dark_rainbow/base.html
++++ b/engineer/templates/engineer/themes/dark_rainbow/base.html
+@@ -29,7 +29,7 @@
+     <div class="container">
+         <div class="row">
+             <header id="top" class="twelve columns">
+-                <h1>dark rainbow</h1>
++                <h1 class=""><a href="{% url 'home' %}">{{ engineer.site_title }}</a></h1>
+                 <nav id="primary">
+                     {% include 'engineer/themes/dark_rainbow/_primary_nav.html' %}
+                 </nav>
+@@ -41,24 +41,7 @@
+             </section>
+             <section id="sidebar" class="three columns">
+                 {% block sidebar %}
+-                    <section class="sidebar">
+-                        <header>
+-                            <h1>{% block sidebar_title %}{% endblock %}</h1>
+-                        </header>
+-                        <div>
+-                            {% block sidebar_content %}
+-                                <p>I'm <a href="">Tyler Butler</a>: tinkerer, designer, developer, and lover of all things simple.
+-                                </p>
+-                                <ul>
+-                                    <li><a href="{% url 'archives' %}">archives</a></li>
+-                                    <li><a href="http://twitter.com/tylerbutler">twitter</a></li>
+-                                    <li><a href="http://bitbucket.org/tylerbutler">bitbucket</a></li>
+-                                    <li><a href="http://github.com/tylerbutler">github</a></li>
+-                                    <li><a href="http://forrst.me/tylerbutler">forrst</a></li>
+-                                </ul>
+-                            {% endblock %}
+-                        </div>
+-                    </section>
++                    {% include 'engineer/themes/dark_rainbow/_sidebar.html' %}
+                 {% endblock %}
+             </section>
+         </div>
+@@ -72,4 +55,10 @@
+             </footer>
+         </div>
+     </div>
+-{% endblock body %}
+\ No newline at end of file
++{% endblock body %}
++
++{% block scripts_bottom %}
++    {% compress js %}
++        <script type="text/javascript" src="{{ STATIC_URL }}engineer/themes/dark_rainbow/scripts/highlight.js"></script>
++    {% endcompress %}
++{% endblock %}
+diff --git a/engineer/themes.py b/engineer/themes.py
+--- a/engineer/themes.py
++++ b/engineer/themes.py
+@@ -1,10 +1,11 @@
+ from django.conf import settings
+ from path import path
++from potpourri.functions import get_class
+ 
+ __author__ = 'tyler@tylerbutler.com'
+ 
+ def theme_path(template):
+-    theme = settings.ENGINEER_THEME
++    theme = get_class(settings.ENGINEER_THEME)
+     return path(theme['template_root']) / template
+ 
+ 
+@@ -16,5 +17,5 @@
+     'use_foundation': True,
+     'use_lesscss': True,
+     'use_modernizr': False,
+-    'use_jquery': False,
++    'use_jquery': True,
+ }