| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | @include 'layout/head.html' |
| 5 | </head> |
| 6 | <body> |
| 7 | @include 'layout/header.html' |
| 8 | |
| 9 | <div class="content"> |
| 10 | <h1>Search</h1> |
| 11 | |
| 12 | <div class="search-menu"> |
| 13 | Type: |
| 14 | @if search_type == 'repos' |
| 15 | <span>repositories</span> |
| 16 | | |
| 17 | <a href="/search?query=@valid_query&type=users">users</a> |
| 18 | @else |
| 19 | <a href="/search?query=@valid_query&type=repos">repositories</a> |
| 20 | | |
| 21 | <span>users</span> |
| 22 | @end |
| 23 | </div> |
| 24 | |
| 25 | @if search_type == 'repos' |
| 26 | @if repos.len > 0 |
| 27 | <p class="search-info">Showing ${repos.len} available repository results</p> |
| 28 | @for repo in repos |
| 29 | <div class="list-item"> |
| 30 | <a href="/@repo.user_name/@repo.name"> |
| 31 | <h3>@repo.user_name/@repo.name</h3> |
| 32 | </a> |
| 33 | @if repo.description.len > 0 |
| 34 | <p><i>@repo.description</i></p> |
| 35 | @end |
| 36 | <span class="search-repo-stars-count">${repo.nr_stars} |
| 37 | @include 'svgs/unstar.html' |
| 38 | </span> |
| 39 | </div> |
| 40 | @end |
| 41 | @else |
| 42 | <p class="search-info">We couldn’t find any repositories matching "${valid_query}"</p> |
| 43 | @end |
| 44 | @end |
| 45 | |
| 46 | @if search_type == 'users' |
| 47 | @if users.len > 0 |
| 48 | <p class="search-info">Showing ${users.len} available user results</p> |
| 49 | @for user in users |
| 50 | <div class="list-item"> |
| 51 | <div class='avatar'> |
| 52 | <a href="/@user.username"> |
| 53 | <img src="@{app.prepare_user_avatar_url(user.avatar)}"> |
| 54 | </a> |
| 55 | </div> |
| 56 | |
| 57 | <a href="/@user.username"> |
| 58 | <h3>@user.username</h3> |
| 59 | </a> |
| 60 | @if user.full_name.len > 0 |
| 61 | <p>@user.full_name</p> |
| 62 | @end |
| 63 | </div> |
| 64 | @end |
| 65 | @else |
| 66 | <p class="search-info">We couldn’t find any users matching "${valid_query}"</p> |
| 67 | @end |
| 68 | @end |
| 69 | </div> |
| 70 | |
| 71 | @include 'layout/footer.html' |
| 72 | </body> |
| 73 | </html> |
| 74 | |