Beispiel #1
0
 def contrib_collabs(self):
     r = [a.collab for a in self.article.contrib_collabs]
     if len(r) > 0:
         r = html_reports.format_list('collabs', 'ul', r)
     else:
         r = self.display_labeled_value('collabs', 'None')
     return r
Beispiel #2
0
 def conversion_status_report(self):
     title = _('Conversion results')
     status = self.conversion_status
     style = 'conversion'
     text = ''
     if status is not None:
         for category in sorted(status.keys()):
             _style = style
             if status.get(category) is None:
                 ltype = 'ul'
                 list_items = ['None']
                 _style = None
             elif len(status[category]) == 0:
                 ltype = 'ul'
                 list_items = ['None']
                 _style = None
             else:
                 ltype = 'ol'
                 list_items = status[category]
             text += html_reports.format_list(
                 categories_messages.get(category, category), ltype,
                 list_items, _style)
     if len(text) > 0:
         text = html_reports.tag('h3', title) + text
     return text
Beispiel #3
0
 def orphan_files_report(self):
     if len(self.package_folder.orphans) > 0:
         return '<div class="xmllist"><p>{}</p>{}</div>'.format(
             _('Invalid files names'),
             html_reports.format_list('', 'ol',
                                      self.package_folder.orphans))
     return ''
Beispiel #4
0
 def sections(self):
     _sections = []
     for item in self.article.article_sections:
         for label, sections in item.items():
             type_and_title_items = [
                 sectitle + ' (' + sectype + ')'
                 for sectype, sectitle in sections
             ]
         _sections.append([label, type_and_title_items])
     return html_reports.format_list('sections:', 'ul', _sections)
Beispiel #5
0
    def xml_list(self):
        r = ''
        r += u'<p>{}: {}</p>'.format(_('XML path'), self.package_folder.path)
        r += u'<p>{}: {}</p>'.format(_('Total of XML files'),
                                     len(self.package_folder.pkgfiles_items))

        files = ''
        for name, pkgfiles in self.package_folder.pkgfiles_items.items():
            files += '<li>{}</li>'.format(
                html_reports.format_list(name, 'ol', pkgfiles.files))
        r += '<ol>{}</ol>'.format(files)
        return u'<div class="xmllist">{}</div>'.format(r)
Beispiel #6
0
 def invalid_xml_report(self):
     r = ''
     if len(self.invalid_xml_name_items) > 0:
         r += html_reports.tag(
             'div',
             html_reports.p_message(
                 _('{status}: invalid XML files. ').format(
                     status=validation_status.STATUS_BLOCKING_ERROR)))
         r += html_reports.tag(
             'div',
             html_reports.format_list('', 'ol', self.invalid_xml_name_items,
                                      'issue-problem'))
     return r
Beispiel #7
0
 def report_missing_required_issue_data(self):
     if not hasattr(self, '_report_missing_required_issue_data'):
         r = ''
         for label, items in self.group.missing_required_data.items():
             r += html_reports.tag(
                 'div',
                 html_reports.p_message(
                     _('{status}: missing {label} in: ').format(
                         status=validation_status.STATUS_BLOCKING_ERROR,
                         label=label)))
             r += html_reports.tag(
                 'div',
                 html_reports.format_list('', 'ol', items, 'issue-problem'))
         self._report_missing_required_issue_data = r
     return self._report_missing_required_issue_data
Beispiel #8
0
 def report_issue_data_duplicated_values(self):
     if not hasattr(self, '_report_issue_data_duplicated_values'):
         parts = []
         for label, values in self.group.duplicated_values.items():
             status = self.group.ERROR_LEVEL_FOR_UNIQUE_VALUES[label]
             _m = _(
                 'Unique value for {label} is required for all the documents in the package'
             ).format(label=label)
             parts.append(html_reports.p_message(status + ': ' + _m))
             for value, xml_files in values.items():
                 parts.append(
                     html_reports.format_list(
                         _('found {label}="{value}" in:').format(
                             label=label, value=value), 'ul', xml_files,
                         'issue-problem'))
         self._report_issue_data_duplicated_values = ''.join(parts)
     return self._report_issue_data_duplicated_values
Beispiel #9
0
 def journal_issue_header_report(self):
     if not hasattr(self, '_journal_issue_header_report'):
         common_data = ''
         for label, values in self.group.common_data.items():
             if len(values.keys()) == 1:
                 common_data += html_reports.tag(
                     'p',
                     html_reports.display_label_value(
                         label,
                         list(values.keys())[0]))
             else:
                 common_data += html_reports.format_list(
                     label + ':', 'ol', values.keys())
         self._journal_issue_header_report = html_reports.tag(
             'h2', _('Data in the XML Files')) + html_reports.tag(
                 'div', common_data, 'issue-data')
     return self._journal_issue_header_report
Beispiel #10
0
 def keywords(self):
     return html_reports.format_list(
         'keywords:', 'ol', [display_kwd(k) for k in self.article.keywords])
Beispiel #11
0
 def contrib_names(self):
     return html_reports.format_list(
         'authors:', 'ol',
         [format_author(a) for a in self.article.contrib_names])