def registration_callback(vreg): vreg.register_and_replace( PIWSAuthenticatedUserStatus, BSAuthenticatedUserStatus) vreg.register(RelationBox) vreg.register(PIWSNavigationtBox) vreg.register(PIWSSubjectStatistics) vreg.register(PIWSAssessmentStatistics) vreg.register(PIWSImageViewers) vreg.unregister(EditBox) vreg.unregister(BreadCrumbEntityVComponent) vreg.unregister(BreadCrumbAnyRSetVComponent) vreg.unregister(BreadCrumbETypeVComponent) vreg.unregister(BreadCrumbLinkToVComponent) vreg.unregister(AnonUserStatusLink) config = load_forms(vreg.config) if config < 0: vreg.unregister(CWUploadBox)
def registration_callback(vreg): vreg.register_and_replace(PIWSAuthenticatedUserStatus, BSAuthenticatedUserStatus) vreg.register(RelationBox) vreg.register(PIWSNavigationtBox) vreg.register(PIWSSubjectStatistics) vreg.register(PIWSAssessmentStatistics) vreg.register(PIWSImageViewers) vreg.unregister(EditBox) vreg.unregister(BreadCrumbEntityVComponent) vreg.unregister(BreadCrumbAnyRSetVComponent) vreg.unregister(BreadCrumbETypeVComponent) vreg.unregister(BreadCrumbLinkToVComponent) vreg.unregister(AnonUserStatusLink) config = load_forms(vreg.config) if config < 0: vreg.unregister(CWUploadBox)
def registration_callback(vreg): vreg.register_and_replace(PIWSAuthenticatedUserStatus, BSAuthenticatedUserStatus) vreg.register(RelationBox) vreg.register(TimeLeft) vreg.register(PIWSNavigationtBox) vreg.register(PIWSSubjectStatistics) vreg.register(PIWSAssessmentStatistics) vreg.register(PIWSImageViewers) vreg.register(PIWSSummary) vreg.unregister(EditBox) vreg.unregister(BreadCrumbEntityVComponent) vreg.unregister(BreadCrumbAnyRSetVComponent) vreg.unregister(BreadCrumbETypeVComponent) vreg.unregister(BreadCrumbLinkToVComponent) vreg.unregister(AnonUserStatusLink) vreg.register_and_replace(FooterView, MetaDataView) config = load_forms(vreg.config) if not isinstance(config, dict): vreg.unregister(CWUploadBox)
def render_body(self, w): """ Create the diifferent item of the navigation box """ # Subjects w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any S Where S is Subject") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'Subjects</a>') w(u'</div></div><br/>') # Assessments if self.display_assessment: w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any A Where A is Assessment") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'Assessments</a>') w(u'</div></div><br/>') # Scan w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any S Where S is Scan") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'Scans</a>') w(u'</div></div><br/>') # QuestionnaireRun ajaxcallback = "get_questionnaires_data" rql_labels = ("DISTINCT Any T ORDERBY T WHERE A is Assessment, " "A timepoint T") rql_types = ("DISTINCT Any T ORDERBY T WHERE Q is Questionnaire, " "Q type T") rset = self._cw.execute(rql_types) types = [line[0] for line in rset.rows] if len(types) > 0: # > main button w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') w(u'<a class="btn btn-info"' 'data-toggle="collapse" data-target="#questionnaires">') w(u'Tables</a>') w(u'</div></div>') # > typed buttons container w(u'<div id="questionnaires" class="collapse">') w(u'<div class="panel-body">') w(u'<hr>') # > typed buttons for qtype in types: href = self._cw.build_url( "view", vid="jtable-table", rql_labels=rql_labels, ajaxcallback=ajaxcallback, title="All Questionnaires", elts_to_sort=["ID"], tooltip_name="All Questionnaires", qtype=qtype) w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'{0}</a>'.format(qtype)) w(u'</div></div><br/>') w(u'<hr>') w(u'</div></div><br/>') # ProcessingRun rql_types = ("DISTINCT Any T ORDERBY T WHERE P is ProcessingRun, " "P type T") rset = self._cw.execute(rql_types) types = [line[0] for line in rset.rows] if len(types) > 0: # > main button w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') w(u'<a class="btn btn-info"' 'data-toggle="collapse" data-target="#processings">') w(u'Processed data</a>') w(u'</div></div>') # > typed buttons container w(u'<div id="processings" class="collapse">') w(u'<div class="panel-body">') w(u'<hr>') # > typed buttons for ptype in types: href = self._cw.build_url(rql="Any P Where P is ProcessingRun, " "P type '{0}'".format(ptype)) w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'{0}</a>'.format(ptype)) w(u'</div></div><br/>') w(u'<hr>') w(u'</div></div><br/>') # GenomicMeasures w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any GM Where GM is GenomicMeasure") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'Genomic measures</a>') w(u'</div></div><br/>') # CWSearch w(u'<hr>') w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any S Where S is CWSearch") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'<span class="glyphicon glyphicon-shopping-cart"></span> ' u'My cart</a>') w(u'</div></div><br/>') # CWUpload config = load_forms(self._cw.vreg.config) if config > 0: w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any U Where U is CWUpload") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'<span class="glyphicon glyphicon glyphicon-cloud-upload">' '</span> My uploads</a>') w(u'</div></div><br/>')
def render_body(self, w): """ Create the diifferent item of the navigation box """ # Subjects w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any S Where S is Subject") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'Subjects</a>') w(u'</div></div><br/>') # Assessments if self.display_assessment: w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any A Where A is Assessment") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'Assessments</a>') w(u'</div></div><br/>') # Scan w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any S Where S is Scan") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'Scans</a>') w(u'</div></div><br/>') # QuestionnaireRun ajaxcallback = "get_questionnaires_data" rql_labels = ("DISTINCT Any T ORDERBY T WHERE A is Assessment, " "A timepoint T") rql_types = ("DISTINCT Any T ORDERBY T WHERE Q is Questionnaire, " "Q type T") rset = self._cw.execute(rql_types) types = [line[0] for line in rset.rows] if len(types) > 0: # > main button w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') w(u'<a class="btn btn-info"' 'data-toggle="collapse" data-target="#questionnaires">') w(u'Tables</a>') w(u'</div></div>') # > typed buttons container w(u'<div id="questionnaires" class="collapse">') w(u'<div class="panel-body">') w(u'<hr>') # > typed buttons for qtype in types: href = self._cw.build_url("view", vid="jtable-table", rql_labels=rql_labels, ajaxcallback=ajaxcallback, title="All Questionnaires", elts_to_sort=["ID"], tooltip_name="All Questionnaires", qtype=qtype) w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'{0}</a>'.format(qtype)) w(u'</div></div><br/>') w(u'<hr>') w(u'</div></div><br/>') # ProcessingRun rql_types = ("DISTINCT Any T ORDERBY T WHERE P is ProcessingRun, " "P type T") rset = self._cw.execute(rql_types) types = [line[0] for line in rset.rows] if len(types) > 0: # > main button w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') w(u'<a class="btn btn-info"' 'data-toggle="collapse" data-target="#processings">') w(u'Processed data</a>') w(u'</div></div>') # > typed buttons container w(u'<div id="processings" class="collapse">') w(u'<div class="panel-body">') w(u'<hr>') # > typed buttons for ptype in types: href = self._cw.build_url( rql="Any P Where P is ProcessingRun, " "P type '{0}'".format(ptype)) w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'{0}</a>'.format(ptype)) w(u'</div></div><br/>') w(u'<hr>') w(u'</div></div><br/>') # GenomicMeasures w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any GM Where GM is GenomicMeasure") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'Genomic measures</a>') w(u'</div></div><br/>') # CWSearch w(u'<hr>') w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any S Where S is CWSearch") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'<span class="glyphicon glyphicon-shopping-cart"></span> ' u'My cart</a>') w(u'</div></div><br/>') # CWUpload config = load_forms(self._cw.vreg.config) if config > 0: w(u'<div class="btn-toolbar">') w(u'<div class="btn-group-vertical btn-block">') href = self._cw.build_url(rql="Any U Where U is CWUpload") w(u'<a class="btn btn-primary" href="{0}">'.format(href)) w(u'<span class="glyphicon glyphicon glyphicon-cloud-upload">' '</span> My uploads</a>') w(u'</div></div><br/>')