Commit 6fb16c9c authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[accounts/ui/statistics/navigation] updated look and feel of accounts from feedbacks

parent f01c557a
Pipeline #11686 failed with stage
in 25 minutes and 58 seconds
......@@ -289,7 +289,7 @@ class SuperviseeAddGodfatherView(BaseCreateSupervisionTrackViewSupervisee):
godfather = User.objects.get(username=supervisor_name)
if not godfather.profile.is_godfather:
#Not a valid godfather
reason = "Not a valid godfather request"
reason = "Not a valid supervisor request"
result = {
'error': reason,
}
......@@ -297,14 +297,14 @@ class SuperviseeAddGodfatherView(BaseCreateSupervisionTrackViewSupervisee):
else:
if godfather.profile.status == Profile.BLOCKED:
#Not a valid godfather
reason = "Not a valid godfather request"
reason = "Not a valid supervisor request"
result = {
'error': reason,
}
return BadRequestResponse(result)
except:
#This username does not exist but don't give too much information
reason = "Not a valid godfather request"
reason = "Not a valid supervisor request"
result = {
'error': reason,
}
......
......@@ -53,7 +53,7 @@ beat.accounts.dialogs.modal_renew_account = function(dialog_id, api_url, redirec
buttons: [
{
id: 'button-' + dialog_id + '-renameit',
text: 'Revalidate account',
text: 'Revalidate',
click: function() {
$.ajaxSetup({
......@@ -131,7 +131,7 @@ beat.accounts.dialogs.modal_change_supervisor = function(dialog_id, old_godfathe
buttons: [
{
id: 'button-' + dialog_id + '-renameit',
text: 'New supervision request',
text: 'Request',
click: function() {
var new_godfather_username = $('#' + dialog_id + ' #new_godfather_username')[0].value;
......@@ -140,13 +140,13 @@ beat.accounts.dialogs.modal_change_supervisor = function(dialog_id, old_godfathe
if (name.length == 0)
{
alert("You can't enter an empty godfather username!");
alert("You can't enter an empty supervisor username!");
return;
}
if (new_godfather_username == old_godfather_username)
{
alert("The new godfather username is the same as the previous one!");
alert("The new supervisor username is the same as the previous one!");
return;
}
......@@ -225,7 +225,7 @@ beat.accounts.dialogs.modal_add_supervisor = function(dialog_id, api_url, redire
buttons: [
{
id: 'button-' + dialog_id + '-renameit',
text: 'New supervision request',
text: 'Request',
click: function() {
var new_godfather_username = $('#' + dialog_id + ' #new_godfather_username')[0].value;
......@@ -234,7 +234,7 @@ beat.accounts.dialogs.modal_add_supervisor = function(dialog_id, api_url, redire
if (name.length == 0)
{
alert("You can't enter an empty godfather username!");
alert("You can't enter an empty supervisor username!");
return;
}
......@@ -310,7 +310,7 @@ beat.accounts.dialogs.modal_validate_supervisee = function(dialog_id, api_url, r
buttons: [
{
id: 'button-' + dialog_id + '-renameit',
text: 'Validation of supervisee account',
text: 'Accept',
click: function() {
$.ajaxSetup({
......@@ -384,7 +384,7 @@ beat.accounts.dialogs.modal_remove_supervisee = function(dialog_id, api_url, red
buttons: [
{
id: 'button-' + dialog_id + '-renameit',
text: 'Removal of supervisee account',
text: 'Reject',
click: function() {
$.ajaxSetup({
......
......@@ -23,9 +23,9 @@
<div id="{{ dialog_id }}" class="change_supervisor" style="display:none;" title="Supervision update">
<div class="settings">
<div><span id="infos"></span></div>
Take into account that requesting a new supervision will temporarely set your account in a rejected state until the request is validated by your new supervisor.<br>
Take into account that requesting a new supervision will temporarely set your account to an inactive state until the request is validated by your new supervisor.<br>
If your new supervisor rejects your supervision request, you need to find another supervisor.<br>
If no supervisor is found after a specific date, your account will be blocked and you will need to proceed with an unblock account request<br>
If no supervisor is found after a specific date, your account will be blocked and you will need to proceed with an account reactivation request<br>
<div><span class="label">New supervisor username: </span><input id="new_godfather_username" type="text" /></div>
<div><span class="documentation">A request for supervision will be sent to the new supervisor</span></div>
</div>
......
......@@ -23,6 +23,6 @@
<div id="{{ dialog_id }}" class="renew_account alert-warning" style="display:none;" title="Validate supervisee">
<div class="settings">
<div><span id="infos"></span></div>
This action will add the supervisee to your supervision list. You therefore acknowledge that this user is under your responsability.
This action will add the supervisee to your supervision list. You therefore acknowledge that this user works under your supervision and follows the platform terms of service.
</div>
</div>
......@@ -207,7 +207,11 @@
{% if user.profile.status == 'A' %}
<span class="label label-success" style="float:right">Status Accepted</span>
{% elif user.profile.status == 'R' %}
<span class="label label-danger" style="float:right">Status Rejected</span>
{% if user.profile.supervision_key == None %}
<span class="label label-danger" style="float:right">Status Rejected</span>
{% else %}
<span class="label label-warning" style="float:right">Status Pending</span>
{% endif %}
{% elif user.profile.status == 'Y' %}
<span class="label label-warning" style="float:right">Status Revalidation Required</span>
{% endif %}
......@@ -219,39 +223,41 @@
{% if user.profile.status == 'A' %}
<li class="list-group-item list-group-item-success" style="text-align:center;">Status is currently accepted: No action is directly required</li>
<br>
<h4>General Information</h4>
<h4>Supervision Information</h4>
<ul class="list-group">
<li class="list-group-item"><b>Supervisor:</b> {{ supervisiontrack.godfather.username }}</li>
<li class="list-group-item"><b>Supervision Track started on:</b> {{ supervisiontrack.start_date }}</li>
<li class="list-group-item"><b>Supervision Track last validation date:</b> {{ supervisiontrack.last_validation_date }}</li>
<li class="list-group-item"><b>Supervision Track expiration date:</b> {{ supervisiontrack.expiration_date }}</li>
<li class="list-group-item"><b>Supervisor:</b> <a href="{% url "activity-stream" supervisiontrack.godfather.username %}">{{ supervisiontrack.godfather.username }}</a></li>
<li class="list-group-item"><b>Supervision start date:</b> {{ supervisiontrack.start_date }}</li>
<li class="list-group-item"><b>Supervision last validation date:</b> {{ supervisiontrack.last_validation_date }}</li>
<li class="list-group-item"><b>Supervision expiration date:</b> {{ supervisiontrack.expiration_date }}</li>
</ul>
<div class="form-group" style="text-align: center;">
<input type="hidden" name="token" value="true">
<button type="button" class="btn btn-warning" onclick="beat.accounts.dialogs.modal_change_supervisor('change_supervisor', '{{ supervisiontrack.godfather.username }}', '{% url 'api_accounts:add_supervisor' supervisiontrack.godfather.username %}', '{% url 'accounts:settings' %}');"><i class="fa fa-refresh fa-fw fa-lg"></i> Wish to update supervision?</button>
<button type="button" class="btn btn-warning" onclick="beat.accounts.dialogs.modal_change_supervisor('change_supervisor', '{{ supervisiontrack.godfather.username }}', '{% url 'api_accounts:add_supervisor' supervisiontrack.godfather.username %}', '{% url 'accounts:settings' %}');"><i class="fa fa-refresh fa-fw fa-lg"></i> Change supervisor?</button>
</div>
{% elif user.profile.status == 'R' %}
<li class="list-group-item list-group-item-danger" style="text-align:center;">Status is rejected: You need to find a new supervisor</li>
<br>
{% if user.profile.supervision_key == None %}
<li class="list-group-item list-group-item-danger" style="text-align:center;">Status is rejected: You need to find a new supervisor</li>
<br>
<h4>General Information</h4>
<ul class="list-group">
<li class="list-group-item"><b>You need to find a new supervisor to continue using your account</b></li>
<li class="list-group-item"><b>Deadline account blockage date (if no supervisor):</b> {{ user.profile.rejection_date }}</li>
<li class="list-group-item"><i>If your account gets blocked you can still follow the unblock procedure to re-activate it.</i></li>
<li class="list-group-item"><i>If your account gets blocked you can still follow the account reactivation procedure to re-activate it.</i></li>
</ul>
<div class="form-group" style="text-align: center;">
<input type="hidden" name="token" value="true">
<button type="button" class="btn btn-danger" onclick="beat.accounts.dialogs.modal_add_supervisor('change_supervisor', '{% url 'api_accounts:add_supervisor' 'nogodfather' %}', '{% url 'accounts:settings' %}');"><i class="fa fa-plus fa-fw fa-lg"></i> Add a supervisor</button>
</div>
{% else %}
<li class="list-group-item list-group-item-warning" style="text-align:center;">Status is pending: You need to wait approval from supervisor</li>
<br>
<h4>General Information about a pending request</h4>
<ul class="list-group">
<li class="list-group-item"><b>Pending request made to supervisor:</b> {{ supervisiontrack.godfather.username }}</li>
<li class="list-group-item"><b>Deadline account blockage date (if no supervisor):</b> {{ user.profile.rejection_date }}</li>
<li class="list-group-item"><i>You need to be patient until this supervisor accepts your request. An email was sent about your request, but in the meantime you can remind him to accept your supervision.<br>
If this supervisor rejects your supervision request, you will be informed and you will get the opportunity to make a new one.<br>
If your account gets blocked you can still follow the unblock procedure to re-activate it.</i></li>
If your account gets blocked you can still follow the account reactivation procedure to re-activate it.</i></li>
</ul>
{% endif %}
<br>
......@@ -361,7 +367,7 @@
</table>
<li class="list-group-item"><i>Valid supervisees are marked in green and supervisees that are under a revalidation process (yearly basis) are marked in yellow.
You can remind them to revalidate there account before the expiration date or else their account will get blocked (and need to pass through an unblock procedure)</i><br>
You can remind them to revalidate their account before the expiration date or else their account will get blocked (and need to pass through an account reactivation procedure)</i><br>
{% endif %}
</div>
</form>
......
......@@ -89,7 +89,7 @@ class UserAdmin(UserAdmin):
if obj.is_staff:
return "Staff account"
if obj.profile.is_godfather:
return "Godfather account"
return "Supervisor account"
else:
supervisiontrack = SupervisionTrack.objects.get(supervisee=obj,
is_valid=True)
......
......@@ -46,7 +46,7 @@
<!-- summary statistics -->
<div class="row">
<div class="col-sm-3">
<div class="col-sm-offset-1 col-sm-2">
<h3>Totals <span class="badge">{{ totals.counter }} entries</span></h3>
<ul class="list-group">
<li class="list-group-item">CPU Time <span class="badge">{{ totals.cpu_time_hours }} h</span></li>
......@@ -58,7 +58,7 @@
</ul>
<p class="help">Instantaneous (not averaged over wallclock time)</p>
</div>
<div class="col-sm-3">
<div class="col-sm-2">
<h3>User Objects</h3>
<ul class="list-group">
<li class="list-group-item">Experiments <span class="badge">{{ totals.experiments }}</span></li>
......@@ -70,7 +70,7 @@
</ul>
<p class="help">Items contributed by users</p>
</div>
<div class="col-sm-3">
<div class="col-sm-2">
<h3>User Queries</h3>
<ul class="list-group">
<li class="list-group-item">Attestations <span class="badge">{{ totals.attestations }}</span></li>
......@@ -79,7 +79,7 @@
</ul>
<p class="help">User analysis and certification</p>
</div>
<div class="col-sm-3">
<div class="col-sm-2">
<h3>System Properties</h3>
<ul class="list-group">
<li class="list-group-item">Users <span class="badge">{{ totals.users }}</span></li>
......@@ -90,24 +90,21 @@
</ul>
<p class="help">Items available and managed by administrators</p>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<h3>Users Profiles</h3>
<div class="col-sm-2">
<h3>User Profiles</h3>
<ul class="list-group">
<li class="list-group-item">Total Users <span class="badge">{{ totals.users }}</span></li>
<li class="list-group-item">New Users Unvalidated <span class="badge">{{ totals.newusers }}</span></li>
<li class="list-group-item">New Users Waiting Validation <span class="badge">{{ totals.waitingvalidationusers}}</span></li>
<li class="list-group-item">Accepted Users <span class="badge">{{ totals.acceptedusers }}</span></li>
<li class="list-group-item">Year Revalidation Users <span class="badge">{{ totals.yearrevalidationusers }}</span></li>
<li class="list-group-item">Rejected Users <span class="badge">{{ totals.rejectedusers }}</span></li>
<li class="list-group-item">Blocked Users <span class="badge">{{ totals.blockedusers }}</span></li>
<li class="list-group-item">Total <span class="badge">{{ totals.users }}</span></li>
<li class="list-group-item">Awaiting Activation <span class="badge">{{ totals.newusers }}</span></li>
<li class="list-group-item">Awaiting Supervisor Validation <span class="badge">{{ totals.waitingvalidationusers}}</span></li>
<li class="list-group-item">Active <span class="badge">{{ totals.acceptedusers }}</span></li>
<li class="list-group-item">Year Revalidation <span class="badge">{{ totals.yearrevalidationusers }}</span></li>
<li class="list-group-item">Without Supervisor <span class="badge">{{ totals.rejectedusers }}</span></li>
<li class="list-group-item">Inactive <span class="badge">{{ totals.blockedusers }}</span></li>
</ul>
<p class="help">Users on the platform</p>
<p class="help">Profile status of users on the platform</p>
</div>
</div>
<!-- tabs -->
<div class="row">
<div class="col-sm-12">
......
......@@ -85,7 +85,7 @@ class RegistrationForm(forms.Form):
godfather = forms.RegexField(regex=r'^\w+$',
max_length=30,
widget=forms.TextInput(attrs=attrs_dict),
label=_(u'Godfather Username (Your account needs to be validated by a recognized person)'))
label=_(u'Supervisor Username'))
def clean_username(self):
......@@ -108,12 +108,12 @@ class RegistrationForm(forms.Form):
try:
user = User.objects.get(username__iexact=self.cleaned_data['godfather'])
if user.profile.status == Profile.BLOCKED:
raise forms.ValidationError(_(u'This user is not a valid godfather. Please choose another.'))
raise forms.ValidationError(_(u'This user is not a valid supervisor. Please choose another.'))
except User.DoesNotExist:
raise forms.ValidationError(_(u'This godfather username does not exist. Please choose another.'))
raise forms.ValidationError(_(u'This supervisor username does not exist. Please choose another.'))
if not user.profile.is_godfather:
raise forms.ValidationError(_(u'This user is not a recognized godfather. Please choose another.'))
raise forms.ValidationError(_(u'This user is not a recognized supervisor. Please choose another.'))
return self.cleaned_data['godfather']
......@@ -276,7 +276,7 @@ class BlockedUserRevalidationForm(forms.Form):
godfather = forms.RegexField(regex=r'^\w+$',
max_length=30,
widget=forms.TextInput(attrs=attrs_dict),
label=_(u'Godfather Username (Your account needs to be re-validated by a recognized person)'))
label=_(u'Supervisor Username (Your account needs to be re-validated by a recognized person)'))
def clean_username(self):
......@@ -298,10 +298,10 @@ class BlockedUserRevalidationForm(forms.Form):
try:
user = User.objects.get(username__iexact=self.cleaned_data['godfather'])
except User.DoesNotExist:
raise forms.ValidationError(_(u'This godfather username does not exist. Please choose another.'))
raise forms.ValidationError(_(u'This supervisor username does not exist. Please choose another.'))
if not user.profile.is_godfather:
raise forms.ValidationError(_(u'This user is not a recognized godfather. Please choose another.'))
raise forms.ValidationError(_(u'This user is not a recognized supervisor. Please choose another.'))
return self.cleaned_data['godfather']
......
......@@ -30,14 +30,14 @@
{% if account %}
<p class="text">Your account is almost activated. Welcome {{ account.username }}.
We have asked your "godfather" to validate your account and accept you as a
We have asked your "supervisor" to validate your account and accept you as a
supervisee. You will be informed by email once this is done.
In the meantime you can remind your "godfather"(supervisor) to validate
In the meantime you can remind your "supervisor" to validate
your account. You will then be able to <a href="{% url 'login' %}">sign in</a> and start your own experiments!</p>
{% else %}
<p class="text">Your account wasn't activated. Check that the URL you entered is correct.
If you already clicked on the link sent to you by email, you need to wait
for your "godfather"(supervisor) to accept your account activation request.
for your "supervisor" to accept your account activation request.
If you still have problems to activate your account, <a href="{% url 'contact' %}">contact a member of our support staff</a>.</p>
{% endif %}
......
......@@ -7,7 +7,7 @@ This can be done by going to your profile and making a revalidation request by
clicking on the corresponding button.
If you haven't done this by this expiration date: {{ expiration_date }}, your account
will be blocked and you will then need to go trough an unblock account
will be blocked and you will then need to go trough an account revalidation
procedure to re-activate it.
BEAT Administrators at the Idiap Research Institute
......@@ -14,4 +14,4 @@ account.
Your account will be blocked on {{ supervisee.profile.rejection_date }}. You have until this date to find a
supervisor. Passed this date your account will be blocked and you will need to
proceed with an unblock account request.
proceed with an account reactivation request.
Dear {{ supervisor.first_name }},
One of your supervisee has made a request to end your current supervision and request for a new one towards another supervisor related to his current situation.
One of your supervisees has made a request to end your current supervision and request for a new one towards another supervisor related to his current situation.
First Name: {{ supervisee.first_name }}
Last Name: {{ supervisee.last_name }}
Email: {{ supervisee.email }}
Username: {{ supervisee.username }}
This message is to inform you that you will not be responsible towards this supervisee in the current future.
This message is to inform you that you are no longer responsible towards this supervisee in the current future.
BEAT Administrators at the Idiap Research Institute
......@@ -2,7 +2,5 @@ Dear {{ supervisee.first_name }},
Your account was successfully activated by your supervisor {{ supervisor.username }}.
Welcome {{ supervisee.username }},
You can now <a href="{% url 'login' %}">sign in</a> and start your own
experiments!</p>
Dear {{ supervisor.first_name }},
Thank you in advance for validating the registration of one your supervisee at the Idiap Research Institute's Biometric
Thank you in advance for validating the registration of one your supervisees at the Idiap Research Institute's Biometric
Evaluation and Testing (BEAT) platform. Before we can activate his account
you must login to your account and under supervision tab validate the following supervisee:
......
Dear {{ supervisor.first_name }},
Thank you in advance for validating the request of one your supervisee at the Idiap Research Institute's Biometric
Thank you in advance for validating the request of one your supervisees at the Idiap Research Institute's Biometric
Evaluation and Testing (BEAT) platform. Before we can activate this
supervision request, you must login to your account and under supervision tab validate the following supervisee:
......
......@@ -10,7 +10,7 @@ Account Management click on "Add a supervisor" and validate it with a known
supervisor.
Failing to do so, your account will be blocked after a few weeks! (you
can however still re-activate it through an unblock account procedure)
can however still re-activate it through an account reactivation procedure)
If you are having problems to revalidate your account, contact a member of our
support staff at {{ prefix }}{% url 'contact' %}.
......
......@@ -97,6 +97,11 @@
{% for error in form.godfather.errors %}
<div class="alert alert-danger" role="alert">{{ error }}</div>
{% endfor %}
<div class="alert alert-warning" role="alert">Your account needs to
be validated by a recognized person on the platform. This recognized
person is known as a supervisor.
If you wish to become a supervisor, please follow the <a href="{% url 'contact' %}">contact information</a>
</div>
</div>
<div class="form-group{% if form.tos.errors %} has-error{% endif %}">
......
......@@ -165,7 +165,7 @@ def blocked_user_reactivation(request):
else:
messages.error(request, "A supervision request already exists for this account, you need to wait for your supervisor's decision.")
else:
messages.error(request, "The selected godfather is not valid.")
messages.error(request, "The selected supervisor is not valid.")
else:
path = request.GET.get('next', '/')
messages.error(request, "Your profile is not blocked, you can go to the login page instead.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment