git://git.onelab.eu
/
myslice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
caafec9
)
MyAcc: using JS confirm instead of JS Alert
author
Yasin
<mohammed-yasin.rahman@lip6.fr>
Mon, 20 Jan 2014 17:02:53 +0000
(18:02 +0100)
committer
Yasin
<mohammed-yasin.rahman@lip6.fr>
Mon, 20 Jan 2014 17:02:53 +0000
(18:02 +0100)
portal/accountview.py
patch
|
blob
|
history
portal/static/css/account_view.css
patch
|
blob
|
history
portal/static/js/my_account.edit_profile.js
patch
|
blob
|
history
portal/templates/account-view.html
patch
|
blob
|
history
diff --git
a/portal/accountview.py
b/portal/accountview.py
index
73b55fd
..
f3a1527
100644
(file)
--- a/
portal/accountview.py
+++ b/
portal/accountview.py
@@
-328,7
+328,7
@@
def account_process(request):
public_key = public_key.replace('"', '');
user_pub_key = {'keys': public_key}
sfa_update_user(request, user_hrn, user_pub_key)
public_key = public_key.replace('"', '');
user_pub_key = {'keys': public_key}
sfa_update_user(request, user_hrn, user_pub_key)
- messages.success(request, 'Sucess: New Keypair Generated!')
+ messages.success(request, 'Sucess: New Keypair Generated!
Delegation of your credentials will be automatic.
')
return HttpResponseRedirect("/portal/account/")
else:
messages.error(request, 'Account error: You need an account in myslice platform to perform this action')
return HttpResponseRedirect("/portal/account/")
else:
messages.error(request, 'Account error: You need an account in myslice platform to perform this action')
@@
-413,6
+413,7
@@
def account_process(request):
user_params = { 'config': updated_config, 'auth_type':'user'}
manifold_update_account(request,user_params)
messages.success(request, 'Private Key deleted. You need to delegate credentials manually once it expires.')
user_params = { 'config': updated_config, 'auth_type':'user'}
manifold_update_account(request,user_params)
messages.success(request, 'Private Key deleted. You need to delegate credentials manually once it expires.')
+ messages.success(request, 'Once your credentials expire, Please delegate manually using SFA: http://trac.myslice.info/wiki/DelegatingCredentials')
return HttpResponseRedirect("/portal/account/")
else:
messages.error(request, 'Delete error: Private key is not stored in the server')
return HttpResponseRedirect("/portal/account/")
else:
messages.error(request, 'Delete error: Private key is not stored in the server')
diff --git
a/portal/static/css/account_view.css
b/portal/static/css/account_view.css
index
f445aee
..
4984ed0
100644
(file)
--- a/
portal/static/css/account_view.css
+++ b/
portal/static/css/account_view.css
@@
-262,6
+262,24
@@
table.profile button {
margin-right: 15px;
}
margin-right: 15px;
}
+#delete {
+ width: 80px;
+ vertical-align: middle;
+ float: right;
+ margin-right: 15px;
+
+}
+
+#upload_key {
+ width: 80px;
+ vertical-align: middle;
+ float: right;
+ margin-right: 15px;
+
+}
+
+
+
table.profile span.hide_this{
display: inline;
display: none;
table.profile span.hide_this{
display: inline;
display: none;
diff --git
a/portal/static/js/my_account.edit_profile.js
b/portal/static/js/my_account.edit_profile.js
index
dcbfbb3
..
70607ba
100644
(file)
--- a/
portal/static/js/my_account.edit_profile.js
+++ b/
portal/static/js/my_account.edit_profile.js
@@
-162,16
+162,19
@@
jQuery(document).ready(function(){
});
});
});
});
-// alert box for the "Generate new Key Pair button"
-function
myFunction
()
+
+function
editAlert
()
{
{
-alert("You have requested to generate new key pairs. Please download and save the new keypairs after receiving the success message.");
+alert("You can't edit email/authority. Please contact support and specify your requirements.");
+window.location.href = "/portal/contact/";
}
}
-function emailAlert()
+
+/*
+// alert box for the "Generate new Key Pair button"
+function myFunction()
{
{
-alert("To edit email please contact the administratior. You will be redirected to the support page now");
-window.location.href = "/portal/contact/";
+alert("You have requested to generate new key pairs. Please download and save the new keypairs after receiving the success message.");
}
function affAlert()
}
function affAlert()
@@
-179,7
+182,7
@@
function affAlert()
alert("To edit affiliation please contact the administratior. You will be redirected to the support page now");
window.location.href = "/portal/contact/";
}
alert("To edit affiliation please contact the administratior. You will be redirected to the support page now");
window.location.href = "/portal/contact/";
}
-/*
+
// alert having ok or cancel option
function show_confirm()
{
// alert having ok or cancel option
function show_confirm()
{
diff --git
a/portal/templates/account-view.html
b/portal/templates/account-view.html
index
83e03d3
..
3c3d543
100644
(file)
--- a/
portal/templates/account-view.html
+++ b/
portal/templates/account-view.html
@@
-26,7
+26,7
@@
<td class="key">Email</td>
<td class="value">
<span id="emailval" class="value" >{{ person.email }}</span>
<td class="key">Email</td>
<td class="value">
<span id="emailval" class="value" >{{ person.email }}</span>
- <button class="btn btn-default btn-xs" type="button" id="edit_email" onclick="e
mail
Alert()" title="To change your affiliation please contact the administrator">
+ <button class="btn btn-default btn-xs" type="button" id="edit_email" onclick="e
dit
Alert()" title="To change your affiliation please contact the administrator">
<span class="glyphicon glyphicon-question-sign"></span> Edit
</button>
</td>
<span class="glyphicon glyphicon-question-sign"></span> Edit
</button>
</td>
@@
-78,17
+78,17
@@
<td class="key">Authority</td>
<td class="value">
<span id="affval" class="value">{{ authority }}</span>
<td class="key">Authority</td>
<td class="value">
<span id="affval" class="value">{{ authority }}</span>
- <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="
aff
Alert()" title="To change your authority please contact the administrator">
+ <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="
edit
Alert()" title="To change your authority please contact the administrator">
<span class="glyphicon glyphicon-question-sign"></span> Edit
</button>
</td>
</tr>
<tr class="even">
<td class="key">Generate Keys</td>
<span class="glyphicon glyphicon-question-sign"></span> Edit
</button>
</td>
</tr>
<tr class="even">
<td class="key">Generate Keys</td>
- <td>
- <
button id="generate_keypair" class="btn btn-danger btn-xs" name="generate" type="submit" onclick="myFunction()
"
- title="Generate a new key pair. After it is generated, you will need to download your public and private keys again.">Generate a new Key Pair
-
</button
>
+ <td>
+ <
input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair
"
+ onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
+
title="It will generate a new key Pair and your current credentials will be overwritten."/
>
</td>
</tr>
<tr class="odd">
</td>
</tr>
<tr class="odd">
@@
-98,11
+98,10
@@
<span class="hide_this" id="span_upload">
<button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
<div style='display:none;'>
<span class="hide_this" id="span_upload">
<button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
<div style='display:none;'>
- <input type='hidden' name='upload' /></div>
- <input type="file" name="pubkey" class="required" id="pubkey"/>
- <button class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key">
- <span class="glyphicon glyphicon-upload"></span> Upload
- </button>
+ <input type='hidden' name='upload' /></div>
+ <input type="file" name="pubkey" class="required" id="pubkey"/>
+ <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
+ onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
</span>
<div style='display:none;'> <input type='hidden' name='dload' /> </div>
<button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
</span>
<div style='display:none;'> <input type='hidden' name='dload' /> </div>
<button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
@@
-120,7
+119,8
@@
<button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
<span class="glyphicon glyphicon-download"></span> Download
</button>
<button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
<span class="glyphicon glyphicon-download"></span> Download
</button>
- <button class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" title="Delete your private key">Delete </button>
+ <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
+ onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
</td>
{%else%}
<td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
</td>
{%else%}
<td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
@@
-128,7
+128,8
@@
<button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
<span class="glyphicon glyphicon-download"></span> Download
</button>
<button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
<span class="glyphicon glyphicon-download"></span> Download
</button>
- <button class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key">Delete </button>
+ <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key"
+ value="Delete" />
</td>
{%endif%}
</tr>
</td>
{%endif%}
</tr>