Skip to content

Commit

Permalink
Include program codes in contribution exports
Browse files Browse the repository at this point in the history
  • Loading branch information
plourenco authored and ThiefMaster committed Oct 20, 2021
1 parent 57245ca commit e89d355
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Improvements

- Support TLS certificates for SMTP authentication (:pr:`5100`, thanks :user:`dweinholz`)
- Add CSV/Excel contribution list exports containing affiliations (:issue:`5114`, :pr:`5118`)
- Include program codes in contribution PDFs and spreadsheets (:pr:`5126`)

Bugfixes
^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
\sffamily
\noindent
\VAR{_('Contribution ID')}: \textbf{\VAR{contrib.friendly_id}}
\JINJA{if contrib.code}
\VAR{_('Contribution code')}: \textbf{\VAR{contrib.code}}
\JINJA{endif}
\hfill
\VAR{_('Type')}: \textbf{\VAR{(contrib.type.name if contrib.type else _('not specified'))}}
}
Expand Down
6 changes: 4 additions & 2 deletions indico/modules/events/contributions/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ def _format_person(person):

has_board_number = any(c.board_number for c in contributions)
has_authors = any(pl.author_type != AuthorType.none for c in contributions for pl in c.person_links)
headers = ['Id', 'Title', 'Description', 'Date', 'Duration', 'Type', 'Session', 'Track', 'Presenters', 'Materials']
headers = ['Id', 'Title', 'Description', 'Date', 'Duration', 'Type', 'Session', 'Track', 'Presenters', 'Materials',
'Program Code']
if has_authors:
headers += ['Authors', 'Co-Authors']
if has_board_number:
Expand All @@ -155,7 +156,8 @@ def _format_person(person):
'Session': c.session.title if c.session else None,
'Track': c.track.title if c.track else None,
'Materials': None,
'Presenters': ', '.join(_format_person(speaker) for speaker in c.speakers)}
'Presenters': ', '.join(_format_person(speaker) for speaker in c.speakers),
'Program Code': c.code}
if has_authors:
contrib_data.update({
'Authors': ', '.join(_format_person(author) for author in c.primary_authors),
Expand Down

0 comments on commit e89d355

Please sign in to comment.