Skip to content

Commit

Permalink
Showcase view and configuration for File Displayer [#136 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
illiphilli committed Jul 6, 2011
1 parent 4dac7e7 commit bb3bb49
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
51 changes: 51 additions & 0 deletions framework/modules/common/views/file/Showcase.tpl
@@ -0,0 +1,51 @@
{css unique="files-showcase" link="`$smarty.const.PATH_RELATIVE`framework/modules/common/assets/css/filedisplayer.css"}

{/css}

{if $config.floatthumb!="No Float" && !$config.lightbox}
{capture assign="imgflot"}
float:{$config.floatthumb|lower};
{/capture}

{capture assign="spacing"}
margin:{$config.spacing}px;
{/capture}
{/if}

{assign var=quality value=$config.quality|default:$smarty.const.THUMB_QUALITY}
<div class="showcase">
<div class="main-img">
{if $config.pio && $params.is_listing}
{assign var=miw value=$config.listingwidth}
{else}
{assign var=miw value=$config.piwidth}
{/if}
{img file_id=$files[0]->id w=$miw alt="`$files[0]->alt`" class="mainimg `$config.tclass`"}
</div>
{if ($config.pio && !$params.is_listing) || !$config.pio}
<div class="thumb-imgs">
{foreach from=$files item=img key=key}<a href="{$img->url}" rel="showcase-{$img->id}" title="{$img->title}" class="image-link" style="margin:{$config.spacing}px;" />{img file_id=$img->id w=$config.thumb h=$config.thumb zc=1 q=$quality|default:75 style="`$imgflot``$spacing`" alt="`$img->alt`" class="`$config.tclass`"}</a>{/foreach}
</div>
{/if}
</div>

{if ($config.pio && !$params.is_listing) || !$config.pio}
{script unique="showcase" yui3mods=1}
{literal}
YUI(EXPONENT.YUI3_CONFIG).use('node','event', function(Y) {
var thumbs = Y.all('.thumb-imgs .image-link');
thumbs.on('click',function(e){
e.halt();
});
thumbs.on('{/literal}{if $config.hoverorclick==1}click{else}mouseenter{/if}{literal}',function(e){
e.halt();
var mainimg = e.currentTarget.ancestor('.showcase').one('.main-img img');
var newid = e.currentTarget.getAttribute('rel').replace('showcase-','');
mainimg.setAttribute('src',EXPONENT.URL_FULL+"thumb.php?id="+newid+"&w=500&q=75");
});
//Y.Lightbox.init();
});
{/literal}
{/script}
{/if}
24 changes: 24 additions & 0 deletions framework/modules/common/views/file/configure/Showcase.tpl
@@ -0,0 +1,24 @@
{css unique="gallery-config"}
{literal}
small {
display:block;
}
{/literal}
{/css}


<h3>{"Image ShowcaseConfiguration"|gettext}</h3>
<h4>{"Portolio listing page"|gettext}</h4>

{control type="checkbox" label="Only show primary image on listing pages" name="pio" value=1 checked=$config.pio}
{control type="text" label="Listing page image width" name="listingwidth" value=$config.listingwidth|default:100 size=5}

<h4>{"Portolio landing page"|gettext}</h4>
{control type="dropdown" name="lpfloat" label="File Display Box Float" items="No Float,Left,Right" value=$config.lpfloat}
{control type="text" label="Width of Landing Page File Display Box" name="lpfwidth" value=$config.lpfwidth size=5}
{control type="text" label="Width of main image" name="piwidth" value=$config.piwidth|default:100 size=5}
{control type="text" name="thumb" label="Thumbnail Box Size"|gettext value=$config.thumb|default:100 size=5}
{control type="radiogroup" columns=2 name="hoverorclick" label="Replace main image on click or hover?" items="Click,Hover" values="1,2" default=$config.hoverorclick|default:"1"}
{control type="text" name="spacing" label="Thumbnail Spacing"|gettext value=$config.spacing|default:10 size=5}
{control type=text name="quality" label="Thumbnail JPEG Quality <small>0 - 99. 100 will use actual image without thumbnailing</small>" value=$config.quality|default:$smarty.const.THUMB_QUALITY size="5"}
{control type="text" name="tclass" label="Stylesheet class to apply to images"|gettext value=$config.tclass}

0 comments on commit bb3bb49

Please sign in to comment.