author | Sandrine Ribeau <sandrine.ribeau@logilab.fr> |
Tue, 13 Apr 2010 19:41:20 +0200 | |
changeset 5236 | 13296aa038a9 |
parent 5235 | 3a92e6d92a64 |
child 5237 | 10dd0dd78778 |
i18n/en.po | file | annotate | diff | comparison | revisions | |
i18n/es.po | file | annotate | diff | comparison | revisions | |
i18n/fr.po | file | annotate | diff | comparison | revisions | |
web/views/cwuser.py | file | annotate | diff | comparison | revisions | |
web/views/schema.py | file | annotate | diff | comparison | revisions |
--- a/i18n/en.po Tue Apr 06 12:23:10 2010 +0200 +++ b/i18n/en.po Tue Apr 13 19:41:20 2010 +0200 @@ -1774,6 +1774,9 @@ msgid "creation" msgstr "" +msgid "creation date" +msgstr "" + msgid "creation time of an entity" msgstr "" @@ -1810,20 +1813,38 @@ msgstr "custom workflow of" msgid "cwetype-box" -msgstr "box" - -msgid "cwetype-schema-permissions" +msgstr "\"box\" view" + +msgid "cwetype-description" +msgstr "description" + +msgid "cwetype-permissions" msgstr "permissions" -msgid "cwetype-schema-text" -msgstr "description" - msgid "cwetype-views" msgstr "views" msgid "cwetype-workflow" msgstr "workflow" +msgid "cwgroup-main" +msgstr "description" + +msgid "cwgroup-permissions" +msgstr "permissions" + +msgid "cwrdef-description" +msgstr "description" + +msgid "cwrdef-permissions" +msgstr "permissions" + +msgid "cwrtype-description" +msgstr "description" + +msgid "cwrtype-permissions" +msgstr "permissions" + msgid "cwuri" msgstr "internal uri" @@ -2293,6 +2314,9 @@ msgid "final" msgstr "" +msgid "first name" +msgstr "" + msgid "firstname" msgstr "" @@ -2517,12 +2541,6 @@ msgid "image" msgstr "" -msgid "in memory entity schema" -msgstr "" - -msgid "in memory relation schema" -msgstr "" - msgid "in_group" msgstr "in group" @@ -2678,6 +2696,12 @@ msgid "last connection date" msgstr "" +msgid "last login time" +msgstr "" + +msgid "last name" +msgstr "" + msgid "last usage" msgstr "" @@ -3166,6 +3190,9 @@ msgid "related entity has no workflow set" msgstr "" +msgid "relation" +msgstr "" + #, python-format msgid "relation %(relname)s of %(ent)s" msgstr "" @@ -3238,6 +3265,9 @@ msgid "require_permission_object" msgstr "required by" +msgid "required" +msgstr "" + msgid "required attribute" msgstr "" @@ -3281,15 +3311,15 @@ msgid "schema's permissions definitions" msgstr "" +msgid "schema-description" +msgstr "entity and relation types" + msgid "schema-image" -msgstr "schema" +msgstr "image" msgid "schema-security" msgstr "permissions" -msgid "schema-text" -msgstr "description" - msgid "search" msgstr "" @@ -3879,6 +3909,9 @@ msgid "used to grant a permission to a group" msgstr "" +msgid "user" +msgstr "" + #, python-format msgid "" "user %s has made the following change(s):\n"
--- a/i18n/es.po Tue Apr 06 12:23:10 2010 +0200 +++ b/i18n/es.po Tue Apr 13 19:41:20 2010 +0200 @@ -1815,6 +1815,9 @@ msgid "creation" msgstr "Creación" +msgid "creation date" +msgstr "" + msgid "creation time of an entity" msgstr "Fecha de creación de una entidad" @@ -1853,17 +1856,35 @@ msgid "cwetype-box" msgstr "" -msgid "cwetype-schema-permissions" -msgstr "Autorizaciónes" - -msgid "cwetype-schema-text" -msgstr "Modelo de datos" +msgid "cwetype-description" +msgstr "" + +msgid "cwetype-permissions" +msgstr "" msgid "cwetype-views" msgstr "" msgid "cwetype-workflow" -msgstr "Workflow" +msgstr "" + +msgid "cwgroup-main" +msgstr "" + +msgid "cwgroup-permissions" +msgstr "" + +msgid "cwrdef-description" +msgstr "" + +msgid "cwrdef-permissions" +msgstr "" + +msgid "cwrtype-description" +msgstr "" + +msgid "cwrtype-permissions" +msgstr "" msgid "cwuri" msgstr "" @@ -2343,6 +2364,9 @@ msgid "final" msgstr "" +msgid "first name" +msgstr "" + msgid "firstname" msgstr "Nombre" @@ -2575,12 +2599,6 @@ msgid "image" msgstr "Imagen" -msgid "in memory entity schema" -msgstr "Esquema de la entidad en memoria" - -msgid "in memory relation schema" -msgstr "Esquema de la relación en memoria" - msgid "in_group" msgstr "En el grupo" @@ -2741,6 +2759,12 @@ msgid "last connection date" msgstr "Ultima fecha de conexión" +msgid "last login time" +msgstr "" + +msgid "last name" +msgstr "" + msgid "last usage" msgstr "" @@ -3239,6 +3263,9 @@ msgid "related entity has no workflow set" msgstr "" +msgid "relation" +msgstr "" + #, python-format msgid "relation %(relname)s of %(ent)s" msgstr "relación %(relname)s de %(ent)s" @@ -3311,6 +3338,9 @@ msgid "require_permission_object" msgstr "Requerido por autorización" +msgid "required" +msgstr "" + msgid "required attribute" msgstr "Atributo requerido" @@ -3358,15 +3388,15 @@ msgid "schema's permissions definitions" msgstr "definiciones de permisos del esquema" +msgid "schema-description" +msgstr "" + msgid "schema-image" msgstr "esquema imagen" msgid "schema-security" msgstr "" -msgid "schema-text" -msgstr "esquema text" - msgid "search" msgstr "buscar" @@ -3964,6 +3994,9 @@ msgid "used to grant a permission to a group" msgstr "utilizado para otorgar permisos a un grupo" +msgid "user" +msgstr "" + #, python-format msgid "" "user %s has made the following change(s):\n" @@ -4449,6 +4482,9 @@ #~ msgid "rql expression allowing to update entities of this type" #~ msgstr "expresion RQL permitiendo actualizar entidades de este tipo" +#~ msgid "schema-text" +#~ msgstr "esquema text" + #~ msgid "server debug information" #~ msgstr "server debug information"
--- a/i18n/fr.po Tue Apr 06 12:23:10 2010 +0200 +++ b/i18n/fr.po Tue Apr 13 19:41:20 2010 +0200 @@ -434,7 +434,7 @@ msgstr "Aide" msgid "Index" -msgstr "" +msgstr "Index" msgid "Instance" msgstr "Instance" @@ -1255,7 +1255,7 @@ msgstr "attribut" msgid "attributes permissions:" -msgstr "" +msgstr "permissions des attributs :" msgid "august" msgstr "août" @@ -1838,6 +1838,9 @@ msgid "creation" msgstr "création" +msgid "creation date" +msgstr "date de création" + msgid "creation time of an entity" msgstr "date de création d'une entité" @@ -1874,20 +1877,38 @@ msgstr "workflow de" msgid "cwetype-box" -msgstr "boîte" - -msgid "cwetype-schema-permissions" +msgstr "vue \"boîte\"" + +msgid "cwetype-description" +msgstr "description" + +msgid "cwetype-permissions" msgstr "permissions" -msgid "cwetype-schema-text" -msgstr "description" - msgid "cwetype-views" msgstr "vues" msgid "cwetype-workflow" msgstr "workflow" +msgid "cwgroup-main" +msgstr "description" + +msgid "cwgroup-permissions" +msgstr "permissions" + +msgid "cwrdef-description" +msgstr "description" + +msgid "cwrdef-permissions" +msgstr "permissions" + +msgid "cwrtype-description" +msgstr "description" + +msgid "cwrtype-permissions" +msgstr "permissions" + msgid "cwuri" msgstr "uri interne" @@ -2377,6 +2398,9 @@ msgid "final" msgstr "final" +msgid "first name" +msgstr "prénom" + msgid "firstname" msgstr "prénom" @@ -2612,12 +2636,6 @@ msgid "image" msgstr "image" -msgid "in memory entity schema" -msgstr "schéma de l'entité en mémoire" - -msgid "in memory relation schema" -msgstr "schéma de la relation en mémoire" - msgid "in_group" msgstr "dans le groupe" @@ -2779,6 +2797,12 @@ msgid "last connection date" msgstr "dernière date de connexion" +msgid "last login time" +msgstr "dernière date de connexion" + +msgid "last name" +msgstr "nom" + msgid "last usage" msgstr "dernier usage" @@ -3275,6 +3299,9 @@ msgid "related entity has no workflow set" msgstr "l'entité lié n'a pas de workflow" +msgid "relation" +msgstr "relation" + #, python-format msgid "relation %(relname)s of %(ent)s" msgstr "relation %(relname)s de %(ent)s" @@ -3347,6 +3374,9 @@ msgid "require_permission_object" msgstr "permission of" +msgid "required" +msgstr "requis" + msgid "required attribute" msgstr "attribut requis" @@ -3395,15 +3425,15 @@ msgid "schema's permissions definitions" msgstr "permissions définies dans le schéma" +msgid "schema-description" +msgstr "types d'entité et de relation" + msgid "schema-image" -msgstr "schéma" +msgstr "image" msgid "schema-security" msgstr "permissions" -msgid "schema-text" -msgstr "description" - msgid "search" msgstr "rechercher" @@ -4007,6 +4037,9 @@ msgid "used to grant a permission to a group" msgstr "utiliser pour donner une permission à un groupe" +msgid "user" +msgstr "utilisateur" + #, python-format msgid "" "user %s has made the following change(s):\n" @@ -4175,9 +4208,3 @@ msgid "you should probably delete that property" msgstr "vous devriez probablement supprimer cette propriété" - -#~ msgid "Delete permissions" -#~ msgstr "Permissions de supprimer" - -#~ msgid "attributes with modified permissions:" -#~ msgstr "attributs ayant des permissions modifiées :"
--- a/web/views/cwuser.py Tue Apr 06 12:23:10 2010 +0200 +++ b/web/views/cwuser.py Tue Apr 13 19:41:20 2010 +0200 @@ -12,6 +12,7 @@ from cubicweb.selectors import one_line_rset, implements, match_user_groups from cubicweb.view import EntityView from cubicweb.web import action, uicfg +from cubicweb.web.views import tabs _pvs = uicfg.primaryview_section _pvs.tag_attribute(('CWUser', 'login'), 'hidden')
--- a/web/views/schema.py Tue Apr 06 12:23:10 2010 +0200 +++ b/web/views/schema.py Tue Apr 13 19:41:20 2010 +0200 @@ -57,20 +57,16 @@ w(u'<table class="schemaInfo">') w(u'<tr><th>%s</th><th>%s</th><th>%s</th></tr>' % ( _("permission"), _('granted to groups'), _('rql expressions'))) - w(u'<table class="schemaInfo">') - w(u'<tr><th>%s</th><th>%s</th><th>%s</th></tr>\n' % - (_('permission'), _('granted to groups'), - _('rql expressions'))) for action in erschema.ACTIONS: w(u'<tr><td>%s</td><td>' % _(action)) if permissions is None: groups = erschema.get_groups(action) else: - groups = permissions[action][1] + groups = permissions[action][0] # XXX get group entity and call it's incontext view groups = [u'<a class="%s" href="%s">%s</a>' % ( group, self._cw.build_url('cwgroup/%s' % group), label) - for group, label in sorted((_(g), g) for group in groups)] + for group, label in sorted((_(g), g) for g in groups)] w(u'<br/>'.join(groups)) w(u'</td><td>') if permissions is None: @@ -99,8 +95,8 @@ # definition w = self.w w(u'<div style="margin: 0px 1.5em">') - tmpl = u'[<strong>%s</strong> %s <strong>%s</strong>]' - for perm, rdefs in perms: + tmpl = u'<strong>%s</strong> %s <strong>%s</strong>' + for perm, rdefs in perms.iteritems(): w(u'<div>%s</div>' % u', '.join( tmpl % (_(s.type), _(rschema.type), _(o.type)) for s, o in rdefs)) # accessing rdef from previous loop by design: only used to get @@ -272,16 +268,17 @@ __select__ = tabs.PrimaryTab.__select__ & implements('CWEType') def render_entity_attributes(self, entity, siderelations=None): + _ = self._cw._ self.w(u'<div>%s</div>' % xml_escape(entity.description or u'')) # entity schema image url = entity.absolute_url(vid='schemagraph') self.w(u'<img src="%s" alt="%s"/>' % ( xml_escape(url), - xml_escape(self._cw._('graphical schema for %s') % entity.name))) + xml_escape(_('graphical schema for %s') % entity.name))) # entity schema attributes self.w(u'<h2>%s</h2>' % _('Attributes')) rset = self._cw.execute( - 'Any A,F,DE,D,C, I,J,A ORDERBY AA WHERE A is CWAttribute, ' + 'Any A,F,D,C,I,J,A,DE ORDERBY AA WHERE A is CWAttribute, ' 'A ordernum AA, A defaultval D, A description DE, A cardinality C, ' 'A fulltextindexed I, A internationalizable J, ' 'A relation_type R, R name N, A to_entity O, O name F, ' @@ -289,48 +286,46 @@ {'x': entity.eid}) self.wview('table', rset, 'null', cellvids={0: 'rdef-name-cell', - 4: 'etype-attr-cardinality-cell', - 7: 'rdef-constraints-cell'}, - headers=(_(u'name'), _(u'type'), _(u'description'), + 3: 'etype-attr-cardinality-cell', + 6: 'rdef-constraints-cell'}, + headers=(_(u'name'), _(u'type'), _(u'default value'), _(u'required'), _(u'fulltext indexed'), _(u'internationalizable'), - _(u'constraints')), + _(u'constraints'), _(u'description')), mainindex=0) # entity schema relations self.w(u'<h2>%s</h2>' % _('Relations')) rset = self._cw.execute( - 'Any A, TT, "i18ncard_"+SUBSTRING(C, 1, 1),K,D,A,A,RN,TTN ORDERBY RN ' - 'WHERE A is CWRelation, A description D, A composite K, ' - 'A relation_type R, R name RN, A to_entity TT, TT name TTN, ' - 'A cardinality C, A from_entity S, S eid %(x)s', + 'Any A,TT,"i18ncard_"+SUBSTRING(C, 1, 1),K,A,TTN ORDERBY RN ' + 'WHERE A is CWRelation, A composite K, A cardinality C, ' + 'A relation_type R, R name RN, ' + 'A to_entity TT, TT name TTN, A from_entity S, S eid %(x)s', {'x': entity.eid}) if rset: self.w(u'<h5>%s %s</h5>' % (entity.name, _('is subject of:'))) self.wview('table', rset, 'null', cellvids={0: 'rdef-name-cell', 2: 'etype-rel-cardinality-cell', - 5: 'rdef-constraints-cell'}, + 4: 'rdef-constraints-cell'}, headers=(_(u'name'), _(u'object type'), _(u'cardinality'), - _(u'composite'), _(u'description'), - _(u'constraints'), _(u'relation direction')), - displaycols=range(5), mainindex=0) + _(u'composite'), _(u'constraints')), + displaycols=range(5)) self.w(u'<br/>') rset = self._cw.execute( - 'Any A, TT, "i18ncard_"+SUBSTRING(C, 2, 1),K,D,A,A,RN,TTN ORDERBY RN ' - 'WHERE A is CWRelation, A description D, A composite K, ' - 'A relation_type R, R name RN, A from_entity TT, TT name TTN, ' - 'A cardinality C, A to_entity O, O eid %(x)s', + 'Any A,TT,"i18ncard_"+SUBSTRING(C, 2, 1),K,A,TTN ORDERBY RN ' + 'WHERE A is CWRelation, A composite K, A cardinality C, ' + 'A relation_type R, R name RN, ' + 'A from_entity TT, TT name TTN, A to_entity O, O eid %(x)s', {'x': entity.eid}) if rset: self.w(u'<h5>%s %s</h5>' % (entity.name, _('is object of:'))) self.wview('table', rset, 'null', cellvids={0: 'rdef-object-name-cell', 2: 'etype-rel-cardinality-cell', - 5: 'rdef-constraints-cell'}, + 4: 'rdef-constraints-cell'}, headers=(_(u'name'), _(u'subject type'), _(u'cardinality'), - _(u'composite'), _(u'description'), - _(u'constraints'), _(u'relation direction')), - displaycols=range(5), mainindex=0) + _(u'composite'), _(u'constraints')), + displaycols=range(5)) class CWETypeAttributeCardinalityCell(baseviews.FinalView): @@ -338,7 +333,9 @@ def cell_call(self, row, col): if self.cw_rset.rows[row][col][0] == '1': - self.w(self._cw._(u'required')) + self.w(self._cw._(u'yes')) + else: + self.w(self._cw._(u'no')) class CWETypeRelationCardinalityCell(baseviews.FinalView): @@ -421,7 +418,7 @@ _ = self._cw._ # possible views for this entity type views = [(_(view.title),) for view in self.possible_views(etype)] - self.wview('pyvaltable', pyvalue=views, headers=(_(u'views'),)) + self.wview('pyvaltable', pyvalue=sorted(views), headers=(_(u'views'),)) def possible_views(self, etype): rset = self._cw.etype_rset(etype) @@ -454,22 +451,21 @@ __select__ = implements('CWRType') def render_entity_attributes(self, entity, siderelations=None): + _ = self._cw._ self.w(u'<div>%s</div>' % xml_escape(entity.description or u'')) rschema = self._cw.vreg.schema.rschema(entity.name) if not rschema.final: - msg = self._cw._('graphical schema for %s') % entity.name + msg = _('graphical schema for %s') % entity.name self.w(tags.img(src=entity.absolute_url(vid='schemagraph'), alt=msg)) - rset = self._cw.execute('Any R,ST,OT,C,CC,R WHERE R is CWRelation, ' + rset = self._cw.execute('Any R,C,CC,R WHERE R is CWRelation, ' 'R relation_type RT, RT eid %(x)s, ' - 'R from_type ST, R to_type OT, ' 'R cardinality C, R composite CC', {'x': entity.eid}) self.wview('table', rset, 'null', - headers=(_(u'relation'), _(u'subject'), _(u'object'), - _(u'cardinality'), _(u'composite'), + headers=(_(u'relation'), _(u'cardinality'), _(u'composite'), _(u'constraints')), - cellvids={5: 'rdef-constraints-cell'}) + cellvids={3: 'rdef-constraints-cell'}) class CWRTypePermTab(SecurityViewMixIn, EntityView): @@ -502,7 +498,7 @@ entity = self.cw_rset.get_entity(row, col) rschema = self._cw.vreg.schema.rschema(entity.rtype.name) rdef = rschema.rdefs[(entity.stype.name, entity.otype.name)] - self.display_permission(rdef) + self.permissions_table(rdef) class CWRDEFNameView(tableview.CellView): @@ -513,10 +509,12 @@ __regid__ = 'rdef-name-cell' __select__ = implements('CWRelation', 'CWAttribute') - def cell_content(self, entity): + def cell_call(self, row, col): + entity = self.cw_rset.get_entity(row, col) rtype = entity.relation_type[0].name # XXX use contect entity + pgettext - return u'%s (%s)' % (rtype, self._cw._(rtype)) + self.w(u'<a href="%s">%s</a> (%s)' % ( + entity.absolute_url(), rtype, self._cw._(rtype))) class CWRDEFObjectNameView(tableview.CellView): """same as CWRDEFNameView but when the context is the object entity @@ -524,10 +522,12 @@ __regid__ = 'rdef-object-name-cell' __select__ = implements('CWRelation', 'CWAttribute') - def cell_content(self, entity): + def cell_call(self, row, col): + entity = self.cw_rset.get_entity(row, col) rtype = entity.relation_type[0].name # XXX use contect entity + pgettext - return u'%s (%s)' % (rtype, self._cw.__(rtype + '_object')) + self.w(u'<a href="%s">%s</a> (%s)' % ( + entity.absolute_url(), rtype, self._cw.__(rtype + '_object'))) class CWRDEFConstraintsCell(EntityView): __regid__ = 'rdef-constraints-cell' @@ -538,7 +538,7 @@ rschema = self._cw.vreg.schema.rschema(entity.rtype.name) rdef = rschema.rdefs[(entity.stype.name, entity.otype.name)] constraints = [xml_escape(str(c)) for c in getattr(rdef, 'constraints')] - self.w(u', '.join(constraints)) + self.w(u'<br/>'.join(constraints)) # schema images ###############################################################