-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor2.html
135 lines (131 loc) · 4.01 KB
/
editor2.html
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
{% assign badges = product.metafields.my_fields.badges | newline_to_br | split: '<br />'%}
<div style="display: flex;
flex-direction: row;
">
<p>Badges:</p>
{% for badge in badges %}
{% if badge.size <= 3%} {% continue %} {% elsif badge contains "Canadian" %} <div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;
margin-bottom: 30px">
<i class="fa-brands fa-2x fa-canadian-maple-leaf"></i>
<p>Canadian</p>
</div>
{% elsif badge contains "Vegan"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;
margin-bottom: 30px">
<i class="fa-solid fa-2x fa-seedling"></i>
<p>Vegan</p>
</div>
{% else %}
<p>Unsupported</p>
{% endif %}
{% endfor %}
</div>
<!-- Allergen HTML -->
{% assign allergens = product.metafields.my_fields.allergens | newline_to_br | split: 'break'%}
{% if allergens.size == 1 %}
{% assign all = allergens[0] | newline_to_br | split: '<br />'%}
{% else %}
<p>TODO</p>
{%endif%}
{}
<div style="
display: flex;
flex-direction: column;">
<h4>{{all[0]}}</h4>
<div style="display: flex;
flex-direction: row;
flex-wrap: wrap;">
{% for allergen in all %}
{% if allergen contains all[0] or allergen.size <= 3 %} {% continue %} {% endif %} {% if allergen contains "Egg" %}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;
margin-bottom: 30px">
<i class="fa-solid fa-2x fa-egg"></i>
<p>Egg</p>
</div>
{% elsif allergen contains "Dairy"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class=" fa-solid fa-2x fa-cheese"></i>
<p>Dairy</p>
</div>
{% elsif allergen contains "Mustard"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class="fa-solid fa-2x fa-hotdog"></i>
<p>Mustard</p>
</div>
{% elsif allergen contains "Peanuts"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class=" fa-solid fa-2x fa-seedling"></i>
<p>Peanuts</p>
</div>
{% elsif allergen contains "Seafood"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class=" fa-solid fa-2x fa-shrimp"></i>
<p>Seafood</p>
</div>
{% elsif allergen contains "Sesame"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class=" fa-solid fa-2x fa-stroopwafel"></i>
<p>Sesame</p>
</div>
{% elsif allergen contains "Soy"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class=" fa-solid fa-2x fa-cookie-bite"></i>
<p>Soy</p>
</div>
{% elsif allergen contains "Sulfites"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class=" fa-solid fa-2x fa-brain"></i>
<p>Sulfites</p>
</div>
{% elsif allergen contains "Tree Nuts"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class=" fa-solid fa-2x fa-cake-candles"></i>
<p>Tree Nuts</p>
</div>
{% elsif allergen contains "Wheat Gluten"%}
<div style="display: flex;
flex-direction: column;
align-items: center;
flex: 0 0 25%; margin-bottom: 30px;">
<i class=" fa-solid fa-2x fa-bread-slice"></i>
<p>Wheat Gluten</p>
</div>
{% else %}
<p>Unsupported </p>
{% endif %}
{% endfor %}
</div>
</div>