/
profile.hbs
154 lines (148 loc) · 10.7 KB
/
profile.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<div data-user_id="{{data.account._id}}" class="hide"></div>
<div data-host="{{data.host}}" class="hide"></div>
<div class="grid grid-collapse page-content no-border-top" ng-controller="profileCtrl"
ng-init="
otpEnabled={{#isNotNull data.account.tOTPKey}}true{{else}}false{{/isNotNull}};
init();
">
<div class="page-title uk-width-1-1 noshadow page-title-border-bottom">
<p class="left">{{data.account.fullname}}</p>
<div class="right" style="margin: 15px 15px 0 0;">
<!--<button class="md-btn md-btn-white md-btn-flat-primary md-btn-wave md-btn-wave-light md-btn-small" ng-click="showTour();">Show Tour</button>-->
</div>
</div>
<!--Content Here-->
<div class="page-wrapper scrollable no-overflow-x full-height">
<div id="page-content-inner" class="uk-grid">
<div class="uk-width-1-1 relative">
<div class="profilePicFormWrap no-touch uk-width-1-1 uk-float-left">
<form id="aUploadImageForm" class="form nomargin uk-clearfix" enctype="multipart/form-data">
<input type="hidden" name="_id" value="{{data.account._id}}" />
<input type="hidden" name="username" value="{{data.account.username}}" />
<div class="largeProfilePic cursor-pointer hoverEffect" style="position: absolute; left: 35px; top: 0;" onclick="onProfileImageClick()">
<input id="profileImageInput" name="aProfile_{{data.account.username}}" type="file" value="{{data.account.image}}" style="visibility: hidden; height: 0; width: 0" />
{{#if data.account.image}}
<img id="profileImage" data-userid="{{data.account._id}}" src="/uploads/users/{{data.account.image}}" alt="{{data.account.username}}"/>
{{else}}
<img id="profileImage" data-userid="{{data.account._id}}" src="/uploads/users/defaultProfile.jpg" alt="{{data.account.username}}"/>
{{/if}}
<div class="img-caption">
<h3>Upload Profile Image</h3>
<span>Image must be square and at least 256x256</span>
</div>
</div>
</form>
</div>
<div class="totp-settings-wrap uk-float-left" style="min-width: 256px; margin-top: 275px;">
<div class="panel trupanel nopadding no-hover-shadow uk-overflow-hidden">
<div class="left">
<h6 style="padding: 0 0 0 15px; margin: 15px 0 0 0; font-size: 12px; line-height: 10px;">Two Factor Authentication</h6>
<h5 style="padding: 0 0 10px 15px; margin: 2px 0 0 0; font-size: 10px;" class="uk-text-muted">
Extra account security.
</h5>
</div>
<div class="right" style="position:relative;">
<!-- Switch -->
<div class="md-switch md-green" style="margin: 20px 0 0 0;">
<label>
<input id="tpsEnabled" name="tpsEnabled" type="checkbox" ng-model="otpEnabled" ng-click="otpChange($event)">
<span class="lever"></span>
</label>
</div>
</div>
<hr class="nomargin-top clear">
<div class="panel-body2" style="margin: 10px 7px 7px 7px;">
<div class="uk-margin-small-bottom">
<label for="tOTPKey" style="color:#727272;">Shared Key</label>
<input id="tOTPKey" type="text" class="md-input md-input-width-medium" value="{{data.account.tOTPKey}}" disabled />
</div>
<div id="totp-qrcode"
data-hasKey="{{#isNotNull data.account.tOTPKey}}true{{else}}false{{/isNotNull}}"
data-totpkey="otpauth://totp/{{data.host}}-{{data.account.username}}:{{data.host}}-{{data.account.username}}?secret={{data.account.tOTPKey}}&issuer=Trudesk">
</div>
</div>
</div>
</div>
<form id="updateProfileForm" class="uk-form-stacked" action="" method="POST">
<input name="aId" type="hidden" value="{{data.account._id}}" />
<div style="margin-left: 285px;">
<div class="profile-item-wrap uk-margin-medium-bottom">
<div class="panel trupanel nopadding no-hover-shadow uk-overflow-hidden" style="min-height: 60px; height: auto;">
<div>
<h6 style="padding: 0 0 0 15px; margin: 15px 0 0 0; font-size: 16px; line-height: 14px;">User Information</h6>
<h5 style="padding: 0 0 10px 15px; margin: 2px 0 0 0; font-size: 12px;" class="uk-text-muted">
Your profile information.
</h5>
</div>
<hr class="nomargin-top">
<div class="panel-body2" style="padding: 20px 15px 15px 15px;">
<div class="">
<div class="uk-margin-medium-bottom">
<label for="aUsername" style="color: #727272;">Username</label>
<input id="aUsername" class="md-input md-input-width-medium" name="aUsername" type="text" disabled value="{{data.account.username}}" />
</div>
<div class="uk-margin-medium-bottom">
<label for="aFullname">Name</label>
<input id="aFullname" class="md-input md-input-width-medium" name="aFullname" type="text" value="{{data.account.fullname}}" />
</div>
<div class="uk-margin-medium-bottom">
<label for="aPass">Password</label>
<input id="aPass" class="md-input" name="aPass" type="password" data-validation="length" data-validation-length="max255" data-validation-error-msg="Password too long. Maximum length is 25 characters." />
</div>
<div class="uk-margin-medium-bottom">
<label for="aPassConfirm">Confirm Password</label>
<input id="aPassConfirm" class="md-input" name="aPassConfirm" type="password" data-validation="length" data-validation-length="max255" data-validation-error-msg="Password too long. Maximum length is 25 characters." />
</div>
<div class="uk-margin-medium-bottom">
<label for="aEmail">Email</label>
<input id="aEmail" class="md-input" name="aEmail" type="email" value="{{data.account.email}}" data-validation="email" data-validation-error-msg="Please enter a valid email address."/>
</div>
<div class="uk-clearfix">
<button type="submit" class="uk-float-right md-btn md-btn-small md-btn-success md-btn-wave-light" ng-click="updateUser($event)">Save</button>
</div>
</div>
</div>
</div>
</div>
<div class="profile-item-wrap uk-margin-medium-bottom">
<div class="panel trupanel nopadding no-hover-shadow uk-overflow-hidden" style="min-height: 60px; height: auto;">
<div class="left">
<h6 style="padding: 0 0 0 15px; margin: 15px 0 0 0; font-size: 16px; line-height: 14px;">Mobile API Token</h6>
<h5 style="padding: 0 0 10px 15px; margin: 2px 0 0 0; font-size: 12px;" class="uk-text-muted">
API Token for the trudesk mobile app.
</h5>
</div>
<div class="right" style="position:relative; padding: 15px;">
<button
type="button"
class="uk-float-right md-btn md-btn-small md-btn-danger md-btn-wave-light removeApiButton {{#unless data.account.accessToken}} hide {{/unless}}"
ng-click="removeApiKey($event)">Remove Token
</button>
<button
type="button"
class="uk-float-right md-btn md-btn-small md-btn-success md-btn-wave-light generateApiButton {{#if data.account.accessToken}} hide {{/if}}"
ng-click="generateApiKey($event)">Generate Token
</button>
</div>
<hr class="nomargin-top clear">
<div class="panel-body2" style="padding: 20px 15px 15px 15px">
<div class="uk-margin-medium-bottom">
<label for="aApiKey" style="color: #727272;">API Token</label>
<input type="text" id="aApiKey" class="md-input" name="aApiKey" value="{{data.account.accessToken}}" readonly>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{{#contentFor 'js-plugins'}}
<script type="text/javascript">
function onProfileImageClick() {
document.getElementById('profileImageInput').click()
}
</script>
{{/contentFor}}