diff options
| author | 2013-11-20 16:58:50 -0300 | |
|---|---|---|
| committer | 2013-11-20 16:58:50 -0300 | |
| commit | ca94afc07df55cb7fc6fe3b4f3011877b7881195 (patch) | |
| tree | d81e1f275aa77545f33740723f307a83dde2e0b4 /nikola/data/themes/bootstrap | |
| parent | f794eee787e9cde54e6b8f53e45d69c9ddc9936a (diff) | |
Imported Upstream version 6.2.1upstream/6.2.1
Diffstat (limited to 'nikola/data/themes/bootstrap')
16 files changed, 747 insertions, 0 deletions
diff --git a/nikola/data/themes/bootstrap/README.md b/nikola/data/themes/bootstrap/README.md new file mode 100644 index 0000000..5340fe2 --- /dev/null +++ b/nikola/data/themes/bootstrap/README.md @@ -0,0 +1,23 @@ +A "website-done-with-bootstrap" theme, so to speak. + +Has a fixed navigation bar at top that displays the NAVIGATION_LINKS +setting and supports nested menus. + +This theme is used in Nikola's website: http://getnikola.com + +Important: To fit in the bootstrap navigation bar, the search form needs the +navbar-form and pull-left CSS classes applied. Here is an example with Nikola's +default duckduckgo search form: + + SEARCH_FORM = """ + <!-- Custom search --> + <form method="get" id="search" action="http://duckduckgo.com/" class="navbar-form pull-left"> + <input type="hidden" name="sites" value="%s"/> + <input type="hidden" name="k8" value="#444444"/> + <input type="hidden" name="k9" value="#D51920"/> + <input type="hidden" name="kt" value="h"/> + <input type="text" name="q" maxlength="255" placeholder="Search…" class="span2" style="margin-top: 4px;"/> + <input type="submit" value="DuckDuckGo Search" style="visibility: hidden;" /> + </form> + <!-- End of custom search --> + """ % SITE_URL diff --git a/nikola/data/themes/bootstrap/assets/css/colorbox.css b/nikola/data/themes/bootstrap/assets/css/colorbox.css new file mode 100644 index 0000000..13c3308 --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/css/colorbox.css @@ -0,0 +1,69 @@ +/* + Colorbox Core Style: + The following CSS is consistent between example themes and should not be altered. +*/ +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} +#cboxTitle{margin:0;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} +#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0;} +#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} + +/* + User Style: + Change the following styles to modify the appearance of Colorbox. They are + ordered & tabbed in a way that represents the nesting of the generated HTML. +*/ +#cboxOverlay{background:url(images/overlay.png) repeat 0 0;} +#colorbox{outline:0;} + #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;} + #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;} + #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;} + #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;} + #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;} + #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;} + #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;} + #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;} + #cboxContent{background:#fff; overflow:hidden;} + .cboxIframe{background:#fff;} + #cboxError{padding:50px; border:1px solid #ccc;} + #cboxLoadedContent{margin-bottom:28px;} + #cboxTitle{position:absolute; bottom:4px; right: 29px; text-align: right; width:100%; color:#949494;} + #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;} + #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;} + #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + + #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;} + #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxPrevious:hover{background-position:-75px -25px;} + #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxNext:hover{background-position:-50px -25px;} + #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxClose:hover{background-position:-25px -25px;} + +/* + The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill + when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9. + See: http://jacklmoore.com/notes/ie-transparency-problems/ +*/ +.cboxIE #cboxTopLeft, +.cboxIE #cboxTopCenter, +.cboxIE #cboxTopRight, +.cboxIE #cboxBottomLeft, +.cboxIE #cboxBottomCenter, +.cboxIE #cboxBottomRight, +.cboxIE #cboxMiddleLeft, +.cboxIE #cboxMiddleRight { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); +} diff --git a/nikola/data/themes/bootstrap/assets/css/images/border.png b/nikola/data/themes/bootstrap/assets/css/images/border.png Binary files differnew file mode 100644 index 0000000..f463a10 --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/css/images/border.png diff --git a/nikola/data/themes/bootstrap/assets/css/images/controls.png b/nikola/data/themes/bootstrap/assets/css/images/controls.png Binary files differnew file mode 100644 index 0000000..dcfd6fb --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/css/images/controls.png diff --git a/nikola/data/themes/bootstrap/assets/css/images/loading.gif b/nikola/data/themes/bootstrap/assets/css/images/loading.gif Binary files differnew file mode 100644 index 0000000..b4695d8 --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/css/images/loading.gif diff --git a/nikola/data/themes/bootstrap/assets/css/images/loading_background.png b/nikola/data/themes/bootstrap/assets/css/images/loading_background.png Binary files differnew file mode 100644 index 0000000..6ae83e6 --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/css/images/loading_background.png diff --git a/nikola/data/themes/bootstrap/assets/css/images/overlay.png b/nikola/data/themes/bootstrap/assets/css/images/overlay.png Binary files differnew file mode 100644 index 0000000..53ea98f --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/css/images/overlay.png diff --git a/nikola/data/themes/bootstrap/assets/css/theme.css b/nikola/data/themes/bootstrap/assets/css/theme.css new file mode 100644 index 0000000..2ff1a80 --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/css/theme.css @@ -0,0 +1,87 @@ +body { + padding-top: 60px; +} +@media (max-width: 979px) { + body { + padding-top: 0px; + } +} +#container { + width: 960px; + margin: 50 auto; +} + +#contentcolumn { + max-width: 760px; +} +#q { + width: 150px; +} + +img { + max-width: 90%; +} + +.postbox { + border-bottom: 2px solid darkgrey; + margin-bottom: 12px; +} + +.footerbox {padding: 15px; text-align: center; margin-bottom: 15px;} + +td.label { + /* Issue #290 */ + background-color: inherit; +} + +.footnote-reference { + /* Issue 290 */ + vertical-align: super; + font-size: xx-small; +} + +.caption { + /* Issue 292 */ + text-align: center; + padding-top: 1em; +} + +div.figure > img, +div.figure > a > img { + /* Issue 292 */ + display: block; + margin-left: auto; + margin-right: auto; +} + +div.sidebar, div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { + /* Issue 277 */ + border: 1px solid #aaa; + border-radius: 5px; +} + +blockquote p, blockquote { + font-size: 17.5px; + font-weight: 300; + line-height: 1.25; +} + +ul.bricks > li { + display: inline; + background-color: lightblue; + padding: 8px; + border-radius: 5px; + line-height: 3; + white-space:nowrap; + margin: 3px; +} + +ul.breadcrumb > li:before { + content: " / "; +} + +pre, pre code { + white-space: pre; + word-wrap: normal; + overflow: auto; +}
\ No newline at end of file diff --git a/nikola/data/themes/bootstrap/assets/js/flowr.plugin.js b/nikola/data/themes/bootstrap/assets/js/flowr.plugin.js new file mode 100644 index 0000000..c0d986b --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/js/flowr.plugin.js @@ -0,0 +1,265 @@ +/** + * Flowr.js - Simple jQuery plugin to emulate Flickr's justified view + * For usage information refer to http://github.com/kalyan02/flowr-js + * + * + * @author: Kalyan Chakravarthy (http://KalyanChakravarthy.net) + * @version: v0.1 + */ +(function($){ + //$("#container2").css( 'border', '1px solid #ccc'); + $.fn.flowr = function(options) { + + $this = this; + var ROW_CLASS_NAME = 'flowr-row'; // Class name for the row of flowy + var MAX_LAST_ROW_GAP = 25; // If the width of last row is lesser than max-width, recalculation is needed + var NO_COPY_FIELDS = [ 'complete', 'data', 'responsive' ]; // these attributes will not be carried forward for append related calls + var DEFAULTS = { + 'data' : [], + 'padding' : 5, // whats the padding between flowy items + 'height' : 240, // Minimum height an image row should take + 'render' : null, // callback function to get the tag + 'append' : false, // TODO + 'widthAttr' : 'width', // a custom data structure can specify which attribute refers to height/width + 'heightAttr' : 'height', + 'maxScale' : 1.5, // In case there is only 1 elment in last row + 'maxWidth' : this.width()-1, // 1px is just for offset + 'itemWidth' : null, // callback function for width + 'itemHeight' : null, // callback function for height + 'complete' : null, // complete callback + 'rowClassName' : ROW_CLASS_NAME, + 'rows' : -1, // Maximum number of rows to render. -1 for no limit. + 'responsive' : true // make content responsive + }; + var settings = $.extend( DEFAULTS, options); + + // If data is being appended, we already have settings + // If we already have settings, retrieve them + if( settings.append && $this.data('lastSettings') ) { + lastSettings = $this.data('lastSettings'); + + // Copy over the settings from previous init + for( attr in DEFAULTS ) { + if( NO_COPY_FIELDS.indexOf(attr)<0 && settings[attr] == DEFAULTS[attr] ) { + settings[attr] = lastSettings[attr]; + } + } + + // Check if we have an incomplete last row + lastRow = $this.data('lastRow'); + if( lastRow.data.length > 0 && settings.maxWidth-lastRow.width > MAX_LAST_ROW_GAP ) { + // Prepend the incomplete row to newly loaded data and redraw + lastRowData = lastSettings.data.slice( lastSettings.data.length - lastRow.data.length - 1 ); + settings.data = lastRowData.concat(settings.data); + + // Remove the incomplete row + // TODO: Don't reload this stuff later. Reattach to new row. + $( '.' + settings.rowClassName + ':last', $this ).detach(); + } else { + // console.log( lastRow.data.length ); + // console.log( lastRow.width ); + } + } + + // only on the first initial call + if( !settings.responsive && !settings.append ) + $this.width( $this.width() ); + + // Basic sanity checks + if( !(settings.data instanceof Array) ) + return; + + if( typeof(settings.padding) != 'number' ) + settings.padding = parseInt( settings.padding ); + + if( typeof(settings.itemWidth) != 'function' ) { + settings.itemWidth = function(data) { + return data[ settings.widthAttr ]; + } + } + + if( typeof(settings.itemHeight) != 'function' ) { + settings.itemHeight = function(data) { + return data[ settings.heightAttr ]; + } + } + + // A standalone utility to calculate the item widths for a particular row + // Returns rowWidth: width occupied & data : the items in the new row + var utils = { + getNextRow : function( data, settings ) { + var itemIndex = 0; + var itemsLength = data.length; + var lineItems = []; + var lineWidth = 0; + var maxWidth = settings.maxWidth; + var paddingSize = settings.padding; + + // console.log( 'maxItems=' + data.length ); + + requiredPadding = function() { + var extraPads = arguments.length == 1 ? arguments[0] : 0; + return (lineItems.length - 1 + extraPads) * settings.padding; + } + + while( lineWidth + requiredPadding() < settings.maxWidth && (itemIndex < itemsLength) ) { + var itemData = data[ itemIndex ]; + var itemWidth = settings.itemWidth.call( $this, itemData ); + var itemHeight = settings.itemHeight.call( $this, itemData ); + + var minHeight = settings.height; + var minWidth = Math.floor( itemWidth * settings.height / itemHeight ); + + var newLineWidth = lineWidth + minWidth + requiredPadding(1); + + if (minWidth > settings.maxWidth) { + // very short+wide images like panoramas + // show them even if ugly, as wide as possible + minWidth = settings.maxWidth-1; + minHeight = settings.height * minHeight / minWidth; + } + + // console.log( 'lineWidth = ' + lineWidth ); + // console.log( 'newLineWidth = ' + newLineWidth ); + if( newLineWidth < settings.maxWidth ) { + lineItems.push({ + 'height' : minHeight, + 'width' : minWidth, + 'itemData' : itemData + }); + + lineWidth += minWidth; + itemIndex ++; + } else { + // We'd have exceeded width. So break off to scale. + // console.log( 'breaking off = ' + itemIndex ); + // console.log( 'leave off size = ' + lineItems.length ); + break; + } + } //while + + // Scale the size to max width + testWidth=0; + if( lineWidth < settings.maxWidth ) { + var fullScaleWidth = settings.maxWidth - requiredPadding() - 10; + var currScaleWidth = lineWidth; + var scaleFactor = fullScaleWidth / currScaleWidth; + if( scaleFactor > settings.maxScale ) + scaleFactor = 1; + + var newHeight = Math.round( settings.height * scaleFactor ); + for( i=0; i<lineItems.length; i++ ) { + var lineItem = lineItems[ i ]; + lineItem.width = Math.floor(lineItem.width * scaleFactor); + lineItem.height = newHeight; + + testWidth += lineItem.width; + } + } + + return { + data : lineItems, + width : testWidth + requiredPadding() + }; + }, //getNextRow + reorderContent : function(){ + /* + TODO: optimize for faster resizing by reusing dom objects instead of killing the dom + */ + var _initialWidth = $this.data('width'); + var _newWidth = $this.width(); + var _change = _initialWidth - _newWidth; + + if(_initialWidth!=_newWidth) { + $this.html(''); + var _settings = $this.data( 'lastSettings' ); + _settings.data = $this.data( 'data' ); + _settings.maxWidth = $this.width() - 1; + $this.flowr( _settings ); + } + } + } //utils + + // If the resposive var is set to true then listen for resize method + // and prevent resizing from happening twice if responsive is set again during append phase! + if( settings.responsive && !$this.data('__responsive') ) { + $(window).resize(function(){ + initialWidth = $this.data('width'); + newWidth = $this.width(); + + //initiate resize + if( initialWidth != newWidth ) { + var task_id = $this.data('task_id'); + if( task_id ) { + task_id = clearTimeout( task_id ); + task_id = null; + } + task_id = setTimeout( utils.reorderContent, 80 ); + $this.data('task_id', task_id ); + } + }); + $this.data('__responsive',true); + } + + + return this.each(function(){ + + // Get a copy of original data. 1 level deep copy is sufficient. + var data = settings.data.slice(0); + var rowData = null; + var currentRow = 0; + var currentItem = 0; + + // Store all the data + var allData = $this.data( 'data' ) || []; + for(i=0;i<data.length;i++) { + allData.push( data[i] ); + } + $this.data( 'data', allData ); + + // While we have a new row + while( ( rowData = utils.getNextRow(data,settings) ) != null && rowData.data.length > 0 ) { + if( settings.rows > 0 && currentRow >= settings.rows ) + break; + // remove the number of elements in the new row from the top of data stack + data.splice( 0, rowData.data.length ); + + // Create a new row div, add class, append the htmls and insert the flowy items + var $row = $('<div>').addClass(settings.rowClassName); + for( i=0; i<rowData.data.length; i++ ) { + var displayData = rowData.data[i]; + // Get the HTML object from custom render function passed as argument + var displayObject = settings.render.call( $this, displayData ); + displayObject = $(displayObject); + // Set some basic stuff + displayObject + .css( 'width', displayData.width ) + .css( 'height', displayData.height ) + .css( 'margin-left', i==0 ? '0' : settings.padding + "px" ); //TODO:Refactor + $row.append( displayObject ); + + currentItem++; + } + $this.append( $row ); + // console.log ( "I> rowData.data.length="+rowData.data.length +" rowData.width="+rowData.width ); + + currentRow++; + $this.data('lastRow', rowData ); + } + // store the current state of settings and the items in last row + // we'll need this info when we append more items + $this.data('lastSettings', settings ); + + // onComplete callback + // pass back info about list of rows and items rendered + if( typeof (settings.complete) == 'function' ) { + var completeData = { + renderedRows : currentRow, + renderedItems : currentItem + } + settings.complete.call( $this, completeData ); + } + }); + }; + +})(jQuery); diff --git a/nikola/data/themes/bootstrap/bundles b/nikola/data/themes/bootstrap/bundles new file mode 100644 index 0000000..14124a3 --- /dev/null +++ b/nikola/data/themes/bootstrap/bundles @@ -0,0 +1,4 @@ +assets/css/all-nocdn.css=bootstrap.css,bootstrap-responsive.css,rst.css,code.css,colorbox.css,theme.css,custom.css +assets/css/all.css=rst.css,code.css,colorbox.css,theme.css,custom.css +assets/js/all-nocdn.js=jquery-1.10.2.min.js,bootstrap.min.js,jquery.colorbox-min.js +assets/js/all.js=jquery.colorbox-min.js diff --git a/nikola/data/themes/bootstrap/engine b/nikola/data/themes/bootstrap/engine new file mode 100644 index 0000000..2951cdd --- /dev/null +++ b/nikola/data/themes/bootstrap/engine @@ -0,0 +1 @@ +mako diff --git a/nikola/data/themes/bootstrap/parent b/nikola/data/themes/bootstrap/parent new file mode 100644 index 0000000..df967b9 --- /dev/null +++ b/nikola/data/themes/bootstrap/parent @@ -0,0 +1 @@ +base diff --git a/nikola/data/themes/bootstrap/templates/base.tmpl b/nikola/data/themes/bootstrap/templates/base.tmpl new file mode 100644 index 0000000..8cb2e43 --- /dev/null +++ b/nikola/data/themes/bootstrap/templates/base.tmpl @@ -0,0 +1,93 @@ +## -*- coding: utf-8 -*- +<%namespace name="base" file="base_helper.tmpl" import="*" /> +<%namespace name="bootstrap" file="bootstrap_helper.tmpl" import="*" /> +<%namespace name="notes" file="annotation_helper.tmpl" import="*" /> +${set_locale(lang)} +<!DOCTYPE html> +<html +%if comment_system == 'facebook': +xmlns:fb="http://ogp.me/ns/fb#" +%endif +lang="${lang}"> +<head> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + ${bootstrap.html_head()} + <%block name="extra_head"> + </%block> + % if annotations and post and not post.meta('noannotations'): + ${notes.css()} + % elif not annotations and post and post.meta('annotations'): + ${notes.css()} + % endif + ${extra_head_data} +</head> +<body> +<!-- Menubar --> +<div class="navbar navbar-fixed-top" id="navbar"> + <div class="navbar-inner"> + <div class="container"> + + <!-- .btn-navbar is used as the toggle for collapsed navbar content --> + <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="${abs_link('/')}"> + ${blog_title} + </a> + <!-- Everything you want hidden at 940px or less, place within here --> + <div class="nav-collapse collapse"> + <ul class="nav"> + ${bootstrap.html_navigation_links()} + </ul> + %if search_form: + ${search_form} + %endif + <ul class="nav pull-right"> + <%block name="belowtitle"> + %if len(translations) > 1: + <li>${base.html_translations()}</li> + %endif + </%block> + % if not hide_sourcelink: + <li><%block name="sourcelink"></%block></li> + %endif + </ul> + </div> + </div> + </div> +</div> +<!-- End of Menubar --> +<div class="container-fluid" id="container-fluid"> + <!--Body content--> + <div class="row-fluid"> + <div class="span2"></div> + <div class="span8"> + <%block name="content"></%block> + </div> + </div> + <!--End of body content--> +</div> +<div class="footerbox"> + ${content_footer} +</div> +${bootstrap.late_load_js()} +${base.html_social()} + <script type="text/javascript">jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true}); + $(window).on('hashchange', function(){ + if (location.hash && $(location.hash)[0]) { + $('body').animate({scrollTop: $(location.hash).offset().top - $('#navbar').outerHeight(true)*1.2 }, 1); + } + }); + $(document).ready(function(){$(window).trigger('hashchange')}); + </script> + <%block name="extra_js"></%block> + % if annotations and post and not post.meta('noannotations'): + ${notes.code()} + % elif not annotations and post and post.meta('annotations'): + ${notes.code()} + % endif + ${body_end} +</body> diff --git a/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl b/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl new file mode 100644 index 0000000..763ac20 --- /dev/null +++ b/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl @@ -0,0 +1,96 @@ +## Override only the functions that differ from base_helper.tmpl +<%def name="html_head()"> + <meta charset="utf-8"> + %if description: + <meta name="description" content="${description}"> + %endif + <meta name="author" content="${blog_author}"> + <title>${title|striphtml} | ${blog_title|striphtml}</title> + ${mathjax_config} + %if use_bundles: + %if use_cdn: + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet"> + <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> + %else: + <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css"> + %endif + %else: + %if use_cdn: + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet"> + %else: + <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"> + %endif + <link href="/assets/css/rst.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/code.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/colorbox.css" rel="stylesheet" type="text/css"/> + <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> + %if has_custom_css: + <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> + %endif + %endif + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script> + <![endif]--> + %if rss_link: + ${rss_link} + %else: + %if len(translations) > 1: + %for language in translations: + <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}"> + %endfor + %else: + <link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}"> + %endif + %endif + %if favicons: + %for name, file, size in favicons: + <link rel="${name}" href="${file}" sizes="${size}"/> + %endfor + %endif +</%def> + +<%def name="late_load_js()"> + %if use_bundles: + %if use_cdn: + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script> + <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script> + <script src="/assets/js/all.js" type="text/javascript"></script> + %else: + <script src="/assets/js/all-nocdn.js" type="text/javascript"></script> + %endif + %else: + %if use_cdn: + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script> + <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script> + %else: + <script src="/assets/js/jquery-1.10.2.min.js" type="text/javascript"></script> + <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script> + %endif + <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script> + %endif +</%def> + + +<%def name="html_navigation_links()"> + %for url, text in navigation_links[lang]: + % if isinstance(url, tuple): + <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">${text}<b class="caret"></b></a> + <ul class="dropdown-menu"> + %for suburl, text in url: + % if rel_link(permalink, suburl) == "#": + <li class="active"><a href="${suburl}">${text}</a> + %else: + <li><a href="${suburl}">${text}</a> + %endif + %endfor + </ul> + % else: + % if rel_link(permalink, url) == "#": + <li class="active"><a href="${url}">${text}</a> + %else: + <li><a href="${url}">${text}</a> + %endif + % endif + %endfor +</%def> diff --git a/nikola/data/themes/bootstrap/templates/gallery.tmpl b/nikola/data/themes/bootstrap/templates/gallery.tmpl new file mode 100644 index 0000000..17ae61c --- /dev/null +++ b/nikola/data/themes/bootstrap/templates/gallery.tmpl @@ -0,0 +1,86 @@ +## -*- coding: utf-8 -*- +<%inherit file="base.tmpl"/> +<%namespace name="comments" file="comments_helper.tmpl"/> +<%namespace name="ui" file="crumbs.tmpl" import="bar"/> +<%block name="sourcelink"></%block> + +<%block name="content"> + ${ui.bar(crumbs)} + %if text: + <p> + ${text} + </p> + %endif + <ul> + % for folder in folders: + <li><a href="${folder}"><i class="icon-folder-open"></i> ${folder}</a></li> + % endfor + </ul> + + <div id="gallery_container"></div> + <noscript> + <ul class="thumbnails"> + %for image in photo_array: + <li><a href="${image['url']}" class="thumbnail image-reference" title="${image['title']}"> + <img src="${image['url_thumb']}" alt="${image['title']}" /></a> + %endfor + </ul> + </noscript> +%if enable_comments: + ${comments.comment_form(None, permalink, title)} +%endif +</%block> + + +<%block name="extra_head"> +<style type="text/css"> + .image-block { + display: inline-block; + } + .flowr_row { + width: 100%; + } + </style> +</%block> + + +<%block name="extra_js"> +<script src="/assets/js/flowr.plugin.js"></script> +<script> +jsonContent = ${photo_array_json}; +$("#gallery_container").flowr({ + data : jsonContent, + height : ${thumbnail_size}*.6, + padding: 5, + rows: -1, + render : function(params) { + // Just return a div, string or a dom object, anything works fine + img = $("<img />").attr({ + 'src': params.itemData.url_thumb, + 'width' : params.width, + 'height' : params.height + }).css('max-width', '100%'); + link = $( "<a></a>").attr({ + 'href': params.itemData.url, + 'class': 'image-reference' + }); + div = $("<div />").addClass('image-block').attr({ + 'title': params.itemData.title, + 'data-toggle': "tooltip", + }); + link.append(img); + div.append(link); + div.hover(div.tooltip()); + return div; + }, + itemWidth : function(data) { return data.size.w; }, + itemHeight : function(data) { return data.size.h; }, + complete : function(params) { + if( jsonContent.length > params.renderedItems ) { + nextRenderList = jsonContent.slice( params.renderedItems ); + } + } + }); +$("a.image-reference").colorbox({rel:"gal", maxWidth:"100%",maxHeight:"100%",scalePhotos:true}); +</script> +</%block> diff --git a/nikola/data/themes/bootstrap/templates/slides.tmpl b/nikola/data/themes/bootstrap/templates/slides.tmpl new file mode 100644 index 0000000..14983ad --- /dev/null +++ b/nikola/data/themes/bootstrap/templates/slides.tmpl @@ -0,0 +1,22 @@ +<div id="${carousel_id}" class="carousel slide"> + <ol class="carousel-indicators"> + % for i in range(len(content)): + % if i == 0: + <li data-target="#${carousel_id}" data-slide-to="${i}" class="active"></li> + % else: + <li data-target="#${carousel_id}" data-slide-to="${i}"></li> + % endif + % endfor + </ol> + <div class="carousel-inner"> + % for i, image in enumerate(content): + % if i == 0: + <div class="item active"><img src="${image}" alt="" style="margin: 0 auto 0 auto;"></div> + % else: + <div class="item"><img src="${image}" alt="" style="margin: 0 auto 0 auto;"></div> + % endif + % endfor + </div> + <a class="left carousel-control" href="#${carousel_id}" data-slide="prev">‹</a> + <a class="right carousel-control" href="#${carousel_id}" data-slide="next">›</a> +</div> |
