Пример #1
0
def article_history(articles):
    r = []
    for status, article in articles:
        text = []
        text.append(html_reports.tag('h4', _(status)))
        text.append(html_reports.display_label_value(_('name'), article.xml_name, 'p'))
        if article.is_ex_aop:
            text.append(html_reports.display_label_value(_('status'), 'ex-aop', 'p'))
        text.append(html_reports.display_label_value('order', article.order, 'p'))
        if article.creation_date_display is not None:
            text.append(html_reports.display_label_value(_('creation date'), article.creation_date_display, 'p'))
            text.append(html_reports.display_label_value(_('last update date'), article.last_update_display, 'p'))
        r.append(html_reports.tag('div', ''.join(text), 'hist-' + status))
    return ''.join(r)
Пример #2
0
def display_article_metadata(_article, sep='<br/>'):
    dates_labels = ['collection', 'aop', 'epub', 'epub-ppub']
    dates = [_article.collection_dateiso, _article.ahpdate_dateiso, _article.epub_dateiso, _article.epub_ppub_dateiso]

    r = ''
    r += html_reports.tag('p', html_reports.tag('strong', _article.xml_name), 'doi')
    r += html_reports.tag('p', _article.publisher_article_id, 'doi')
    r += html_reports.tag('p', html_reports.tag('strong', _article.order), 'fpage')
    for l, d in zip(dates_labels, dates):
        if d is not None:
            r += html_reports.display_label_value(_('date') + ' (' + l + ')', utils.display_datetime(d), 'p')
    r += html_reports.tag('p', html_reports.tag('strong', _article.title), 'article-title')
    r += html_reports.tag('p', display_authors(_article.article_contrib_items, sep))
    return r