-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathsetting.html
More file actions
167 lines (149 loc) · 6.22 KB
/
setting.html
File metadata and controls
167 lines (149 loc) · 6.22 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
<%- partial('../sidebar') %>
<div id='content'>
<div class='panel'>
<div class='header'>
<ul class='breadcrumb'>
<li><a href='/'>主页</a><span class='divider'>/</span></li>
<li class='active'>设置</li>
</ul>
</div>
<div class='inner'>
<% if(typeof(error) !== 'undefined' && error){ %>
<div class="alert alert-error">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong><%= error %></strong>
</div>
<% } %>
<% if (typeof(success) !== 'undefined' && success) { %>
<div class="alert alert-success">
<strong><%= success %></strong>
</div>
<% } %>
<form id='setting_form' class='form-horizontal' action='/setting' method='post'>
<div class='control-group'>
<label class='control-label' for='name'>用户名</label>
<div class='controls'>
<input class='input-xlarge readonly' id='name' name='name' size='30' type='text' readonly='true'
value="<%= loginname %>"/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='email'>电子邮件</label>
<div class='controls'>
<input class='input-xlarge readonly' id='email' name='email' size='30' type='text'
readonly='true' value="<%= email %>"/>
<p>同时决定了 Gravatar 头像</p>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='url'>个人网站</label>
<div class='controls'>
<input class='input-xlarge' id='url' name='url' size='30' type='text' value="<%= typeof(url) !== 'undefined' ? url : '' %>"/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='location'>所在地点</label>
<div class='controls'>
<input class='input-xlarge' id='location' name='location' size='30' type='text'
value="<%= typeof(location) !== 'undefined' ? location : '' %>"/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='weibo'>微博</label>
<div class='controls'>
<input class='input-xlarge' id='weibo' name='weibo' size='30' type='text' value="<%= typeof(weibo) !== 'undefined' ? weibo : '' %>"
placeholder="e.g. http://weibo.com/cnodejs"/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='github'>GitHub</label>
<div class='controls'>
<input class='input-xlarge' id='github' name='github' size='30' type='text'
value="<%= typeof(githubUsername) !== 'undefined' ? '@' + githubUsername : '' %>" placeholder="@username" readonly="readonly" />
<p>请通过 GitHub 登陆 CNode 来修改此处</p>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='signature'>个性签名</label>
<div class='controls'>
<textarea class='input-xlarge' id='signature' name='signature' size='30'><%= typeof(signature) !== 'undefined' ? signature : "" %></textarea>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='notice'>回复邮件提醒</label>
<div class='controls'>
<select name='receive_reply_mail'>
<option value=1 <% if (typeof(receive_reply_mail) !== 'undefined' && receive_reply_mail == true) { %> selected <% } %>>开启</option>
<option value=0 <% if (typeof(receive_reply_mail) !== 'undefined' && receive_reply_mail == false) { %> selected <% } %>>关闭</option>
</select>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='notice'>@邮件提醒</label>
<div class='controls'>
<select name='receive_at_mail'>
<option value=1 <% if (typeof(receive_at_mail) !== 'undefined' && receive_at_mail == true) { %> selected <% } %>>开启</option>
<option value=0 <% if (typeof(receive_at_mail) !== 'undefined' && receive_at_mail == false) { %> selected <% } %>>关闭</option>
</select>
</div>
</div>
<input type='hidden' id='action' name='action' value='change_setting'/>
<input type='hidden' name='_csrf' value='<%= csrf %>'/>
<div class='form-actions'>
<input type='submit' class='span-primary submit_btn' data-loading-text="保存中.." value='保存设置'/>
</div>
</form>
</div>
</div>
<div class='panel'>
<div class='header'>
<span class='col_fade'>更改密码</span>
</div>
<div class='inner'>
<form id='change_pass_form' class='form-horizontal' action='/setting' method='post'>
<div class='control-group'>
<label class='control-label' for='old_pass'>当前密码</label>
<div class='controls'>
<input class='input-xlarge' type='password' id='old_pass' name='old_pass' size='30'/>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='new_pass'>新密码</label>
<div class='controls'>
<input class='input-xlarge' type='password' id='new_pass' name='new_pass' size='30'/>
</div>
</div>
<input type='hidden' id='action' name='action' value='change_password'/>
<input type='hidden' name='_csrf' value='<%= csrf %>'/>
<div class='form-actions'>
<input type='submit' class='span-primary submit_btn' data-loading-text="更改中.." value='更改密码'/>
</div>
</form>
</div>
</div>
<div class='panel'>
<div class='header'>
<span class='col_fade'>Access Token</span>
</div>
<div class='inner'>
<div>
<span>字符串:</span>
<%- accessToken %>
</div>
<div>
<span>二维码:</span>
<span id="access-token-qrcode"></span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
// qrcode generate
var accessToken = "<%- accessToken %>";
new QRCode(document.getElementById("access-token-qrcode"), {
text: accessToken,
width: 200,
height: 200,
});
// END qrcode generate
</script>