Updated portal page interface
authorThierry Florac <thierry.florac@onf.fr>
Wed, 12 Jul 2017 12:19:53 +0200
changeset 36 c41baac58e21
parent 35 8b2e5695535a
child 37 8bdda8a34fa2
Updated portal page interface
src/pyams_portal/interfaces/__init__.py
--- a/src/pyams_portal/interfaces/__init__.py	Wed Jun 28 16:44:18 2017 +0200
+++ b/src/pyams_portal/interfaces/__init__.py	Wed Jul 12 12:19:53 2017 +0200
@@ -324,6 +324,8 @@
 # Portal templates interfaces
 #
 
+LOCAL_TEMPLATE_NAME = '__local__'
+
 TEMPLATE_CONFIGURATION_KEY = 'pyams_portal.template'
 
 TEMPLATE_CONTAINER_CONFIGURATION_KEY = 'pyams_portal.container.configuration'
@@ -401,6 +403,16 @@
                               required=True,
                               default=False)
 
+    @invariant
+    def check_template(self):
+        if not (self.use_local_template or self.shared_template):
+            raise Invalid(_("You must choose to use a local template or select a shared one!"))
+
+    local_template = Object(title=_("Local template"),
+                            schema=IPortalTemplate,
+                            required=False,
+                            readonly=True)
+
     use_shared_template = Bool(title=_("Use shared template?"),
                                description=_("If 'yes', you can select a shared template"),
                                required=True,
@@ -411,15 +423,6 @@
                              vocabulary='PyAMS portal templates',
                              required=False)
 
-    @invariant
-    def check_template(self):
-        if not (self.use_local_template or self.shared_template):
-            raise Invalid(_("You must choose to use a local template or select a shared one!"))
-
-    local_template = Object(title=_("Local template"),
-                            schema=IPortalTemplate,
-                            required=False)
-
     template = Attribute("Used template")