diff --git a/Classes/Components/LineList.php b/Classes/Components/LineList.php index f313b8d..7b6267f 100644 --- a/Classes/Components/LineList.php +++ b/Classes/Components/LineList.php @@ -54,8 +54,10 @@ public function render(){ $pager = new Pagerfanta( new ContentSearchAdapter($query, $this->controller->getRepository()->getSearchService()) ); + + $limit = isset($this->parameters['limit'])?$this->parameters['limit']:$this->controller->getContainer()->getParameter('project.line_list.limit'); - $pager->setMaxPerPage($this->controller->getContainer()->getParameter('project.line_list.limit')); + $pager->setMaxPerPage($limit); $pager->setCurrentPage($request->get('page', 1)); // $list = $searchService->findContent($query); @@ -63,9 +65,9 @@ public function render(){ ->getContentService() ->loadContentByContentInfo($location->getContentInfo()); - + $template = isset($this->parameters['template'])?$this->parameters['template']:'TuteiBaseBundle:parts:line_list.html.twig'; return $this->controller->render( - 'TuteiBaseBundle:parts:line_list.html.twig', array( + $template, array( 'location' => $location, 'content' => $content, 'pager' => $pager diff --git a/Resources/config/twig.yml b/Resources/config/twig.yml index 566887b..d768c95 100644 --- a/Resources/config/twig.yml +++ b/Resources/config/twig.yml @@ -4,6 +4,8 @@ globals: siteaccess: site: language: eng-GB + siteadmin: + language: eng-GB por: language: por-BR diff --git a/Resources/public/css/lightbox.css b/Resources/public/css/lightbox.css new file mode 100644 index 0000000..c5de701 --- /dev/null +++ b/Resources/public/css/lightbox.css @@ -0,0 +1,202 @@ +/* line 7, ../sass/lightbox.sass */ +body:after { + content: url(../images/close.png) url(../images/loading.gif) url(../images/prev.png) url(../images/next.png); + display: none; +} + +/* line 11, ../sass/lightbox.sass */ +.lightboxOverlay { + position: absolute; + top: 0; + left: 0; + z-index: 9999; + background-color: black; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + opacity: 0.8; + display: none; +} + +/* line 20, ../sass/lightbox.sass */ +.lightbox { + position: absolute; + left: 0; + width: 100%; + z-index: 10000; + text-align: center; + line-height: 0; + font-weight: normal; +} +/* line 28, ../sass/lightbox.sass */ +.lightbox .lb-image { + display: block; + height: auto; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + border-radius: 3px; +} +/* line 32, ../sass/lightbox.sass */ +.lightbox a img { + border: none; +} + +/* line 35, ../sass/lightbox.sass */ +.lb-outerContainer { + position: relative; + background-color: white; + *zoom: 1; + width: 250px; + height: 250px; + margin: 0 auto; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -ms-border-radius: 4px; + -o-border-radius: 4px; + border-radius: 4px; +} +/* line 38, ../../../../.rvm/gems/ruby-1.9.3-p392/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */ +.lb-outerContainer:after { + content: ""; + display: table; + clear: both; +} + +/* line 44, ../sass/lightbox.sass */ +.lb-container { + padding: 4px; +} + +/* line 47, ../sass/lightbox.sass */ +.lb-loader { + position: absolute; + top: 43%; + left: 0%; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} + +/* line 56, ../sass/lightbox.sass */ +.lb-cancel { + display: block; + width: 32px; + height: 32px; + margin: 0 auto; + background: url(../images/loading.gif) no-repeat; +} + +/* line 63, ../sass/lightbox.sass */ +.lb-nav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} + +/* line 71, ../sass/lightbox.sass */ +.lb-container > .nav { + left: 0; +} + +/* line 74, ../sass/lightbox.sass */ +.lb-nav a { + outline: none; +} + +/* line 77, ../sass/lightbox.sass */ +.lb-prev, .lb-next { + width: 49%; + height: 100%; + cursor: pointer; + /* Trick IE into showing hover */ + display: block; +} + +/* line 84, ../sass/lightbox.sass */ +.lb-prev { + left: 0; + float: left; +} +/* line 87, ../sass/lightbox.sass */ +.lb-prev:hover { + background: url(../images/prev.png) left 48% no-repeat; +} + +/* line 90, ../sass/lightbox.sass */ +.lb-next { + right: 0; + float: right; +} +/* line 93, ../sass/lightbox.sass */ +.lb-next:hover { + background: url(../images/next.png) right 48% no-repeat; +} + +/* line 96, ../sass/lightbox.sass */ +.lb-dataContainer { + margin: 0 auto; + padding-top: 5px; + *zoom: 1; + width: 100%; + -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; +} +/* line 38, ../../../../.rvm/gems/ruby-1.9.3-p392/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */ +.lb-dataContainer:after { + content: ""; + display: table; + clear: both; +} + +/* line 103, ../sass/lightbox.sass */ +.lb-data { + padding: 0 4px; + color: #bbbbbb; +} +/* line 106, ../sass/lightbox.sass */ +.lb-data .lb-details { + width: 85%; + float: left; + text-align: left; + line-height: 1.1em; +} +/* line 111, ../sass/lightbox.sass */ +.lb-data .lb-caption { + font-size: 13px; + font-weight: bold; + line-height: 1em; +} +/* line 115, ../sass/lightbox.sass */ +.lb-data .lb-number { + display: block; + clear: left; + padding-bottom: 1em; + font-size: 12px; + color: #999999; +} +/* line 121, ../sass/lightbox.sass */ +.lb-data .lb-close { + display: block; + float: right; + width: 30px; + height: 30px; + background: url(../images/close.png) top right no-repeat; + text-align: right; + outline: none; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); + opacity: 0.7; +} +/* line 130, ../sass/lightbox.sass */ +.lb-data .lb-close:hover { + cursor: pointer; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} diff --git a/Resources/public/images/close.png b/Resources/public/images/close.png new file mode 100644 index 0000000..20baa1d Binary files /dev/null and b/Resources/public/images/close.png differ diff --git a/Resources/public/images/demopage/donate.png b/Resources/public/images/demopage/donate.png new file mode 100644 index 0000000..187ec5c Binary files /dev/null and b/Resources/public/images/demopage/donate.png differ diff --git a/Resources/public/images/demopage/favicon.ico b/Resources/public/images/demopage/favicon.ico new file mode 100644 index 0000000..6dec42e Binary files /dev/null and b/Resources/public/images/demopage/favicon.ico differ diff --git a/Resources/public/images/demopage/image-1.jpg b/Resources/public/images/demopage/image-1.jpg new file mode 100644 index 0000000..fe2e1cb Binary files /dev/null and b/Resources/public/images/demopage/image-1.jpg differ diff --git a/Resources/public/images/demopage/image-2.jpg b/Resources/public/images/demopage/image-2.jpg new file mode 100644 index 0000000..1f4f5df Binary files /dev/null and b/Resources/public/images/demopage/image-2.jpg differ diff --git a/Resources/public/images/demopage/image-3.jpg b/Resources/public/images/demopage/image-3.jpg new file mode 100644 index 0000000..b6d5798 Binary files /dev/null and b/Resources/public/images/demopage/image-3.jpg differ diff --git a/Resources/public/images/demopage/image-4.jpg b/Resources/public/images/demopage/image-4.jpg new file mode 100644 index 0000000..a7e9dba Binary files /dev/null and b/Resources/public/images/demopage/image-4.jpg differ diff --git a/Resources/public/images/demopage/image-5.jpg b/Resources/public/images/demopage/image-5.jpg new file mode 100644 index 0000000..c75fba5 Binary files /dev/null and b/Resources/public/images/demopage/image-5.jpg differ diff --git a/Resources/public/images/demopage/image-6.jpg b/Resources/public/images/demopage/image-6.jpg new file mode 100644 index 0000000..95b3523 Binary files /dev/null and b/Resources/public/images/demopage/image-6.jpg differ diff --git a/Resources/public/images/demopage/thumb-1.jpg b/Resources/public/images/demopage/thumb-1.jpg new file mode 100644 index 0000000..0d2c4b6 Binary files /dev/null and b/Resources/public/images/demopage/thumb-1.jpg differ diff --git a/Resources/public/images/demopage/thumb-2.jpg b/Resources/public/images/demopage/thumb-2.jpg new file mode 100644 index 0000000..39de856 Binary files /dev/null and b/Resources/public/images/demopage/thumb-2.jpg differ diff --git a/Resources/public/images/demopage/thumb-3.jpg b/Resources/public/images/demopage/thumb-3.jpg new file mode 100644 index 0000000..6acf4f9 Binary files /dev/null and b/Resources/public/images/demopage/thumb-3.jpg differ diff --git a/Resources/public/images/demopage/thumb-4.jpg b/Resources/public/images/demopage/thumb-4.jpg new file mode 100644 index 0000000..634e982 Binary files /dev/null and b/Resources/public/images/demopage/thumb-4.jpg differ diff --git a/Resources/public/images/demopage/thumb-5.jpg b/Resources/public/images/demopage/thumb-5.jpg new file mode 100644 index 0000000..4bb7d48 Binary files /dev/null and b/Resources/public/images/demopage/thumb-5.jpg differ diff --git a/Resources/public/images/demopage/thumb-6.jpg b/Resources/public/images/demopage/thumb-6.jpg new file mode 100644 index 0000000..9628f0b Binary files /dev/null and b/Resources/public/images/demopage/thumb-6.jpg differ diff --git a/Resources/public/images/loading.gif b/Resources/public/images/loading.gif new file mode 100644 index 0000000..5087c2a Binary files /dev/null and b/Resources/public/images/loading.gif differ diff --git a/Resources/public/images/next.png b/Resources/public/images/next.png new file mode 100644 index 0000000..08365ac Binary files /dev/null and b/Resources/public/images/next.png differ diff --git a/Resources/public/images/prev.png b/Resources/public/images/prev.png new file mode 100644 index 0000000..329fa98 Binary files /dev/null and b/Resources/public/images/prev.png differ diff --git a/Resources/public/js/lightbox-2.6.min.js b/Resources/public/js/lightbox-2.6.min.js new file mode 100644 index 0000000..fe7360a --- /dev/null +++ b/Resources/public/js/lightbox-2.6.min.js @@ -0,0 +1 @@ +(function(){var b,d,c;b=jQuery;c=(function(){function b(){this.fadeDuration=500;this.fitImagesInViewport=true;this.resizeDuration=700;this.showImageNumberLabel=true;this.wrapAround=false}b.prototype.albumLabel=function(b,c){return"Image "+b+" of "+c};return b})();d=(function(){function c(b){this.options=b;this.album=[];this.currentImageIndex=void 0;this.init()}c.prototype.init=function(){this.enable();return this.build()};c.prototype.enable=function(){var c=this;return b('body').on('click','a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]',function(d){c.start(b(d.currentTarget));return false})};c.prototype.build=function(){var c=this;b("
").appendTo(b('body'));this.$lightbox=b('#lightbox');this.$overlay=b('#lightboxOverlay');this.$outerContainer=this.$lightbox.find('.lb-outerContainer');this.$container=this.$lightbox.find('.lb-container');this.containerTopPadding=parseInt(this.$container.css('padding-top'),10);this.containerRightPadding=parseInt(this.$container.css('padding-right'),10);this.containerBottomPadding=parseInt(this.$container.css('padding-bottom'),10);this.containerLeftPadding=parseInt(this.$container.css('padding-left'),10);this.$overlay.hide().on('click',function(){c.end();return false});this.$lightbox.hide().on('click',function(d){if(b(d.target).attr('id')==='lightbox'){c.end()}return false});this.$outerContainer.on('click',function(d){if(b(d.target).attr('id')==='lightbox'){c.end()}return false});this.$lightbox.find('.lb-prev').on('click',function(){if(c.currentImageIndex===0){c.changeImage(c.album.length-1)}else{c.changeImage(c.currentImageIndex-1)}return false});this.$lightbox.find('.lb-next').on('click',function(){if(c.currentImageIndex===c.album.length-1){c.changeImage(0)}else{c.changeImage(c.currentImageIndex+1)}return false});return this.$lightbox.find('.lb-loader, .lb-close').on('click',function(){c.end();return false})};c.prototype.start=function(c){var f,e,j,d,g,n,o,k,l,m,p,h,i;b(window).on("resize",this.sizeOverlay);b('select, object, embed').css({visibility:"hidden"});this.$overlay.width(b(document).width()).height(b(document).height()).fadeIn(this.options.fadeDuration);this.album=[];g=0;j=c.attr('data-lightbox');if(j){h=b(c.prop("tagName")+'[data-lightbox="'+j+'"]');for(d=k=0,m=h.length;kj)||(c.height>i)){if((c.width/j)>(c.height/i)){h=j;g=parseInt(c.height/(c.width/h),10);d.width(h);d.height(g)}else{g=i;h=parseInt(c.width/(c.height/g),10);d.width(h);d.height(g)}}}return e.sizeContainer(d.width(),d.height())};c.src=this.album[f].link;this.currentImageIndex=f};c.prototype.sizeOverlay=function(){return b('#lightboxOverlay').width(b(document).width()).height(b(document).height())};c.prototype.sizeContainer=function(f,g){var b,d,e,h,c=this;h=this.$outerContainer.outerWidth();e=this.$outerContainer.outerHeight();d=f+this.containerLeftPadding+this.containerRightPadding;b=g+this.containerTopPadding+this.containerBottomPadding;this.$outerContainer.animate({width:d,height:b},this.options.resizeDuration,'swing');setTimeout(function(){c.$lightbox.find('.lb-dataContainer').width(d);c.$lightbox.find('.lb-prevLink').height(b);c.$lightbox.find('.lb-nextLink').height(b);c.showImage()},this.options.resizeDuration)};c.prototype.showImage=function(){this.$lightbox.find('.lb-loader').hide();this.$lightbox.find('.lb-image').fadeIn('slow');this.updateNav();this.updateDetails();this.preloadNeighboringImages();this.enableKeyboardNav()};c.prototype.updateNav=function(){this.$lightbox.find('.lb-nav').show();if(this.album.length>1){if(this.options.wrapAround){this.$lightbox.find('.lb-prev, .lb-next').show()}else{if(this.currentImageIndex>0){this.$lightbox.find('.lb-prev').show()}if(this.currentImageIndex1&&this.options.showImageNumberLabel){this.$lightbox.find('.lb-number').text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn('fast')}else{this.$lightbox.find('.lb-number').hide()}this.$outerContainer.removeClass('animating');this.$lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration,function(){return b.sizeOverlay()})};c.prototype.preloadNeighboringImages=function(){var c,b;if(this.album.length>this.currentImageIndex+1){c=new Image();c.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){b=new Image();b.src=this.album[this.currentImageIndex-1].link}};c.prototype.enableKeyboardNav=function(){b(document).on('keyup.keyboard',b.proxy(this.keyboardAction,this))};c.prototype.disableKeyboardNav=function(){b(document).off('.keyboard')};c.prototype.keyboardAction=function(g){var d,e,f,c,b;d=27;e=37;f=39;b=g.keyCode;c=String.fromCharCode(b).toLowerCase();if(b===d||c.match(/x|o|c/)){this.end()}else if(c==='p'||b===e){if(this.currentImageIndex!==0){this.changeImage(this.currentImageIndex-1)}}else if(c==='n'||b===f){if(this.currentImageIndex!==this.album.length-1){this.changeImage(this.currentImageIndex+1)}}};c.prototype.end=function(){this.disableKeyboardNav();b(window).off("resize",this.sizeOverlay);this.$lightbox.fadeOut(this.options.fadeDuration);this.$overlay.fadeOut(this.options.fadeDuration);return b('select, object, embed').css({visibility:"visible"})};return c})();b(function(){var e,b;b=new c();return e=new d(b)})}).call(this); \ No newline at end of file diff --git a/Resources/views/content/gallery/full.html.twig b/Resources/views/content/gallery/full.html.twig index ad0c995..18ea659 100644 --- a/Resources/views/content/gallery/full.html.twig +++ b/Resources/views/content/gallery/full.html.twig @@ -14,6 +14,8 @@ {{ render( controller( "tutei:showComponent", { 'name': 'LineList', 'parameters': { 'location': location, + 'limit':9, + 'template': 'TuteiBaseBundle:parts:gallery_list.html.twig', 'request': app.request } } ) ) }} diff --git a/Resources/views/content/image/line.html.twig b/Resources/views/content/image/line.html.twig index 1eb4781..64266df 100644 --- a/Resources/views/content/image/line.html.twig +++ b/Resources/views/content/image/line.html.twig @@ -8,14 +8,19 @@ {{ ez_render_field( content, 'name', { lang: language } ) }} + {% if content.fields.image is defined %} + {% set image_alias = ez_image_alias( content.getField('image'), content.versionInfo, 'original' ) %} + + {{ ez_render_field(content, 'image', { parameters:{ alias:'small' }, attr:{ class:'block_item', custom_attribute:'value' } } ) - }} + }} + {% endif %} \ No newline at end of file diff --git a/Resources/views/pagelayout.html.twig b/Resources/views/pagelayout.html.twig index b49d11f..1abfab2 100644 --- a/Resources/views/pagelayout.html.twig +++ b/Resources/views/pagelayout.html.twig @@ -33,6 +33,7 @@ Not using bootstrap-theme.min.css --> {% stylesheets "bundles/tuteibase/css/bootstrap.min.css" + "bundles/tuteibase/css/lightbox.css" "bundles/tuteibase/css/project.css" filter='cssrewrite' %} @@ -159,6 +160,7 @@ {% javascripts "bundles/tuteibase/js/bootstrap.min.js" + "bundles/tuteibase/js/lightbox-2.6.min.js" "bundles/tuteibase/js/project.js" %} diff --git a/Resources/views/parts/gallery_list.html.twig b/Resources/views/parts/gallery_list.html.twig new file mode 100644 index 0000000..72bde1f --- /dev/null +++ b/Resources/views/parts/gallery_list.html.twig @@ -0,0 +1,26 @@ +{% set columns = 3 %} +{% set column_width = 12 // columns %} + +{% if pager|length() > 0 %} +
+
+ {% for item in pager %} + + {% if loop.index0 > 0 and loop.index0 % columns == 0 %} +
+
+ {% endif %} +
+ {{ render_esi( controller( 'ez_content:viewLocation', {'locationId': item.contentInfo.mainLocationId, 'viewType': 'line'} ) ) }} +
+ {% endfor %} +
+
+ + {% if pager.haveToPaginate() %} +
+ {{ pagerfanta( pager, 'twitter_bootstrap_translated', {'routeName': location} ) }} +
+ {% endif %} + +{% endif %} \ No newline at end of file