merge stable cubicweb-version-3.4.6
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 31 Aug 2009 18:04:26 +0200
branchstable
changeset 3067 921fdbf8b303
parent 3066 ff83ccd612ce (current diff)
parent 3064 3fbcdf220ce9 (diff)
child 3068 52dba800ca4d
merge
--- a/cwconfig.py	Mon Aug 31 16:29:10 2009 +0200
+++ b/cwconfig.py	Mon Aug 31 18:04:26 2009 +0200
@@ -134,6 +134,9 @@
     'float' : 'Float',
     }
 
+_forced_mode = os.environ.get('CW_MODE')
+assert _forced_mode in (None, 'system', 'user')
+
 class CubicWebNoAppConfiguration(ConfigurationMixIn):
     """base class for cubicweb configuration without a specific instance directory
     """
@@ -150,7 +153,7 @@
         CUBES_DIR = '%(APYCOT_ROOT)s/local/share/cubicweb/cubes/' % os.environ
         # create __init__ file
         file(join(CUBES_DIR, '__init__.py'), 'w').close()
-    elif exists(join(CW_SOFTWARE_ROOT, '.hg')) or os.environ.get('CW_MODE') == 'user':
+    elif (exists(join(CW_SOFTWARE_ROOT, '.hg')) and _forced_mode != 'system') or _forced_mode == 'user':
         mode = 'dev'
         CUBES_DIR = abspath(normpath(join(CW_SOFTWARE_ROOT, '../cubes')))
     else:
--- a/web/views/editforms.py	Mon Aug 31 16:29:10 2009 +0200
+++ b/web/views/editforms.py	Mon Aug 31 18:04:26 2009 +0200
@@ -371,6 +371,8 @@
     entity
     """
     id = 'copy'
+    warning_message = _('Please note that this is only a shallow copy')
+
     def render_form(self, entity):
         """fetch and render the form"""
         # make a copy of entity to avoid altering the entity in the
@@ -381,7 +383,7 @@
         self.initialize_varmaker()
         self.newentity.eid = self.varmaker.next()
         self.w(u'<script type="text/javascript">updateMessage("%s");</script>\n'
-               % self.req._('Please note that this is only a shallow copy'))
+               % self.req._(self.warning_message))
         super(CopyFormView, self).render_form(self.newentity)
         del self.newentity
 
--- a/web/views/primary.py	Mon Aug 31 16:29:10 2009 +0200
+++ b/web/views/primary.py	Mon Aug 31 18:04:26 2009 +0200
@@ -51,6 +51,7 @@
         boxes = self._prepare_side_boxes(entity)
         if boxes or hasattr(self, 'render_side_related'):
             self.w(u'<table width="100%"><tr><td style="width: 75%">')
+        self.render_entity_summary(entity)
         self.w(u'<div class="mainInfo">')
         self.content_navigation_components('navcontenttop')
         self.render_entity_attributes(entity)
@@ -90,6 +91,8 @@
 
     def render_entity_metadata(self, entity):
         entity.view('metadata', w=self.w)
+
+    def render_entity_summary(self, entity):
         summary = self.summary(entity) # deprecate summary?
         if summary:
             self.w(u'<div class="summary">%s</div>' % summary)