Skip to content

Commit 0391a9e

Browse files
author
Robin Duda
committed
hide excel options + show supported extensions and verification status.
1 parent cf1acbb commit 0391a9e

File tree

3 files changed

+76
-13
lines changed

3 files changed

+76
-13
lines changed

src/main/resources/templates/index.jade

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ html(lang='en')
1515
p.text-danger Not connected, #[a(href=".") refresh?]
1616
div.col-xs-10.col-xs-offset-1.col-lg-4.col-lg-offset-4
1717
.panel.panel-info
18-
.panel-heading#panelheader Upload an .xlsx or .xls file!
18+
.panel-heading#panelheader Supported file types: #{context.supportedFiles}!
1919
.panel-body
2020
div#progress
2121
.progress
@@ -32,8 +32,10 @@ html(lang='en')
3232
label.col-lg-3.control-label(for='mapping') Mapping
3333
.col-lg-9
3434
input#index.form-control(type='text', name='mapping', placeholder='default')
35-
.form-group
36-
label.col-lg-3.control-label(for='offset') Title-row (excel)
35+
a.text-center.clickable#excel-options-show
36+
show excel options
37+
.form-group(hidden)#excel-options
38+
label.col-lg-3.control-label(for='offset') Title-row
3739
.col-lg-9
3840
input#offset.form-control(type='text', name='offset', value='1')
3941
.form-group

src/main/resources/webroot/css/style.css

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,57 @@ span.glyphicon {
1919
z-index: 1;
2020
}
2121

22+
#excel-options-show {
23+
width: 100%;
24+
text-align: center;
25+
display: block;
26+
margin-bottom: 8px;
27+
}
28+
29+
.clickable {
30+
cursor: pointer;
31+
}
32+
2233
#progress-bar {
2334
animation: 0.2s linear 0s normal none infinite progress-bar-stripes;
2435
transition: width 0.25s !important;
2536
}
37+
38+
.jumbotron {
39+
background-color: #ffffff32;
40+
color: #fff;
41+
}
42+
43+
body {
44+
background:
45+
linear-gradient(red, transparent),
46+
linear-gradient(to top left, lime, transparent),
47+
linear-gradient(to top right, blue, transparent);
48+
background-blend-mode: screen;
49+
height: 100%;
50+
margin: 0;
51+
background-repeat: no-repeat;
52+
background-attachment: fixed;
53+
}
54+
55+
html {
56+
height: 100%;
57+
}
58+
59+
a:link {
60+
color: darkkhaki;
61+
}
62+
63+
a:visited {
64+
color: darkkhaki;
65+
}
66+
67+
a:hover {
68+
color: yellow;
69+
text-decoration: none;
70+
}
71+
72+
a:active {
73+
color: cornsilk;
74+
text-decoration: none;
75+
}

src/main/resources/webroot/js/application.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ websock.onmessage = (e) => {
66
console.log(e.data);
77

88
if (data.uploadId === uploadId) {
9-
$('#panelheader').text('Importing ' + $('#file').val().split('\\').pop() + ' into ' + $('#index').val());
10-
$('#progress-bar').css('width', data.progress + '%');
11-
$
9+
10+
if (data.action === "import") {
11+
$('#panelheader').text('Importing ' + $('#file').val().split('\\').pop() + ' into ' + $('#index').val());
12+
$('#progress-bar').css('width', data.progress + '%');
13+
}
14+
15+
if (data.action === "verify") {
16+
$('#panelheader').text('Verifying ' + $('#file').val().split('\\').pop());
17+
}
1218
}
13-
}
19+
};
1420

15-
$('#file').change(function () {
21+
$('#file').change(() => {
1622
uploadId = Math.random().toString(36).substring(7);
1723
$('#upload').hide();
1824
$('#uploadId').val(uploadId);
@@ -25,23 +31,28 @@ $('#file').change(function () {
2531
}, 500);
2632
});
2733

28-
$(document).ready(function () {
34+
$(document).ready(() => {
2935
var date = new Date();
3036
$('#progress').hide();
3137
$('#index').val(date.toLocaleString('en-us', {month: 'long'}).toLowerCase() + '-' + date.getFullYear());
32-
$(function () {
38+
$(() => {
3339
$("[data-toggle='tooltip']").tooltip();
3440
});
3541
});
3642

37-
$('#close-window').click(function () {
43+
$('#close-window').click(() => {
3844
window.close();
3945
});
4046

41-
$('#add-window').click(function () {
47+
$('#add-window').click(() => {
4248
window.open('http://' + location.host, '_blank');
4349
});
4450

45-
$('#start-page').click(function () {
51+
$('#start-page').click(() => {
4652
window.location.href = '/';
53+
});
54+
55+
$('#excel-options-show').click(() => {
56+
$('#excel-options').show();
57+
$('#excel-options-show').hide();
4758
});

0 commit comments

Comments
 (0)