File size: 3,185 Bytes
a11165b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{% extends "base.html" %}
{% block content %}
<section class="find-page">
  <h1 class="find-heading">Search "{{ query }}"</h1>
  {% if state == "loading" %}
    <div class="find-state find-loading" role="status">
      <span class="spinner" aria-hidden="true"></span>
      <p>Loading results&hellip;</p>
    </div>
  {% elif state == "error" %}
    <div class="find-state find-error" role="alert">
      <p>Something went wrong loading results.</p>
      <a class="button-secondary" href="/find/?q={{ query|urlencode }}">Retry search</a>
    </div>
  {% elif state == "empty" or not exact_rows %}
    <div class="find-state find-empty">
      <p>No results found for "{{ query }}"</p>
      <p class="section-note">Check the spelling or try a different search.</p>
    </div>
  {% else %}
    <section class="find-section" aria-labelledby="titles-heading">
      <h2 id="titles-heading" class="section-title">Titles</h2>
      <h3 class="exact-heading">Exact matches</h3>
      <ul class="result-list">
        {% for row in exact_rows %}
          <li class="result-row{% if loop.first %} result-exact{% endif %}">
            <img class="result-thumb" src="{{ row.thumb }}" alt="{{ row.title }} poster" width="60" height="89" loading="lazy">
            <div class="result-body">
              {% if row.local_id %}
                <a class="result-title" href="/title/{{ row.local_id }}/">{{ row.title }}</a>
              {% else %}
                <span class="result-title result-title-static">{{ row.title }}</span>
              {% endif %}
              <p class="result-facts">
                <span>{{ row.year }}</span><span>{{ row.runtime }}</span><span>{{ row.cert }}</span>{% if row.metascore %}<span class="metascore">{{ row.metascore }}</span><span>Metascore</span>{% endif %}
              </p>
              <p class="result-rating">
                <span class="star-glyph" aria-hidden="true">&#9733;</span>
                {{ row.rating }} <span class="votes">({{ row.votes }})</span>
                {% if row.local_id %}<a class="rate-inline" href="/title/{{ row.local_id }}/">Rate</a>{% endif %}
              </p>
            </div>
          </li>
        {% endfor %}
      </ul>
      <p class="more-link">More popular matches</p>
    </section>
    {% if people_rows %}
      <section class="find-section" aria-labelledby="people-heading">
        <h2 id="people-heading" class="section-title">People</h2>
        <h3 class="exact-heading">Exact matches</h3>
        <ul class="result-list">
          {% for person in people_rows %}
            <li class="result-row person-row">
              <img class="result-thumb person-thumb" src="{{ person.thumb }}" alt="{{ person.name }} headshot" width="60" height="60" loading="lazy">
              <div class="result-body">
                <a class="result-title" href="/name/{{ person.id }}/">{{ person.name }}</a>
                <p class="result-facts"><span>{{ person.roles }}</span></p>
                <p class="result-known">{{ person.known_for }}</p>
              </div>
            </li>
          {% endfor %}
        </ul>
      </section>
    {% endif %}
  {% endif %}
</section>
{% endblock %}