<commit_before>{% extends "base.html" %}

{% load naturaltimediff %}

{% block title %}Your Profile{% endblock %}

{% block content %}

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.js"></script>
<script type="text/javascript">

function refresh_apikey(key) {
    $("#api-time-" + key).html("<center><img src='/static/img/spinner.gif'/></center>");  
    $.getJSON("/profile/refresh/eveapi/" + key + "/", function(json) {
            $("#api-time-" + json[0].fields.api_user_id).html("a moment ago");
    });
}

</script>


<h1>Your Profile</h1>

<p>
<b>Username:</b> {{ user.username }}<br/>
<b>Email:</b> {{ user.email }}<br/>
</p>

<h2>External API Auth Services</h2>
<p>To reset your External API Auth Services password, which is used to access tools and websites which use Auth's API, click the link below</p>
<p><a href="{% url sso.views.set_apipasswd %}">Reset External API Auth Services Password</a></p>

{% if user.eveaccount_set.all %}
<h2>External non-API Service Accounts</h2>
<p>This is a list of all your current non-api external service accounts, to
create a login for a service click the Add Service link</p>
{% if user.serviceaccount_set.all %}
<table>
<thead>
<tr><th>Service</th><th>Username</th><th>URL</th><th>Active</th><th>Actions</th></tr>
</thead>
<tbody>
{% for acc in user.serviceaccount_set.all %}
<tr><td>{{ acc.service }}</td>
    <td>{{ acc.service_uid }}</td>
    <td><a href="{{ acc.service.url }}">{{ acc.service.url }}</a></td>
    <td>{% if acc.active %}Yes{% else %}No{% endif %}</td>
    <td>
    {% if acc.active %}
    <a href="{% url sso.views.service_reset acc.id %}">Reset</a>&nbsp;/&nbsp;
    <a href="{% url sso.views.service_del acc.id %}">Delete</a>
    {% if acc.service.provide_login %}
    &nbsp;/&nbsp;<a href="{% url sso.views.service_login acc.id %}">Login</a>
    {% endif %}
    {% endif %}
    </td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}

<p>
<a href="{% url sso.views.service_add %}">Add Service</a>
</p>

<br/>
{% endif %}

<h2>Eve API Keys</h2>
<p>Adding an Eve API key will allow you to access any services allowed for your
corporation. Limited keys are accepted for service validation. API keys
are stored for on-going authentication. As the assigned owner of a key you may
remove them at any time, but this may affect any existing services you have
setup.</p>
{% 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><th>Actions</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 id="api-time-{{ acc.api_user_id }}">{{ acc.api_last_updated|naturaltimediff }}</td>
    <td><a href="javascript:refresh_apikey({{ acc.api_user_id }})">Refresh</a>,&nbsp;
        <a href="{% url sso.views.eveapi_log acc.api_user_id %}">Logs</a>,&nbsp;
        <a href="{% url sso.views.eveapi_del acc.api_user_id %}">Delete</a></td>
</tr>
</tbody>
{% endfor %}
</table>
{% endif %}
<p>
<a href="{% url sso.views.eveapi_add %}">Add a Eve API key</a><commit_msg>Update the status as well<commit_after>{% extends "base.html" %}

{% load naturaltimediff %}

{% block title %}Your Profile{% endblock %}

{% block content %}

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.js"></script>
<script type="text/javascript">

function refresh_apikey(key) {
    $("#api-status-" + key).html("<center><img src='/static/img/spinner.gif'/></center>");
    $("#api-time-" + key).html("<center><img src='/static/img/spinner.gif'/></center>");  
    $.getJSON("/profile/refresh/eveapi/" + key + "/", function(json) {
            $("#api-time-" + json[0].fields.api_user_id).html("a moment ago");

            switch(json[0].fields.api_status) {
                case 0:
                    $("#api-status-" + json[0].fields.api_user_id).html("Unknown");
                    break;
                case 1:
                    $("#api-status-" + json[0].fields.api_user_id).html("OK");
                    break;
                case 2:
                    $("#api-status-" + json[0].fields.api_user_id).html("Other Error");
                    break;
                case 3:
                    $("#api-status-" + json[0].fields.api_user_id).html("Account Expired");
                    break;
                default:
                    $("#api-status-" + json[0].fields.api_user_id).html("Error");
                    break;
            }
    });
}

</script>


<h1>Your Profile</h1>

<p>
<b>Username:</b> {{ user.username }}<br/>
<b>Email:</b> {{ user.email }}<br/>
</p>

<h2>External API Auth Services</h2>
<p>To reset your External API Auth Services password, which is used to access tools and websites which use Auth's API, click the link below</p>
<p><a href="{% url sso.views.set_apipasswd %}">Reset External API Auth Services Password</a></p>

{% if user.eveaccount_set.all %}
<h2>External non-API Service Accounts</h2>
<p>This is a list of all your current non-api external service accounts, to
create a login for a service click the Add Service link</p>
{% if user.serviceaccount_set.all %}
<table>
<thead>
<tr><th>Service</th><th>Username</th><th>URL</th><th>Active</th><th>Actions</th></tr>
</thead>
<tbody>
{% for acc in user.serviceaccount_set.all %}
<tr><td>{{ acc.service }}</td>
    <td>{{ acc.service_uid }}</td>
    <td><a href="{{ acc.service.url }}">{{ acc.service.url }}</a></td>
    <td>{% if acc.active %}Yes{% else %}No{% endif %}</td>
    <td>
    {% if acc.active %}
    <a href="{% url sso.views.service_reset acc.id %}">Reset</a>&nbsp;/&nbsp;
    <a href="{% url sso.views.service_del acc.id %}">Delete</a>
    {% if acc.service.provide_login %}
    &nbsp;/&nbsp;<a href="{% url sso.views.service_login acc.id %}">Login</a>
    {% endif %}
    {% endif %}
    </td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}

<p>
<a href="{% url sso.views.service_add %}">Add Service</a>
</p>

<br/>
{% endif %}

<h2>Eve API Keys</h2>
<p>Adding an Eve API key will allow you to access any services allowed for your
corporation. Limited keys are accepted for service validation. API keys
are stored for on-going authentication. As the assigned owner of a key you may
remove them at any time, but this may affect any existing services you have
setup.</p>
{% 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><th>Actions</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 id="api-status-{{ acc.api_user_id }}">{{ acc.get_api_status_display }}</td>
    <td id="api-time-{{ acc.api_user_id }}">{{ acc.api_last_updated|naturaltimediff }}</td>
    <td><a href="javascript:refresh_apikey({{ acc.api_user_id }})">Refresh</a>,&nbsp;
        <a href="{% url sso.views.eveapi_log acc.api_user_id %}">Logs</a>,&nbsp;
        <a href="{% url sso.views.eveapi_del acc.api_user_id %}">Delete</a></td>
</tr>
</tbody>
{% endfor %}
</table>
{% endif %}
<p>
<a href="{% url sso.views.eveapi_add %}">Add a Eve API key</a>
{'fraction_non_alphanumeric': 0.20898936886018032, 'fraction_numerical': 0.004306284483918719, 'mean_word_length': 3.47710843373494, 'pattern_counts': {'":': 0, '<': 252, '<?xml version=': 0, '>': 252, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '894321', 'n_tokens_mistral': 2788, 'n_tokens_neox': 2593, 'n_words': 637}