Updated labels
authorThierry Florac <thierry.florac@onf.fr>
Fri, 30 Nov 2018 12:31:21 +0100
changeset 1141 a033c4cad074
parent 1140 1df391914ba5
child 1142 d201a33692e2
Updated labels
src/pyams_content/component/paragraph/interfaces/html.py
src/pyams_content/component/paragraph/zmi/html.py
--- a/src/pyams_content/component/paragraph/interfaces/html.py	Thu Nov 29 15:35:49 2018 +0100
+++ b/src/pyams_content/component/paragraph/interfaces/html.py	Fri Nov 30 12:31:21 2018 +0100
@@ -12,15 +12,10 @@
 
 __docformat__ = 'restructuredtext'
 
+from zope.schema import Choice
 
-# import standard library
-
-# import interfaces
 from pyams_content.component.paragraph.interfaces import IBaseParagraph
-
-# import packages
 from pyams_i18n.schema import I18nHTMLField, I18nTextField
-from zope.schema import Choice
 
 from pyams_content import _
 
@@ -30,19 +25,19 @@
 #
 
 RAW_PARAGRAPH_TYPE = 'raw'
-RAW_PARAGRAPH_NAME = _("Raw HTML ")
+RAW_PARAGRAPH_NAME = _("Raw source")
 RAW_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.raw.renderers'
 
 
 class IRawParagraph(IBaseParagraph):
     """Raw HTML paragraph interface"""
 
-    body = I18nTextField(title=_("Raw HTML code"),
-                         description=_("This HTML code will be used 'as is', without any transformation. Use with "
-                                       "care!!"),
+    body = I18nTextField(title=_("Source code"),
+                         description=_("This code will be used 'as is', without any transformation, if using the "
+                                       "'raw' renderer. Use with care!!"),
                          required=False)
 
-    renderer = Choice(title=_("Raw HTML code template"),
+    renderer = Choice(title=_("Source code template"),
                       description=_("Presentation template used for this paragraph"),
                       vocabulary=RAW_PARAGRAPH_RENDERERS,
                       default='default')
--- a/src/pyams_content/component/paragraph/zmi/html.py	Thu Nov 29 15:35:49 2018 +0100
+++ b/src/pyams_content/component/paragraph/zmi/html.py	Fri Nov 30 12:31:21 2018 +0100
@@ -57,7 +57,7 @@
 @viewlet_config(name='add-raw-paragraph.divider', context=IParagraphContainerTarget, view=IParagraphContainerView,
                 layer=IPyAMSLayer, manager=IToolbarAddingMenu, weight=990)
 class RawParagraphAddMenuDivider(ProtectedFormObjectMixin, MenuDivider):
-    """Raw paragraph add menu divider"""
+    """Source code paragraph add menu divider"""
 
     def __new__(cls, context, request, view, manager):
         settings = get_parent(context, IParagraphFactorySettings)
@@ -69,9 +69,9 @@
 @viewlet_config(name='add-raw-paragraph.menu', context=IParagraphContainerTarget, view=IParagraphContainerView,
                 layer=IPyAMSLayer, manager=IToolbarAddingMenu, weight=999)
 class RawParagraphAddMenu(BaseParagraphAddMenu):
-    """Raw HTML paragraph add menu"""
+    """Source code paragraph add menu"""
 
-    label = _("Raw HTML...")
+    label = _("Source code...")
     label_css_class = 'fa fa-fw ' + RawParagraph.icon_class
     url = 'add-raw-paragraph.html'
     paragraph_type = RAW_PARAGRAPH_TYPE
@@ -82,9 +82,9 @@
 @ajax_config(name='add-raw-paragraph.json', context=IParagraphContainerTarget, layer=IPyAMSLayer,
              base=BaseParagraphAJAXAddForm)
 class RawParagraphAddForm(AdminDialogAddForm):
-    """Raw HTML paragraph add form"""
+    """Source code paragraph add form"""
 
-    legend = _("Add new raw HTML paragraph")
+    legend = _("Add new source code paragraph")
     dialog_class = 'modal-large'
     icon_css_class = 'fa fa-fw ' + RawParagraph.icon_class
     label_css_class = 'control-label col-md-2'
@@ -96,7 +96,7 @@
     def updateWidgets(self, prefix=None):
         super(RawParagraphAddForm, self).updateWidgets(prefix)
         if 'body' in self.widgets:
-            self.widgets['body'].widget_css_class = 'input height-100'
+            self.widgets['body'].widget_css_class = 'monospace input height-200'
 
     def create(self, data):
         return RawParagraph()
@@ -110,11 +110,11 @@
 @ajax_config(name='properties.json', context=IRawParagraph, layer=IPyAMSLayer,
              base=BaseParagraphAJAXEditForm)
 class RawParagraphPropertiesEditForm(BaseParagraphPropertiesEditForm):
-    """Raw HTML paragraph properties edit form"""
+    """Source code paragraph properties edit form"""
 
     prefix = 'raw_properties.'
 
-    legend = _("Edit raw HTML paragraph properties")
+    legend = _("Edit source code paragraph properties")
     icon_css_class = 'fa fa-fw ' + RawParagraph.icon_class
 
     fields = field.Fields(IRawParagraph).omit(*PARAGRAPH_HIDDEN_FIELDS)
@@ -125,7 +125,7 @@
     def updateWidgets(self, prefix=None):
         super(RawParagraphPropertiesEditForm, self).updateWidgets(prefix)
         if 'body' in self.widgets:
-            self.widgets['body'].widget_css_class = 'input height-100'
+            self.widgets['body'].widget_css_class = 'monospace input height-200'
 
 
 @adapter_config(context=(IRawParagraph, IPyAMSLayer), provides=IParagraphInnerEditor)
@@ -133,7 +133,7 @@
              base=BaseParagraphAJAXEditForm)
 @implementer(IInnerForm)
 class RawParagraphInnerEditForm(RawParagraphPropertiesEditForm):
-    """Raw HTML paragraph inner edit form"""
+    """Source code paragraph inner edit form"""
 
     legend = None