Author: jmorliaguet
Date: Thu Jun 29 21:15:26 2006
New Revision: 3565

Added:
   
cpsskins/branches/paris-sprint-2006/ui/screens/common/icons/set-default-16.png  
 (contents, props changed)
Modified:
   cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js
   cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml
   cpsskins/branches/paris-sprint-2006/ui/screens/common/icons/configure.zcml
   cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py
   cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py

Log:

- added a menu option to set the default theme / page



Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js  
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js  Thu Jun 
29 21:15:26 2006
@@ -57,6 +57,18 @@
   perspectives.switchTo('element-editor');
 }
 
+function setAsDefault(info) {
+  var data = info.model.getData();
+  var args = {
+    id: data.id
+  }
+  var options = {
+    parameters: $H(args).toQueryString(),
+    onComplete: function(req) {info.controller.refreshViews();}
+  }
+  new Ajax.Request('@@setAsDefault', options);
+}
+
 function duplicateElement(info) {
   var data = info.model.getData();
   var args = {
@@ -114,6 +126,7 @@
   'delete element': deleteElement,
   'edit element': editElement,
   'edit format': editFormat,
+  'set as default': setAsDefault,
   'cancel event': function(e) {return false;}
 });
 

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml        
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml        
Thu Jun 29 21:15:26 2006
@@ -274,6 +274,11 @@
       />
 
       <page
+          name="setAsDefault"
+          attribute="setAsDefault"
+      />
+
+      <page
           name="insertElement"
           attribute="insertElement"
       />

Modified: 
cpsskins/branches/paris-sprint-2006/ui/screens/common/icons/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/icons/configure.zcml  
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/icons/configure.zcml  
Thu Jun 29 21:15:26 2006
@@ -23,6 +23,10 @@
       layer="cpsskins.browser.skin.cpsskins" />
 
   <resource
+      name="set-default-16.png" file="set-default-16.png"
+      layer="cpsskins.browser.skin.cpsskins" />
+
+  <resource
       name="format-16.png" file="format-16.png"
       layer="cpsskins.browser.skin.cpsskins" />
 

Added: 
cpsskins/branches/paris-sprint-2006/ui/screens/common/icons/set-default-16.png
==============================================================================
Binary file. No diff available.

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py      
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py      Thu Jun 
29 21:15:26 2006
@@ -378,6 +378,14 @@
         self.setElementOrder(added_id, int(order))
         return str(added_id)
 
+    def setAsDefault(self, id):
+        """Set the element as a default element.
+        """
+        tmutil = self.tmutil
+        element = tmutil.getElementById(id)
+        element = removeSecurityProxy(element)
+        tmutil.setAsDefault(element)
+
     def moveUp(self, id):
         """Move the element upward.
         """

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       Thu Jun 
29 21:15:26 2006
@@ -608,6 +608,12 @@
             'action': 'edit element',
             'visible': 'editable',
            },
+           {'type': 'item',
+            'label': _('Set as default'),
+            'icon': '++resource++set-default-16.png',
+            'action': 'set as default',
+            'visible': 'editable',
+           },
            {'type': 'separator',
            },
            {'type': 'item',
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to