|
167 | 167 | {# djlint:off H008 #} |
168 | 168 | {% match status %} |
169 | 169 | {% when JobStatus::Archived %} |
170 | | - <span class='bg-red-100 text-red-800 text-{{ size }} {%- if size.to_string() == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span> |
| 170 | + <span class='bg-red-100 text-red-800 text-{{ size }} {%- if size == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span> |
171 | 171 | {% when JobStatus::Draft %} |
172 | | - <span class='bg-blue-100 text-blue-800 text-{{ size }} {%- if size.to_string() == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span> |
| 172 | + <span class='bg-blue-100 text-blue-800 text-{{ size }} {%- if size == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span> |
173 | 173 | {% when JobStatus::Published %} |
174 | | - <span class='bg-green-100 text-green-800 text-{{ size }} {%- if size.to_string() == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span> |
| 174 | + <span class='bg-green-100 text-green-800 text-{{ size }} {%- if size == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span> |
175 | 175 | {% endmatch %} |
176 | 176 | {# djlint:on H008 #} |
177 | 177 | {% endmacro job_status_badge %} |
|
201 | 201 |
|
202 | 202 | {# Select option #} |
203 | 203 | {% macro select_option(value, label, selected = "") %} |
204 | | - <option value="{{ value }}" |
205 | | - {% if value.to_string() == selected.to_string() %}selected{% endif %}>{{ label }}</option> |
| 204 | + <option value="{{ value }}" {% if value == selected|ref %}selected{% endif %}>{{ label }}</option> |
206 | 205 | {% endmacro select_option %} |
207 | 206 | {# End select option #} |
208 | 207 |
|
209 | 208 | {# Badge #} |
210 | 209 | {% macro badge(content, content_styles = "", icon = "") %} |
211 | 210 | <div class="inline-flex bg-gray-100 text-gray-800 text-sm/4 font-medium px-2.5 py-1.5 rounded-full border"> |
212 | 211 | <div class="flex items-center"> |
213 | | - {% if icon.to_string() != "" %} |
| 212 | + {% if !icon.is_empty() %} |
214 | 213 | <div class="me-2"> |
215 | 214 | <div class="svg-icon size-4 icon-{{ icon }} bg-gray-500"></div> |
216 | 215 | </div> |
|
300 | 299 | {# Form title #} |
301 | 300 | {% macro form_title(title, description = "") %} |
302 | 301 | <div class="text-xl lg:text-2xl font-medium text-gray-900">{{ title }}</div> |
303 | | - {% if description.to_string() != "" %} |
304 | | - <p class="mt-1 text-sm/6 text-gray-500">{{ description }}</p> |
305 | | - {% endif %} |
| 302 | + {% if !description.is_empty() %}<p class="mt-1 text-sm/6 text-gray-500">{{ description }}</p>{% endif %} |
306 | 303 | {% endmacro form_title %} |
307 | 304 | {# End form title #} |
308 | 305 |
|
|
317 | 314 | value="{{ value }}" |
318 | 315 | name="{{ name }}" |
319 | 316 | class="radio-primary" |
320 | | - {% if value.to_string() == checked.to_string() %}checked{% endif %} |
| 317 | + {% if value == checked %}checked{% endif %} |
321 | 318 | {% if required %}required{% endif %}> |
322 | 319 | </div> |
323 | 320 | {% endmacro radio_box %} |
|
0 commit comments