Skip to content

Commit 44ac1c0

Browse files
committed
Update views.
1 parent 653adb4 commit 44ac1c0

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

app/views/crop.pug

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,23 @@ block content
1515
- if (crop.hasAgriSoil)
1616
dt.col-lg-3 Preferred Soils:
1717
dd.col-lg-9
18-
ul
19-
each item in crop.hasAgriSoil
20-
li
21-
a(class="link-underline link-underline-opacity-0" href=`/app/soil/${item}`) #{item}
18+
- if (Array.isArray(crop.hasAgriSoil))
19+
ul
20+
each item in crop.hasAgriSoil
21+
li
22+
a(class="link-underline link-underline-opacity-0" href=`/app/soil/${item}`) #{item}
23+
- else
24+
a(class="link-underline link-underline-opacity-0" href=`/app/soil/${crop.hasAgriSoil}`) #{crop.hasAgriSoil}
2225
- if (crop.hasAgriPest)
2326
dt.col-lg-3 Pests:
2427
dd.col-lg-9
25-
ul
26-
each item in crop.hasAgriPest
27-
li
28-
a(class="link-underline link-underline-opacity-0" href=`/app/pest/${item}`) #{item}
28+
- if (Array.isArray(crop.hasAgriPest))
29+
ul
30+
each item in crop.hasAgriPest
31+
li
32+
a(class="link-underline link-underline-opacity-0" href=`/app/pest/${item}`) #{item}
33+
- else
34+
a(class="link-underline link-underline-opacity-0" href=`/app/pest/${crop.hasAgriPest}`) #{crop.hasAgriPest}
2935

3036
div.row
3137
div.col

app/views/land.pug

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ block content
4141
- if (land.hasDevices)
4242
dt.col-lg-3 Devices
4343
dd.col-lg-9
44-
ul
45-
each item in land.hasDevices
46-
li
47-
a(class="link-underline link-underline-opacity-0" href=`/app/agri-device/${item}`) #{item}
44+
- if (Array.isArray(land.hasDevices))
45+
ul
46+
each item in land.hasDevices
47+
li
48+
a(class="link-underline link-underline-opacity-0" href=`/app/agri-device/${item}`) #{item}
49+
- else
50+
a(class="link-underline link-underline-opacity-0" href=`/app/agri-device/${land.hasDevices}`) #{land.hasDevices}
4851

4952
- if (land.ownedBy)
5053
dt.col-lg-3 OwnedBy

0 commit comments

Comments
 (0)