~electric/shop-oregon-local

ref: 585941b0a562d8fc670478a9db83187bf0a1c793 shop-oregon-local/lib/shop_local_web/templates/page/index.html.eex -rw-r--r-- 4.3 KiB
585941b0Micah D Add no results message / fix clothes tree links 2 months ago
                                                                                
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<section class="phx-hero">
  <h3>
    <img class="logo" src="<%= Routes.static_path(@conn, "/images/favicon.png") %>"/>
    Shop Local
  </h3>
  <%= form_for @conn, Routes.page_path(@conn, :search), [method: "get", class: "optional-checkboxes"], fn f -> %>
    <%= text_input f, :search, placeholder: "What are you looking for?" %>

    <div class="toggle" toggle-for=".search-options">
      <div selected>+ Search Options</div>
      <div>- Search Options</div>
    </div>
    <div class="search-options" display-type="flex">
      <div class="location-options">
        <h4>Store Locations</h4>
        <%= for l <- locations do %>
          <div class="label-group">
            <%= checkbox f, l, checked: as_bool(@search[l]) %>
            <%= label f, l, to_label(l) %>
          </div>
        <% end %>
      </div>
      <div class="tag-options">
        <h4>Store Categories</h4>
        <%= for t <- tags do %>
          <div class="label-group">
            <%= checkbox f, t, checked: as_bool(@search[t]) %>
            <%= label f, t, to_label(t) %>
          </div>
        <% end %>
      </div>
      <div class="other-options">
        <h4>Other Options</h4>
        <div class="label-group">
          <%= checkbox f, :use_cache, checked: as_bool(@search["use_cache"]) %>
          <%= label f, :use_cache, to_label("use_cache") %>
        </div>
      </div>
    </div>
    </br>
    <%= submit "Search" %>
  <% end %>
</section>
<section class="row results">
  <%= if Map.has_key?(assigns, :results) do %>
    <%= if Enum.empty?(@results) do %>
      <div class="no-results">
      <h1 >Sorry, no results found.</h1>
      <p>It could help to try changing the search options, or to use different keywords.</p>
      </div>
    <%= else %>
      <ul>
      <%= for i <- @results do %>
          <li>
            <a href="<%= i.link %>">
              <b><%= i.name %></b>
              <i><%= view_price(i.price) %></i>
              &mdash; <%= i.provider %>
              <div class="product-content">
                <div class="product-image-container">
                  <%= if i.image_src != "" do %>
                    <img 
                     class="product-image"
                     loading="lazy" 
                     alt="Product Image"
                     src="<%= i.image_src %>"
                    >
                   <% end %>
                </div>
                <p><%= i.desc %></p>
              </div>
            </a>
          </li>
      <% end %>
      </ul>
    <% end %>
  <% end %>
</section>


<section class="row">
  <article class="column">
    <h2>Regions</h2>
    <ul>
      <li>
        <a href="https://business.albanychamber.com/list/">Albany</a>
      </li>
      <li>
        <a href="https://www.visitcorvallis.com/shopping">Corvallis</a>
      </li>
      <li>
        <a href="https://cm.mcminnville.org/list">McMinnville</a>
      </li>
    </ul>
  </article>
  <article class="column">
    <h2>Stores</h2>
    <ul>
      <li>
        <a href="https://burstschocolates.com/">Bursts Chocolates</a>
      </li>
      <li>
        <a href="https://www.browsersbookstore.com/">Browsers Bookstore (Corvallis)</a>
      </li>
      <li>
        <a href="https://www.clothes-tree.com/">The Clothes Tree</a>
      </li>
      <li>
        <a href="https://conundrum.house/">Conundrum House</a>
      </li>
      <li>
        <a href="https://grassrootsbookstore.com/">Grassroots Bookstore</a>
      </li>
      <li>
        <a href="https://merriartist.com/">The Merri Artist</a>
      </li>
      <li>
        <a href="https://oregoncoffeeandtea.com/">Oregon Coffee &amp; Tea</a>
      </li>
      <li>
        <a href="https://www.peaksportscorvallis.com">Peak Sports</a>
      </li>
      <li>
        <a href="https://pegasusgames.com">Pegasus Games</a>
      </li>
      <li>
        <a href="https://www.restylealbany.com/">ReStyle Albany</a>
      </li>
      <li>
        <a href="https://www.restylecorvallis.com/">ReStyle Corvallis</a>
      </li>
      <li>
        <a href="http://www.robnettshardware.com/">Robnett's Hardware</a>
      </li>
      <li>
        <a href="https://www.thetoyfactory.us">The Toy Factory</a>
      </li>
    </ul>
  </article>
  <article class="column">
    <h2>More Info</h2>
    <ul>
      <li>
        <a href="/about">About this site</a>
      </li>
    </ul>
  </article>
</section>