Skip to content

Commit

Permalink
Add profile pictures to meeting's participant list
Browse files Browse the repository at this point in the history
  • Loading branch information
Leats committed Dec 16, 2020
1 parent aa0566a commit 1bc2eca
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 24 deletions.
5 changes: 5 additions & 0 deletions indico/modules/events/registration/models/registrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ def display_full_name(self):
"""Return the full name using the user's preferred name format."""
return format_display_full_name(session.user, self)

@property
def avatar_url(self):
"""Return the url of the user's avatar."""
return self.user.picture_url

@property
def is_ticket_blocked(self):
"""Check whether the ticket is blocked by a plugin."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<div class="participant-list-wrapper">
<ul class="participant-list">
{%- for participant in event.published_registrations|sort(attribute='display_full_name') -%}
<li class="event-user {% if participant.checked_in and participant.registration_form.publish_checkin_enabled %}checked-in{% endif %}">
{{ participant.display_full_name }}
<li class="ui image label meeting-participant {% if participant.checked_in and participant.registration_form.publish_checkin_enabled %} checked-in {% endif %}">
<img src="{{ participant.picture_url }}" alt="">{{ participant.display_full_name }}
</li>
{%- endfor -%}
</ul>
Expand Down
7 changes: 4 additions & 3 deletions indico/modules/users/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
from indico.web.flask.util import send_file, url_for
from indico.web.forms.base import FormDefaults
from indico.web.http_api.metadata import Serializer
from indico.web.rh import RHProtected, RHTokenProtected
from indico.web.rh import RH, RHProtected, RHTokenProtected
from indico.web.util import jsonify_data, jsonify_form, jsonify_template


Expand Down Expand Up @@ -223,10 +223,11 @@ def _process(self, source):
return send_file('avatar.png', BytesIO(gravatar), mimetype='image/png')


class RHProfilePictureDisplay(RHUserBase):
class RHProfilePictureDisplay(RH):
"""Display the user's profile picture."""

allow_system_user = True
def _process_args(self):
self.user = User.get(request.view_args['user_id'], is_deleted=False)

def _process(self):
if self.user.picture_source == ProfilePictureSource.standard:
Expand Down
26 changes: 7 additions & 19 deletions indico/web/client/styles/modules/event_display/_meetings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ li > table + .note-area-wrapper {
}

&.collapsed {
max-height: 4.75em;
max-height: 4.3em;
overflow: hidden;
}

Expand Down Expand Up @@ -147,31 +147,19 @@ li > table + .note-area-wrapper {
@extend %font-family-title;

padding: 0;
margin: 0;
margin: 0 0 0 -0.2em;
list-style-type: none;
}
}

.event-user {
.ui.image.label.meeting-participant {
display: inline-block;
margin-bottom: 4px;
margin-left: 0.2em;

&.checked-in {
@include border-all($pastel-green);
background: lighten($pastel-green, 30%);
color: darken($pastel-green, 20%);

&::before {
color: $pastel-green;
}
}

&.no-label {
background: none;
border: none;
color: $dark-gray;
padding: 0;

&::before {
color: $gray;
}
}
}

Expand Down

0 comments on commit 1bc2eca

Please sign in to comment.