def headers(self): headers = DataTablesHeader(DataTablesColumn(_("View Form")), DataTablesColumn(_("Username")), DataTablesColumn(_("Submit Time")), DataTablesColumn(_("Form"))) headers.no_sort = True return headers
def headers(self): headers = DataTablesHeader(*[DataTablesColumn("Location")]) for product in self.unique_products(self.get_supply_points): headers.add_column(DataTablesColumn(product.code)) return headers
def headers(self): header = DataTablesHeader( DataTablesColumn("Invoice #"), DataTablesColumn("Account Name (Fogbugz Client Name)"), DataTablesColumn("Project Space"), DataTablesColumn("New This Month?"), DataTablesColumn("Company Name"), DataTablesColumn("Emails"), DataTablesColumn("First Name"), DataTablesColumn("Last Name"), DataTablesColumn("Phone Number"), DataTablesColumn("Address Line 1"), DataTablesColumn("Address Line 2"), DataTablesColumn("City"), DataTablesColumn("State/Province/Region"), DataTablesColumn("Postal Code"), DataTablesColumn("Country"), DataTablesColumnGroup("Statement Period", DataTablesColumn("Start"), DataTablesColumn("End")), DataTablesColumn("Date Due"), DataTablesColumn("Total"), DataTablesColumn("Amount Due"), DataTablesColumn("Payment Status"), DataTablesColumn("Do Not Invoice"), ) if not self.is_rendered_as_email: header.add_column(DataTablesColumn("View Invoice")) return header
def headers(self): headers = DataTablesHeader( DataTablesColumn(_("Username"), prop_name='username.exact', sql_col='user_dim__username'), DataTablesColumn(_("Last Submission"), prop_name='reporting_metadata.last_submissions.submission_date', alt_prop_name='reporting_metadata.last_submission_for_user.submission_date', sql_col='last_form_submission_date'), DataTablesColumn(_("Last Sync"), prop_name='reporting_metadata.last_syncs.sync_date', alt_prop_name='reporting_metadata.last_sync_for_user.sync_date', sql_col='last_sync_log_date'), DataTablesColumn(_("Application"), help_text=_("The name of the application from the user's last request."), sortable=False), DataTablesColumn(_("Application Version"), help_text=_("The application version from the user's last request."), prop_name='reporting_metadata.last_builds.build_version', alt_prop_name='reporting_metadata.last_build_for_user.build_version', sql_col='last_form_app_build_version'), DataTablesColumn(_("CommCare Version"), help_text=_("""The CommCare version from the user's last request"""), prop_name='reporting_metadata.last_submissions.commcare_version', alt_prop_name='reporting_metadata.last_submission_for_user.commcare_version', sql_col='last_form_app_commcare_version'), ) headers.custom_sort = [[1, 'desc']] return headers
def headers(self): if self.config['products']: products = SQLProduct.objects.filter(product_id__in=self.config['products'], domain=self.config['domain']).order_by('code') else: products = SQLProduct.objects.filter(domain=self.config['domain']).order_by('code') headers = DataTablesHeader(*[ DataTablesColumn(_('Name')), DataTablesColumn(_('% Facilities Submitting Soh On Time')), DataTablesColumn(_('% Facilities Submitting Soh Late')), DataTablesColumn(_('% Facilities Not Responding To Soh')), DataTablesColumn(_('% Facilities With 1 Or More Stockouts This Month')), ]) datespan_type = self.config['datespan_type'] if datespan_type == 2: month = 'quarter' elif datespan_type == 3: month = 'year' else: month = 'month' for p in products: headers.add_column(DataTablesColumn(_('%s stock outs this %s') % (p.code, month))) return headers
def headers(self, data): headers = DataTablesHeader( DataTablesColumnGroup('Domain', DataTablesColumn('Practice')), DataTablesColumnGroup('Total', DataTablesColumn('Total')) ) for column in super(TableCardReportIndividualPercentSqlData, self).headers(data): headers.add_column(column) return headers
def headers(self): headers = DataTablesHeader( DataTablesColumn(_("Sync Date"), sort_type=DTSortType.NUMERIC), DataTablesColumn(_("# of Cases"), sort_type=DTSortType.NUMERIC), DataTablesColumn(_("Sync Duration"), sort_type=DTSortType.NUMERIC), ) headers.custom_sort = [[0, 'desc']] return headers
def headers(self): versions = get_all_versions() headers = DataTablesHeader( DataTablesColumn(_("Project")) ) for version in versions: headers.add_column(DataTablesColumn(version)) return headers
def headers(self): headers = DataTablesHeader(DataTablesColumn("View Form"), DataTablesColumn("Username"), DataTablesColumn("Submit Time"), DataTablesColumn("Form Type"), DataTablesColumn("Error Type"), DataTablesColumn("Error Message")) headers.no_sort = True return headers
def headers(self): headers = DataTablesHeader(DataTablesColumn('Location')) for product in self.unique_products( get_supply_points(self.config['domain'], self.config['location_id']), all=(not self.config['export']) ): if not self.config['export']: headers.add_column(DataTablesColumn(product.code)) else: headers.add_column(DataTablesColumn(u'{} ({})'.format(product.name, product.code))) return headers
def headers(self): header = DataTablesHeader( DataTablesColumn('Date'), DataTablesColumn('User'), DataTablesColumn('Phone number'), DataTablesColumn('Direction'), DataTablesColumn('Text') ) header.custom_sort = [[0, 'desc']] return header
def headers(self): if self.subreport_slug is None: raise ValueError("Cannot render this report. A subreport_slug is required.") header = DataTablesHeader(DataTablesColumn(_("FLW Name"))) for col in self.adm_report.columns: sort_type = DTSortType.NUMERIC if hasattr(col, 'returns_numerical') and col.returns_numerical else None help_text = _(col.description) if col.description else None header.add_column(DataTablesColumn(_(col.name), sort_type=sort_type, help_text=help_text)) header.custom_sort = self.adm_report.default_sort_params return header
def headers(self, data): headers = DataTablesHeader( *[ DataTablesColumnGroup("Domain", DataTablesColumn("Practice")), DataTablesColumnGroup("Total", DataTablesColumn("Total")), ] ) for column in super(TableCardReportIndividualPercentSqlData, self).headers(data): headers.add_column(column) return headers
def headers(self): header = DataTablesHeader( DataTablesColumn(_("Timestamp")), DataTablesColumn(_("User Name")), DataTablesColumn(_("Phone Number")), DataTablesColumn(_("Direction")), DataTablesColumn(_("Message")), ) header.custom_sort = [[0, 'desc']] return header
def headers(self): headers = DataTablesHeader( DataTablesColumn('Select <a href="#" class="select-all btn btn-mini btn-inverse">all</a> <a href="#" class="select-none btn btn-mini btn-warning">none</a>', sortable=False, span=2), DataTablesColumn("Case Name", span=3), DataTablesColumn("Case Type", span=2), DataTablesColumn("Owner", span=2), DataTablesColumn("Last Modified", span=3, sort_type=DTSortType.NUMERIC) ) headers.custom_sort = [[1, 'asc']] return headers
def headers(self): headers = DataTablesHeader( DataTablesColumn('Facility'), DataTablesColumn('Date of transaction submission'), DataTablesColumn('Transaction Type') ) for product in self.products: headers.add_column(DataTablesColumn("{0} Stock on Hand".format(product.name))) headers.add_column(DataTablesColumn("{0} Consumption".format(product.name))) return headers
def headers(self): headers = DataTablesHeader(DataTablesColumn("User")) for landmark in self.landmarks: headers.add_column( DataTablesColumn( "Last %s Days" % landmark if landmark else "Ever", sort_type=DTSortType.NUMERIC, help_text="Number of cases modified or closed in the last %s days " % landmark, ) ) headers.add_column( DataTablesColumn( "Active Cases ", sort_type=DTSortType.NUMERIC, help_text="Number of cases modified in the last %s days that are still open" % self.milestone, ) ) headers.add_column( DataTablesColumn( "Closed Cases ", sort_type=DTSortType.NUMERIC, help_text="Number of cases closed in the last %s days" % self.milestone, ) ) headers.add_column( DataTablesColumn( "Inactive Cases ", sort_type=DTSortType.NUMERIC, help_text="Number of cases that are open but haven't been touched in the last %s days" % self.milestone, ) ) return headers
def headers(self): headers = DataTablesHeader( DataTablesColumn(_("Sync Date"), sort_type=DTSortType.NUMERIC), DataTablesColumn(_("# of Cases"), sort_type=DTSortType.NUMERIC), DataTablesColumn(_("Sync Duration"), sort_type=DTSortType.NUMERIC) ) if self.show_extra_columns: headers.add_column(DataTablesColumn(_("Sync Log"))) headers.custom_sort = [[0, 'desc']] return headers
def headers(self): column_names = [c.prop_name for c in self.columns] headers = DataTablesHeader(*self.columns) # by default, sort by name, otherwise we fall back to the case_name hidden column if "case_name" in column_names[1:]: headers.custom_sort = [[column_names[1:].index("case_name") + 1, 'asc']] elif "name" in column_names: headers.custom_sort = [[column_names.index("name"), 'asc']] else: headers.custom_sort = [[0, 'asc']] return headers
def headers(self): cols = [ DataTablesColumn(_("Message Text")), DataTablesColumn(_("Risk Profile")), ] for case in self.interactive_participants: header_text = case.get_case_property("name_and_pid") cols.append(DataTablesColumn(header_text)) header = DataTablesHeader(*cols) header.custom_sort = [[1, "asc"]] return header
def headers(self): headers = DataTablesHeader( DataTablesColumn("Name", span=3), DataTablesColumn("Organization", span=2), DataTablesColumn("Category", span=2), DataTablesColumn("Copies", span=2), DataTablesColumn("License", span=2), DataTablesColumn("Last Modified", span=3, sort_type=DTSortType.NUMERIC) ) headers.custom_sort = [[1, 'asc']] return headers
def headers(self): header = DataTablesHeader( DataTablesColumn(_('Date')), DataTablesColumn(_('Content'), sortable=False), DataTablesColumn(_('Type'), sortable=False), DataTablesColumn(_('Recipient'), sortable=False), DataTablesColumn(_('Status'), sortable=False), DataTablesColumn(_('Detail'), sortable=False), ) header.custom_sort = [[0, 'desc']] return header
def headers(self): header = DataTablesHeader( DataTablesColumn(_("Date")), DataTablesColumn(_("Content"), sortable=False), DataTablesColumn(_("Type"), sortable=False), DataTablesColumn(_("Recipient"), sortable=False), DataTablesColumn(_("Status"), sortable=False), DataTablesColumn(_("Detail"), sortable=False), ) header.custom_sort = [[0, "desc"]] return header
def headers(self): headers = DataTablesHeader(*[ DataTablesColumn('', sortable=False, sort_type="title-numeric"), DataTablesColumnGroup(_('ASHAs'), DataTablesColumn(_('Name of ASHAs'), sortable=False)), ]) for index, v in enumerate(self.ashas): headers.add_column(DataTablesColumnGroup(index + 1, DataTablesColumn(v['hv_asha_name'], sortable=False))) headers.add_column(DataTablesColumn('', sortable=False)) return headers
def headers(self): headers = DataTablesHeader(DataTablesColumn(_("View Form"), sortable=False), DataTablesColumn(_("Username"), prop_name="username"), DataTablesColumn(_("Submit Time"), prop_name="received_on"), DataTablesColumn(_("Form Type"), sortable=False), DataTablesColumn(_("Error Type"), sortable=False), DataTablesColumn(_("Error Message"), sortable=False)) if self.support_toggle_enabled: headers.add_column(DataTablesColumn(_("Re-process Form"))) headers.custom_sort = [[2, "desc"]] return headers
def headers(self): headers = DataTablesHeader(DataTablesColumn("Name"), DataTablesColumn("User"), DataTablesColumn("Created Date"), DataTablesColumn("Modified Date"), DataTablesColumn("Status")) headers.no_sort = True if not self.individual: self.name = "%s for %s" % (self.name, SelectMobileWorkerField.get_default_text(self.user_filter)) if not self.case_type: headers.prepend_column(DataTablesColumn("Case Type")) return headers
def domain_activity_report(request, template="hqadmin/domain_activity_report.html"): context = get_hqadmin_base_context(request) context.update(json.loads(_cacheable_domain_activity_report(request).content)) context["layout_flush_content"] = True headers = DataTablesHeader(DataTablesColumn("Domain")) for landmark in context["landmarks"]: headers.add_column(DataTablesColumn("Last %s Days" % landmark)) headers.add_column(DataTablesColumn("All Users")) context["headers"] = headers context["aoColumns"] = headers.render_aoColumns return render(request, template, context)
def headers(self): headers = DataTablesHeader(*[ DataTablesColumn(_('Product')), DataTablesColumn(_('Total # facilities registered with this product')), DataTablesColumn(_('Total # facilities reported')), DataTablesColumn(_('% Facilities with stockouts')) ]) for location in self.get_locations(self.config['location_id'], self.config['domain']).order_by('name'): headers.add_column(DataTablesColumn(location.name)) headers.add_column(DataTablesColumn(_('Total Stock'))) return headers
def headers(self): header = DataTablesHeader( DataTablesColumn(_("Participant ID")), DataTablesColumn(_("Study Arm")), DataTablesColumn(_("Originator")), DataTablesColumn(_("Timestamp")), DataTablesColumn(_("Message Text")), DataTablesColumn(_("Message ID")), DataTablesColumn(_("Direction")), ) header.custom_sort = [[1, "asc"],[0, "asc"],[3, "asc"]] return header
def headers(self): headers = DataTablesHeader( DataTablesColumn(_("Case Type"), prop_name="type.exact"), DataTablesColumn(_("Name"), prop_name="name.exact"), DataTablesColumn(_("Owner"), prop_name="owner_display", sortable=False), DataTablesColumn(_("Created Date"), prop_name="opened_on"), DataTablesColumn(_("Created By"), prop_name="opened_by_display", sortable=False), DataTablesColumn(_("Modified Date"), prop_name="modified_on"), DataTablesColumn(_("Status"), prop_name="get_status_display", sortable=False) ) headers.custom_sort = [[5, 'desc']] return headers
def headers(self): #csv_keys = ['submitted_date', u'note', u'patient', 'doc_type', 'is_reconciliation', u'provider', # u'day_index', 'day_note', u'encounter_date', u'anchor_date', u'total_doses', # u'pact_id', u'dose_number', u'created_date', u'is_art', u'adherence', '_id', u'doc_id', u'method', u'observed_date'] headers = DataTablesHeader( DataTablesColumn("PACT ID", prop_name="pact_id"), DataTablesColumn("ART", prop_name="is_art"), DataTablesColumn("CHW", prop_name="provider"), DataTablesColumn("Method", prop_name="method"), DataTablesColumn("Encounter Date", prop_name="encounter_date"), DataTablesColumn("Anchor Date", prop_name="anchor_date"), DataTablesColumn("Observed Date", prop_name="observed_date"), DataTablesColumn("Adherence", prop_name="adherence"), DataTablesColumn("Created Date", prop_name="created_date"), DataTablesColumn("Submitted Date", prop_name="submitted_date"), DataTablesColumn("Dose Number", prop_name="dose_number"), DataTablesColumn("Total Doses", prop_name="total_doses"), DataTablesColumn("Day Slot", prop_name="day_slot"), DataTablesColumn("Note", prop_name="note")) return headers
def headers(self): return DataTablesHeader( DataTablesColumn( _("Total Appointments Sent"), help_text= _("# of Appointment Cases with at least one CommConnect reminder sent out within date range" )), DataTablesColumn( _("% Appointments Confirmed"), help_text= _("# of Appointment Cases that had a message sent out within the time period with the case property with a state of confirmed" )), DataTablesColumn( _("% Reminders Confirmed"), help_text= _("# of forms sent out over SMS for appointment cases that are completed over the date period and not partial submissions" )), DataTablesColumn(_("Avg Reminders Per Appointment")), DataTablesColumn(_("Avg Confirmations Per Appointment")), )
def headers(self): headers = DataTablesHeader( DataTablesColumn( mark_safe( # nosec: no user input 'Select <a href="#" class="select-all btn btn-xs btn-default">all' '</a> <a href="#" class="select-none btn btn-xs btn-default">' 'none</a>'), sortable=False, span=2), DataTablesColumn(_("Case Name"), span=3, prop_name="name.exact"), DataTablesColumn(_("Case Type"), span=2, prop_name="type.exact"), DataTablesColumn(_("Owner"), span=2, prop_name="owner_display", sortable=False), DataTablesColumn(_("Last Modified"), span=3, prop_name="modified_on"), ) return headers
def headers(self): headers = DataTablesHeader( DataTablesColumn(_("Date of service"), prop_name="form.meta.timeEnd"), DataTablesColumn(_("Beneficiary Name"), sortable=False), DataTablesColumn(_("Service Type"), sortable=False), DataTablesColumn(_("Health Facility"), sortable=False), DataTablesColumn(_("Card No."), sortable=False), DataTablesColumn(_("LGA"), sortable=False), DataTablesColumn(_("Phone No."), sortable=False), DataTablesColumn(_("Amount"), sortable=False), DataTablesColumn(_("Comment"), sortable=False), DataTablesColumn(_("User"), sortable=False), DataTablesColumn(mark_safe( 'Status/Action <a href="#" class="select-all btn btn-xs btn-info">all</a> ' '<a href="#" class="select-none btn btn-xs btn-default">none</a>' ), sortable=False, span=3)) return headers
def headers(self): headers = DataTablesHeader(DataTablesColumn(_("User"), span=3)) if not self.all_relevant_forms: headers.add_column( DataTablesColumn(_( "No submissions were found for selected forms within this date range." ), sortable=False)) else: for _form, info in self.all_relevant_forms.items(): help_text = None if info['is_fuzzy']: help_text = "This column shows Fuzzy Submissions." elif info['is_remote']: help_text = "These forms came from a Remote CommCare HQ Application." headers.add_column( DataTablesColumn(info['name'], sort_type=DTSortType.NUMERIC, help_text=help_text)) headers.add_column( DataTablesColumn(_("All Forms"), sort_type=DTSortType.NUMERIC)) return headers
def headers(self): return DataTablesHeader( DataTablesColumn(_('Beneficiary ID'), sortable=False), DataTablesColumn(_('Beneficiary Name'), sortable=False), DataTablesColumn(_("Father/Husband's Name"), sortable=False), DataTablesColumn(_('Gender'), sortable=False), DataTablesColumn(_('Age'), sortable=False), DataTablesColumn(_('Mobile No. 1'), sortable=False), DataTablesColumn(_('Mobile No. 2'), sortable=False), DataTablesColumn(_('Address'), sortable=False), DataTablesColumn(_('Ward No.'), sortable=False), DataTablesColumn(_('Block / Taluka / Mandal'), sortable=False), DataTablesColumn(_('District'), sortable=False), DataTablesColumn(_('Village / Town / City'), sortable=False), DataTablesColumn(_('State'), sortable=False), DataTablesColumn(_('Pincode'), sortable=False), DataTablesColumn(_('Treating Provider Name'), sortable=False), DataTablesColumn(_('Treating Provider ID'), sortable=False), DataTablesColumn(_('Treatment Supervisor Name'), sortable=False), DataTablesColumn(_('TS Mobile NO.'), sortable=False), DataTablesColumn(_('Assigned FO'), sortable=False), DataTablesColumn(_('Date of Notification'), sortable=False), DataTablesColumn(_('Date of Rx. Start'), sortable=False), DataTablesColumn(_('Adherence Mechanism Assigned (Current)'), sortable=False), DataTablesColumn(_('Date of 99D Registration'), sortable=False), DataTablesColumn(_('Date of MERM Registration'), sortable=False), DataTablesColumn(_('% Adherence Reported'), sortable=False), DataTablesColumn(_('% of Adherence by 99D'), sortable=False), DataTablesColumn(_('% Adherence by Treatment Supervisor'), sortable=False), DataTablesColumn(_('% Adherence by FO'), sortable=False), DataTablesColumn(_('% Adherence by Patient'), sortable=False), DataTablesColumn(_('% Adherence by Provider'), sortable=False), DataTablesColumn(_('% Adherence by Other'), sortable=False), DataTablesColumn(_('% Adherence by MERM'), sortable=False), DataTablesColumn(_('% Unknown Doses'), sortable=False), DataTablesColumn(_('% Missed Doses'), sortable=False), DataTablesColumn(_('Interim Rx. Outcome'), sortable=False), DataTablesColumn(_('Date of last household visit'), sortable=False))
def headers(self): headers = DataTablesHeader(*[ DataTablesColumn(_('Product')), DataTablesColumn( _('Total # facilities registered with this product')), DataTablesColumn(_('Total # facilities reported')), DataTablesColumn(_('% Facilities with stockouts')) ]) for location in self.get_locations( self.config['location_id'], self.config['domain']).order_by('name'): headers.add_column(DataTablesColumn(location.name)) headers.add_column(DataTablesColumn(_('Total Stock'))) return headers
def headers(self): headers = DataTablesHeader(*[ DataTablesColumn('', sortable=False, sort_type="title-numeric"), DataTablesColumnGroup( _('ASHAs'), DataTablesColumn(_('Name of ASHAs'), sortable=False)), ]) for index, v in enumerate(self.ashas): headers.add_column( DataTablesColumnGroup( index + 1, DataTablesColumn(v['hv_asha_name'], sortable=False))) headers.add_column(DataTablesColumn('', sortable=False)) return headers
def headers(self): headers = DataTablesHeader( DataTablesColumn("Project"), DataTablesColumn(_("Organization"), prop_name="internal.organization_name"), DataTablesColumn(_("Deployment Date"), prop_name="deployment.date"), DataTablesColumn(_("# Active Mobile Workers"), sort_type=DTSortType.NUMERIC, prop_name="cp_n_active_cc_users", help_text=_("The number of mobile workers who have submitted a form in the last 30 days")), DataTablesColumn(_("# Mobile Workers"), sort_type=DTSortType.NUMERIC, prop_name="cp_n_cc_users"), DataTablesColumn(_("# Active Cases"), sort_type=DTSortType.NUMERIC, prop_name="cp_n_active_cases", help_text=_("The number of cases modified in the last 120 days")), DataTablesColumn(_("# Cases"), sort_type=DTSortType.NUMERIC, prop_name="cp_n_cases"), DataTablesColumn(_("# Form Submissions"), sort_type=DTSortType.NUMERIC, prop_name="cp_n_forms"), DataTablesColumn(_("First Form Submission"), prop_name="cp_first_form"), DataTablesColumn(_("Last Form Submission"), prop_name="cp_last_form"), DataTablesColumn(_("# Web Users"), sort_type=DTSortType.NUMERIC, prop_name="cp_n_web_users"), DataTablesColumn(_("Notes"), prop_name="internal.notes"), DataTablesColumn(_("Services"), prop_name="internal.services"), DataTablesColumn(_("Project State"), prop_name="internal.project_state"), ) return headers
def headers(self): h = [ DataTablesColumn(mark_safe(""" Select <a class="select-visible btn btn-xs btn-default">all</a> <a class="select-none btn btn-xs btn-default">none</a> """), sortable=False, span=3), DataTablesColumn(_("View Form"), span=2), DataTablesColumn(_("Username"), prop_name='form.meta.username', span=3), DataTablesColumn( _("Submission Time") if self.by_submission_time else _("Completion Time"), prop_name=self.time_field, span=3, ), DataTablesColumn(_("Form"), prop_name='form.@name'), ] return DataTablesHeader(*h)
def headers(self): columns = [ DataTablesColumn(format_html( '{}<button id="all" class="select-visible btn btn-xs btn-default">{}</button>' '<button id="none" class="select-none btn btn-xs btn-default">{}</button>', _('Select'), _('all'), _('none')), sortable=False, span=3), DataTablesColumn(_('Status')), DataTablesColumn(_('URL')), DataTablesColumn(_('Last sent date')), DataTablesColumn(_('Retry Date')), DataTablesColumn(_('Delivery Attempts')), DataTablesColumn(_('View payload')), DataTablesColumn(_('Resend')), DataTablesColumn(_('Cancel or Requeue payload')) ] if toggles.SUPPORT.enabled_for_request(self.request): columns.insert(2, DataTablesColumn(_('Payload ID'))) return DataTablesHeader(*columns)
def headers(self): maternal_deaths = NumericColumn("Maternal Deaths") maternal_near_miss = NumericColumn("Maternal Near Miss") still_births = NumericColumn("Still Births") neonatal_mortality = NumericColumn("Neonatal Mortality") outcomes_on_discharge = DataTablesColumnGroup("Outcomes on Discharge", maternal_deaths, still_births, neonatal_mortality) outcomes_on_discharge.css_span = 2 outcomes_on_7days = DataTablesColumnGroup("Outcomes at 7 Days", maternal_deaths, maternal_near_miss, still_births, neonatal_mortality) outcomes_on_7days.css_span = 2 positive_outcomes = DataTablesColumnGroup("Total Positive Outcomes", maternal_deaths, maternal_near_miss, still_births, neonatal_mortality) positive_outcomes.css_span = 2 return DataTablesHeader( DataTablesColumn("Region"), DataTablesColumn("District"), DataTablesColumn("Site"), NumericColumn("Birth Events"), NumericColumn("Referred In Births"), outcomes_on_discharge, outcomes_on_7days, positive_outcomes, NumericColumn("Primary Outcome Yes"), NumericColumn("Primary Outcome No"), NumericColumn("Lost to Follow Up") )
def headers(self): date = self.report_config['startdate'] first = ((date + relativedelta(months=3)).month, (date + relativedelta(months=3)).year) second = ((date + relativedelta(months=2)).month, (date + relativedelta(months=2)).year) third = ((date + relativedelta(months=1)).month, (date + relativedelta(months=1)).year) return DataTablesHeader(*[ DataTablesColumn(_('Number of ASHAs functional on-'), sortable=False), DataTablesColumn('%s %d' % (calendar.month_name[first[0]], first[1]), sortable=False), DataTablesColumn('%s %d' % (calendar.month_name[second[0]], second[1]), sortable=False), DataTablesColumn('%s %d' % (calendar.month_name[third[0]], third[1]), sortable=False), DataTablesColumn(_('Average'), sortable=False) ])
def headers(self): return DataTablesHeader( DataTablesColumn('Category'), DataTablesColumn('PW'), DataTablesColumn('LM'), DataTablesColumnGroup('Children 0-5 months', DataTablesColumn('B'), DataTablesColumn('G')), DataTablesColumnGroup('Children 6-11 months', DataTablesColumn('B'), DataTablesColumn('G')), DataTablesColumnGroup('Children 12-35 months', DataTablesColumn('B'), DataTablesColumn('G')), DataTablesColumnGroup('Children 36-59 months', DataTablesColumn('B'), DataTablesColumn('G')), DataTablesColumnGroup('Children 60-71 months', DataTablesColumn('B'), DataTablesColumn('G')), DataTablesColumnGroup('All Children 0-71 months', DataTablesColumn('B'), DataTablesColumn('G')), DataTablesColumn('AG'))
def headers(self): return DataTablesHeader( DataTablesColumn('Region', sortable=False), DataTablesColumn('District', sortable=False), DataTablesColumn('Site', sortable=False), DataTablesColumnGroup( u'Patients Agés de - 5 Ans', DataTablesColumn('Nombre Total de cas vus (toutes affections confondues)', sortable=False), DataTablesColumn('Nombre de cas Suspects de paludisme', sortable=False), DataTablesColumn('Nombre de cas de paludisme confirmés', sortable=False) ), DataTablesColumnGroup( u'Patients Agés de 5 - 10 ans', DataTablesColumn('Nombre Total de cas vus (toutes affections confondues)', sortable=False), DataTablesColumn('Nombre de cas Suspects de paludisme', sortable=False), DataTablesColumn('Nombre de cas de paludisme confirmés', sortable=False) ), DataTablesColumnGroup( u'Patients Agés de 10 ans et +', DataTablesColumn('Nombre Total de cas vus (toutes affections confondues)', sortable=False), DataTablesColumn('Nombre de cas Suspects de paludisme', sortable=False), DataTablesColumn('Nombre de cas de paludisme confirmés', sortable=False) ), DataTablesColumnGroup( u'Femmes Enceintes MALADES', DataTablesColumn('Nombre Total de cas vus (toutes affections confondues)', sortable=False), DataTablesColumn('Nombre de cas Suspects de paludisme', sortable=False), DataTablesColumn('Nombre de cas de paludisme confirmés', sortable=False) ), DataTablesColumnGroup( u'Rapport par Catégorie', DataTablesColumn('Total Cas', sortable=False), DataTablesColumn('% des Moins de 5 ans', sortable=False), DataTablesColumn('% des 5 - 10 ans', sortable=False), DataTablesColumn('% des Plus de 10 ans', sortable=False), DataTablesColumn('% des Femmes Enceinte', sortable=False) ), DataTablesColumn('Zones', sortable=False) )
def headers(self): r_type = self.slug.split('_')[0] if r_type == 'district': col_name = 'hf' else: col_name = 'user_name' def format(data): if col_name == 'user_name': return raw_username(data) else: return data headers = DataTablesHeader() headers.add_column(self.columns[0].data_tables_column) for head in self.records.keys(): headers.add_column(DataTablesColumn(format(head))) return headers
def headers(self): columns = [ DataTablesColumn(_('Product')), DataTablesColumn(_('# Facilities'), sortable=False), DataTablesColumn( _('Stocked Out'), help_text=_("A facility is counted as stocked out when its \ current stock is below the emergency level."), sortable=False), DataTablesColumn( _('Understocked'), help_text=_("A facility is counted as under stocked when its \ current stock is above the emergency level but below the \ low stock level."), sortable=False), DataTablesColumn( _('Adequate Stock'), help_text=_("A facility is counted as adequately stocked when \ its current stock is above the low level but below the \ overstock level."), sortable=False), DataTablesColumn( _('Overstocked'), help_text=_("A facility is counted as overstocked when \ its current stock is above the overstock level."), sortable=False), DataTablesColumn( _('Insufficient Data'), help_text=_("A facility is marked as insufficient data when \ there is no known consumption amount or there \ has never been a stock report at the location. \ Consumption amount can be unknown if there is \ either no default consumption value or the reporting \ history does not meet the calculation settings \ for the project."), sortable=False) ] return DataTablesHeader(*columns)
def headers(self): return DataTablesHeader( DataTablesColumn('Voucher Case ID'), DataTablesColumn('Voucher Readable ID'), DataTablesColumn('Voucher Status'), DataTablesColumn('Voucher District ID'), DataTablesColumn('Voucher Type'), DataTablesColumn('Voucher Approved Amount'), DataTablesColumn('Voucher Beneficiary ID'), DataTablesColumn('Voucher Beneficiary Name'), DataTablesColumn('Voucher Issued by Name'), DataTablesColumn('Amount Paid'), DataTablesColumn('Date Paid'), DataTablesColumn('Comments'), DataTablesColumn('Payment Mode'), DataTablesColumn('Check Number'), DataTablesColumn('Bank Name'), DataTablesColumn('Reason Rejected'), DataTablesColumn('Date Rejected'), DataTablesColumn('BETS Sent Date'), DataTablesColumn('Forwading Status'), DataTablesColumn('BETS Response Message'), )
def headers(self): columns = [ DataTablesColumn(_('Product')), DataTablesColumn(_('Stock on Hand'), help_text=_('Total stock on hand for all locations matching the filters.')), ] if self.showing_advanced_columns(): columns += [ DataTablesColumn(_('Monthly Consumption'), help_text=_('Total average monthly consumption for all locations matching the filters.')), DataTablesColumn(_('Months of Stock'), help_text=_('Number of months of stock remaining for all locations matching the filters. \ Computed by calculating stock on hand divided by monthly consumption.')), DataTablesColumn(_('Stock Status'), help_text=_('Stock status prediction made using calculated consumption \ or project specific default values. "No Data" means that \ there is not enough data to compute consumption and default \ values have not been uploaded yet.')), # DataTablesColumn(_('Resupply Quantity Suggested')), ] return DataTablesHeader(*columns)
def get_report_context(self, data_provider): headers = DataTablesHeader( *[c.data_tables_column for c in data_provider.columns]) if self.needs_filters: rows = [] charts = [] total_row = [] else: formatter = DataFormatter( TableDataFormat(data_provider.columns, no_value=self.no_value)) rows = list( formatter.format(data_provider.data, keys=data_provider.keys, group_by=data_provider.group_by)) charts = list( self.get_chart( rows, data_provider.columns, x_label=data_provider.chart_x_label, y_label=data_provider.chart_y_label, has_total_column=data_provider.has_total_column)) total_row = list(calculate_total_row(rows)) if total_row: total_row[0] = 'Total' context = dict(report_table=dict(title=data_provider.title, headers=headers, rows=rows, total_row=total_row, default_rows=self.default_rows, datatables=True), charts=charts, chart_span=12) return context
def headers(self): blocks = self.get_blocks_for_district() headers = [DataTablesColumnGroup('')] headers.extend([ DataTablesColumnGroup(block) for block in self.get_blocks_for_district() ]) columns = [ DatabaseColumn(_( "Percentage of ASHAs functional on " "(Number of functional ASHAs/total number of ASHAs) x 100"), SimpleColumn(''), header_group=headers[0]) ] for i, block in enumerate(blocks): columns.append( DatabaseColumn(_('%s of ASHAs') % '%', SimpleColumn(block), header_group=headers[i + 1])) columns.append( DatabaseColumn(_('Grade of Block'), SimpleColumn(block), header_group=headers[i + 1])) return DataTablesHeader(*headers)
def headers(self): header = DataTablesHeader( DataTablesColumn("Invoice #"), DataTablesColumn("Account Name (Fogbugz Client Name)"), DataTablesColumn("Subscription"), DataTablesColumn("Project Space"), DataTablesColumn("New This Month?"), DataTablesColumn("Company Name"), DataTablesColumn("Emails"), DataTablesColumn("First Name"), DataTablesColumn("Last Name"), DataTablesColumn("Phone Number"), DataTablesColumn("Address Line 1"), DataTablesColumn("Address Line 2"), DataTablesColumn("City"), DataTablesColumn("State/Province/Region"), DataTablesColumn("Postal Code"), DataTablesColumn("Country"), DataTablesColumn("Salesforce Account ID"), DataTablesColumn("Salesforce Contract ID"), DataTablesColumnGroup("Statement Period", DataTablesColumn("Start"), DataTablesColumn("End")), DataTablesColumn("Date Due"), DataTablesColumn("Plan Cost"), DataTablesColumn("Plan Credits"), DataTablesColumn("SMS Cost"), DataTablesColumn("SMS Credits"), DataTablesColumn("User Cost"), DataTablesColumn("User Credits"), DataTablesColumn("Total"), DataTablesColumn("Total Credits"), DataTablesColumn("Amount Due"), DataTablesColumn("Payment Status"), DataTablesColumn("Do Not Invoice"), ) if not self.is_rendered_as_email: header.add_column(DataTablesColumn("Action")) header.add_column(DataTablesColumn("View Invoice")) return header
def headers(self): return DataTablesHeader( DataTablesColumn(_("User")), DataTablesColumn(_("# Forms Submitted"), sortable=False), DataTablesColumn(_("Avg # Forms Submitted"), sortable=False), DataTablesColumn(_("Last Form Submission"), sortable=False))
def headers(self): return DataTablesHeader(DataTablesColumn('Username'), DataTablesColumn('Email'), DataTablesColumn('Date joined'), DataTablesColumn('Is active?'), DataTablesColumn('Is migrated?'))
def headers(self): columns = [c.data_tables_column for c in self.data_provider.columns] headers = DataTablesHeader(*columns) return headers
def headers(self): return DataTablesHeader(DataTablesColumn('Name'), DataTablesColumn('Code'), DataTablesColumn('active'), DataTablesColumn('Is migrated'))
def headers(self): return DataTablesHeader(*get_headers())
def headers(self): return DataTablesHeader(*[ DataTablesColumn('Entity'), DataTablesColumn('Number'), DataTablesColumn('Percentage') ])
def headers(self): headers = [] for __, title, text, __ in self.model.method_map: headers.append(DataTablesColumn(name=title, help_text=text)) return DataTablesHeader(*headers)
def headers(self): columns = self.display_config['table_columns'] headers = DataTablesHeader( *[DataTablesColumn(name=name, sortable=False) for name in columns]) return headers