[views] Backport views to medicalexp cube
authorVincent Michel <vincent.michel@logilab.fr>
Thu, 13 Dec 2012 14:32:06 +0100
changeset 18 e74cc1d215ce
parent 17 4c53799efd65
child 19 da04d356b60d
[views] Backport views to medicalexp cube
views/facets.py
views/primary.py
--- a/views/facets.py	Tue Dec 11 18:51:53 2012 +0100
+++ b/views/facets.py	Thu Dec 13 14:32:06 2012 +0100
@@ -6,39 +6,6 @@
 
 
 ############################################################################
-### SUBJECT FACETS #########################################################
-############################################################################
-class SubjectEtypeFacet(facet.RQLPathFacet):
-    __regid__ = 'subject-etype-facet'
-    __select__ = is_instance('Subject')
-    order = 0
-    path = ['M concerns X', 'M is_instance_of T', 'T name N']
-    filter_variable = 'N'
-    title = _('Available Measures')
-
-class SubjectGenderFacet(facet.AttributeFacet):
-    __regid__ = 'subject-gender-facet'
-    __select__ = facet.AttributeFacet.__select__ & is_instance('Subject')
-    order = 1
-    rtype = 'gender'
-    title = _('Gender')
-
-class SubjectHandednessFacet(facet.AttributeFacet):
-    __regid__ = 'subject-handedness-facet'
-    __select__ = facet.AttributeFacet.__select__ & is_instance('Subject')
-    order = 2
-    rtype = 'handedness'
-    title = _('Handedness')
-
-class SubjectAgeFacet(facet.AttributeFacet):
-    __regid__ = 'subject-age-facet'
-    __select__ = facet.AttributeFacet.__select__ & is_instance('Subject')
-    rtype = 'age'
-    title = _('Age')
-    support_and = True
-
-
-############################################################################
 ### MEASURE FACETS #########################################################
 ############################################################################
 class MeasureEtypeFacet(facet.RQLPathFacet):
--- a/views/primary.py	Tue Dec 11 18:51:53 2012 +0100
+++ b/views/primary.py	Thu Dec 13 14:32:06 2012 +0100
@@ -57,40 +57,3 @@
         self.w(u'</div>')
         self.w(u'</div>')
         self.w(u'</div>')
-
-
-class CenterPrimaryView(PrimaryView):
-    __select__ = PrimaryView.__select__ & is_instance('Center')
-
-    def call(self, rset=None):
-        entity = self.cw_rset.get_entity(0,0)
-        self.w(u'<div class="page-header">')
-        # Header
-        self.w(u'<h1>%s</h1>' % entity.dc_title())
-        self.w(u'</div>')
-        self.w(u'<div class="row-fluid">')
-        # Attributes
-        self.w(u'<div class="span6">')
-        self.w(u'<h3>%s  <em>%s</em></h3>' % (self._cw._('Identifier'), entity.identifier))
-        self.w(u'<h3>%s  <em>%s</em></h3>' % (self._cw._('Department'), entity.department))
-        self.w(u'<h3>%s  <em>%s</em></h3>' % (self._cw._('City'), entity.city))
-        self.w(u'<h3>%s  <em>%s</em></h3>' % (self._cw._('Postal code'), entity.postal_code))
-        self.w(u'<h3>%s  <em>%s</em></h3>' % (self._cw._('Country'), entity.country))
-        self.w(u'</div>')
-        # Resources
-        self.w(u'</div>')
-        self.w(u'<div class="row-fluid">')
-        # Assessments
-        self.w(u'<div class="span6">')
-        self.w(u'<h3>Subjects assessment holded</h3>')
-        self.wview('list', rset=self._cw.execute('Any S WHERE S is Subject, '
-                                                 'X holds A,  S concerned_by A, '
-                                                 'X eid %(e)s', {'e': entity.eid}))
-        self.w(u'</div>')
-        # Devices
-        self.w(u'<div class="span6">')
-        self.w(u'<h3>Devices</h3>')
-        self.wview('list', rset=self._cw.execute('Any S WHERE S is Device, '
-                                                 'S hosted_by X, X eid %(e)s', {'e': entity.eid}))
-        self.w(u'</div>')
-        self.w(u'</div>')