Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/public/blingo-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion client/src/views/BlingoView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ onMounted(() => {
<v-col lg="5" cols="12">
<div class="mb-8">
<h1 class="blingo-title text-primaryBlue text-center">Blingo</h1>
<h2 class="blingo-subtitle text-center text-primaryGreen">Connecting to the ocean</h2>
<h2 class="blingo-subtitle text-center text-primaryGreen">
Connecting people to our blue planet through positive actions
</h2>
</div>

<!-- Challenge Card -->
Expand Down
Binary file added documentation/docs/img/exporting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions documentation/docs/staff.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,11 @@ If you just want to see the submissions of a particular user, this can be done f
If you wish to revoke a user's submission, you can do so by pressing the delete button. The submission will then no longer be visible in the user's profile page. Alternatively, if you just wish to delete the image the user uploaded, then you can mark the "Clear" checkbox within the image field and press the "Save" button.

![Screenshot](img/revoking-submission.png)

## Exporting

The admin dashboard provides the option to export its data into CSV format. To do this, navigate to the database table you wish to export (the screenshot below shows the User table). Mark the checkbox in the top left to select all the rows (you can also select a subset of the rows if you prefer). Then select "Export selected objects as CSV" from the dropdown and press "Go". This will download a CSV file containing all the relevant data for the table you are viewing.

![Screenshot](img/exporting.png)

Note that staff users are not included in the CSV file resulting from exporting the User table.
5 changes: 4 additions & 1 deletion server/bingo/actions.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from django.http import HttpResponse
from django.contrib.admin import action
from django.db.models import ForeignKey
from .models import User, TileInteraction


def get_friendly_value(instance, field_name, value):
display_method = f'get_{field_name}_display'
if hasattr(instance, display_method):
return getattr(instance, display_method)()
elif isinstance(field := type(instance)._meta.get_field(field_name), ForeignKey):
return str(field.related_model.objects.get(pk=value))
else:
# If it's not a choice field, return the raw value
# If it's not a choice field or a foreign key, return the raw value
return value


Expand Down