Permalink
Browse files

updated templates to using bootstrap 3; using `static` templatetag fo…

…r media
  • Loading branch information...
1 parent 32ce76f commit 62dd8495e7535b7b85694d100ddd6a4da1354299 @deanmalmgren deanmalmgren committed Dec 3, 2013

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,4 +1,5 @@
{% load compress %}
+{% load staticfiles %}
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
@@ -19,56 +20,66 @@
<!-- Mobile viewport optimized: h5bp.com/viewport -->
<meta name="viewport" content="width=device-width">
+ {% block meta %}
+ {% endblock %}
+
+ {# use the CDN to get bootstrap css. can not be inside compress css block #}
+ {% block cdn_css %}
+ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/css/bootstrap.min.css">
+ {% endblock cdn_css %}
+
{% compress css %}
- <link rel="stylesheet" href="{{ STATIC_URL }}css/style.css">
+ <link rel="stylesheet" href="{% static 'css/app.css' %}">
{% block css %}{% endblock %}
{% endcompress %}
- <style>
- body {
- padding-top: 60px;
- padding-bottom: 40px;
- }
- </style>
<!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->
<!-- All JavaScript at the bottom, except this Modernizr build.
Modernizr enables HTML5 elements & feature detects for optimal performance.
Create your own custom Modernizr build: www.modernizr.com/download/ -->
{% compress js %}
- <script src="{{ STATIC_URL }}js/libs/modernizr-2.6.2-respond-1.1.0.min.js"></script>
+ <script src="{% static 'js/libs/modernizr-2.6.2-respond-1.1.0.min.js' %}"></script>
{% endcompress %}
</head>
-<body class="{% block body_class %}{% endblock %}">
+<body class="{% block body_class %}{% endblock %}" {% block body_attributes %}{% endblock %}>
{% block body %}
<!-- Prompt IE 6 users to install Chrome Frame. Remove this if you support IE 6.
chromium.org/developers/how-tos/chrome-frame-getting-started -->
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<header>
-
+ {% block header %}{% endblock %}
</header>
<div role="main">
{% block content %}{% endblock %}
</div>
<footer>
- <p>&copy; Company 2013</p>
+ {% block footer %}
+ <div class="container">
+ <hr>
+ <p>&copy; Company 2013</p>
+ </div>
+ {% endblock footer %}
</footer>
<!-- JavaScript at the bottom for fast page loading -->
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
+ {% block cdn_js %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ STATIC_URL }}js/libs/jquery-1.9.1.min.js"><\/script>')</script>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/js/bootstrap.min.js"></script>
+ {% endblock cdn_js %}
<!-- scripts concatenated and minified via django-compressor -->
{% compress js %}
- <script src="{{ STATIC_URL }}js/libs/bootstrap.min.js"></script>
- <script src="{{ STATIC_URL }}js/plugins.js"></script>
- <script src="{{ STATIC_URL }}js/main.js"></script>
+ {% block js %}
+ <script src="{% static 'js/main.js' %}"></script>
+ {% endblock js %}
{% endcompress %}
<!-- end scripts -->
@@ -1,75 +1,73 @@
{% extends "_layouts/base.html" %}
+{% block css %}
+{{block.super}}
+<style>
+/* Move down content because we have a fixed navbar that is 50px tall */
+body {
+ padding-top: 50px;
+ padding-bottom: 20px;
+}
+</style>
+{% endblock css %}
+
{% block page_title %}Your Site - Home{% endblock %}
{% block page_class %}home-page{% endblock %}
{% block content %}
-<!-- This code is taken from http://twitter.github.com/bootstrap/examples/hero.html -->
+<!-- This code is taken from http://getbootstrap.com/examples/jumbotron/ -->
- <div class="navbar navbar-inverse navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container">
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
- <a class="brand" href="#">Project name</a>
- <div class="nav-collapse collapse">
- <ul class="nav">
- <li class="active"><a href="#">Home</a></li>
- <li><a href="#about">About</a></li>
- <li><a href="#contact">Contact</a></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
- <ul class="dropdown-menu">
- <li><a href="#">Action</a></li>
- <li><a href="#">Another action</a></li>
- <li><a href="#">Something else here</a></li>
- <li class="divider"></li>
- <li class="nav-header">Nav header</li>
- <li><a href="#">Separated link</a></li>
- <li><a href="#">One more separated link</a></li>
- </ul>
- </li>
- </ul>
- <form class="navbar-form pull-right">
- <input class="span2" type="text" placeholder="Email">
- <input class="span2" type="password" placeholder="Password">
- <button type="submit" class="btn">Sign in</button>
- </form>
- </div><!--/.nav-collapse -->
- </div>
- </div>
+ <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="#">Project name</a>
</div>
-
- <div class="container">
-
- <!-- Main hero unit for a primary marketing message or call to action -->
- <div class="hero-unit">
- <h1>Hello, world!</h1>
- <p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
- <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
+ <div class="navbar-collapse collapse">
+ <form class="navbar-form navbar-right">
+ <div class="form-group">
+ <input type="text" placeholder="Email" class="form-control">
</div>
-
- <!-- Example row of columns -->
- <div class="row">
- <div class="span4">
- <h2>Heading</h2>
- <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
- <p><a class="btn" href="#">View details &raquo;</a></p>
- </div>
- <div class="span4">
- <h2>Heading</h2>
- <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
- <p><a class="btn" href="#">View details &raquo;</a></p>
- </div>
- <div class="span4">
- <h2>Heading</h2>
- <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
- <p><a class="btn" href="#">View details &raquo;</a></p>
- </div>
+ <div class="form-group">
+ <input type="password" placeholder="Password" class="form-control">
</div>
+ <button type="submit" class="btn btn-success">Sign in</button>
+ </form>
+ </div><!--/.navbar-collapse -->
+ </div>
+ </div>
+
+ <div class="jumbotron">
+ <div class="container">
+ <h1>Hello, world!</h1>
+ <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
+ <p><a class="btn btn-primary btn-lg" role="button">Learn more »</a></p>
+ </div>
+ </div>
- <hr>
+ <div class="container">
+ <!-- Example row of columns -->
+ <div class="row">
+ <div class="col-md-4">
+ <h2>Heading</h2>
+ <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
+ <p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
+ <div class="col-md-4">
+ <h2>Heading</h2>
+ <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
+ <p><a class="btn btn-default" href="#" role="button">View details »</a></p>
+ </div>
+ <div class="col-md-4">
+ <h2>Heading</h2>
+ <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
+ <p><a class="btn btn-default" href="#" role="button">View details »</a></p>
+ </div>
+ </div>
+ </div>
+
{% endblock %}

0 comments on commit 62dd849

Please sign in to comment.