Skip to content

Commit

Permalink
Merge pull request #334 from opendata-swiss/feat/display-whether-user…
Browse files Browse the repository at this point in the history
…-is-locked-out

Feat/display whether user is locked out
  • Loading branch information
bellisk authored Jul 31, 2024
2 parents cc4bb96 + 50181e3 commit b0d9085
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions ckanext/switzerland/templates/user/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,42 @@
{{ h.build_nav_icon('user.activity', _('Activity Stream'), id=user.name) }}
{% endif %}
{% endblock %}

{% block user_info %}
{% if h.user_locked_out(user.name) %}
{% set login_status = 'locked out' %}
{% else %}
{% set login_status = 'login enabled' %}
{% endif %}
<div class="info">
<dl>
{% if user.name.startswith('http://') or user.name.startswith('https://') %}
<dt>{{ _('Open ID') }}</dt>
<dd>{{ user.name|urlize(25) }}{# Be great if this just showed the domain #}</dd>
{% else %}
<dt>{{ _('Username') }}</dt>
<dd>{{ user.name }}</dd>
{% endif %}
</dl>
{% if is_myself %}
<dl>
<dt>{{ _('Email') }} <span class="label label-default" title="{{ _('This means only you can see this') }}">{{ _('Private') }}</span></dt>
<dd>{{ user.email }}</dd>
</dl>
{% endif %}
<dl>
<dt>{{ _('Member Since') }}</dt>
<dd>{{ h.render_datetime(user.created) }}</dd>
</dl>
<dl>
<dt>{{ _('State') }}</dt>
<dd>{{ _(user.state) }}, {{ _(login_status) }}</dd>
</dl>
{% if is_myself %}
<dl>
<dt class="key">{{ _('API Key') }} <span class="label label-default" title="{{ _('This means only you can see this') }}">{{ _('Private') }}</span></dt>
<dd class="value"><code>{{ user.apikey }}</code></dd>
</dl>
{% endif %}
</div>
{% endblock %}

0 comments on commit b0d9085

Please sign in to comment.