Files
test-auth/app/templates/sso/lookup/user.html

130 lines
3.4 KiB
HTML

{% extends "base.html" %}
{% load naturaltimediff %}
{% load installed %}
{% block content %}
<h1>{{user.username}}'s Profile</h1>
<p>
<li><b>Username:</b> {{ user.username }}</li>
<li><b>Active:</b> {{ user.is_active }}</li>
<li><b>Email:</b> {{ user.email }}</li>
<li><b>Groups:</b> {{ user.groups.all|join:", " }}</li>
{% if "hr"|installed %}
<li><b>Blacklist Status: {% if blacklisted %}<font color='red'>BLACKLISTED</font> ({{ blacklisted }} items){% else %}<font color='geen'>OK</font>{% endif %}</b></li>
{% endif %}
</p>
<p>
<div class="skill_controls">
<a href="{% url sso.views.refresh_access user.id %}">Update Access</a>
{% if "hr"|installed %}
{% if perms.hr.add_blacklist %}
<a href="{% url hr.views.blacklist_user user.id %}">Blacklist User</a>
{% endif %}
{% endif %}
</div>
</p>
{% if is_admin %}
<br/>
{% if services %}
<h2>Service Accounts</h2>
<table>
<tr><th>Service</th><th>Username</th><th>Active</th></tr>
{% for acc in services %}
<tr><td>{{ acc.service }}</td>
<td>{{ acc.service_uid }}</td>
<td>{% if acc.active %}Yes{% else %}No{% endif %}</td>
</tr>
{% endfor %}
</table>
{% endif %}
<br/>
{% if user.application_set.all %}
<h2>Applications</h2>
<table>
<tr><th>ID</th><th>Character</th><th>Applied To</th><th>Status</th></tr>
{% for app in user.application_set.all %}
<tr><td><a href="{% url hr.views.view_application app.id %}">{{ app.id }}</a></td>
<td>{{ app.character }}</td>
<td>{{ app.corporation }}</td>
<td>{{ app.get_status_display }}</td></tr>
{% endfor %}
</table>
{% endif %}
{% if user.recommendation_set.all %}
<br />
<h2>Recommendations</h2>
<table>
<tr><th>Recommended Application</th><th>Recommendation Character</th><th>Recommendation Date</th></tr>
{% for rec in user.recommendation_set.all %}
<tr><td><a href="{% url hr.views.view_application rec.application.id %}">{{ rec.application.character.name }}</a></td>
<td>{{ rec.user_character }}</td>
<td>{{ rec.recommendation_date }}</td></tr>
{% endfor %}
</table>
{% endif %}
<br/>
<h2>Eve API Keys</h2>
{% if user.eveaccount_set.all %}
<table>
<thead>
<tr><th>User ID</th><th>API Key</th><th>Description</th><th>Type</th><th>Active</th><th>Last Updated</th></tr>
</thead>
<tbody>
{% for acc in user.eveaccount_set.all %}
<tr><td>{{ acc.api_user_id }}</td>
<td>{{ acc.api_key }}</td>
<td>{{ acc.description }}</td>
<td>{{ acc.get_api_keytype_display }}</td>
<td>{{ acc.get_api_status_display }}</td>
<td>{{ acc.api_last_updated|naturaltimediff }}</td>
</tr>
</tbody>
{% endfor %}
</table>
{% endif %}
<br/>
{% if user.eveaccount_set.all %}
<table>
<tr><th>Character Name</th><th>Corp</th></tr>
{% for acc in user.eveaccount_set.all %}
<tr><th colspan=2>Account {{ acc.api_user_id }}</th></tr>
{% for char in acc.characters.all %}
<tr><td><a href="{% url eve_api.views.eveapi_character char.id %}">{{ char.name }}</a></td>
<td>{{ char.corporation }}</td>
</tr>
{% endfor %}
{% endfor %}
</table>
{% endif %}
{% if "reddit"|installed %}
<br/>
<h2>Reddit Accounts</h2>
{% if user.redditaccount_set.all %}
<table>
<thead>
<tr><th>Username</th><th>Created Date</th><th>Validated</th></tr>
</thead>
<tbody>
{% for acc in user.redditaccount_set.all %}
<tr><td><a href="http://reddit.com/user/{{ acc.username }}/">{{ acc.username }}</a></td>
<td>{{ acc.date_created }}</td>
<td>{% if acc.validated %}Yes{% else %}No{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endif %}
{% endif %}
{% endblock %}