msgid "This %s is already in the selection."
msgstr ""
-#: o/skins/get_slide_buyable_items.pt:21 o/skins/photo_layout_macros.pt:47
-#: o/skins/photo_layout_macros.pt:49 o/skins/photo_view.pt:91
+#: o/skins/get_slide_buyable_items.pt:21 o/skins/photo_layout_macros.pt:52
+#: o/skins/photo_layout_macros.pt:55 o/skins/photo_view.pt:91
#: o/skins/photo_view.pt:94
msgid "Add to cart"
msgstr ""
msgid "refresh amount"
msgstr ""
-#: o/skins/my_cart_template.pt:59
+#: o/skins/my_cart_template.pt:59 o/skins/portfolio_view.pt:71
msgid "delete"
msgstr ""
msgid "Dimensions"
msgstr ""
-#: o/skins/photo_layout_macros.pt:32 o/skins/photo_layout_macros.pt:34
+#: o/skins/photo_layout_macros.pt:33 o/skins/photo_layout_macros.pt:36
msgid "Add to selection"
msgstr ""
-#: o/skins/photo_layout_macros.pt:39 o/skins/photo_layout_macros.pt:41
+#: o/skins/photo_layout_macros.pt:42 o/skins/photo_layout_macros.pt:45
msgid "Remove to selection"
msgstr ""
-#: o/skins/photo_layout_macros.pt:54 o/skins/photo_layout_macros.pt:56
+#: o/skins/photo_layout_macros.pt:61 o/skins/photo_layout_macros.pt:64
#: o/skins/portfolio_presentation_template.pt:47
msgid "Delete"
msgstr ""
-#: o/skins/photo_layout_macros.pt:65 o/skins/photo_layout_macros.pt:68
+#: o/skins/photo_layout_macros.pt:79 o/skins/photo_layout_macros.pt:82
msgid "Hide for anonymous"
msgstr ""
-#: o/skins/photo_layout_macros.pt:76 o/skins/photo_layout_macros.pt:79
+#: o/skins/photo_layout_macros.pt:92 o/skins/photo_layout_macros.pt:95
msgid "Show for anonymous"
msgstr ""
msgid "Edit metadata"
msgstr ""
-#: o/skins/photo_view.pt:116 o/skins/photo_view_ajax_template.pt:18
+#: o/skins/photo_view.pt:118
msgid "Keywords"
msgstr ""
-#: o/skins/photo_view.pt:123 o/skins/photo_view_ajax_template.pt:26
+#: o/skins/photo_view.pt:125
msgid "reference:"
msgstr ""
-#: o/skins/photo_view.pt:129 o/skins/photo_view_ajax_template.pt:33
+#: o/skins/photo_view.pt:131
msgid "download picture"
msgstr ""
+#: o/skins/portfolio_edit_form.py:13
+msgid "Photo deleted."
+msgstr ""
+
+#: o/skins/portfolio_edit_form.py:15
+msgid "Deleted photos."
+msgstr ""
+
+#: o/skins/portfolio_edit_form.py:18
+msgid "Nothing to delete."
+msgstr ""
+
#: o/skins/portfolio_presentation_template.pt:22
msgid "Delete presentation"
msgstr ""
msgid ""
msgstr ""
"Project-Id-Version: Plinn 2.0\n"
-"POT-Creation-Date: Sun Jun 29 07:16:48 2014\n"
-"PO-Revision-Date: 2014-06-29 07:19+0200\n"
+"POT-Creation-Date: Sat Jul 5 14:18:53 2014\n"
+"PO-Revision-Date: 2014-07-05 14:19+0200\n"
"Last-Translator: Benoît PIN\n"
"Language-Team: CRI http://cri.ensmp.fr\n"
"Language: \n"
msgstr "Cette %s est déjà dans la sélection."
# from portfolio-manual
-#: o/skins/get_slide_buyable_items.pt:21 o/skins/photo_layout_macros.pt:47
-#: o/skins/photo_layout_macros.pt:49 o/skins/photo_view.pt:91
+#: o/skins/get_slide_buyable_items.pt:21 o/skins/photo_layout_macros.pt:52
+#: o/skins/photo_layout_macros.pt:55 o/skins/photo_view.pt:91
#: o/skins/photo_view.pt:94
msgid "Add to cart"
msgstr "Ajouter au panier"
msgid "refresh amount"
msgstr "actualiser le montant"
-#: o/skins/my_cart_template.pt:59
+#: o/skins/my_cart_template.pt:59 o/skins/portfolio_view.pt:71
msgid "delete"
msgstr "supprimer"
msgstr "Dimensions"
# from portfolio-manual
-#: o/skins/photo_layout_macros.pt:32 o/skins/photo_layout_macros.pt:34
+#: o/skins/photo_layout_macros.pt:33 o/skins/photo_layout_macros.pt:36
msgid "Add to selection"
msgstr "Ajouter à la sélection"
# from portfolio-manual
-#: o/skins/photo_layout_macros.pt:39 o/skins/photo_layout_macros.pt:41
+#: o/skins/photo_layout_macros.pt:42 o/skins/photo_layout_macros.pt:45
msgid "Remove to selection"
msgstr "Retirer de la sélection"
-#: o/skins/photo_layout_macros.pt:54 o/skins/photo_layout_macros.pt:56
+#: o/skins/photo_layout_macros.pt:61 o/skins/photo_layout_macros.pt:64
#: o/skins/portfolio_presentation_template.pt:47
msgid "Delete"
msgstr "Supprimer"
-#: o/skins/photo_layout_macros.pt:65 o/skins/photo_layout_macros.pt:68
+#: o/skins/photo_layout_macros.pt:79 o/skins/photo_layout_macros.pt:82
msgid "Hide for anonymous"
msgstr "Masquer pour les anonymes"
-#: o/skins/photo_layout_macros.pt:76 o/skins/photo_layout_macros.pt:79
+#: o/skins/photo_layout_macros.pt:92 o/skins/photo_layout_macros.pt:95
msgid "Show for anonymous"
msgstr "Montrer aux anonymes"
msgid "Edit metadata"
msgstr "Modifier les métadonnées"
-#: o/skins/photo_view.pt:116 o/skins/photo_view_ajax_template.pt:18
+#: o/skins/photo_view.pt:118
msgid "Keywords"
msgstr "Mots-clefs"
-#: o/skins/photo_view.pt:123 o/skins/photo_view_ajax_template.pt:26
+#: o/skins/photo_view.pt:125
msgid "reference:"
msgstr "référence :"
-#: o/skins/photo_view.pt:129 o/skins/photo_view_ajax_template.pt:33
+#: o/skins/photo_view.pt:131
msgid "download picture"
msgstr "télécharger l'image"
+#: o/skins/portfolio_edit_form.py:13
+msgid "Photo deleted."
+msgstr "Photo supprimée."
+
+#: o/skins/portfolio_edit_form.py:15
+msgid "Deleted photos."
+msgstr "Photos supprimées."
+
+#: o/skins/portfolio_edit_form.py:18
+msgid "Nothing to delete."
+msgstr "Rien à supprimer."
+
#: o/skins/portfolio_presentation_template.pt:22
msgid "Delete presentation"
msgstr "Supprimer la présentation"
msgid ""
msgstr ""
"Project-Id-Version: 3.0\n"
-"POT-Creation-Date: Sun Jun 29 07:19:35 2014\n"
+"POT-Creation-Date: Sat Jul 5 14:18:53 2014\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Zope 3 Developers <zope-dev@zope.org>\n"
msgstr ""
#: o/skins/get_slide_buyable_items.pt:21
-#: o/skins/photo_layout_macros.pt:47
-#: o/skins/photo_layout_macros.pt:49
+#: o/skins/photo_layout_macros.pt:52
+#: o/skins/photo_layout_macros.pt:55
#: o/skins/photo_view.pt:91
#: o/skins/photo_view.pt:94
msgid "Add to cart"
#: o/skins/my_cart_template.pt:59
#: o/skins/my_cart_template.pt:59
+#: o/skins/portfolio_view.pt:71
+#: o/skins/portfolio_view.pt:71
msgid "delete"
msgstr ""
msgid "Dimensions"
msgstr ""
-#: o/skins/photo_layout_macros.pt:32
-#: o/skins/photo_layout_macros.pt:34
+#: o/skins/photo_layout_macros.pt:33
+#: o/skins/photo_layout_macros.pt:36
msgid "Add to selection"
msgstr ""
-#: o/skins/photo_layout_macros.pt:39
-#: o/skins/photo_layout_macros.pt:41
+#: o/skins/photo_layout_macros.pt:42
+#: o/skins/photo_layout_macros.pt:45
msgid "Remove to selection"
msgstr ""
-#: o/skins/photo_layout_macros.pt:54
-#: o/skins/photo_layout_macros.pt:56
+#: o/skins/photo_layout_macros.pt:61
+#: o/skins/photo_layout_macros.pt:64
#: o/skins/portfolio_presentation_template.pt:47
msgid "Delete"
msgstr ""
-#: o/skins/photo_layout_macros.pt:65
-#: o/skins/photo_layout_macros.pt:68
+#: o/skins/photo_layout_macros.pt:79
+#: o/skins/photo_layout_macros.pt:82
msgid "Hide for anonymous"
msgstr ""
-#: o/skins/photo_layout_macros.pt:76
-#: o/skins/photo_layout_macros.pt:79
+#: o/skins/photo_layout_macros.pt:92
+#: o/skins/photo_layout_macros.pt:95
msgid "Show for anonymous"
msgstr ""
msgid "Edit metadata"
msgstr ""
-#: o/skins/photo_view.pt:116
-#: o/skins/photo_view_ajax_template.pt:18
+#: o/skins/photo_view.pt:118
msgid "Keywords"
msgstr ""
-#: o/skins/photo_view.pt:123
-#: o/skins/photo_view_ajax_template.pt:26
+#: o/skins/photo_view.pt:125
msgid "reference:"
msgstr ""
-#: o/skins/photo_view.pt:129
-#: o/skins/photo_view_ajax_template.pt:33
+#: o/skins/photo_view.pt:131
msgid "download picture"
msgstr ""
+#: o/skins/portfolio_edit_form.py:13
+msgid "Photo deleted."
+msgstr ""
+
+#: o/skins/portfolio_edit_form.py:15
+msgid "Deleted photos."
+msgstr ""
+
+#: o/skins/portfolio_edit_form.py:18
+msgid "Nothing to delete."
+msgstr ""
+
#: o/skins/portfolio_presentation_template.pt:22
msgid "Delete presentation"
msgstr ""
</a>
</span>
<span class="button cb">
- <input type="checkbox" />
+ <input type="checkbox" name="uids:list"
+ tal:attributes="value info/cmf_uid"/>
</span>
<tal:block tal:condition="features/hideAnonymous|nothing">
<span class="button slide-hide"
Lightbox = function(grid) {
this.grid = grid;
this.lastCBChecked = undefined;
+ this.form = undefined;
+ var parent = this.grid.parentNode;
+ while(parent) {
+ parent = parent.parentNode;
+ if (parent.tagName === 'FORM') {
+ this.form = parent;
+ break;
+ }
+ else if (parent.tagName === 'BODY') {
+ break;
+ }
+ }
thisLightbox = this;
addListener(this.grid, 'click', function(evt){thisLightbox.mouseClickHandler(evt);});
- if (!browser.isGecko){
- addListener(this.grid, 'mouseover', function(evt){thisLightbox.mouseOverHandler(evt);});
- addListener(this.grid, 'mouseout', function(evt){thisLightbox.mouseOutHandler(evt);});
+ if (this.form) {
+ var fm = new FormManager(this.form);
+ fm.onBeforeSubmit = function(fm_, evt) {return thisLightbox.onBeforeSubmit(fm_, evt);};
+ fm.onResponseLoad = function(req) {return thisLightbox.onResponseLoad(req);};
}
};
}
};
-Lightbox.prototype.mouseOverHandler = function(evt) {
- var target = getTargetedObject(evt);
- if (target.tagName==='AREA') {
- var slide = target.parentNode.parentNode;
- if(reSelected.test(slide.className)) {
- slide.className = 'slide_over_selected';}
- else {
- slide.className = 'slide_over';}
+Lightbox.prototype.onBeforeSubmit = function(fm, evt) {
+ switch(fm.submitButton.name) {
+ case 'delete' :
+ this.hideSelection();
+ break;
}
};
-Lightbox.prototype.mouseOutHandler = function(evt) {
- var target = getTargetedObject(evt);
- if (target.tagName==='AREA') {
- var slide = target.parentNode.parentNode;
- if(reSelected.test(slide.className)) {
- slide.className = 'selected';}
- else {
- slide.className = undefined;}
+Lightbox.prototype.onResponseLoad = function(req) {
+ switch(req.responseXML.documentElement.nodeName) {
+ case 'deleted' :
+ this.deleteSelection();
+ break;
+ case 'error' :
+ this.showSelection();
+ break;
+ }
+};
+
+Lightbox.prototype.hideSelection = function() {
+ var i, e, slide;
+ for (i=0 ; i<this.form.elements.length ; i++) {
+ e = this.form.elements[i];
+ if (e.type === 'checkbox' && e.checked) {
+ slide = e.parentNode.parentNode;
+ slide.classList.add('zero_opacity');
+ }
+ }
+};
+
+Lightbox.prototype.showSelection = function() {
+ var i, e, slide;
+ for (i=0 ; i<this.form.elements.length ; i++) {
+ e = this.form.elements[i];
+ if (e.type === 'checkbox' && e.checked) {
+ slide = e.parentNode.parentNode;
+ slide.classList.remove('zero_opacity');
+ }
+ }
+};
+
+Lightbox.prototype.deleteSelection = function() {
+ var i, e, slide;
+ for (i=0 ; i<this.form.elements.length ; i++) {
+ e = this.form.elements[i];
+ if (e.type === 'checkbox' && e.checked) {
+ slide = e.parentNode.parentNode;
+ slide.classList.add('zero_width');
+ }
+ }
+ var self = this;
+ // if you change this, delay you should also change this css rule :
+ // .lightbox span { transition: width 1s
+ setTimeout(function(){self._removeSelection();}, 1000);
+};
+
+Lightbox.prototype._removeSelection = function() {
+ console.info('_removeSelection');
+ var i, e, slide;
+ var toRemove = [];
+ for (i=0 ; i<this.form.elements.length ; i++) {
+ e = this.form.elements[i];
+ if (e.type === 'checkbox' && e.checked) {
+ toRemove.push(e.parentNode.parentNode);
+ }
+ }
+ for (i=0 ; i<toRemove.length ; i++) {
+ slide = toRemove[i];
+ slide.parentNode.removeChild(slide);
}
+ this.cbIndex = undefined;
};
Lightbox.prototype.getCBIndex = function(cb) {
--- /dev/null
+##parameters=
+from Products.CMFCore.utils import getUtilityByInterfaceName
+from Products.Portfolio.utils import translate
+_ = lambda msg : translate(msg, context)
+
+uidh = getUtilityByInterfaceName('Products.CMFUid.interfaces.IUniqueIdHandler')
+
+form = context.REQUEST.form
+fg = form.get
+if fg('ajax') :
+ context.REQUEST.RESPONSE.setHeader('Content-Type', 'text/xml;;charset=utf-8')
+
+if fg('delete.x') or form.has_key('delete') :
+ ids = [uidh.getBrain(uid).getId for uid in fg('uids', [])]
+ if ids :
+ if len(ids) == 1 :
+ msg = _('Photo deleted.')
+ else :
+ msg = _('Deleted photos.')
+ context.manage_delObjects(ids)
+ else :
+ msg = _('Nothing to delete.')
+
+ if not fg('ajax') :
+ context.setStatus(True, msg)
+ return context.setRedirect(context, 'object/view')
+
+ else :
+ return '<deleted>%s</deleted>' % msg
+return '<error/>'
\ No newline at end of file
}
.lightbox span {
- width: &dtml-slide_size;px;
- height: &dtml-slide_size;px;
- display:block;
- float:left;
+ width: &dtml-slide_size;px;
+ height: &dtml-slide_size;px;
+ display:block;
+ float:left;
+ transition: width 1s, opacity 0.5s;
}
.lightbox a.slide {
.lightbox .cb {
margin-left: <dtml-var expr="slide_size - 22">px;
margin-top: 5px;
+ width:auto;
+ height:auto;
}
.lightbox .cb input[checked] {
visibility: visible;
}
+.lightbox .zero_opacity {
+ opacity:0;
+}
+
+.lightbox .zero_width {
+ width:0;
+}
.lightbox .slide-hide,
.lightbox .slide-show {
infos batchInfos/infos;
features batchInfos/features"
tal:omit-tag="">
- <div metal:use-macro="here/photo_layout_macros/macros/grid">
- affichage grille
- </div>
+ <form tal:attributes="action string:${here/absolute_url}/portfolio_edit_form" method="post">
+ <div id="image_toolbar" class="image_toolbar">
+ <input type="image" width="17" height="27" alt="delete" title="delete"
+ name="delete"
+ tal:attributes="src string:$portal_url/trash_btn.gif"
+ i18n:attributes="alt;title"/>
+ <br/>
+ </div>
+
+ <div metal:use-macro="here/photo_layout_macros/macros/grid">
+ affichage grille
+ </div>
+ </form>
</div>
<br clear="all"/>
</div>