From 3801d2f473449602313c7d822f30918b60866331 Mon Sep 17 00:00:00 2001 From: quimera Date: Tue, 23 Apr 2013 19:40:06 -0300 Subject: [PATCH 1/4] added special widgect for the cover creation and layout selection --- src/collective/cover/configure.zcml | 7 ++ src/collective/cover/models/cover.xml | 3 +- .../cover/static/selectlayoutpreview.js | 39 ++++++++ src/collective/cover/widgets/__init__.py | 0 src/collective/cover/widgets/interfaces.py | 6 ++ src/collective/cover/widgets/selectpreview.py | 91 +++++++++++++++++++ .../cover/widgets/selectpreview_display.pt | 26 ++++++ .../cover/widgets/selectpreview_input.pt | 48 ++++++++++ 8 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 src/collective/cover/static/selectlayoutpreview.js create mode 100644 src/collective/cover/widgets/__init__.py create mode 100644 src/collective/cover/widgets/interfaces.py create mode 100644 src/collective/cover/widgets/selectpreview.py create mode 100644 src/collective/cover/widgets/selectpreview_display.pt create mode 100644 src/collective/cover/widgets/selectpreview_input.pt diff --git a/src/collective/cover/configure.zcml b/src/collective/cover/configure.zcml index 81f58e4b4..4f16fac08 100644 --- a/src/collective/cover/configure.zcml +++ b/src/collective/cover/configure.zcml @@ -50,4 +50,11 @@ allowed_interface="Products.CMFPlone.browser.interfaces.IPlone" /> + + + + diff --git a/src/collective/cover/models/cover.xml b/src/collective/cover/models/cover.xml index 80ab65acc..432d67827 100644 --- a/src/collective/cover/models/cover.xml +++ b/src/collective/cover/models/cover.xml @@ -6,7 +6,8 @@ - Choose one of the predefined layouts diff --git a/src/collective/cover/static/selectlayoutpreview.js b/src/collective/cover/static/selectlayoutpreview.js new file mode 100644 index 000000000..5cb6dd488 --- /dev/null +++ b/src/collective/cover/static/selectlayoutpreview.js @@ -0,0 +1,39 @@ +$(document).ready(function() { + + function draw_preview(layout, ctx) { + //row position, depends of the number of the content that the row has + var row_offset = 10; + var canvas_width = 200; + $(layout).each(function(){ + //row + ctx.fillStyle = "#EEEEEE"; + ctx.fillRect(1, row_offset, canvas_width, 70); + + //columns + var column_h_offset = 6; + $(this.children).each(function(){ + var column_width = (canvas_width / 16 * this.size) - 6; + ctx.fillStyle = "#D9D9D9"; + ctx.fillRect(column_h_offset + 3, row_offset + 10, column_width - 6, 50); + + column_h_offset = column_h_offset + column_width; + + }); + + row_offset = row_offset + 80; + + }); + } + + $.fn.layoutpreview = function (id, layouts){ + var select = $(id); + var layout_preview = $('#layout-preview'); + select.change(function(b, a) { + var layout_name = $(this).find(":selected").val(); + var ctx = $('#canvas-layout')[0].getContext('2d'); + $('#canvas-layout')[0].width = $('#canvas-layout')[0].width; + draw_preview(layouts[layout_name], ctx); + // layout_preview.html(JSON.stringify(layouts[layout_name])); + }); + } +}); diff --git a/src/collective/cover/widgets/__init__.py b/src/collective/cover/widgets/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/collective/cover/widgets/interfaces.py b/src/collective/cover/widgets/interfaces.py new file mode 100644 index 000000000..46e97089e --- /dev/null +++ b/src/collective/cover/widgets/interfaces.py @@ -0,0 +1,6 @@ + +from z3c.form import interfaces + + +class ISelectPreviewWidget(interfaces.ISelectWidget): + """Select widget with preview.""" diff --git a/src/collective/cover/widgets/selectpreview.py b/src/collective/cover/widgets/selectpreview.py new file mode 100644 index 000000000..f24fdc8e3 --- /dev/null +++ b/src/collective/cover/widgets/selectpreview.py @@ -0,0 +1,91 @@ +import json + +import zope.interface +from zope.component import getUtility + +from z3c.form import interfaces +from z3c.form.widget import FieldWidget +from z3c.form.browser import select + +from zope.browserpage.viewpagetemplatefile import ViewPageTemplateFile + +from collective.cover.widgets.interfaces import ISelectPreviewWidget + +from collective.cover.controlpanel import ICoverSettings +from plone.registry.interfaces import IRegistry + + +class SelectPreviewWidget(select.SelectWidget): + """ Widget for adding new keywords and autocomplete with the ones in the + system. + """ + zope.interface.implementsOnly(ISelectPreviewWidget) + klass = u"keyword-widget" + display_template = ViewPageTemplateFile('selectpreview_display.pt') + input_template = ViewPageTemplateFile('selectpreview_input.pt') + + # JavaScript template + js_template = """\ + (function($) { + $().ready(function() { + var layouts = %(layouts)s; + $.fn.layoutpreview('#%(id)s', layouts); + }); + })(jQuery); + """ + + def js(self): + registry = getUtility(IRegistry) + settings = registry.forInterface(ICoverSettings) + layouts = settings.layouts + + simple_layouts = {} + for layout in layouts: + simplyfied = [] + lay = json.loads(layouts[layout]) + + self.simplify_layout(lay, simplyfied) + simple_layouts[layout] = simplyfied + + return self.js_template % dict(id=self.id, layouts=json.dumps(simple_layouts)) + + def render(self): + if self.mode == interfaces.DISPLAY_MODE: + return self.display_template(self) + else: + return self.input_template(self) + + def simplify_layout(self, layout, simple_layout=[]): + for element in layout: + item = {} + if element['type'] == 'row': + item['type'] = 'row' + + if element['type'] == 'group': + item['type'] = 'group' + item['size'] = element['data']['column-size'] + + if element['type'] == 'tile': + item['type'] = 'tile' + item['tile-type'] = element['tile-type'] + + if 'children' in element: + item['children'] = [] + simple_layout.append(item) + self.simplify_layout(element['children'], item['children']) + else: + simple_layout.append(item) + + +@zope.component.adapter(zope.schema.interfaces.IChoice, + zope.interface.Interface, + interfaces.IFormLayer) +@zope.interface.implementer(interfaces.IFieldWidget) +def SelectFieldWidget(field, source, request=None): + """IFieldWidget factory for SelectWidget.""" + # BBB: emulate our pre-2.0 signature (field, request) + if request is None: + real_request = source + else: + real_request = request + return FieldWidget(field, SelectPreviewWidget(real_request)) diff --git a/src/collective/cover/widgets/selectpreview_display.pt b/src/collective/cover/widgets/selectpreview_display.pt new file mode 100644 index 000000000..885242dcc --- /dev/null +++ b/src/collective/cover/widgets/selectpreview_display.pt @@ -0,0 +1,26 @@ + +, + \ No newline at end of file diff --git a/src/collective/cover/widgets/selectpreview_input.pt b/src/collective/cover/widgets/selectpreview_input.pt new file mode 100644 index 000000000..f587c095a --- /dev/null +++ b/src/collective/cover/widgets/selectpreview_input.pt @@ -0,0 +1,48 @@ +
+ + + + +
+ +
+
From 908212ac45bad9171c170eb3f0798b2300906727 Mon Sep 17 00:00:00 2001 From: quimera Date: Tue, 23 Apr 2013 19:40:06 -0300 Subject: [PATCH 2/4] added special widgect for the cover creation and layout selection --- src/collective/cover/configure.zcml | 7 ++ src/collective/cover/models/cover.xml | 3 +- .../cover/static/selectlayoutpreview.js | 39 ++++++++ src/collective/cover/widgets/__init__.py | 0 src/collective/cover/widgets/interfaces.py | 6 ++ src/collective/cover/widgets/selectpreview.py | 91 +++++++++++++++++++ .../cover/widgets/selectpreview_display.pt | 26 ++++++ .../cover/widgets/selectpreview_input.pt | 48 ++++++++++ 8 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 src/collective/cover/static/selectlayoutpreview.js create mode 100644 src/collective/cover/widgets/__init__.py create mode 100644 src/collective/cover/widgets/interfaces.py create mode 100644 src/collective/cover/widgets/selectpreview.py create mode 100644 src/collective/cover/widgets/selectpreview_display.pt create mode 100644 src/collective/cover/widgets/selectpreview_input.pt diff --git a/src/collective/cover/configure.zcml b/src/collective/cover/configure.zcml index 81f58e4b4..4f16fac08 100644 --- a/src/collective/cover/configure.zcml +++ b/src/collective/cover/configure.zcml @@ -50,4 +50,11 @@ allowed_interface="Products.CMFPlone.browser.interfaces.IPlone" /> + + + + diff --git a/src/collective/cover/models/cover.xml b/src/collective/cover/models/cover.xml index 80ab65acc..432d67827 100644 --- a/src/collective/cover/models/cover.xml +++ b/src/collective/cover/models/cover.xml @@ -6,7 +6,8 @@ - Choose one of the predefined layouts diff --git a/src/collective/cover/static/selectlayoutpreview.js b/src/collective/cover/static/selectlayoutpreview.js new file mode 100644 index 000000000..5cb6dd488 --- /dev/null +++ b/src/collective/cover/static/selectlayoutpreview.js @@ -0,0 +1,39 @@ +$(document).ready(function() { + + function draw_preview(layout, ctx) { + //row position, depends of the number of the content that the row has + var row_offset = 10; + var canvas_width = 200; + $(layout).each(function(){ + //row + ctx.fillStyle = "#EEEEEE"; + ctx.fillRect(1, row_offset, canvas_width, 70); + + //columns + var column_h_offset = 6; + $(this.children).each(function(){ + var column_width = (canvas_width / 16 * this.size) - 6; + ctx.fillStyle = "#D9D9D9"; + ctx.fillRect(column_h_offset + 3, row_offset + 10, column_width - 6, 50); + + column_h_offset = column_h_offset + column_width; + + }); + + row_offset = row_offset + 80; + + }); + } + + $.fn.layoutpreview = function (id, layouts){ + var select = $(id); + var layout_preview = $('#layout-preview'); + select.change(function(b, a) { + var layout_name = $(this).find(":selected").val(); + var ctx = $('#canvas-layout')[0].getContext('2d'); + $('#canvas-layout')[0].width = $('#canvas-layout')[0].width; + draw_preview(layouts[layout_name], ctx); + // layout_preview.html(JSON.stringify(layouts[layout_name])); + }); + } +}); diff --git a/src/collective/cover/widgets/__init__.py b/src/collective/cover/widgets/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/collective/cover/widgets/interfaces.py b/src/collective/cover/widgets/interfaces.py new file mode 100644 index 000000000..46e97089e --- /dev/null +++ b/src/collective/cover/widgets/interfaces.py @@ -0,0 +1,6 @@ + +from z3c.form import interfaces + + +class ISelectPreviewWidget(interfaces.ISelectWidget): + """Select widget with preview.""" diff --git a/src/collective/cover/widgets/selectpreview.py b/src/collective/cover/widgets/selectpreview.py new file mode 100644 index 000000000..f24fdc8e3 --- /dev/null +++ b/src/collective/cover/widgets/selectpreview.py @@ -0,0 +1,91 @@ +import json + +import zope.interface +from zope.component import getUtility + +from z3c.form import interfaces +from z3c.form.widget import FieldWidget +from z3c.form.browser import select + +from zope.browserpage.viewpagetemplatefile import ViewPageTemplateFile + +from collective.cover.widgets.interfaces import ISelectPreviewWidget + +from collective.cover.controlpanel import ICoverSettings +from plone.registry.interfaces import IRegistry + + +class SelectPreviewWidget(select.SelectWidget): + """ Widget for adding new keywords and autocomplete with the ones in the + system. + """ + zope.interface.implementsOnly(ISelectPreviewWidget) + klass = u"keyword-widget" + display_template = ViewPageTemplateFile('selectpreview_display.pt') + input_template = ViewPageTemplateFile('selectpreview_input.pt') + + # JavaScript template + js_template = """\ + (function($) { + $().ready(function() { + var layouts = %(layouts)s; + $.fn.layoutpreview('#%(id)s', layouts); + }); + })(jQuery); + """ + + def js(self): + registry = getUtility(IRegistry) + settings = registry.forInterface(ICoverSettings) + layouts = settings.layouts + + simple_layouts = {} + for layout in layouts: + simplyfied = [] + lay = json.loads(layouts[layout]) + + self.simplify_layout(lay, simplyfied) + simple_layouts[layout] = simplyfied + + return self.js_template % dict(id=self.id, layouts=json.dumps(simple_layouts)) + + def render(self): + if self.mode == interfaces.DISPLAY_MODE: + return self.display_template(self) + else: + return self.input_template(self) + + def simplify_layout(self, layout, simple_layout=[]): + for element in layout: + item = {} + if element['type'] == 'row': + item['type'] = 'row' + + if element['type'] == 'group': + item['type'] = 'group' + item['size'] = element['data']['column-size'] + + if element['type'] == 'tile': + item['type'] = 'tile' + item['tile-type'] = element['tile-type'] + + if 'children' in element: + item['children'] = [] + simple_layout.append(item) + self.simplify_layout(element['children'], item['children']) + else: + simple_layout.append(item) + + +@zope.component.adapter(zope.schema.interfaces.IChoice, + zope.interface.Interface, + interfaces.IFormLayer) +@zope.interface.implementer(interfaces.IFieldWidget) +def SelectFieldWidget(field, source, request=None): + """IFieldWidget factory for SelectWidget.""" + # BBB: emulate our pre-2.0 signature (field, request) + if request is None: + real_request = source + else: + real_request = request + return FieldWidget(field, SelectPreviewWidget(real_request)) diff --git a/src/collective/cover/widgets/selectpreview_display.pt b/src/collective/cover/widgets/selectpreview_display.pt new file mode 100644 index 000000000..885242dcc --- /dev/null +++ b/src/collective/cover/widgets/selectpreview_display.pt @@ -0,0 +1,26 @@ + +, + \ No newline at end of file diff --git a/src/collective/cover/widgets/selectpreview_input.pt b/src/collective/cover/widgets/selectpreview_input.pt new file mode 100644 index 000000000..f587c095a --- /dev/null +++ b/src/collective/cover/widgets/selectpreview_input.pt @@ -0,0 +1,48 @@ +
+ + + + +
+ +
+
From 24fb0e06d616d74138055df09fcae2a4255c6dbf Mon Sep 17 00:00:00 2001 From: quimera Date: Thu, 25 Apr 2013 03:12:19 -0300 Subject: [PATCH 3/4] correction in preview generation, style for preview --- .../cover/static/selectlayoutpreview.js | 32 +++-- .../cover/widgets/selectpreview_input.pt | 112 +++++++++++------- 2 files changed, 93 insertions(+), 51 deletions(-) diff --git a/src/collective/cover/static/selectlayoutpreview.js b/src/collective/cover/static/selectlayoutpreview.js index 5cb6dd488..bef640d64 100644 --- a/src/collective/cover/static/selectlayoutpreview.js +++ b/src/collective/cover/static/selectlayoutpreview.js @@ -3,20 +3,21 @@ $(document).ready(function() { function draw_preview(layout, ctx) { //row position, depends of the number of the content that the row has var row_offset = 10; - var canvas_width = 200; + var canvas_width = 300; $(layout).each(function(){ //row ctx.fillStyle = "#EEEEEE"; - ctx.fillRect(1, row_offset, canvas_width, 70); + ctx.fillRect(0, row_offset, canvas_width, 70); //columns - var column_h_offset = 6; + var column_h_offset = 10; + var n_columns = this.children.length; $(this.children).each(function(){ - var column_width = (canvas_width / 16 * this.size) - 6; + var column_width = (290 / 16 * this.size) - 10; ctx.fillStyle = "#D9D9D9"; - ctx.fillRect(column_h_offset + 3, row_offset + 10, column_width - 6, 50); + ctx.fillRect(column_h_offset, row_offset + 10, column_width, 50); - column_h_offset = column_h_offset + column_width; + column_h_offset = column_h_offset + column_width + 10; }); @@ -25,15 +26,24 @@ $(document).ready(function() { }); } + function setup_preview(layout_preview, select, ctx, layouts) { + var layout_name = select.find(":selected").val(); + $('#canvas-layout')[0].width = $('#canvas-layout')[0].width; + $('#canvas-layout')[0].height = 80 * layouts[layout_name].length > 300 ? 80 * layouts[layout_name].length : 300; + draw_preview(layouts[layout_name], ctx); + + layout_preview.find('h3').html(layout_name); + } + $.fn.layoutpreview = function (id, layouts){ var select = $(id); var layout_preview = $('#layout-preview'); + + var ctx = $('#canvas-layout')[0].getContext('2d'); + setup_preview(layout_preview, select, ctx, layouts); + select.change(function(b, a) { - var layout_name = $(this).find(":selected").val(); - var ctx = $('#canvas-layout')[0].getContext('2d'); - $('#canvas-layout')[0].width = $('#canvas-layout')[0].width; - draw_preview(layouts[layout_name], ctx); - // layout_preview.html(JSON.stringify(layouts[layout_name])); + setup_preview(layout_preview, $(this), ctx, layouts); }); } }); diff --git a/src/collective/cover/widgets/selectpreview_input.pt b/src/collective/cover/widgets/selectpreview_input.pt index f587c095a..005beb0ac 100644 --- a/src/collective/cover/widgets/selectpreview_input.pt +++ b/src/collective/cover/widgets/selectpreview_input.pt @@ -3,46 +3,78 @@ tal:omit-tag=""> - - + +
+ + +
- +
+ Layout Details + + +
From 2cd9681bc492c6fef08ddc5ddfef144c527e150b Mon Sep 17 00:00:00 2001 From: quimera Date: Thu, 25 Apr 2013 14:49:56 -0300 Subject: [PATCH 4/4] tests added, i18n and minor templte modification --- .../cover/locales/collective.cover.pot | 107 ++++++++-------- .../es/LC_MESSAGES/collective.cover.po | 113 +++++++++-------- .../pt_BR/LC_MESSAGES/collective.cover.po | 119 ++++++++++-------- .../cover/tests/test_widget_preview.py | 47 +++++++ .../cover/widgets/selectpreview_input.pt | 6 +- 5 files changed, 230 insertions(+), 162 deletions(-) create mode 100644 src/collective/cover/tests/test_widget_preview.py diff --git a/src/collective/cover/locales/collective.cover.pot b/src/collective/cover/locales/collective.cover.pot index f975167bc..d6e2f8bd5 100644 --- a/src/collective/cover/locales/collective.cover.pot +++ b/src/collective/cover/locales/collective.cover.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: collective.cover\n" -"POT-Creation-Date: 2013-01-07 14:04+0000\n" +"POT-Creation-Date: 2013-04-25 17:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -54,7 +54,7 @@ msgstr "" msgid "A tile to embed content from a remote source." msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:88 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:75 msgid "Add Content" msgstr "" @@ -62,11 +62,15 @@ msgstr "" msgid "An easy-to-use package to create complex cover pages for Plone sites." msgstr "" +#: collective/cover/tiles/carousel.py:24 +msgid "Auto play" +msgstr "" + #: tiles/configure.zcml msgid "Basic Tile" msgstr "" -#: collective/cover/tiles/configuration_view.py:193 +#: collective/cover/tiles/configuration_view.py:201 #: collective/cover/tiles/edit.py:84 msgid "Cancel" msgstr "" @@ -83,7 +87,7 @@ msgstr "" msgid "Collection Tile" msgstr "" -#: collective/cover/templates/layoutedit.pt:43 +#: collective/cover/templates/layoutedit.pt:55 msgid "Column" msgstr "" @@ -91,11 +95,11 @@ msgstr "" msgid "Compose" msgstr "" -#: collective/cover/tiles/configuration_view.py:156 +#: collective/cover/tiles/configuration_view.py:164 msgid "Configure ${name}" msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:16 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:16 msgid "Content tree" msgstr "" @@ -112,11 +116,11 @@ msgstr "" msgid "Cover Settings" msgstr "" -#: collective/cover/tiles/basic.py:46 +#: collective/cover/tiles/basic.py:45 msgid "Date" msgstr "" -#: collective/cover/tiles/basic.py:36 +#: collective/cover/tiles/basic.py:33 #: collective/cover/tiles/embed.py:26 #: collective/cover/tiles/file.py:49 msgid "Description" @@ -126,11 +130,12 @@ msgstr "" msgid "Download link" msgstr "" -#: collective/cover/layout_templates/tile.pt:45 +#: collective/cover/layout_templates/tile.pt:46 msgid "Edit" msgstr "" -#: collective/cover/tiles/list.py:29 +#: collective/cover/tiles/carousel.py:17 +#: collective/cover/tiles/list.py:30 msgid "Elements" msgstr "" @@ -142,7 +147,7 @@ msgstr "" msgid "Embedding code" msgstr "" -#: collective/cover/templates/layoutedit.pt:33 +#: collective/cover/templates/layoutedit.pt:45 msgid "Export layout" msgstr "" @@ -150,7 +155,7 @@ msgstr "" msgid "File Tile" msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:22 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:22 msgid "Filter items" msgstr "" @@ -158,12 +163,8 @@ msgstr "" msgid "HTML tag" msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:70 -msgid "Home" -msgstr "" - -#: collective/cover/tiles/basic.py:41 -#: collective/cover/tiles/image.py:20 +#: collective/cover/tiles/basic.py:38 +#: collective/cover/tiles/image.py:24 #: collective/cover/tiles/link.py:31 msgid "Image" msgstr "" @@ -172,7 +173,7 @@ msgstr "" msgid "Image Tile" msgstr "" -#: collective/cover/tiles/configuration_widgets/namedimage.pt:42 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:45 msgid "Image size" msgstr "" @@ -182,7 +183,11 @@ msgstr "" msgid "Layout" msgstr "" -#: collective/cover/templates/layoutedit.pt:31 +#: collective/cover/widgets/selectpreview_input.pt:74 +msgid "Layout Details" +msgstr "" + +#: collective/cover/templates/layoutedit.pt:43 msgid "Layout name" msgstr "" @@ -204,21 +209,25 @@ msgstr "" #: collective/cover/tiles/configuration_widgets/basewidget.pt:30 #: collective/cover/tiles/configuration_widgets/list.pt:40 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:30 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:33 msgid "No" msgstr "" +#: collective/cover/widgets/selectpreview_input.pt:77 +msgid "No description" +msgstr "" + #: collective/cover/tiles/configuration_widgets/list.pt:12 msgid "Number of items" msgstr "" #: collective/cover/controlpanel.py:25 -msgid "Only objects of these content types will be searched on the contentchooser." +msgid "Only objects of these content types will be searched on the content chooser." msgstr "" #: collective/cover/tiles/configuration_widgets/basewidget.pt:32 #: collective/cover/tiles/configuration_widgets/list.pt:42 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:32 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:35 msgid "Order" msgstr "" @@ -238,6 +247,10 @@ msgstr "" msgid "Please drag&drop an image here to populate the tile." msgstr "" +#: collective/cover/tiles/templates/collection.pt:8 +msgid "Please drop a collection here to fill the tile." +msgstr "" + #: collective/cover/tiles/templates/embed.pt:8 msgid "Please edit the tile to add the code to be embedded." msgstr "" @@ -246,11 +259,11 @@ msgstr "" msgid "Please edit the tile to enter some text." msgstr "" -#: collective/cover/tiles/configuration_widgets/namedimage.pt:58 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:62 msgid "Position" msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:15 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:15 msgid "Recent items" msgstr "" @@ -258,16 +271,16 @@ msgstr "" msgid "Rich Text Tile" msgstr "" -#: collective/cover/templates/layoutedit.pt:40 +#: collective/cover/templates/layoutedit.pt:52 msgid "Row" msgstr "" -#: collective/cover/tiles/configuration_view.py:160 +#: collective/cover/tiles/configuration_view.py:168 #: collective/cover/tiles/edit.py:52 msgid "Save" msgstr "" -#: collective/cover/templates/layoutedit.pt:49 +#: collective/cover/templates/layoutedit.pt:61 msgid "Saved" msgstr "" @@ -275,10 +288,6 @@ msgstr "" msgid "Searchable Content Types" msgstr "" -#: collective/cover/tiles/templates/collection.pt:10 -msgid "Select a collection to fill this tile." -msgstr "" - #: collective/cover/controlpanel.py:37 msgid "Settings for the collective.cover package" msgstr "" @@ -287,7 +296,7 @@ msgstr "" msgid "Text length" msgstr "" -#: collective/cover/tiles/templates/collection.pt:18 +#: collective/cover/tiles/templates/collection.pt:16 msgid "The collection doesn't have any results." msgstr "" @@ -295,15 +304,15 @@ msgstr "" msgid "The layout to be used to render groups and tiles" msgstr "" -#: collective/cover/templates/layoutedit.pt:46 +#: collective/cover/templates/layoutedit.pt:58 msgid "Tile" msgstr "" -#: collective/cover/tiles/configuration_view.py:202 +#: collective/cover/tiles/configuration_view.py:210 msgid "Tile configuration cancelled." msgstr "" -#: collective/cover/tiles/configuration_view.py:189 +#: collective/cover/tiles/configuration_view.py:197 msgid "Tile configuration saved." msgstr "" @@ -311,7 +320,7 @@ msgstr "" msgid "Tile saved" msgstr "" -#: collective/cover/tiles/basic.py:31 +#: collective/cover/tiles/basic.py:28 #: collective/cover/tiles/embed.py:21 #: collective/cover/tiles/file.py:44 msgid "Title" @@ -321,7 +330,7 @@ msgstr "" msgid "URL" msgstr "" -#: collective/cover/tiles/basic.py:61 +#: collective/cover/tiles/basic.py:62 #: collective/cover/tiles/file.py:60 #: collective/cover/tiles/link.py:41 msgid "UUID" @@ -331,31 +340,27 @@ msgstr "" msgid "Uninstall profile for the collective.cover package." msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:63 -msgid "Up level" -msgstr "" - #: collective/cover/tiles/configuration_widgets/basewidget.pt:12 #: collective/cover/tiles/configuration_widgets/list.pt:22 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:12 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:15 msgid "Visible" msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:12 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:12 msgid "X" msgstr "" #: collective/cover/tiles/configuration_widgets/basewidget.pt:21 #: collective/cover/tiles/configuration_widgets/list.pt:31 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:21 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:24 msgid "Yes" msgstr "" -#: collective/cover/tiles/base.py:122 +#: collective/cover/tiles/base.py:124 msgid "You are not allowed to add content to this tile" msgstr "" -#: collective/cover/tiles/base.py:136 +#: collective/cover/tiles/base.py:138 msgid "You are not allowed to remove content of this tile" msgstr "" @@ -367,20 +372,20 @@ msgstr "" msgid "collective.cover uninstall" msgstr "" -#: collective/cover/tiles/basic.py:52 +#: collective/cover/tiles/basic.py:55 msgid "help_categories" msgstr "" #. Default: "Categories" -#: collective/cover/tiles/basic.py:51 +#: collective/cover/tiles/basic.py:54 msgid "label_categories" msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:31 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:31 msgid "more" msgstr "" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:26 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:26 msgid "ok" msgstr "" diff --git a/src/collective/cover/locales/es/LC_MESSAGES/collective.cover.po b/src/collective/cover/locales/es/LC_MESSAGES/collective.cover.po index 67d03d60a..241e4d2de 100644 --- a/src/collective/cover/locales/es/LC_MESSAGES/collective.cover.po +++ b/src/collective/cover/locales/es/LC_MESSAGES/collective.cover.po @@ -3,9 +3,9 @@ msgid "" msgstr "" "Project-Id-Version: collective.cover\n" -"POT-Creation-Date: 2013-01-07 14:04+0000\n" -"PO-Revision-Date: 2013-01-07 15:34-0300\n" -"Last-Translator: Héctor Velarde \n" +"POT-Creation-Date: 2013-04-25 17:47+0000\n" +"PO-Revision-Date: 2013-04-25 14:48-0300\n" +"Last-Translator: quimera \n" "Language-Team: Spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -57,7 +57,7 @@ msgstr "Un tile que muestra el resultado de una colección." msgid "A tile to embed content from a remote source." msgstr "Un tile para integrar contenido de una fuente remota." -#: collective/cover/contentchooser_templates/content_contentchooser.pt:88 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:75 msgid "Add Content" msgstr "Agregar contenido" @@ -65,11 +65,15 @@ msgstr "Agregar contenido" msgid "An easy-to-use package to create complex cover pages for Plone sites." msgstr "Un paquete de uso fácil para crear portadas en sitios Plone." +#: collective/cover/tiles/carousel.py:24 +msgid "Auto play" +msgstr "" + #: tiles/configure.zcml msgid "Basic Tile" msgstr "Tile básico" -#: collective/cover/tiles/configuration_view.py:193 +#: collective/cover/tiles/configuration_view.py:201 #: collective/cover/tiles/edit.py:84 msgid "Cancel" msgstr "Cancelar" @@ -86,7 +90,7 @@ msgstr "Elija uno de los diseños predefinidos" msgid "Collection Tile" msgstr "Tile de colección" -#: collective/cover/templates/layoutedit.pt:43 +#: collective/cover/templates/layoutedit.pt:55 msgid "Column" msgstr "Columna" @@ -94,11 +98,11 @@ msgstr "Columna" msgid "Compose" msgstr "Componer" -#: collective/cover/tiles/configuration_view.py:156 +#: collective/cover/tiles/configuration_view.py:164 msgid "Configure ${name}" msgstr "Configurar ${name}" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:16 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:16 msgid "Content tree" msgstr "Árbol de contenido" @@ -115,11 +119,11 @@ msgstr "Diseño de portada" msgid "Cover Settings" msgstr "Configuraciones de portada" -#: collective/cover/tiles/basic.py:46 +#: collective/cover/tiles/basic.py:45 msgid "Date" msgstr "Fecha" -#: collective/cover/tiles/basic.py:36 +#: collective/cover/tiles/basic.py:33 #: collective/cover/tiles/embed.py:26 #: collective/cover/tiles/file.py:49 msgid "Description" @@ -129,11 +133,12 @@ msgstr "Descripción" msgid "Download link" msgstr "Enlace de descarga" -#: collective/cover/layout_templates/tile.pt:45 +#: collective/cover/layout_templates/tile.pt:46 msgid "Edit" msgstr "Editar" -#: collective/cover/tiles/list.py:29 +#: collective/cover/tiles/carousel.py:17 +#: collective/cover/tiles/list.py:30 msgid "Elements" msgstr "Elementos" @@ -145,7 +150,7 @@ msgstr "Tile de código incrustado" msgid "Embedding code" msgstr "Código a incrustar" -#: collective/cover/templates/layoutedit.pt:33 +#: collective/cover/templates/layoutedit.pt:45 msgid "Export layout" msgstr "Exportar diseño" @@ -153,7 +158,7 @@ msgstr "Exportar diseño" msgid "File Tile" msgstr "Tile de archivo" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:22 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:22 msgid "Filter items" msgstr "Filtrar elementos" @@ -161,12 +166,8 @@ msgstr "Filtrar elementos" msgid "HTML tag" msgstr "Tag HTML" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:70 -msgid "Home" -msgstr "Inicio" - -#: collective/cover/tiles/basic.py:41 -#: collective/cover/tiles/image.py:20 +#: collective/cover/tiles/basic.py:38 +#: collective/cover/tiles/image.py:24 #: collective/cover/tiles/link.py:31 msgid "Image" msgstr "Imagen" @@ -175,7 +176,7 @@ msgstr "Imagen" msgid "Image Tile" msgstr "Tile de imagen" -#: collective/cover/tiles/configuration_widgets/namedimage.pt:42 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:45 msgid "Image size" msgstr "Tamaño de la imagen" @@ -185,7 +186,11 @@ msgstr "Tamaño de la imagen" msgid "Layout" msgstr "Diseño" -#: collective/cover/templates/layoutedit.pt:31 +#: collective/cover/widgets/selectpreview_input.pt:74 +msgid "Layout Details" +msgstr "Detalles del diseño" + +#: collective/cover/templates/layoutedit.pt:43 msgid "Layout name" msgstr "Nombre del diseño" @@ -207,21 +212,25 @@ msgstr "Nombre" #: collective/cover/tiles/configuration_widgets/basewidget.pt:30 #: collective/cover/tiles/configuration_widgets/list.pt:40 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:30 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:33 msgid "No" msgstr "No" +#: collective/cover/widgets/selectpreview_input.pt:77 +msgid "No description" +msgstr "Sin descripción" + #: collective/cover/tiles/configuration_widgets/list.pt:12 msgid "Number of items" msgstr "Número de elementos" #: collective/cover/controlpanel.py:25 -msgid "Only objects of these content types will be searched on the contentchooser." -msgstr "Sólo los objetos de estos tipos de contenido serán buscados en el contentchooser." +msgid "Only objects of these content types will be searched on the content chooser." +msgstr "" #: collective/cover/tiles/configuration_widgets/basewidget.pt:32 #: collective/cover/tiles/configuration_widgets/list.pt:42 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:32 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:35 msgid "Order" msgstr "Orden" @@ -241,6 +250,10 @@ msgstr "Arrastre y suelte un enlace aquí." msgid "Please drag&drop an image here to populate the tile." msgstr "Arrastre y suelte una imagen aquí." +#: collective/cover/tiles/templates/collection.pt:8 +msgid "Please drop a collection here to fill the tile." +msgstr "" + #: collective/cover/tiles/templates/embed.pt:8 msgid "Please edit the tile to add the code to be embedded." msgstr "Por favor edite el tile para agregar el código de incrustación." @@ -249,11 +262,11 @@ msgstr "Por favor edite el tile para agregar el código de incrustación." msgid "Please edit the tile to enter some text." msgstr "Por favor edite el tile para agregar algún texto." -#: collective/cover/tiles/configuration_widgets/namedimage.pt:58 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:62 msgid "Position" msgstr "Posición" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:15 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:15 msgid "Recent items" msgstr "Elementos recientes" @@ -261,16 +274,16 @@ msgstr "Elementos recientes" msgid "Rich Text Tile" msgstr "Tile de texto enriquecido" -#: collective/cover/templates/layoutedit.pt:40 +#: collective/cover/templates/layoutedit.pt:52 msgid "Row" msgstr "Fila" -#: collective/cover/tiles/configuration_view.py:160 +#: collective/cover/tiles/configuration_view.py:168 #: collective/cover/tiles/edit.py:52 msgid "Save" msgstr "Guardar" -#: collective/cover/templates/layoutedit.pt:49 +#: collective/cover/templates/layoutedit.pt:61 msgid "Saved" msgstr "Guardado" @@ -278,10 +291,6 @@ msgstr "Guardado" msgid "Searchable Content Types" msgstr "Tipos de contenido consultables" -#: collective/cover/tiles/templates/collection.pt:10 -msgid "Select a collection to fill this tile." -msgstr "Seleccione una colección para llenar este tile." - #: collective/cover/controlpanel.py:37 msgid "Settings for the collective.cover package" msgstr "Preferencias para el paquete collective.cover" @@ -290,7 +299,7 @@ msgstr "Preferencias para el paquete collective.cover" msgid "Text length" msgstr "Longitud del texto" -#: collective/cover/tiles/templates/collection.pt:18 +#: collective/cover/tiles/templates/collection.pt:16 msgid "The collection doesn't have any results." msgstr "La colección no tiene resultados." @@ -298,15 +307,15 @@ msgstr "La colección no tiene resultados." msgid "The layout to be used to render groups and tiles" msgstr "El diseño que será usado para mostrar grupos y tiles" -#: collective/cover/templates/layoutedit.pt:46 +#: collective/cover/templates/layoutedit.pt:58 msgid "Tile" msgstr "Tile" -#: collective/cover/tiles/configuration_view.py:202 +#: collective/cover/tiles/configuration_view.py:210 msgid "Tile configuration cancelled." msgstr "Configuración del tile cancelada." -#: collective/cover/tiles/configuration_view.py:189 +#: collective/cover/tiles/configuration_view.py:197 msgid "Tile configuration saved." msgstr "Configuración del tile guardada." @@ -314,7 +323,7 @@ msgstr "Configuración del tile guardada." msgid "Tile saved" msgstr "Tile guardado" -#: collective/cover/tiles/basic.py:31 +#: collective/cover/tiles/basic.py:28 #: collective/cover/tiles/embed.py:21 #: collective/cover/tiles/file.py:44 msgid "Title" @@ -324,7 +333,7 @@ msgstr "Titulo" msgid "URL" msgstr "URL" -#: collective/cover/tiles/basic.py:61 +#: collective/cover/tiles/basic.py:62 #: collective/cover/tiles/file.py:60 #: collective/cover/tiles/link.py:41 msgid "UUID" @@ -334,31 +343,27 @@ msgstr "UUID" msgid "Uninstall profile for the collective.cover package." msgstr "Perfil de desinstalación del paquete collective.cover." -#: collective/cover/contentchooser_templates/content_contentchooser.pt:63 -msgid "Up level" -msgstr "Subir nivel" - #: collective/cover/tiles/configuration_widgets/basewidget.pt:12 #: collective/cover/tiles/configuration_widgets/list.pt:22 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:12 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:15 msgid "Visible" msgstr "Visible" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:12 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:12 msgid "X" msgstr "X" #: collective/cover/tiles/configuration_widgets/basewidget.pt:21 #: collective/cover/tiles/configuration_widgets/list.pt:31 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:21 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:24 msgid "Yes" msgstr "Si" -#: collective/cover/tiles/base.py:122 +#: collective/cover/tiles/base.py:124 msgid "You are not allowed to add content to this tile" msgstr "No permiso para agregar contenido a este tile" -#: collective/cover/tiles/base.py:136 +#: collective/cover/tiles/base.py:138 msgid "You are not allowed to remove content of this tile" msgstr "No permiso para remover contenido de este tile" @@ -371,20 +376,20 @@ msgid "collective.cover uninstall" msgstr "Desinstalar Portada" #. Default: "Also known as keywords, tags or labels, these help you categorize your content." -#: collective/cover/tiles/basic.py:52 +#: collective/cover/tiles/basic.py:55 msgid "help_categories" msgstr "Las etiquetas suelen utilizarse para la organización a medida del contenido." #. Default: "Categories" -#: collective/cover/tiles/basic.py:51 +#: collective/cover/tiles/basic.py:54 msgid "label_categories" msgstr "Etiquetas" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:31 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:31 msgid "more" msgstr "más" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:26 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:26 msgid "ok" msgstr "ok" diff --git a/src/collective/cover/locales/pt_BR/LC_MESSAGES/collective.cover.po b/src/collective/cover/locales/pt_BR/LC_MESSAGES/collective.cover.po index b25a1df5f..b667c6e5c 100644 --- a/src/collective/cover/locales/pt_BR/LC_MESSAGES/collective.cover.po +++ b/src/collective/cover/locales/pt_BR/LC_MESSAGES/collective.cover.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: collective.cover\n" -"POT-Creation-Date: 2013-01-07 14:04+0000\n" +"POT-Creation-Date: 2013-04-25 17:47+0000\n" "PO-Revision-Date: 2013-01-07 14:20-0300\n" "Last-Translator: Andre Nogueira \n" "Language-Team: LANGUAGE \n" @@ -54,7 +54,7 @@ msgstr "Um tile que exibe o resultado de uma coleção." msgid "A tile to embed content from a remote source." msgstr "Um tile que permite embedar conteúdo de uma fonte externa." -#: collective/cover/contentchooser_templates/content_contentchooser.pt:88 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:75 msgid "Add Content" msgstr "Adicionar conteúdo" @@ -62,11 +62,15 @@ msgstr "Adicionar conteúdo" msgid "An easy-to-use package to create complex cover pages for Plone sites." msgstr "Um produto para criar capas complexas fácil de usar." +#: collective/cover/tiles/carousel.py:24 +msgid "Auto play" +msgstr "" + #: tiles/configure.zcml msgid "Basic Tile" msgstr "Tile Básico" -#: collective/cover/tiles/configuration_view.py:193 +#: collective/cover/tiles/configuration_view.py:201 #: collective/cover/tiles/edit.py:84 msgid "Cancel" msgstr "Cancelar" @@ -83,7 +87,7 @@ msgstr "Escolha um dos layouts pré-definidos" msgid "Collection Tile" msgstr "Tile de Coleção" -#: collective/cover/templates/layoutedit.pt:43 +#: collective/cover/templates/layoutedit.pt:55 msgid "Column" msgstr "Coluna" @@ -91,11 +95,11 @@ msgstr "Coluna" msgid "Compose" msgstr "Composição" -#: collective/cover/tiles/configuration_view.py:156 +#: collective/cover/tiles/configuration_view.py:164 msgid "Configure ${name}" msgstr "Configurar ${name}" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:16 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:16 msgid "Content tree" msgstr "Árvore de conteúdo" @@ -112,11 +116,12 @@ msgstr "Layout da capa" msgid "Cover Settings" msgstr "Configurações da capa" -#: collective/cover/tiles/basic.py:46 +#: collective/cover/tiles/basic.py:45 msgid "Date" msgstr "Data" -#: collective/cover/tiles/basic.py:36 collective/cover/tiles/embed.py:26 +#: collective/cover/tiles/basic.py:33 +#: collective/cover/tiles/embed.py:26 #: collective/cover/tiles/file.py:49 msgid "Description" msgstr "Descrição" @@ -125,11 +130,12 @@ msgstr "Descrição" msgid "Download link" msgstr "Link para download" -#: collective/cover/layout_templates/tile.pt:45 +#: collective/cover/layout_templates/tile.pt:46 msgid "Edit" msgstr "Editar" -#: collective/cover/tiles/list.py:29 +#: collective/cover/tiles/carousel.py:17 +#: collective/cover/tiles/list.py:30 msgid "Elements" msgstr "Elementos" @@ -141,7 +147,7 @@ msgstr "Tile de Embed" msgid "Embedding code" msgstr "Código de embedding" -#: collective/cover/templates/layoutedit.pt:33 +#: collective/cover/templates/layoutedit.pt:45 msgid "Export layout" msgstr "Exportar o layout" @@ -149,7 +155,7 @@ msgstr "Exportar o layout" msgid "File Tile" msgstr "Tile de Arquivo" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:22 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:22 msgid "Filter items" msgstr "Filtrar itens" @@ -157,11 +163,8 @@ msgstr "Filtrar itens" msgid "HTML tag" msgstr "tag HTML" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:70 -msgid "Home" -msgstr "Home" - -#: collective/cover/tiles/basic.py:41 collective/cover/tiles/image.py:20 +#: collective/cover/tiles/basic.py:38 +#: collective/cover/tiles/image.py:24 #: collective/cover/tiles/link.py:31 msgid "Image" msgstr "Imagem" @@ -170,16 +173,21 @@ msgstr "Imagem" msgid "Image Tile" msgstr "Tile de Imagem" -#: collective/cover/tiles/configuration_widgets/namedimage.pt:42 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:45 msgid "Image size" msgstr "Tamanho da imagem" -#: collective/cover/controlpanel.py:20 collective/cover/models/cover.xml +#: collective/cover/controlpanel.py:20 +#: collective/cover/models/cover.xml #: collective/cover/profiles/default/types/collective.cover.content.xml msgid "Layout" msgstr "Layout" -#: collective/cover/templates/layoutedit.pt:31 +#: collective/cover/widgets/selectpreview_input.pt:74 +msgid "Layout Details" +msgstr "" + +#: collective/cover/templates/layoutedit.pt:43 msgid "Layout name" msgstr "Nome do layout" @@ -201,21 +209,25 @@ msgstr "Nome" #: collective/cover/tiles/configuration_widgets/basewidget.pt:30 #: collective/cover/tiles/configuration_widgets/list.pt:40 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:30 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:33 msgid "No" msgstr "Não" +#: collective/cover/widgets/selectpreview_input.pt:77 +msgid "No description" +msgstr "" + #: collective/cover/tiles/configuration_widgets/list.pt:12 msgid "Number of items" msgstr "Número de itens" #: collective/cover/controlpanel.py:25 -msgid "Only objects of these content types will be searched on the contentchooser." -msgstr "Só os tipos de conteúdo listados serão procurados pelo contentchooser." +msgid "Only objects of these content types will be searched on the content chooser." +msgstr "" #: collective/cover/tiles/configuration_widgets/basewidget.pt:32 #: collective/cover/tiles/configuration_widgets/list.pt:42 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:32 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:35 msgid "Order" msgstr "Ordem" @@ -235,6 +247,10 @@ msgstr "Por favor, arraste e solte um link aqui para popular este tile" msgid "Please drag&drop an image here to populate the tile." msgstr "Por favor, arraste e solte uma imagem aqui para popular este tile." +#: collective/cover/tiles/templates/collection.pt:8 +msgid "Please drop a collection here to fill the tile." +msgstr "" + #: collective/cover/tiles/templates/embed.pt:8 msgid "Please edit the tile to add the code to be embedded." msgstr "Por favor edite o tile para adicionar o código que será embedado." @@ -243,11 +259,11 @@ msgstr "Por favor edite o tile para adicionar o código que será embedado." msgid "Please edit the tile to enter some text." msgstr "Por favor edite o tile para adicionar um texto." -#: collective/cover/tiles/configuration_widgets/namedimage.pt:58 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:62 msgid "Position" msgstr "Posição" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:15 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:15 msgid "Recent items" msgstr "Itens recentes" @@ -255,16 +271,16 @@ msgstr "Itens recentes" msgid "Rich Text Tile" msgstr "Tile de texto rico" -#: collective/cover/templates/layoutedit.pt:40 +#: collective/cover/templates/layoutedit.pt:52 msgid "Row" msgstr "Linha" -#: collective/cover/tiles/configuration_view.py:160 +#: collective/cover/tiles/configuration_view.py:168 #: collective/cover/tiles/edit.py:52 msgid "Save" msgstr "Salvar" -#: collective/cover/templates/layoutedit.pt:49 +#: collective/cover/templates/layoutedit.pt:61 msgid "Saved" msgstr "Salvo" @@ -272,10 +288,6 @@ msgstr "Salvo" msgid "Searchable Content Types" msgstr "Tipos de conteúdo buscáveis" -#: collective/cover/tiles/templates/collection.pt:10 -msgid "Select a collection to fill this tile." -msgstr "Selecione uma coleção para preencher este tile." - #: collective/cover/controlpanel.py:37 msgid "Settings for the collective.cover package" msgstr "Configurações do produto collective.cover" @@ -284,7 +296,7 @@ msgstr "Configurações do produto collective.cover" msgid "Text length" msgstr "Comprimento do texto" -#: collective/cover/tiles/templates/collection.pt:18 +#: collective/cover/tiles/templates/collection.pt:16 msgid "The collection doesn't have any results." msgstr "Esta coleção não possui nenhum resultado." @@ -292,15 +304,15 @@ msgstr "Esta coleção não possui nenhum resultado." msgid "The layout to be used to render groups and tiles" msgstr "O layout que será utilizado" -#: collective/cover/templates/layoutedit.pt:46 +#: collective/cover/templates/layoutedit.pt:58 msgid "Tile" msgstr "Tile" -#: collective/cover/tiles/configuration_view.py:202 +#: collective/cover/tiles/configuration_view.py:210 msgid "Tile configuration cancelled." msgstr "Configuração do tile cancelada." -#: collective/cover/tiles/configuration_view.py:189 +#: collective/cover/tiles/configuration_view.py:197 msgid "Tile configuration saved." msgstr "Configuração do tile salva." @@ -308,7 +320,8 @@ msgstr "Configuração do tile salva." msgid "Tile saved" msgstr "Tile salvo" -#: collective/cover/tiles/basic.py:31 collective/cover/tiles/embed.py:21 +#: collective/cover/tiles/basic.py:28 +#: collective/cover/tiles/embed.py:21 #: collective/cover/tiles/file.py:44 msgid "Title" msgstr "Título" @@ -317,7 +330,8 @@ msgstr "Título" msgid "URL" msgstr "URL" -#: collective/cover/tiles/basic.py:61 collective/cover/tiles/file.py:60 +#: collective/cover/tiles/basic.py:62 +#: collective/cover/tiles/file.py:60 #: collective/cover/tiles/link.py:41 msgid "UUID" msgstr "UUID" @@ -326,31 +340,27 @@ msgstr "UUID" msgid "Uninstall profile for the collective.cover package." msgstr "Perfil de desintalação do produto collective.cover." -#: collective/cover/contentchooser_templates/content_contentchooser.pt:63 -msgid "Up level" -msgstr "Um nível acima" - #: collective/cover/tiles/configuration_widgets/basewidget.pt:12 #: collective/cover/tiles/configuration_widgets/list.pt:22 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:12 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:15 msgid "Visible" msgstr "Visível" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:12 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:12 msgid "X" msgstr "X" #: collective/cover/tiles/configuration_widgets/basewidget.pt:21 #: collective/cover/tiles/configuration_widgets/list.pt:31 -#: collective/cover/tiles/configuration_widgets/namedimage.pt:21 +#: collective/cover/tiles/configuration_widgets/namedimage.pt:24 msgid "Yes" msgstr "Sim" -#: collective/cover/tiles/base.py:122 +#: collective/cover/tiles/base.py:124 msgid "You are not allowed to add content to this tile" msgstr "Você não tem permissão para adicionar conteúdo neste tile" -#: collective/cover/tiles/base.py:136 +#: collective/cover/tiles/base.py:138 msgid "You are not allowed to remove content of this tile" msgstr "Você não tem permissão para apagar conteúdo neste tile" @@ -363,25 +373,24 @@ msgid "collective.cover uninstall" msgstr "Desintalação do collective.cover" #. Default: "Also known as keywords, tags or labels, these help you categorize your content." -#: collective/cover/tiles/basic.py:52 +#: collective/cover/tiles/basic.py:55 msgid "help_categories" -msgstr "" -"Tambem conhecido como palavras chaves, tags ou etiquetas, ajudam a " -"categorizar o conteúdo." +msgstr "Tambem conhecido como palavras chaves, tags ou etiquetas, ajudam a categorizar o conteúdo." #. Default: "Categories" -#: collective/cover/tiles/basic.py:51 +#: collective/cover/tiles/basic.py:54 msgid "label_categories" msgstr "Categorias" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:31 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:31 msgid "more" msgstr "mais" -#: collective/cover/contentchooser_templates/content_contentchooser.pt:26 +#: collective/cover/browser/contentchooser_templates/content_contentchooser.pt:26 msgid "ok" msgstr "aceitar" #: collective/cover/layout_templates/groupselect.pt:18 msgid "save" msgstr "salvar" + diff --git a/src/collective/cover/tests/test_widget_preview.py b/src/collective/cover/tests/test_widget_preview.py new file mode 100644 index 000000000..ee4b9b896 --- /dev/null +++ b/src/collective/cover/tests/test_widget_preview.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +import json +import unittest2 as unittest + +from zope.component import getUtility + +from plone.app.testing import TEST_USER_ID + + +from Products.CMFCore.utils import getToolByName +from plone.app.testing import setRoles +from plone.registry.interfaces import IRegistry + +from collective.cover.testing import INTEGRATION_TESTING + +from collective.cover.widgets.selectpreview import SelectPreviewWidget +from collective.cover.controlpanel import ICoverSettings + + +class WidgetPreviewCase(unittest.TestCase): + layer = INTEGRATION_TESTING + + def setUp(self): + self.portal = self.layer['portal'] + self.request = self.layer['request'] + + def test_layout_structure(self): + portal = self.portal + ttool = getToolByName(self.portal, 'portal_types') + setRoles(self.portal, TEST_USER_ID, ['Manager']) + fti = ttool.getTypeInfo("Document") + obj = fti.constructInstance(portal, "test1") + + widget = SelectPreviewWidget(self.portal.REQUEST) + widget.context = obj + widget.id = 'test' + + registry = getUtility(IRegistry) + settings = registry.forInterface(ICoverSettings) + layouts = settings.layouts + sl = [] + + widget.simplify_layout(json.loads(layouts['Layout A']), sl) + + simplified_layout = [{'type': 'row', 'children': [{'type': 'group', 'children': [{'tile-type': u'collective.cover.carousel', 'type': 'tile'}], 'size': 16}]}, {'type': 'row', 'children': [{'type': 'group', 'children': [{'tile-type': u'collective.cover.list', 'type': 'tile'}], 'size': 8}, {'type': 'group', 'children': [{'tile-type': u'collective.cover.collection', 'type': 'tile'}], 'size': 8}]}, {'type': 'row', 'children': [{'type': 'group', 'children': [{'tile-type': u'collective.cover.basic', 'type': 'tile'}], 'size': 5}, {'type': 'group', 'children': [{'tile-type': u'collective.cover.basic', 'type': 'tile'}], 'size': 5}, {'type': 'group', 'children': [{'tile-type': u'collective.cover.basic', 'type': 'tile'}], 'size': 5}]}] + + self.assertEqual(sl, simplified_layout) diff --git a/src/collective/cover/widgets/selectpreview_input.pt b/src/collective/cover/widgets/selectpreview_input.pt index 005beb0ac..a4ff0aa33 100644 --- a/src/collective/cover/widgets/selectpreview_input.pt +++ b/src/collective/cover/widgets/selectpreview_input.pt @@ -1,5 +1,7 @@
@@ -69,10 +71,10 @@
- Layout Details + Layout Details