search.tmpl 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {{with .Data}}
  2. {{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
  3. <div class="page-title"> Search </div>
  4. <form class="search-form" action="/search" method="GET">
  5. <span class="post-form-field">
  6. <label for="query"> Query </label>
  7. <input id="query" name="q" value="{{.Q}}">
  8. </span>
  9. <span class="post-form-field">
  10. <label for="type"> Type </label>
  11. <select id="type" name="type">
  12. <option value="statuses" {{if eq .Type "statuses"}}selected{{end}}>Statuses</option>
  13. <option value="accounts" {{if eq .Type "accounts"}}selected{{end}}>Accounts</option>
  14. </select>
  15. </span>
  16. <button type="submit"> Search </button>
  17. </form>
  18. {{if eq .Type "statuses"}}
  19. {{range .Statuses}}
  20. {{template "status.tmpl" (WithContext . $.Ctx)}}
  21. {{else}}
  22. {{if .Q}}<div class="no-data-found">No data found</div>{{end}}
  23. {{end}}
  24. {{end}}
  25. {{if eq .Type "accounts"}}
  26. {{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
  27. {{end}}
  28. <div class="pagination">
  29. {{if .NextLink}}
  30. <a href="{{.NextLink}}">[next]</a>
  31. {{end}}
  32. </div>
  33. {{template "footer.tmpl"}}
  34. {{end}}