offline-twitter/internal/webserver/tpl/includes/circle_profile_img.tpl
Alessio 8410182129 Big front-end refactor to make CSS management more tractable
- Convert most CSS class names to BEM style
- Improve a significant amount of layouts / UI bugs
- Probably add a bunch of UI bugs
2024-04-05 15:49:19 -07:00

30 lines
921 B
Smarty

{{define "circle-profile-img"}}
<a class="profile-image" href="/{{.Handle}}">
{{/* TODO: add `width` and `height` attrs to the <img>*/}}
<img class="profile-image__image"
{{if .IsContentDownloaded}}
src="/content/{{.GetProfileImageLocalPath}}"
{{else}}
src="{{.ProfileImageUrl}}"
{{end}}
>
</a>
{{end}}
<!-- TODO: How to use this in a User Feed without a ton of prop-drilling? -->
{{define "circle-profile-img-no-link"}}
<a class="profile-image"
hx-trigger="click consume"
onclick="image_carousel.querySelector('img').src = this.querySelector('img').src; image_carousel.showModal();"
>
{{/* TODO: add `width` and `height` attrs to the <img>*/}}
<img class="profile-image__image"
{{if .IsContentDownloaded}}
src="/content/{{.GetProfileImageLocalPath}}"
{{else}}
src="{{.ProfileImageUrl}}"
{{end}}
>
</a>
{{end}}