mirror of https://gitee.com/bigwinds/arangodb
removed userProfileView.*
This commit is contained in:
parent
83da043073
commit
51ff024337
|
@ -1,93 +0,0 @@
|
|||
<script id="userProfileView.ejs" type="text/template">
|
||||
<div class="headerBar">
|
||||
<a class="arangoHeader">
|
||||
User Profile
|
||||
</a>
|
||||
</div>
|
||||
<div class="contentDiv" id="profileContent">
|
||||
<table class="arangoDataTable contentTables">
|
||||
<tr>
|
||||
<td class="pull-right">
|
||||
<%=img%>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<div>USERNAME:</div>
|
||||
<div><%=username%></div>
|
||||
</div>
|
||||
<div>
|
||||
<div>NAME:</div>
|
||||
<div><%=name%></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="editUserProfileModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true" style="display:none">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<a class="arangoHeader">Edit User Profile</a>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Username:</th>
|
||||
<th id="editUsername"></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name:</th>
|
||||
<th><input type="text" id="editName" name="name" value="" placeholder="Name"/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Gravatar account (Mail):</th>
|
||||
<th><input type="text" id="editUserProfileImg" name="img" value="" placeholder="myAccount@gravatar.com"/></th>
|
||||
<th class="tooltipInfoTh">
|
||||
<div>
|
||||
<a class="modalInfoTooltips" data-toggle="tooltip" data-placement="left"
|
||||
title="Mailaddress or its md5 representation of your gravatar account. The address will be converted into a md5 string. Only the md5 string will be stored, not the mailaddress.">
|
||||
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
|
||||
</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="button-close" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<button id="callEditUserPassword" class="button-danger pull-right">Change Password</button>
|
||||
<button id="submitEditUserProfile" class="button-success pull-right">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="editUserPasswordModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true" style="display:none">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<a class="arangoHeader">Edit User Password</a>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Old Password:</th>
|
||||
<th><input type="password" id="oldPassword" name="oldPassword" value="" placeholder="old password"/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>New Password:</th>
|
||||
<th><input type="password" id="newPassword" name="newPassword" value="" placeholder="new password"/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Confirm New Password:</th>
|
||||
<th><input type="password" id="confirmPassword" name="confirmPassword" value="" placeholder="confirm password"/></th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="button-close" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<button id="submitEditUserPassword" class="button-success pull-right">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
|
@ -1,99 +0,0 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global window, document, Backbone, EJS, SwaggerUi */
|
||||
/*global hljs, $, arangoHelper, templateEngine, CryptoJS */
|
||||
(function() {
|
||||
|
||||
"use strict";
|
||||
|
||||
window.userProfileView = Backbone.View.extend({
|
||||
el: '#content',
|
||||
|
||||
template: templateEngine.createTemplate("userProfileView.ejs"),
|
||||
|
||||
events: {
|
||||
"click #profileContent" : "editUserProfile",
|
||||
"click #submitEditUserProfile" : "submitEditUserProfile"
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
this.collection.fetch({async:false});
|
||||
this.user = this.collection.findWhere({loggedIn: true});
|
||||
},
|
||||
|
||||
render: function(){
|
||||
var img = this.getAvatarSource(this.user.get("extra").img);
|
||||
$(this.el).html(this.template.render({
|
||||
img : img,
|
||||
name : this.user.get("extra").name,
|
||||
username : this.user.get("user")
|
||||
|
||||
}));
|
||||
|
||||
$("[data-toggle=tooltip]").tooltip();
|
||||
|
||||
$('.modalInfoTooltips').tooltip({
|
||||
placement: "left"
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
editUserProfile : function() {
|
||||
this.collection.fetch();
|
||||
$('#editUsername').html(this.user.get("user"));
|
||||
$('#editName').val(this.user.get("extra").name);
|
||||
$('#editUserProfileImg').val(this.user.get("extra").img);
|
||||
|
||||
this.showModal('#editUserProfileModal');
|
||||
},
|
||||
|
||||
submitEditUserProfile : function() {
|
||||
var name = $('#editName').val();
|
||||
var img = $('#editUserProfileImg').val();
|
||||
|
||||
img = this.parseImgString(img);
|
||||
/* if (!this.validateName(name)) {
|
||||
$('#editName').closest("th").css("backgroundColor", "red");
|
||||
return;
|
||||
}*/
|
||||
|
||||
this.user.save({"extra": {"name":name, "img":img}});
|
||||
this.hideModal('#editUserProfileModal');
|
||||
this.updateUserProfile();
|
||||
},
|
||||
|
||||
updateUserProfile: function() {
|
||||
var self = this;
|
||||
this.collection.fetch({
|
||||
success: function() {
|
||||
self.render();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
showModal: function(dialog) {
|
||||
$(dialog).modal('show');
|
||||
},
|
||||
|
||||
hideModal: function(dialog) {
|
||||
$(dialog).modal('hide');
|
||||
},
|
||||
|
||||
|
||||
getAvatarSource: function(img) {
|
||||
var result = '<img src="';
|
||||
if(img) {
|
||||
result += 'https://s.gravatar.com/avatar/';
|
||||
result += img;
|
||||
result += '?s=150';
|
||||
} else {
|
||||
result += 'img/arangodblogoAvatar_150.png';
|
||||
}
|
||||
result += '" />';
|
||||
return result;
|
||||
}
|
||||
|
||||
});
|
||||
}());
|
|
@ -163,13 +163,10 @@
|
|||
"frontend/js/views/appDocumentationView.js",
|
||||
"frontend/js/views/graphView.js",
|
||||
"frontend/js/views/graphManagementView.js",
|
||||
"frontend/js/views/addNewGraphView.js",
|
||||
"frontend/js/views/deleteGraphView.js",
|
||||
"frontend/js/views/dbSelectionView.js",
|
||||
"frontend/js/views/editListEntryView.js",
|
||||
"frontend/js/views/loginView.js",
|
||||
"frontend/js/views/userManagementView.js",
|
||||
"frontend/js/views/userProfileView.js",
|
||||
"frontend/js/views/userBarView.js",
|
||||
|
||||
"frontend/js/views/statisticBarView.js",
|
||||
|
@ -261,7 +258,6 @@
|
|||
"test/specs/views/documentsViewSpec.js",
|
||||
"test/specs/views/documentViewSpec.js",
|
||||
"test/specs/views/graphManagementViewSpec.js",
|
||||
"test/specs/views/addNewGraphViewSpec.js",
|
||||
"test/specs/views/newLogsViewSpec.js",
|
||||
"test/specs/router/routerSpec.js",
|
||||
"test/specs/router/clusterRouterSpec.js"
|
||||
|
|
Loading…
Reference in New Issue