Skip to content

Commit

Permalink
started lightbox dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Stippel authored and Jesse Stippel committed Jan 21, 2016
1 parent 938bfe4 commit 5f7567d
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 38 deletions.
5 changes: 1 addition & 4 deletions src/operun/gallery/browser/gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def images(self):

if obj.image:
images_view = api.content.get_view('images', obj, self.request) # noqa
tag = images_view.tag('image', height=400, width=400, direction='down') # noqa
tag = images_view.tag('image', height=450, width=450, direction='down') # noqa
else:
tag = None

Expand All @@ -55,9 +55,6 @@ def images(self):
'image': tag,
'url': url,
}

items.append(data)



return items
1 change: 1 addition & 0 deletions src/operun/gallery/browser/static/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if (window.jQuery) {

require([
'jquery',
'lightbox',
], function($) {
'use strict';

Expand Down
11 changes: 11 additions & 0 deletions src/operun/gallery/browser/static/gallery.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#gallery {
overflow: auto;
width: 100%;
height: auto;
margin-bottom: 30px;
}

.gallery-image img {
width: 100%;
height: 100%;
}
78 changes: 44 additions & 34 deletions src/operun/gallery/browser/templates/gallery.pt
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
<html i18n:domain="plone"
lang="en"
metal:use-macro="context/main_template/macros/master"
xml:lang="en"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns="http://www.w3.org/1999/xhtml">

<body>

<metal:content-core fill-slot="content-core">
<metal:content-core define-macro="content-core"
tal:define="toc context/table_of_contents|nothing;">

<div id="parent-fieldname-text"
tal:condition="exists:context/text"
tal:content="structure python:context.text.output_relative_to(view.context)"
tal:attributes="class python: toc and 'pat-autotoc' or ''" />

<section id="gallery" tal:define="images view/images" tal:condition="images">
<tal:images tal:repeat="image images">
<div class="image-title">
<h2 tal:content="image/title">Teaser Title</h2>
</div>
<div class="gallery-image">
<img tal:replace="structure image/image"/>
</div>
</tal:images>
</section>

</metal:content-core>
</metal:content-core>

</body>
lang="en"
metal:use-macro="context/main_template/macros/master"
xml:lang="en"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns="http://www.w3.org/1999/xhtml">

<body>

<metal:content-core fill-slot="content-core">
<metal:content-core define-macro="content-core" tal:define="toc context/table_of_contents|nothing;">

<div id="parent-fieldname-text"
tal:condition="exists:context/text"
tal:content="structure python:context.text.output_relative_to(view.context)"
tal:attributes="class python: toc and 'pat-autotoc' or ''"/>

<section id="gallery" tal:define="images view/images" tal:condition="images">
<div class="col-xs-4 col-sm-3" tal:repeat="image images">
<div class="gallery-image">
<!-- <div class="image-title">
<h2 tal:content="image/title">Teaser Title</h2>
</div> -->
<a href="" tal:attributes="href image/url;data-title image/title" data-lightbox="image" data-title=""></a>
</div>
</div>
</section>

</metal:content-core>
</metal:content-core>

<script type="text/javascript">

require([
'jquery',
'lightbox',
], function ($) {
'use strict';

})
</script>

</body>

</html>
1 change: 1 addition & 0 deletions src/operun/gallery/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-

"""Module where all interfaces, events and exceptions live."""

from zope.publisher.interfaces.browser import IDefaultBrowserLayer
Expand Down
8 changes: 8 additions & 0 deletions src/operun/gallery/profiles/default/registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<registry>

<records interface='Products.CMFPlone.interfaces.IResourceRegistry' prefix="plone.resources/lightbox">
<value key="js">++resource++operun.gallery/lightbox.js</value>
<value key="deps">jquery</value>
<value key="css">
<element>++resource++operun.gallery/lightbox.less</element>
</value>
</records>

<records interface='Products.CMFPlone.interfaces.IResourceRegistry' prefix="plone.resources/gallery">
<value key="js">++resource++operun.gallery/gallery.js</value>
<value key="deps">jquery</value>
Expand Down
1 change: 1 addition & 0 deletions src/operun/gallery/setuphandlers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-

from Products.CMFPlone.interfaces import INonInstallable
from zope.interface import implementer

Expand Down

0 comments on commit 5f7567d

Please sign in to comment.