Skip to content

Commit

Permalink
work in progress for switching view to test on live gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Bayfield committed Sep 5, 2014
1 parent e6021e3 commit 17f86f1
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
6 changes: 6 additions & 0 deletions js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ $(document).ready(function(){
$('#btn-grid').click(function() {
$('#btn-grid').addClass('active');
$('#btn-list').removeClass('active');
$('#content').find('.col-outer').removeClass('col-lg-12').addClass('col-lg-3 col-md-4 col-sm-6 col-xs-12');
$('#content').removeClass('content-list').addClass('content-grid');
$('#content .col-inner').equalHeights();
});
$('#btn-list').click(function() {
$('#btn-list').addClass('active');
$('#btn-grid').removeClass('active');
$('#content').find('.col-outer').removeClass('col-lg-3 col-md-4 col-sm-6 col-xs-12').addClass('col-lg-12');
$('#content').removeClass('content-grid').addClass('content-list').equalHeights();
$('#content .col-inner').equalHeights();
});
});
25 changes: 25 additions & 0 deletions less/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@
margin-bottom: 0px;
}

// Grid and list view styles
.content-grid {
.col-inner {
margin-bottom: 0px;
a {
float: none;
}
.caption {
float: none;
padding-left: 0px;
}
}
}
.content-list {
.col-inner {
a {
float: left;
}
.caption {
float: left;
padding-left: 20px;
}
}
}

// Pad out the copyright
.copyright {
padding: 30px;
Expand Down
4 changes: 2 additions & 2 deletions template/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
{include file='infos_errors.tpl'}

<div class="container">
<div id="content" class="row">
<div id="content" class="row content-grid">
{if !empty($CATEGORIES)}
<!-- Start of categories -->
{$CATEGORIES}
{footer_script}{literal}$(document).ready(function(){$('#content .last').load(function(){$('#content .thumbnail').equalHeights()})});{/literal}{/footer_script}
{footer_script}{literal}$(document).ready(function(){$('#content .last').load(function(){$('#content .col-inner').equalHeights()})});{/literal}{/footer_script}
<!-- End of categories -->
{/if}
</div>
Expand Down
4 changes: 2 additions & 2 deletions template/mainpage_categories.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{define_derivative name='derivative_params' width=260 height=180 crop=true}
{foreach from=$category_thumbnails item=cat name=cat_loop}
{assign var=derivative value=$pwg->derivative($derivative_params, $cat.representative.src_image)}
<div class="col-lg-3">
<div class="thumbnail">
<div class="col-outer col-lg-3 col-md-4 col-sm-6 col-xs-12">
<div class="col-inner">
<a href="{$cat.URL}">
<img {if $smarty.foreach.cat_loop.last}class="last" {/if}{if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="{$ROOT_URL}{$themeconf.icon_dir}/img_small.png" data-src="{$derivative->get_url()}"{/if} alt="{$cat.TN_ALT}" title="{$cat.NAME|@replace:'"':' '|@strip_tags:false} - {'display this album'|@translate}">
</a>
Expand Down
17 changes: 17 additions & 0 deletions theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@
.navbar:first-of-type {
margin-bottom: 0px;
}
.content-grid .col-inner {
margin-bottom: 0px;
}
.content-grid .col-inner a {
float: none;
}
.content-grid .col-inner .caption {
float: none;
padding-left: 0px;
}
.content-list .col-inner a {
float: left;
}
.content-list .col-inner .caption {
float: left;
padding-left: 20px;
}
.copyright {
padding: 30px;
}
Expand Down

0 comments on commit 17f86f1

Please sign in to comment.