{% set user = user or user_dict %} {% set orgs_available = h.organizations_available(permission='manage_group', include_dataset_count=True, include_member_count=True, user=user.name) %} {% set groups_available = h.groups_available(am_member=True, include_dataset_count=True, include_member_count=True, user=user.name) %} {%- call ui.util.call(ui.sidebar_section, title=_("Details"), attrs={"id": "user-info"}) -%} {% block secondary_content_inner %} {% block user_image %}
{{ h.user_image(user.id, size=270) }}
{% endblock %}
{{ user.display_name }}
{% block user_about %} {{ about_formatted or ui.empty(_("You have not provided a biography.") if is_myself else _("This user has no biography."))}} {% endblock %}
{% if not is_myself and current_user.is_authenticated %}
{% block user_follow %} {{ ui.alert(error_message, style="danger") if error_message }} {% if am_following %} {{ ui.button(_('Unfollow'), style="secondary", icon="bell-slash", hx={"post": h.url_for('user.unfollow', id=user.id), "target": "#user-info"}, _extra_class="nsw-width-100") }} {% else %} {{ ui.button(_('Follow'), icon="bell", style="secondary", hx={"post": h.url_for('user.follow', id=user.id), "target": "#user-info"}, _extra_class="nsw-width-100") }} {% endif %} {% endblock %}
{% endif %} {% block user_nums %} {% set num_followers = h.follow_count('user', user.id) %} {%- call ui.util.call(ui.table, striped=true, adaptive=true, condensed=true, _extra_class="profile-nums") -%} {{ _('Followers') }} {{ h.SI_number_span(num_followers) }} {{ h.humanize_entity_type('package', dataset_type, 'facet label') or _('Datasets') }} {{ h.SI_number_span(user.number_created_packages) }} {{ h.humanize_entity_type('organization', org_type, 'facet label') or _('Organizations') }} {{ orgs_available | count }} {{ h.humanize_entity_type('group', group_type, 'facet label') or _('Groups') }} {{ groups_available | count }} {%- endcall %} {% endblock %} {% block user_info %}
{{ _('Username') }}
{{ user.name }}
{% if is_myself %}
{%- call ui.util.call(ui.tooltip, tooltip=_('This information is private and visible only to you')) -%} {{ _('Email') }} {%- endcall %} {{ ui.badge(_('Private'), style="info") }}
{{ user.email }}
{% endif %}
{{ _('Member Since') }}
{{ h.render_datetime(user.created) }}
{% if current_user.sysadmin %}
{{_('Last Active') }}
{{ ui.datetime(user.last_active, relative=true, empty=_("Never")) }}
{% endif %}
{{ _('State') }}
{{ _(user.state) }}
{% endblock %} {% endblock %} {%- endcall %}