Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getnikola/nikola
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f2fc835b5ac6
Choose a base ref
...
head repository: getnikola/nikola
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d431b0e01dab
Choose a head ref
  • 2 commits
  • 9 files changed
  • 1 contributor

Commits on May 29, 2015

  1. Copy the full SHA
    67ee72b View commit details
  2. jinjify

    ralsina committed May 29, 2015
    Copy the full SHA
    d431b0e View commit details
1 change: 1 addition & 0 deletions nikola/data/themes/base-jinja/templates/base.tmpl
Original file line number Diff line number Diff line change
@@ -22,5 +22,6 @@
{{ body_end }}
{{ template_hooks['body_end']() }}
{{ base.late_load_js() }}
{% block extra_js %}{% endblock %}
</body>
</html>
74 changes: 66 additions & 8 deletions nikola/data/themes/base-jinja/templates/gallery.tmpl
Original file line number Diff line number Diff line change
@@ -22,20 +22,78 @@
{% endfor %}
</ul>
{% endif %}
{% if photo_array %}
<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>
{% endif %}

<div id="gallery_container"></div>

{% if site_has_comments and enable_comments %}
{{ comments.comment_form(None, permalink, title) }}
{% endif %}
{% endblock %}

{% block extra_head %}
{{ super() }}
<!-- FIXME: this goes in some CSS -->
<style type="text/css">
.image-block {
display: inline-block;
}
.flowr_row {
width: 100%;
}
</style>
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
{% endblock %}

{% block extra_js %}
<script>
function createGallery() {
jQuery.getScript("/assets/js/flowr.plugin.js");
jQuery.getJSON('index.json', success = function(data) {
$("#gallery_container").flowr({
data : data,
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 );
}
}
});
})};

// Load JQuery if it's not there already
if(typeof jQuery=='undefined') {
var headTag = document.getElementsByTagName("head")[0];
var jqTag = document.createElement('script');
jqTag.type = 'text/javascript';
jqTag.src = '//code.jquery.com/jquery-1.11.3.min.js';
jqTag.onload = createGallery;
headTag.appendChild(jqTag);
} else {
createGallery();
}
</script>
{% endblock %}
265 changes: 0 additions & 265 deletions nikola/data/themes/bootstrap-jinja/assets/js/flowr.plugin.js

This file was deleted.

1 change: 0 additions & 1 deletion nikola/data/themes/bootstrap-jinja/assets/js/jquery.min.js

This file was deleted.

This file was deleted.

Loading