53 lines
1.9 KiB
Smarty
Raw Normal View History

{{define "title"}}Search{{end}}
{{define "main"}}
2023-10-14 15:06:50 -03:00
<div class="search-header">
<div class="row spread">
<div class="dummy"></div> {{/* Extra div to take up a slot in the `row` */}}
<h1>Search results: {{.SearchText}}</h1>
<div class="user-feed-buttons-container">
<a class="unstyled-link quick-link" target="_blank" href="https://twitter.com/search?q={{.SearchText}}&src=typed_query&f=top" title="Open on twitter.com">
<img class="svg-icon" src="/static/icons/external-link.svg" width="24" height="24" />
</a>
<a class="unstyled-link quick-link" hx-get="?scrape" hx-target="body" hx-indicator=".search-header" title="Refresh">
<img class="svg-icon" src="/static/icons/refresh.svg" width="24" height="24" />
</a>
</div>
</div>
2023-11-07 12:21:53 -04:00
<div class="row tabs-container">
<a class="tab unstyled-link {{if (not .IsUsersSearch)}}active-tab{{end}}" href="?type=tweets">
2023-11-07 12:21:53 -04:00
<span class="tab-inner">Tweets</span>
</a>
<a class="tab unstyled-link {{if .IsUsersSearch}}active-tab{{end}}" href="?type=users">
2023-11-07 12:21:53 -04:00
<span class="tab-inner">Users</span>
</a>
</div>
<div class="htmx-spinner-container">
<div class="htmx-spinner-background"></div>
<img class="svg-icon htmx-spinner" src="/static/icons/spinner.svg" />
</div>
</div>
2023-11-07 12:21:53 -04:00
{{if .IsUsersSearch}}
2024-02-25 20:39:46 -08:00
{{template "list" (dict "UserIDs" .UserIDs)}}
2023-11-07 12:21:53 -04:00
{{else}}
<div class="sort-order-container">
<span class="sort-order-label">order:</span>
<select name="sort-order" hx-get="#" hx-target="body" hx-push-url="true">
{{range .SortOrderOptions}}
<option
value="{{.}}"
style="text-transform: capitalize;"
{{if (eq ($.SortOrder.String) .)}}
selected
{{end}}
>{{.}}</option>
{{end}}
</select>
</div>
<div class="timeline">
{{template "timeline" .}}
</div>
{{end}}
{{end}}