Skip to content

Commit

Permalink
Merge pull request #77 from fsinfuhh/feature/more_timestamps
Browse files Browse the repository at this point in the history
show full datetime for votes and add it to csv export
  • Loading branch information
timonegk committed Feb 4, 2021
2 parents a5d2903 + 9a0a2b3 commit a145130
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bitpoll/poll/templates/poll/poll.html
Expand Up @@ -51,7 +51,7 @@
data-container="body"
data-title="{{ vote.display_name|force_escape|force_escape }}"
data-content="
{{ vote.date_created|date }}
{{ vote.date_created }}
{% if vote.comment %}
<div class='comment'>{{ vote.comment|force_escape|force_escape }}</div>
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion bitpoll/poll/views.py
Expand Up @@ -157,11 +157,12 @@ def poll(request, poll_url: str, export: bool=False):
response['Content-Disposition'] = 'attachment; filename="poll.csv"'
writer = csv.writer(response)
a = [choice.get_title for choice in current_poll.ordered_choices]
row = ['Name']
row = ['Name', 'Datetime']
row.extend(a)
writer.writerow(row)
for vote, votechoices in zip(poll_votes, vote_choice_matrix):
row = [vote.display_name if not current_poll.hide_participants else _('Hidden')]
row.append(vote.date_created.isoformat(timespec='seconds'))
row.extend([choice['value'].title if choice and choice['value'] else '' for choice in votechoices])
writer.writerow(row)
return response
Expand Down

0 comments on commit a145130

Please sign in to comment.