Skip to content

Commit 724464e

Browse files
authored
Merge pull request #46 from coderbunker/missingUUID2
Remove links and gray out item cards for items without a UUID.
2 parents 5a4dee1 + 8755ecb commit 724464e

File tree

3 files changed

+76
-62
lines changed

3 files changed

+76
-62
lines changed

public/main.css

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,101 @@
11
.logo {
2-
background: url('logo.png');
3-
height: 7em;
4-
margin-top: 1em;
5-
margin-bottom: 1em;
6-
width: 100%;
7-
background-position: right;
8-
background-repeat: no-repeat;
9-
background-size: cover;
10-
position: relative;
2+
background: url('logo.png');
3+
background-position: right;
4+
background-repeat: no-repeat;
5+
background-size: cover;
6+
height: 7em;
7+
margin-bottom: 1em;
8+
margin-top: 1em;
9+
position: relative;
10+
width: 100%;
1111
}
1212

1313
.recent-list {
14-
list-style-type: none;
15-
padding-left: 0;
14+
list-style-type: none;
15+
padding-left: 0;
1616
}
1717
.recent-list li {
1818
padding-bottom: 5px;
1919
}
2020

2121
#appTitle {
22-
color: white;
23-
text-align: center;
24-
font-size: 3em;
25-
white-space: nowrap;
26-
overflow: hidden;
22+
color: white;
23+
font-size: 3em;
24+
overflow: hidden;
25+
text-align: center;
26+
white-space: nowrap;
2727
}
2828

2929
@media screen and (max-width: 500px) {
30-
#appTitle {
31-
color: white;
32-
text-align: left;
33-
font-size: 1.5em;
34-
padding-top: 13px;
35-
padding-left: 0;
36-
margin-left: 0;
37-
white-space: nowrap;
38-
overflow: hidden;
39-
}
30+
#appTitle {
31+
color: white;
32+
font-size: 1.5em;
33+
margin-left: 0;
34+
overflow: hidden;
35+
padding-left: 0;
36+
padding-top: 13px;
37+
text-align: left;
38+
white-space: nowrap;
39+
}
4040
}
4141

4242
.resultContainer {
4343
margin-top: 1em;
4444
overflow: hidden;
4545
}
4646

47+
.faded{
48+
opacity: 0.5;
49+
}
50+
4751
.itemImg {
48-
margin-left: -3vw;
49-
width: 300%;
50-
font-size: 11vw;
52+
font-size: 11vw;
53+
margin-left: -3vw;
54+
width: 300%;
5155
}
5256

5357
@media screen and (min-width: 500px) {
54-
.itemImg {
55-
margin-left: 0;
56-
width: 100%;
57-
font-size: 9vw;
58-
}
58+
.itemImg {
59+
font-size: 9vw;
60+
margin-left: 0;
61+
width: 100%;
62+
}
5963
}
6064

6165
.itemTitle {
6266
text-align: center;
6367
}
6468

6569
.infoBox {
66-
display: flex;
67-
justify-content: space-between;
68-
flex-wrap: wrap;
70+
display: flex;
71+
flex-wrap: wrap;
72+
justify-content: space-between;
6973
}
7074

7175
article {
72-
border-radius: 3px;
73-
padding-top: 1em;
74-
padding-bottom: 1em;
75-
margin-bottom: 1em;
76-
background-color: whitesmoke;
76+
background-color: whitesmoke;
77+
border-radius: 3px;
78+
margin-bottom: 1em;
79+
padding-bottom: 1em;
80+
padding-top: 1em;
7781
}
7882

7983
.miniSearchItem{
80-
padding-top: 1em;
8184
padding-bottom: 1em;
85+
padding-top: 1em;
8286
}
8387
.miniItemImg{
8488
width:100%;
8589

8690
}
8791
.searchResultList {
88-
list-style: none;
89-
padding: 0;
92+
list-style: none;
93+
padding: 0;
9094
}
9195

9296
.stickers{
9397
border: 1px dotted black;
9498
font-size: 30%;
95-
padding-top: 1em;
9699
padding-bottom: 1em;
100+
padding-top: 1em;
97101
}

views/partials/itemCards.ejs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<span> <a href="/search?floor=<%- floor %>&room=<%- room %>&location=<%- location %>"> <%- location.toLowerCase() %> </a></span> >
55
<span> <a href="/search?fixture=<%- fixture %>"> <%- fixture.toLowerCase() %> </a></span>
66
</div>
7-
<div class="well col-xs-12">
7+
<% if (uuid) { %>
8+
<div class="well col-xs-12">
9+
<% } else { %>
10+
<div class="well faded col-xs-12">
11+
<% } %>
812
<div class="col-xs-2">
913
<% if (picture === undefined || picture === '') { %>
1014
<img class="itemImg" src="noImg.png" />
@@ -13,7 +17,11 @@
1317
<%}%>
1418
</div>
1519
<div class="itemTitle col-xs-8">
16-
<h4> <a href="/<%- uuid %>"> <%- fixture.toUpperCase().bold() %> </a> </h4>
20+
<% if (uuid) { %>
21+
<h4> <a href="/<%- uuid %>"> <%- fixture.toUpperCase().bold() %> </a> </h4>
22+
<% } else { %>
23+
<h4> <%- fixture.toUpperCase().bold() %> </h4>
24+
<% } %>
1725
<span> <%- model.toLowerCase().italics() %> </span>
1826
</div>
1927
<div class="itemImg col-xs-2">

views/partials/itemImgInfo.ejs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
<% if (HOWTO) { %>
22
<article class="well col-xs-12">
33
<h2>How To</h2>
4-
<div>
5-
<%- HOWTO %>
6-
</div>
4+
<%- HOWTO %>
75
</article>
86
<%}%>
97
<% if (Troubleshooting) { %>
108
<article class="well col-xs-12">
119
<h2>Need Help</h2>
12-
<div>
13-
<%- Troubleshooting %>
14-
</div>
10+
<%- Troubleshooting %>
1511
</article>
1612
<% } %>
1713
<% if ( similarItems.length > 0 ) { %>
1814
<article class="well col-xs-12">
1915
<h2>Similar Items</h2>
20-
<div>
2116
<% for(var i = 0; i < similarItems.length; i++){ %>
2217
<div class='miniSearchItem col-xs-4'>
23-
<% if (similarItems[i].picture === undefined || similarItems[i].picture === '') { %>
24-
<a href="/<%- similarItems[i].uuid %>"> <img class="miniItemImg" src="noImg.png" /> </a>
25-
<% }else{ %>
26-
<a href="/<%- similarItems[i].uuid %>"> <img class="miniItemImg" src=" <%- similarItems[i].picture %> " /> </a>
27-
<%}%>
28-
</div>
18+
<% if (!similarItems[i].picture) { %>
19+
<% if (!similarItems[i].uuid) { %>
20+
<img class="miniItemImg faded" src="noImg.png" />
21+
<% }else{ %>
22+
<a href="/<%- similarItems[i].uuid %>"> <img class="miniItemImg" src="noImg.png" /> </a>
23+
<%}%>
24+
<% } else{ %>
25+
<% if (!similarItems[i].uuid) { %>
26+
<img class="miniItemImg faded" src=" <%- similarItems[i].picture %> " />
27+
<% }else{ %>
28+
<a href="/<%- similarItems[i].uuid %>"> <img class="miniItemImg" src=" <%- similarItems[i].picture %> " /> </a>
29+
<%} %>
30+
<% } %>
31+
</div>
2932
<% } %>
30-
</div>
3133
</article>
3234
<%}%>
3335
<article class="well col-xs-12">

0 commit comments

Comments
 (0)