# HG changeset patch # User Thierry Florac # Date 1521016896 -3600 # Node ID d925ee5950b31b9f6707904d82c3f3c3b09d8c8b # Parent 2f54fa9f293554abd15163ea1ce8ce68fc38f3a3 Added pictograms paragraph diff -r 2f54fa9f2935 -r d925ee5950b3 src/pyams_content/component/paragraph/interfaces/pictogram.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/component/paragraph/interfaces/pictogram.py Wed Mar 14 09:41:36 2018 +0100 @@ -0,0 +1,89 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.component.paragraph.interfaces import IBaseParagraph +from pyams_content.features.renderer.interfaces import IRenderedContent +from pyams_content.interfaces.container import IOrderedContainer +from pyams_content.reference.pictograms.interfaces import SELECTED_PICTOGRAM_VOCABULARY +from zope.annotation import IAttributeAnnotatable + +# import packages +from pyams_i18n.schema import I18nTextLineField, I18nTextField +from zope.container.constraints import containers, contains +from zope.interface import Interface, Attribute +from zope.schema import Bool, Choice + +from pyams_content import _ + + +PICTOGRAM_CONTAINER_KEY = 'pyams_content.pictograms' + + +class IPictogramItem(IAttributeAnnotatable): + """Pictogram item interface""" + + containers('.IPictogramContainer') + + visible = Bool(title=_("Visible?"), + description=_("Is this pictogram visible in front-office?"), + required=True, + default=True) + + pictogram_name = Choice(title=_("Pictogram"), + description=_("Name of the pictogram to select"), + required=True, + vocabulary=SELECTED_PICTOGRAM_VOCABULARY) + + pictogram = Attribute("Select pictogram object") + + label = I18nTextLineField(title=_("Label"), + description=_("Associated pictogram label"), + required=False) + + body = I18nTextField(title=_("Associated text"), + description=_("Additional text associated to this pictogram"), + required=False) + + +class IPictogramContainer(IOrderedContainer): + """Pictogram items container interface""" + + contains(IPictogramItem) + + def append(self, value, notify=True): + """Append given pictogram item to container""" + + def get_visible_items(self): + """Get list of visible pictogram items""" + + +class IPictogramContainerTarget(Interface): + """Pictogram container target interface""" + + +PICTOGRAM_PARAGRAPH_TYPE = 'Pictograms' +PICTOGRAM_PARAGRAPH_RENDERERS = 'MyAMS.pictograms.renderers' + + +class IPictogramParagraph(IPictogramContainerTarget, IRenderedContent, IBaseParagraph): + """Pictograms paragraph interface""" + + renderer = Choice(title=_("Pictograms template"), + description=_("Presentation template used for pictograms"), + vocabulary=PICTOGRAM_PARAGRAPH_RENDERERS, + default='default') diff -r 2f54fa9f2935 -r d925ee5950b3 src/pyams_content/component/paragraph/pictogram.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/component/paragraph/pictogram.py Wed Mar 14 09:41:36 2018 +0100 @@ -0,0 +1,277 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library +from persistent import Persistent + +# import interfaces +from pyams_content.component.illustration import IIllustrationTarget +from pyams_content.component.paragraph import IParagraphFactory +from pyams_content.component.paragraph.interfaces.pictogram import IPictogramItem, IPictogramContainerTarget, \ + IPictogramContainer, PICTOGRAM_CONTAINER_KEY, IPictogramParagraph, PICTOGRAM_PARAGRAPH_TYPE, \ + PICTOGRAM_PARAGRAPH_RENDERERS +from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE, ERROR_VALUE +from pyams_content.features.renderer.interfaces import IContentRenderer +from pyams_content.reference.pictograms.interfaces import IPictogramTable +from pyams_form.interfaces.form import IFormContextPermissionChecker +from pyams_i18n.interfaces import II18n, II18nManager, INegotiator +from zope.annotation import IAnnotations +from zope.lifecycleevent import IObjectAddedEvent, ObjectModifiedEvent, ObjectCreatedEvent +from zope.location.interfaces import ISublocations +from zope.traversing.interfaces import ITraversable + +# import packages +from pyams_catalog.utils import index_object +from pyams_content.component.paragraph import BaseParagraph, BaseParagraphFactory, BaseParagraphContentChecker +from pyams_content.features.checker import BaseContentChecker +from pyams_content.features.renderer import RenderedContentMixin +from pyams_utils.adapter import adapter_config, ContextAdapter +from pyams_utils.registry import query_utility, get_current_registry, get_utility, utility_config +from pyams_utils.request import check_request +from pyams_utils.traversing import get_parent +from pyams_utils.vocabulary import vocabulary_config +from pyams_utils.zodb import volatile_property +from pyramid.events import subscriber +from zope.container.contained import Contained +from zope.container.ordered import OrderedContainer +from zope.interface import implementer +from zope.location import locate +from zope.schema.fieldproperty import FieldProperty +from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm + +from pyams_content import _ + + +# +# Pictogram item class and adapters +# + +@implementer(IPictogramItem) +class PictogramItem(Persistent, Contained): + """Pictogram item persistent class""" + + visible = FieldProperty(IPictogramItem['visible']) + _pictogram_name = FieldProperty(IPictogramItem['pictogram_name']) + label = FieldProperty(IPictogramItem['label']) + body = FieldProperty(IPictogramItem['body']) + + @property + def pictogram_name(self): + return self._pictogram_name + + @pictogram_name.setter + def pictogram_name(self, value): + if value != self._pictogram_name: + self._pictogram_name = value + del self.pictogram + + @volatile_property + def pictogram(self): + table = query_utility(IPictogramTable) + return table.get(self.pictogram_name) + + +@adapter_config(context=IPictogramItem, provides=IFormContextPermissionChecker) +def PictogramItemPermissionChecker(context): + """Pictogram item permission checker""" + content = get_parent(context, IPictogramContainerTarget) + return IFormContextPermissionChecker(content) + + +@subscriber(IObjectAddedEvent, context_selector=IPictogramItem) +def handle_added_pictogram_item(event): + """Handle added pictogram item""" + content = get_parent(event.object, IPictogramContainerTarget) + if content is not None: + get_current_registry().notify(ObjectModifiedEvent(content)) + + +@adapter_config(context=IPictogramItem, provides=IContentChecker) +class PictogramItemContentChecker(BaseContentChecker): + """Pictogram item content checker""" + + @property + def label(self): + request = check_request() + return II18n(self.context).query_attribute('title', request=request) + + def inner_check(self, request): + output = [] + translate = request.localizer.translate + manager = get_parent(self.context, II18nManager) + if manager is not None: + langs = manager.get_languages() + else: + negotiator = get_utility(INegotiator) + langs = (negotiator.server_language, ) + i18n = II18n(self.context) + for lang in langs: + for attr in ('label', 'body'): + value = i18n.get_attribute(attr, lang, request) + if not value: + field_title = translate(IPictogramItem[attr].title) + if len(langs) == 1: + output.append(translate(MISSING_VALUE).format(field=field_title)) + else: + output.append(translate(MISSING_LANG_VALUE).format(field=field_title, lang=lang)) + field_title = translate(IPictogramItem['pictogram_name'].title) + if not self.context.pictogram_name: + output.append(translate(MISSING_VALUE).format(field=field_title)) + else: + pictogram = self.context.pictogram + if pictogram is None: + output.append(translate(ERROR_VALUE).format(field=field_title, + message=translate(_("Selected pictogram is missing")))) + return output + + +# +# Pictogram container classes and adapters +# + +@implementer(IPictogramContainer) +class PictogramContainer(OrderedContainer): + """Pictogram item container""" + + last_id = 1 + + def append(self, value, notify=True): + key = str(self.last_id) + if not notify: + # pre-locate pictogram item to avoid multiple notifications + locate(value, self, key) + self[key] = value + self.last_id += 1 + if not notify: + # make sure that pictogram item is correctly indexed + index_object(value) + + def get_visible_items(self): + return filter(lambda x: IPictogramItem(x).visible, self.values()) + + +@adapter_config(context=IPictogramContainerTarget, provides=IPictogramContainer) +def pictogram_container_factory(target): + """Pictogram container factory""" + annotations = IAnnotations(target) + container = annotations.get(PICTOGRAM_CONTAINER_KEY) + if container is None: + container = annotations[PICTOGRAM_CONTAINER_KEY] = PictogramContainer() + get_current_registry().notify(ObjectCreatedEvent(container)) + locate(container, target, '++pictos++') + return container + + +@adapter_config(name='pictos', context=IPictogramContainerTarget, provides=ITraversable) +class PictogramContainerNamespace(ContextAdapter): + """Pictogram container ++pictos++ namespace""" + + def traverse(self, name, furtherpath=None): + return IPictogramContainer(self.context) + + +@adapter_config(name='pictograms', context=IPictogramContainerTarget, provides=ISublocations) +class PictogramContainerSublocations(ContextAdapter): + """Pictogram container sub-locations adapter""" + + def sublocations(self): + return IPictogramContainer(self.context).values() + + +@adapter_config(name='pictograms', context=IPictogramContainerTarget, provides=IContentChecker) +class PictogramContainerContentChecker(BaseContentChecker): + """Pictogram container content checker""" + + label = _("Pictograms") + sep = '\n' + weight = 210 + + def inner_check(self, request): + output = [] + registry = request.registry + for pictogram in IPictogramContainer(self.context).values(): + if not pictogram.visible: + continue + for name, checker in sorted(registry.getAdapters((pictogram, ), IContentChecker), + key=lambda x: x[1].weight): + output.append('- {0} :'.format(II18n(pictogram).query_attribute('title', request=request))) + output.append(checker.get_check_output(request)) + return output + + +@implementer(IPictogramParagraph, IIllustrationTarget) +class PictogramParagraph(RenderedContentMixin, BaseParagraph): + """Pictograms paragraph""" + + icon_class = 'fa-paint-brush' + icon_hint = _("Pictograms") + + renderer = FieldProperty(IPictogramParagraph['renderer']) + + +@utility_config(name=PICTOGRAM_PARAGRAPH_TYPE, provides=IParagraphFactory) +class PictogramParagraphFactory(BaseParagraphFactory): + """Pictograms paragraph factory""" + + name = _("Pictograms paragraph") + content_type = PictogramParagraph + + +@adapter_config(context=IPictogramParagraph, provides=IContentChecker) +class PictogramParagraphContentChecker(BaseParagraphContentChecker): + """Pictograms paragraph content checker""" + + @property + def label(self): + request = check_request() + translate = request.localizer.translate + return II18n(self.context).query_attribute('title', request) or \ + '({0})'.format(translate(self.context.icon_hint).lower()) + + def inner_check(self, request): + output = [] + translate = request.localizer.translate + manager = get_parent(self.context, II18nManager) + if manager is not None: + langs = manager.get_languages() + else: + negotiator = get_utility(INegotiator) + langs = (negotiator.server_language, ) + i18n = II18n(self.context) + for lang in langs: + value = i18n.get_attribute('title', lang, request) + if not value: + field_title = translate(IPictogramParagraph['title'].title) + if len(langs) == 1: + output.append(translate(MISSING_VALUE).format(field=field_title)) + else: + output.append(translate(MISSING_LANG_VALUE).format(field=field_title, lang=lang)) + return output + + +@vocabulary_config(name=PICTOGRAM_PARAGRAPH_RENDERERS) +class PictogramParagraphRendererVocabulary(SimpleVocabulary): + """Pictograms paragraph renderers vocabulary""" + + def __init__(self, context=None): + request = check_request() + translate = request.localizer.translate + registry = request.registry + if not IPictogramParagraph.providedBy(context): + context = PictogramParagraph() + terms = [SimpleTerm(name, title=translate(adapter.label)) + for name, adapter in sorted(registry.getAdapters((context, request), IContentRenderer), + key=lambda x: x[1].weight)] + super(PictogramParagraphRendererVocabulary, self).__init__(terms) diff -r 2f54fa9f2935 -r d925ee5950b3 src/pyams_content/component/paragraph/zmi/pictogram.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/component/paragraph/zmi/pictogram.py Wed Mar 14 09:41:36 2018 +0100 @@ -0,0 +1,490 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library +import json + +# import interfaces +from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphContainer, \ + IParagraphPreview +from pyams_content.component.paragraph.interfaces.pictogram import PICTOGRAM_PARAGRAPH_TYPE, IPictogramParagraph, \ + IPictogramContainer, IPictogramContainerTarget, IPictogramItem +from pyams_content.component.paragraph.zmi import IParagraphContainerView +from pyams_content.component.paragraph.zmi.interfaces import IParagraphInnerEditor +from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION +from pyams_content.shared.common import IWfSharedContent +from pyams_form.interfaces.form import IInnerForm, IEditFormButtons, IInnerSubForm +from pyams_i18n.interfaces import II18n +from pyams_skin.interfaces.viewlet import IToolbarAddingMenu, IWidgetTitleViewletManager +from pyams_skin.layer import IPyAMSLayer +from pyams_utils.interfaces import MANAGE_PERMISSION +from pyams_zmi.interfaces import IPropertiesEditForm +from z3c.form.interfaces import INPUT_MODE +from z3c.table.interfaces import IValues, IColumn + +# import packages +from pyams_content.component.paragraph.pictogram import PictogramParagraph, PictogramItem +from pyams_content.component.paragraph.zmi import BaseParagraphAddMenu, BaseParagraphAJAXAddForm, \ + BaseParagraphPropertiesEditForm, BaseParagraphAJAXEditForm +from pyams_content.features.renderer.zmi import BaseRenderedContentPreview +from pyams_content.features.renderer.zmi.widget import RendererFieldWidget +from pyams_content.skin import pyams_content +from pyams_form.form import AJAXAddForm, AJAXEditForm +from pyams_form.security import ProtectedFormObjectMixin +from pyams_i18n.column import I18nAttrColumn +from pyams_pagelet.pagelet import pagelet_config +from pyams_skin.table import BaseTable, SorterColumn, JsActionColumn, I18nColumn, TrashColumn +from pyams_skin.viewlet.toolbar import ToolbarAction +from pyams_template.template import template_config +from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter +from pyams_utils.fanstatic import get_resource_path +from pyams_utils.text import get_text_start +from pyams_utils.traversing import get_parent +from pyams_utils.url import absolute_url +from pyams_viewlet.viewlet import viewlet_config +from pyams_zmi.form import AdminDialogAddForm, InnerAdminDisplayForm, AdminDialogEditForm +from pyramid.decorator import reify +from pyramid.exceptions import NotFound +from pyramid.view import view_config +from z3c.form import field, button +from z3c.table.column import GetAttrColumn +from zope.interface import implementer, Interface + +from pyams_content import _ + + +class IPictogramsView(Interface): + """Pictograms view marker interface""" + + +class IPictogramsParentForm(Interface): + """Pictograms parent form marker interface""" + + +@viewlet_config(name='add-pictogram-paragraph.menu', context=IParagraphContainerTarget, view=IParagraphContainerView, + layer=IPyAMSLayer, manager=IToolbarAddingMenu, weight=590) +class PictogramParagraphAddMenu(BaseParagraphAddMenu): + """Pictogram paragraph add menu""" + + label = _("Pictograms...") + label_css_class = 'fa fa-fw fa-paint-brush' + url = 'add-pictogram-paragraph.html' + paragraph_type = PICTOGRAM_PARAGRAPH_TYPE + + +@pagelet_config(name='add-pictogram-paragraph.html', context=IParagraphContainerTarget, layer=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION) +class PictogramParagraphAddForm(AdminDialogAddForm): + """Pictogram paragraph add form""" + + legend = _("Add new pictogram paragraph") + icon_css_class = 'fa fa-fw fa-paint-brush' + + fields = field.Fields(IPictogramParagraph).select('title', 'renderer') + ajax_handler = 'add-pictogram-paragraph.json' + edit_permission = MANAGE_CONTENT_PERMISSION + + def create(self, data): + return PictogramParagraph() + + def add(self, object): + IParagraphContainer(self.context).append(object) + + +@view_config(name='add-pictogram-paragraph.json', context=IParagraphContainerTarget, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +class PictogramParagraphAJAXAddForm(BaseParagraphAJAXAddForm, PictogramParagraphAddForm): + """Pictogram paragraph add form, JSON renderer""" + + +@pagelet_config(name='properties.html', context=IPictogramParagraph, layer=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION) +class PictogramParagraphPropertiesEditForm(BaseParagraphPropertiesEditForm): + """Pictogram paragraph properties edit form""" + + @property + def title(self): + content = get_parent(self.context, IWfSharedContent) + return II18n(content).query_attribute('title', request=self.request) + + legend = _("Edit pictogram paragraph properties") + icon_css_class = 'fa fa-fw fa-paint-brush' + + fields = field.Fields(IPictogramParagraph).select('title', 'renderer') + fields['renderer'].widgetFactory = RendererFieldWidget + + ajax_handler = 'properties.json' + edit_permission = MANAGE_CONTENT_PERMISSION + + +@view_config(name='properties.json', context=IPictogramParagraph, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +class PictogramParagraphPropertiesAJAXEditForm(BaseParagraphAJAXEditForm, PictogramParagraphPropertiesEditForm): + """Pictogram paragraph properties edit form, JSON renderer""" + + +@adapter_config(context=(IPictogramParagraph, IPyAMSLayer), provides=IParagraphInnerEditor) +@implementer(IInnerForm, IPropertiesEditForm, IPictogramsParentForm) +class PictogramParagraphInnerEditForm(PictogramParagraphPropertiesEditForm): + """Pictogram paragraph inner edit form""" + + legend = None + ajax_handler = 'inner-properties.json' + + @property + def buttons(self): + if self.mode == INPUT_MODE: + return button.Buttons(IEditFormButtons) + else: + return button.Buttons() + + +@view_config(name='inner-properties.json', context=IPictogramParagraph, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +class PictogramParagraphInnerAJAXEditForm(BaseParagraphAJAXEditForm, PictogramParagraphInnerEditForm): + """Pictograms paragraph inner edit form, JSON renderer""" + + def get_ajax_output(self, changes): + output = super(PictogramParagraphInnerAJAXEditForm, self).get_ajax_output(changes) + updated = changes.get(IPictogramParagraph, ()) + if 'renderer' in updated: + form = PictogramParagraphInnerEditForm(self.context, self.request) + form.update() + output.setdefault('events', []).append({ + 'event': 'myams.refresh', + 'options': { + 'object_id': '{0}_{1}_{2}'.format( + self.context.__class__.__name__, + getattr(form.getContent(), '__name__', 'noname').replace('++', ''), + form.id), + 'content': form.render() + } + }) + return output + + +# +# Pictogram paragraph preview +# + +@adapter_config(context=(IPictogramParagraph, IPyAMSLayer), provides=IParagraphPreview) +class PictogramParagraphPreview(BaseRenderedContentPreview): + """Pictogram paragraph preview""" + + +# +# Pictogram items table view +# + +class PictogramsTable(ProtectedFormObjectMixin, BaseTable): + """Pictograms view inner table""" + + @property + def id(self): + return 'pictograms_{0}_list'.format(self.context.__name__) + + hide_header = True + sortOn = None + + @property + def cssClasses(self): + classes = ['table', 'table-bordered', 'table-striped', 'table-hover', 'table-tight'] + permission = self.permission + if (not permission) or self.request.has_permission(permission, self.context): + classes.append('table-dnd') + return {'table': ' '.join(classes)} + + @property + def data_attributes(self): + attributes = super(PictogramsTable, self).data_attributes + attributes['table'] = { + 'id': self.id, + 'data-ams-plugins': 'pyams_content', + 'data-ams-plugin-pyams_content-src': get_resource_path(pyams_content), + 'data-ams-location': absolute_url(IPictogramContainer(self.context), self.request), + 'data-ams-tablednd-drag-handle': 'td.sorter', + 'data-ams-tablednd-drop-target': 'set-pictograms-order.json' + } + attributes.setdefault('tr', {}).update({ + 'id': lambda x, col: 'pictogram_{0}::{1}'.format(get_parent(x, IPictogramContainerTarget).__name__, + x.__name__), + 'data-ams-delete-target': 'delete-pictogram.json' + }) + return attributes + + @reify + def values(self): + return list(super(PictogramsTable, self).values) + + +@adapter_config(context=(IPictogramContainerTarget, IPyAMSLayer, PictogramsTable), provides=IValues) +class PictogramsTableValuesAdapter(ContextRequestViewAdapter): + """Pictograms table values adapter""" + + @property + def values(self): + return IPictogramContainer(self.context).values() + + +@adapter_config(name='sorter', context=(IPictogramContainerTarget, IPyAMSLayer, PictogramsTable), provides=IColumn) +class PictogramsTableSorterColumn(ProtectedFormObjectMixin, SorterColumn): + """Pictograms table sorter column""" + + +@view_config(name='set-pictograms-order.json', context=IPictogramContainer, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +def set_pictograms_order(request): + """Update pictograms order""" + order = list(map(str, json.loads(request.params.get('names')))) + request.context.updateOrder(order) + return {'status': 'success'} + + +@adapter_config(name='image', context=(IPictogramContainerTarget, IPyAMSLayer, PictogramsTable), provides=IColumn) +class PictogramsTableImageColumn(GetAttrColumn): + """Pictogram image column""" + + header = '' + weight = 3 + + cssClasses = {'td': 'text-center width-50'} + dt_sortable = 'false' + + def getValue(self, obj): + pictogram = obj.pictogram + if pictogram is not None: + image = II18n(pictogram).query_attribute('image', request=self.request) + if image: + return ''.format(absolute_url(image, self.request, '++thumb++32x32')) + return '--' + + +@adapter_config(name='show-hide', context=(IPictogramContainerTarget, IPyAMSLayer, PictogramsTable), + provides=IColumn) +class PictogramsTableShowHideColumn(ProtectedFormObjectMixin, JsActionColumn): + """Pictograms container visibility switcher column""" + + cssClasses = {'th': 'action', + 'td': 'action switcher'} + + icon_class = 'fa fa-fw fa-eye' + icon_hint = _("Switch pictogram visibility") + + url = 'PyAMS_content.pictograms.switchVisibility' + + weight = 5 + + def get_icon(self, item): + if item.visible: + icon_class = 'fa fa-fw fa-eye' + else: + icon_class = 'fa fa-fw fa-eye-slash text-danger' + return ''.format(icon_class=icon_class) + + def renderCell(self, item): + if self.permission and not self.request.has_permission(self.permission, context=item): + return self.get_icon(item) + else: + return super(PictogramsTableShowHideColumn, self).renderCell(item) + + +@view_config(name='set-pictogram-visibility.json', context=IPictogramContainer, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +def set_pictogram_visibility(request): + """Set pictogram visibility""" + container = IPictogramContainer(request.context) + pictogram = container.get(str(request.params.get('object_name'))) + if pictogram is None: + raise NotFound() + pictogram.visible = not pictogram.visible + return {'visible': pictogram.visible} + + +@adapter_config(name='name', context=(IPictogramContainerTarget, IPyAMSLayer, PictogramsTable), provides=IColumn) +class PictogramsTableNameColumn(I18nColumn, I18nAttrColumn): + """Pictograms table name column""" + + _header = _("Label") + attrName = 'label' + weight = 10 + + +@adapter_config(name='body', context=(IPictogramContainerTarget, IPyAMSLayer, PictogramsTable), provides=IColumn) +class PictogramsTableBodyColumn(I18nColumn, I18nAttrColumn): + """Pictograms table body column""" + + _header = _("Body") + attrName = 'body' + weight = 20 + + def getValue(self, obj): + value = super(PictogramsTableBodyColumn, self).getValue(obj) + if not value: + return '--' + return get_text_start(value, 40, 10) + + +@adapter_config(name='trash', context=(IPictogramContainerTarget, IPyAMSLayer, PictogramsTable), provides=IColumn) +class PictogramsTableTrashColumn(ProtectedFormObjectMixin, TrashColumn): + """Pictograms table trash column""" + + +@view_config(name='delete-pictogram.json', context=IPictogramContainer, request_type=IPyAMSLayer, + permission=MANAGE_PERMISSION, renderer='json', xhr=True) +def delete_pictogram(request): + """Delete pictogram""" + translate = request.localizer.translate + name = request.params.get('object_name') + if not name: + return { + 'status': 'message', + 'messagebox': { + 'status': 'error', + 'content': translate(_("No provided object_name argument!")) + } + } + if name not in request.context: + return { + 'status': 'message', + 'messagebox': { + 'status': 'error', + 'content': translate(_("Given association name doesn't exist!")) + } + } + del request.context[name] + return {'status': 'success'} + + +@adapter_config(name='pictograms', context=(IPictogramContainerTarget, IPyAMSLayer, IPictogramsParentForm), + provides=IInnerSubForm) +@template_config(template='templates/pictograms.pt', layer=IPyAMSLayer) +@implementer(IPictogramsView) +class PictogramsView(InnerAdminDisplayForm): + """Pictograms view""" + + fields = field.Fields(Interface) + weight = 100 + + def __init__(self, context, request, view): + super(PictogramsView, self).__init__(context, request, view) + self.table = PictogramsTable(context, request) + self.table.view = self + + def update(self): + super(PictogramsView, self).update() + self.table.update() + + +# +# Pictograms forms +# + +@viewlet_config(name='add-pictogram.action', context=IPictogramContainerTarget, layer=IPyAMSLayer, view=IPictogramsView, + manager=IWidgetTitleViewletManager, permission=MANAGE_CONTENT_PERMISSION, weight=1) +class PictogramAddAction(ToolbarAction): + """Pictogram add action""" + + label = _("Add pictogram") + label_css_class = 'fa fa-fw fa-plus' + url = 'add-pictogram.html' + modal_target = True + + +@pagelet_config(name='add-pictogram.html', context=IPictogramContainerTarget, layer=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION) +class PictogramAddForm(AdminDialogAddForm): + """Pictogram add form""" + + legend = _("Add new pictogram") + icon_css_class = 'fa fa-fw fa-arrow-h' + + fields = field.Fields(IPictogramItem).omit('__parent__', '__name__', 'visible') + ajax_handler = 'add-pictogram.json' + edit_permission = MANAGE_CONTENT_PERMISSION + + def updateWidgets(self, prefix=None): + super(PictogramAddForm, self).updateWidgets(prefix) + if 'body' in self.widgets: + self.widgets['body'].widget_css_class = 'textarea' + + def create(self, data): + return PictogramItem() + + def add(self, object): + IPictogramContainer(self.context).append(object) + + +@view_config(name='add-pictogram.json', context=IPictogramContainerTarget, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +class PictogramAJAXAddForm(AJAXAddForm, PictogramAddForm): + """Pictogram add form, JSON renderer""" + + def get_ajax_output(self, changes): + table = PictogramsTable(self.context, self.request) + table.update() + return { + 'status': 'success', + 'message': self.request.localizer.translate(_("Pictogram was correctly added")), + 'events': [{ + 'event': 'myams.refresh', + 'options': { + 'handler': 'PyAMS_content.pictograms.refreshPictograms', + 'object_id': table.id, + 'table': table.render() + } + }] + } + + +@pagelet_config(name='properties.html', context=IPictogramItem, layer=IPyAMSLayer, permission=MANAGE_CONTENT_PERMISSION) +class PictogramPropertiesEditForm(AdminDialogEditForm): + """Pictogram properties edit form""" + + legend = _("Edit pictogram properties") + icon_css_class = 'fa fa-fw fa-paint-brush' + + fields = field.Fields(IPictogramItem).omit('__parent__', '__name__', 'visible') + ajax_handler = 'properties.json' + edit_permission = MANAGE_CONTENT_PERMISSION + + def updateWidgets(self, prefix=None): + super(PictogramPropertiesEditForm, self).updateWidgets(prefix) + if 'body' in self.widgets: + self.widgets['body'].widget_css_class = 'textarea' + + +@view_config(name='properties.json', context=IPictogramItem, request_type=IPyAMSLayer, + permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) +class PictogramPropertiesAJAXEditForm(AJAXEditForm, PictogramPropertiesEditForm): + """Pictogram properties edit form, JSON renderer""" + + def get_ajax_output(self, changes): + output = super(PictogramPropertiesAJAXEditForm, self).get_ajax_output(changes) + updated = changes.get(IPictogramItem, ()) + if updated: + target = get_parent(self.context, IPictogramContainerTarget) + table = PictogramsTable(target, self.request) + table.update() + row = table.setUpRow(self.context) + output.setdefault('events', []).append({ + 'event': 'myams.refresh', + 'options': { + 'handler': 'MyAMS.skin.refreshRow', + 'object_id': 'pictogram_{0}::{1}'.format(target.__name__, + self.context.__name__), + 'row': table.renderRow(row) + } + }) + return output diff -r 2f54fa9f2935 -r d925ee5950b3 src/pyams_content/component/paragraph/zmi/templates/pictograms.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/component/paragraph/zmi/templates/pictograms.pt Wed Mar 14 09:41:36 2018 +0100 @@ -0,0 +1,14 @@ +
+
+ + Pictograms + +
+ +
+
+ +
+
diff -r 2f54fa9f2935 -r d925ee5950b3 src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo Binary file src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo has changed diff -r 2f54fa9f2935 -r d925ee5950b3 src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po --- a/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po Tue Mar 13 17:40:02 2018 +0100 +++ b/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po Wed Mar 14 09:41:36 2018 +0100 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2018-03-12 17:11+0100\n" +"POT-Creation-Date: 2018-03-14 09:14+0100\n" "PO-Revision-Date: 2015-09-10 10:42+0200\n" "Last-Translator: Thierry Florac \n" "Language-Team: French\n" @@ -109,6 +109,7 @@ #: src/pyams_content/component/gallery/zmi/file.py:258 #: src/pyams_content/component/paragraph/zmi/milestone.py:347 +#: src/pyams_content/component/paragraph/zmi/pictogram.py:355 #: src/pyams_content/component/association/zmi/__init__.py:288 #: src/pyams_content/shared/common/zmi/types.py:208 #: src/pyams_content/shared/common/zmi/types.py:457 @@ -329,7 +330,7 @@ #: src/pyams_content/component/extfile/__init__.py:240 #: src/pyams_content/shared/imagemap/interfaces/__init__.py:61 #: src/pyams_content/shared/logo/interfaces/__init__.py:42 -#: src/pyams_content/reference/pictograms/interfaces/__init__.py:33 +#: src/pyams_content/reference/pictograms/interfaces/__init__.py:44 msgid "Image" msgstr "Image" @@ -575,6 +576,20 @@ msgid "no visible paragraph" msgstr "aucun paragraphe visible" +#: src/pyams_content/component/paragraph/pictogram.py:197 +#: src/pyams_content/component/paragraph/pictogram.py:219 +#: src/pyams_content/component/paragraph/zmi/templates/pictograms.pt:6 +msgid "Pictograms" +msgstr "Pictogrammes" + +#: src/pyams_content/component/paragraph/pictogram.py:228 +msgid "Pictograms paragraph" +msgstr "Pictogrammes" + +#: src/pyams_content/component/paragraph/pictogram.py:136 +msgid "Selected pictogram is missing" +msgstr "le pictogramme sélectionné est introuvable" + #: src/pyams_content/component/paragraph/frame.py:52 msgid "Framed text" msgstr "Encadré" @@ -664,6 +679,7 @@ msgstr "Le jalon a été ajouté." #: src/pyams_content/component/paragraph/zmi/milestone.py:355 +#: src/pyams_content/component/paragraph/zmi/pictogram.py:363 #: src/pyams_content/component/association/zmi/__init__.py:292 msgid "Given association name doesn't exist!" msgstr "Le nom d'association indiqué n'existe pas !" @@ -776,6 +792,56 @@ "Vérifiez le paramétrage des types de paragraphes autorisés pour ajouter de " "nouveaux paragraphes." +#: src/pyams_content/component/paragraph/zmi/pictogram.py:81 +msgid "Pictograms..." +msgstr "Pictogrammes" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:92 +msgid "Add new pictogram paragraph" +msgstr "Ajout de pictogrammes" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:122 +msgid "Edit pictogram paragraph properties" +msgstr "Propriétés des pictogrammes" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:283 +msgid "Switch pictogram visibility" +msgstr "Cliquez pour rendre le paragraphe visible ou non" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:319 +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:54 +#: src/pyams_content/shared/common/interfaces/types.py:39 +#: src/pyams_content/shared/form/zmi/field.py:171 +#: src/pyams_content/shared/form/interfaces/__init__.py:57 +msgid "Label" +msgstr "Libellé" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:328 +#: src/pyams_content/component/paragraph/interfaces/video.py:41 +#: src/pyams_content/component/paragraph/interfaces/html.py:53 +#: src/pyams_content/component/video/interfaces/__init__.py:69 +msgid "Body" +msgstr "Contenu HTML" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:399 +#: src/pyams_content/reference/pictograms/zmi/__init__.py:56 +msgid "Add pictogram" +msgstr "Ajouter un pictogramme" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:410 +#: src/pyams_content/reference/pictograms/zmi/__init__.py:67 +msgid "Add new pictogram" +msgstr "Ajout d'un pictogramme" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:450 +#: src/pyams_content/reference/pictograms/zmi/__init__.py:94 +msgid "Edit pictogram properties" +msgstr "Propriétés du pictogramme" + +#: src/pyams_content/component/paragraph/zmi/pictogram.py:434 +msgid "Pictogram was correctly added" +msgstr "Le pictogramme a été ajouté." + #: src/pyams_content/component/paragraph/zmi/frame.py:84 msgid "Framed text..." msgstr "Encadré" @@ -855,6 +921,7 @@ #: src/pyams_content/component/paragraph/interfaces/milestone.py:41 #: src/pyams_content/component/paragraph/interfaces/__init__.py:43 +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:42 #: src/pyams_content/component/association/interfaces/__init__.py:43 #: src/pyams_content/shared/form/interfaces/__init__.py:82 #: src/pyams_content/shared/site/interfaces/__init__.py:95 @@ -931,12 +998,6 @@ msgstr "" "Liste des types de paragraphes ajoutés automatiquement aux nouveaux contenus" -#: src/pyams_content/component/paragraph/interfaces/video.py:41 -#: src/pyams_content/component/paragraph/interfaces/html.py:53 -#: src/pyams_content/component/video/interfaces/__init__.py:69 -msgid "Body" -msgstr "Contenu HTML" - #: src/pyams_content/component/paragraph/interfaces/video.py:53 msgid "Video file content" msgstr "" @@ -950,6 +1011,39 @@ msgid "Presentation template used for this video" msgstr "Mode de rendu utilisé par cette vidéo" +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:43 +msgid "Is this pictogram visible in front-office?" +msgstr "Si 'non', ce pictogramme ne sera pas présenté aux internautes" + +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:47 +#: src/pyams_content/shared/common/interfaces/types.py:67 +msgid "Pictogram" +msgstr "Pictogramme" + +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:48 +msgid "Name of the pictogram to select" +msgstr "Sélection du pictogramme à afficher" + +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:55 +msgid "Associated pictogram label" +msgstr "Libellé associé au pictogramme" + +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:58 +msgid "Associated text" +msgstr "Texte associé" + +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:59 +msgid "Additional text associated to this pictogram" +msgstr "Texte complémentaire associé à ce pictogramme" + +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:86 +msgid "Pictograms template" +msgstr "Mode de rendu" + +#: src/pyams_content/component/paragraph/interfaces/pictogram.py:87 +msgid "Presentation template used for pictograms" +msgstr "Modèle de présentation utilisé par ce paragraphe" + #: src/pyams_content/component/paragraph/interfaces/frame.py:40 msgid "Frame body" msgstr "Contenu" @@ -2544,12 +2638,6 @@ msgid "Name of this data type; must be unique between all data types" msgstr "Nom de ce type de donnée ; doit être unique entre tous les types" -#: src/pyams_content/shared/common/interfaces/types.py:39 -#: src/pyams_content/shared/form/zmi/field.py:171 -#: src/pyams_content/shared/form/interfaces/__init__.py:57 -msgid "Label" -msgstr "Libellé" - #: src/pyams_content/shared/common/interfaces/types.py:42 msgid "Navigation label" msgstr "Libellé de navigation" @@ -2605,10 +2693,6 @@ msgstr "" "Libellé utilisé pour afficher la prochaine date d'un événement pour ce type" -#: src/pyams_content/shared/common/interfaces/types.py:67 -msgid "Pictogram" -msgstr "Pictogramme" - #: src/pyams_content/shared/common/interfaces/types.py:68 msgid "Image associated to this data type" msgstr "Image associée à ce type" @@ -4094,22 +4178,28 @@ msgid "References" msgstr "Références" -#: src/pyams_content/reference/pictograms/zmi/__init__.py:56 -msgid "Add pictogram" -msgstr "Ajouter un pictogramme" - -#: src/pyams_content/reference/pictograms/zmi/__init__.py:67 -msgid "Add new pictogram" -msgstr "Ajout d'un pictogramme" - -#: src/pyams_content/reference/pictograms/zmi/__init__.py:94 -msgid "Edit pictogram properties" -msgstr "Propriétés du pictogramme" - -#: src/pyams_content/reference/pictograms/interfaces/__init__.py:34 +#: src/pyams_content/reference/pictograms/zmi/manager.py:51 +msgid "Pictograms selection..." +msgstr "Sélection de pictogrammes" + +#: src/pyams_content/reference/pictograms/zmi/manager.py:62 +#: src/pyams_content/reference/pictograms/zmi/templates/manager-selection.pt:26 +#: src/pyams_content/reference/pictograms/interfaces/__init__.py:65 +msgid "Selected pictograms" +msgstr "Pictogrammes sélectionnés" + +#: src/pyams_content/reference/pictograms/zmi/templates/manager-selection.pt:7 +msgid "Available pictograms" +msgstr "Pictogrammes disponibles" + +#: src/pyams_content/reference/pictograms/interfaces/__init__.py:45 msgid "Pictogram content" msgstr "Utilisez le bouton \"Parcourir\" pour modifier le contenu de l'image" +#: src/pyams_content/reference/pictograms/interfaces/__init__.py:66 +msgid "List of selected pictograms which will be available to shared contents" +msgstr "Liste des pictogrammes proposés dans les contenus partagés" + #: src/pyams_content/features/renderer/zmi/__init__.py:103 #: src/pyams_content/features/renderer/zmi/templates/renderer-input.pt:4 msgid "Edit renderer properties" @@ -4355,6 +4445,13 @@ msgid "Thank you." msgstr "Merci." +#~ msgid "" +#~ "This form allows you to select pictograms which will be available for " +#~ "selection into your shared contents." +#~ msgstr "" +#~ "Ce formulaire vous permet d'effectuer la sélection des pictogrammes qui " +#~ "seront disponibles pour être intégrés dans les contenus partagés." + #~ msgid "Default gallery renderer" #~ msgstr "Galerie par défaut" diff -r 2f54fa9f2935 -r d925ee5950b3 src/pyams_content/locales/pyams_content.pot --- a/src/pyams_content/locales/pyams_content.pot Tue Mar 13 17:40:02 2018 +0100 +++ b/src/pyams_content/locales/pyams_content.pot Wed Mar 14 09:41:36 2018 +0100 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2018-03-12 17:11+0100\n" +"POT-Creation-Date: 2018-03-14 09:14+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" @@ -110,6 +110,7 @@ #: ./src/pyams_content/component/gallery/zmi/file.py:258 #: ./src/pyams_content/component/paragraph/zmi/milestone.py:347 +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:355 #: ./src/pyams_content/component/association/zmi/__init__.py:288 #: ./src/pyams_content/shared/common/zmi/types.py:208 #: ./src/pyams_content/shared/common/zmi/types.py:457 @@ -316,7 +317,7 @@ #: ./src/pyams_content/component/extfile/__init__.py:240 #: ./src/pyams_content/shared/imagemap/interfaces/__init__.py:61 #: ./src/pyams_content/shared/logo/interfaces/__init__.py:42 -#: ./src/pyams_content/reference/pictograms/interfaces/__init__.py:33 +#: ./src/pyams_content/reference/pictograms/interfaces/__init__.py:44 msgid "Image" msgstr "" @@ -548,6 +549,20 @@ msgid "no visible paragraph" msgstr "" +#: ./src/pyams_content/component/paragraph/pictogram.py:197 +#: ./src/pyams_content/component/paragraph/pictogram.py:219 +#: ./src/pyams_content/component/paragraph/zmi/templates/pictograms.pt:6 +msgid "Pictograms" +msgstr "" + +#: ./src/pyams_content/component/paragraph/pictogram.py:228 +msgid "Pictograms paragraph" +msgstr "" + +#: ./src/pyams_content/component/paragraph/pictogram.py:136 +msgid "Selected pictogram is missing" +msgstr "" + #: ./src/pyams_content/component/paragraph/frame.py:52 msgid "Framed text" msgstr "" @@ -637,6 +652,7 @@ msgstr "" #: ./src/pyams_content/component/paragraph/zmi/milestone.py:355 +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:363 #: ./src/pyams_content/component/association/zmi/__init__.py:292 msgid "Given association name doesn't exist!" msgstr "" @@ -737,6 +753,56 @@ msgid "Check allowed paragraph types to be able to create new paragraphs." msgstr "" +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:81 +msgid "Pictograms..." +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:92 +msgid "Add new pictogram paragraph" +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:122 +msgid "Edit pictogram paragraph properties" +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:283 +msgid "Switch pictogram visibility" +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:319 +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:54 +#: ./src/pyams_content/shared/common/interfaces/types.py:39 +#: ./src/pyams_content/shared/form/zmi/field.py:171 +#: ./src/pyams_content/shared/form/interfaces/__init__.py:57 +msgid "Label" +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:328 +#: ./src/pyams_content/component/paragraph/interfaces/video.py:41 +#: ./src/pyams_content/component/paragraph/interfaces/html.py:53 +#: ./src/pyams_content/component/video/interfaces/__init__.py:69 +msgid "Body" +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:399 +#: ./src/pyams_content/reference/pictograms/zmi/__init__.py:56 +msgid "Add pictogram" +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:410 +#: ./src/pyams_content/reference/pictograms/zmi/__init__.py:67 +msgid "Add new pictogram" +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:450 +#: ./src/pyams_content/reference/pictograms/zmi/__init__.py:94 +msgid "Edit pictogram properties" +msgstr "" + +#: ./src/pyams_content/component/paragraph/zmi/pictogram.py:434 +msgid "Pictogram was correctly added" +msgstr "" + #: ./src/pyams_content/component/paragraph/zmi/frame.py:84 msgid "Framed text..." msgstr "" @@ -816,6 +882,7 @@ #: ./src/pyams_content/component/paragraph/interfaces/milestone.py:41 #: ./src/pyams_content/component/paragraph/interfaces/__init__.py:43 +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:42 #: ./src/pyams_content/component/association/interfaces/__init__.py:43 #: ./src/pyams_content/shared/form/interfaces/__init__.py:82 #: ./src/pyams_content/shared/site/interfaces/__init__.py:95 @@ -887,12 +954,6 @@ msgid "List of paragraphs automatically added to a new content" msgstr "" -#: ./src/pyams_content/component/paragraph/interfaces/video.py:41 -#: ./src/pyams_content/component/paragraph/interfaces/html.py:53 -#: ./src/pyams_content/component/video/interfaces/__init__.py:69 -msgid "Body" -msgstr "" - #: ./src/pyams_content/component/paragraph/interfaces/video.py:53 msgid "Video file content" msgstr "" @@ -905,6 +966,39 @@ msgid "Presentation template used for this video" msgstr "" +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:43 +msgid "Is this pictogram visible in front-office?" +msgstr "" + +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:47 +#: ./src/pyams_content/shared/common/interfaces/types.py:67 +msgid "Pictogram" +msgstr "" + +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:48 +msgid "Name of the pictogram to select" +msgstr "" + +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:55 +msgid "Associated pictogram label" +msgstr "" + +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:58 +msgid "Associated text" +msgstr "" + +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:59 +msgid "Additional text associated to this pictogram" +msgstr "" + +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:86 +msgid "Pictograms template" +msgstr "" + +#: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:87 +msgid "Presentation template used for pictograms" +msgstr "" + #: ./src/pyams_content/component/paragraph/interfaces/frame.py:40 msgid "Frame body" msgstr "" @@ -2408,12 +2502,6 @@ msgid "Name of this data type; must be unique between all data types" msgstr "" -#: ./src/pyams_content/shared/common/interfaces/types.py:39 -#: ./src/pyams_content/shared/form/zmi/field.py:171 -#: ./src/pyams_content/shared/form/interfaces/__init__.py:57 -msgid "Label" -msgstr "" - #: ./src/pyams_content/shared/common/interfaces/types.py:42 msgid "Navigation label" msgstr "" @@ -2464,10 +2552,6 @@ msgid "Label used to announce next date for this type" msgstr "" -#: ./src/pyams_content/shared/common/interfaces/types.py:67 -msgid "Pictogram" -msgstr "" - #: ./src/pyams_content/shared/common/interfaces/types.py:68 msgid "Image associated to this data type" msgstr "" @@ -3890,22 +3974,28 @@ msgid "References" msgstr "" -#: ./src/pyams_content/reference/pictograms/zmi/__init__.py:56 -msgid "Add pictogram" -msgstr "" - -#: ./src/pyams_content/reference/pictograms/zmi/__init__.py:67 -msgid "Add new pictogram" -msgstr "" - -#: ./src/pyams_content/reference/pictograms/zmi/__init__.py:94 -msgid "Edit pictogram properties" -msgstr "" - -#: ./src/pyams_content/reference/pictograms/interfaces/__init__.py:34 +#: ./src/pyams_content/reference/pictograms/zmi/manager.py:51 +msgid "Pictograms selection..." +msgstr "" + +#: ./src/pyams_content/reference/pictograms/zmi/manager.py:62 +#: ./src/pyams_content/reference/pictograms/zmi/templates/manager-selection.pt:26 +#: ./src/pyams_content/reference/pictograms/interfaces/__init__.py:65 +msgid "Selected pictograms" +msgstr "" + +#: ./src/pyams_content/reference/pictograms/zmi/templates/manager-selection.pt:7 +msgid "Available pictograms" +msgstr "" + +#: ./src/pyams_content/reference/pictograms/interfaces/__init__.py:45 msgid "Pictogram content" msgstr "" +#: ./src/pyams_content/reference/pictograms/interfaces/__init__.py:66 +msgid "List of selected pictograms which will be available to shared contents" +msgstr "" + #: ./src/pyams_content/features/renderer/zmi/__init__.py:103 #: ./src/pyams_content/features/renderer/zmi/templates/renderer-input.pt:4 msgid "Edit renderer properties"