🔧 fix(point.html): update variable name from .Type to .Rating to reflect the correct attribute being compared

🔧 fix(service.html): update range variable from .Points to .Attributes to correctly iterate over the list of attributes
This commit is contained in:
pluja 2023-10-30 23:32:11 +01:00
parent ccc30ffa0e
commit 278c3c1bf7
2 changed files with 34 additions and 30 deletions

View File

@ -1,35 +1,39 @@
<a href="/point/{{.ID}}" class="block py-1.5 px-3 text-center text-sm border rounded-lg transition duration-300
{{if eq "good" .Type }}border-green-900 bg-green-900/30 hover:bg-green-900/50 hover:border-green-700
{{else if eq "warning" .Type }}border-amber-900 bg-amber-900/30 hover:bg-amber-900/50 hover:border-amber-700
{{else if eq "bad" .Type }}border-red-900 bg-red-900/30 hover:bg-red-900/50 hover:border-red-700
{{else}}border-info-900 bg-info-900/30 hover:bg-info-900/50 hover:border-info-700
{{if eq 1 .Rating }}border-green-900 bg-green-900/30 hover:bg-green-900/50 hover:border-green-700
{{else if eq 2 .Rating }}border-amber-900 bg-amber-900/30 hover:bg-amber-900/50 hover:border-amber-700
{{else if eq 3 .Rating }}border-red-900 bg-red-900/30 hover:bg-red-900/50 hover:border-red-700
{{else}}border-blue-900 bg-blue-900/30 hover:bg-blue-900/50 hover:border-blue-700
{{end}}">
<h3 class="flex items-center justify-center space-x-2">
<h3 class="flex items-center">
<!-- Icon -->
{{if eq "good" .Type }}
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-green-600 circle-check-filled" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"></path>
</svg>
{{else if eq "warning" .Type }}
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-amber-600 alert-triangle-filled" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" stroke-width="0" fill="currentColor"></path>
</svg>
{{else if eq "bad" .Type }}
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-red-600/75 alert-circle-filled" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" stroke-width="0" fill="currentColor"></path>
</svg>
{{else }}
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-blue-600 info-circle-filled" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z" stroke-width="0" fill="currentColor"></path>
</svg>
{{end}}
<span class="flex-shrink-0">
{{if eq 1 .Rating }}
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-green-600 circle-check-filled" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"></path>
</svg>
{{else if eq 2 .Rating }}
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-amber-600 alert-triangle-filled" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" stroke-width="0" fill="currentColor"></path>
</svg>
{{else if eq 3 .Rating }}
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-red-600/75 alert-circle-filled" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" stroke-width="0" fill="currentColor"></path>
</svg>
{{else }}
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-blue-600 blue-circle-filled" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z" stroke-width="0" fill="currentColor"></path>
</svg>
{{end}}
</span>
<!-- End icon -->
<span class="capitalize-first">{{.Title}}</span>
<span class="flex-1 ml-2 overflow-hidden capitalize-first whitespace-nowrap overflow-ellipsis">
{{.Title}}
</span>
</h3>
</a>

View File

@ -87,14 +87,14 @@
</section>
<!-- KYC Level -->
<section class="flex items-center justify-center px-6">
<section class="flex items-center justify-center px-4">
{{template "components/kyc_level" .Service.KycLevel}}
</section>
<!-- Points -->
<section class="flex flex-col items-center justify-center p-8">
<section class="flex flex-col items-center justify-center p-4">
<div class="grid grid-cols-1 gap-2 md:grid-cols-2">
{{range .Points}}
{{range .Attributes}}
{{template "components/point" .}}
{{end}}
</div>