Skip to content

Commit f8475f1

Browse files
committed
Improve login box
1 parent 0a9c619 commit f8475f1

File tree

3 files changed

+18
-32
lines changed

3 files changed

+18
-32
lines changed

client/core/app.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ box, session, addons, box, files, commands, menu, tabs, panels, operations, loca
9393
var password = hr.Cookies.get("token");
9494

9595
if (!box.isAuth() && ((email && password) || (email && box.get("public"))) && this._autologin) {
96-
this.doLogin(email, password, true);
96+
this.doLogin(email, password);
9797
return;
9898
}
9999
return Application.__super__.render.apply(this, arguments);
@@ -168,13 +168,12 @@ box, session, addons, box, files, commands, menu, tabs, panels, operations, loca
168168

169169
var email = this.$(".login-box #login-email").val();
170170
var password = this.$(".login-box #login-token").val();
171-
var tosave = this.$(".login-box #login-save").is(":checked");
172171

173-
this.doLogin(email, password, tosave);
172+
this.doLogin(email, password);
174173
},
175174

176175
// Do login
177-
doLogin: function(email, password, tosave) {
176+
doLogin: function(email, password) {
178177
var that = this;
179178

180179
// If public: generate a random password
@@ -198,13 +197,9 @@ box, session, addons, box, files, commands, menu, tabs, panels, operations, loca
198197
}
199198

200199
return session.start(email, password).then(function() {
201-
if (tosave) {
202-
hr.Cookies.set("email", email);
203-
hr.Cookies.set("token", password);
204-
} else {
205-
hr.Cookies.set("email", "");
206-
hr.Cookies.set("token", "");
207-
}
200+
hr.Cookies.set("email", email);
201+
hr.Cookies.set("token", password);
202+
208203
that.render();
209204
}).fail(function(err) {
210205
that._autologin = false;

client/resources/stylesheets/ui/login.less

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
left: 0px;
88
right: 0px;
99
bottom: 0px;
10-
background: #fff;
10+
background: #f7f7f7;
1111

1212
.login-box {
1313
position: absolute;
@@ -18,8 +18,8 @@
1818
margin-top: -(@boxHeight/2);
1919
padding: 20px 20px 20px;
2020
border-radius: 2px;
21-
background-color: #f7f7f7;
22-
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
21+
background-color: #fff;
22+
border: 1px solid #ddd;
2323

2424

2525
.form-group {
@@ -30,13 +30,12 @@
3030
}
3131

3232
.header {
33-
font-size: 50px;
34-
line-height: 150px;
35-
opacity: 0.15;
33+
line-height: 100px;
3634
text-align: center;
35+
margin-bottom: 20px;
3736

38-
.fa-stack {
39-
width: 2.8em;
37+
img {
38+
width: 92px;
4039
}
4140
}
4241

client/resources/templates/main.html

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,22 @@
2525
<div class="cb-login">
2626
<div class="login-box">
2727
<div class="header">
28-
<span class="fa-stack">
29-
<i class="fa fa-cloud fa-stack-2x"></i>
30-
<i class="fa fa-code fa-stack-1x fa-inverse"></i>
31-
</span>
28+
<img src="http://localhost:8000/static/images/icons/128.png" />
3229
</div>
3330
<div class="inner">
3431
<% if (hr.offline.isConnected()) { %>
3532
<div class="form-group">
36-
<input type="email" class="form-control input-lg" name="login-email" id="login-email" placeholder="Enter email" value="<%- email %>" autocomplete="off">
33+
<input type="email" class="form-control input-lg" name="login-email" id="login-email" placeholder="Email" value="<%- email %>" autocomplete="off">
3734
<% if (session.box.get("public")) { %>
38-
<p class="help-block">This box is public, please enter an email to log in.</p>
35+
<p class="help-block">This workspace is public, enter an email to identify yourself (GIT and collaborators).</p>
3936
<% } %>
4037
</div>
4138
<% if (!session.box.get("public")) { %>
4239
<div class="form-group">
43-
<input type="password" class="form-control input-lg" name="login-token" id="login-token" placeholder="Enter token" value="<%- token %>" autocomplete="off">
40+
<input type="password" class="form-control input-lg" name="login-token" id="login-token" placeholder="Password" value="<%- token %>" autocomplete="off">
4441
</div>
4542
<% } %>
46-
<div class="checkbox">
47-
<label>
48-
<input type="checkbox" id="login-save" checked> Remember me
49-
</label>
50-
</div>
51-
<button id="login-submit" class="btn btn-lg btn-block btn-primary">Login</button>
43+
<button id="login-submit" class="btn btn-lg btn-block btn-default">Enter</button>
5244
<% } else { %>
5345
<div class="form-group">
5446
<p class="help-block">Sorry, You can't use this workspace in offline mode.</p>

0 commit comments

Comments
 (0)