⌚ OpenOpeningstijden main server application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

place.erb 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <% set_content_for(:closing_js,
  2. "var map = L.map('map').setView([#{@place.geometry.y}, #{@place.geometry.x}], 16);
  3. L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  4. attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'
  5. }).addTo(map);
  6. L.marker([#{@place.geometry.y}, #{@place.geometry.x}]).addTo(map);"
  7. )
  8. %>
  9. <% set_content_for(:region_name, @place.address.city) %>
  10. <% set_content_for(:region_slug, @place.region_slug) %>
  11. <% set_content_for(:place_name, @place.name) %>
  12. <% set_content_for(:title, 'Openingstijden') %>
  13. <section class="row">
  14. <div class="col">
  15. <div id="map"></div>
  16. </div>
  17. <div class="col" itemscope itemtype="http://schema.org/PostalAddress">
  18. <h2 class="title" itemprop="name">
  19. <%= @place.name %>
  20. <%== erb :status_badge_partial, locals: { status: @place.status } %>
  21. </h2>
  22. <address itemprop="address">
  23. <span itemprop="streetAddress">
  24. <%= @place.address.street %> <%= @place.address.housenumber %>
  25. </span>,
  26. <span itemprop="postalCode">
  27. <%= @place.address.postcode %>
  28. </span>
  29. <span itemprop="addressLocality">
  30. <%= @place.address.city %>
  31. </span>
  32. </address>
  33. <% @wday_idx = %w[Zo Ma Di Wo Do Vr Za] %>
  34. <table id="opening_hours" class="table-responsive table-sm table-hover">
  35. <tbody>
  36. <% @place.open_this_week.each do |wday, openings| %>
  37. <tr>
  38. <% if wday == Date.today.wday %>
  39. <th scope="row"><strong><%= @wday_idx[wday] %></strong></th>
  40. <% openings.each do |slot| %>
  41. <td><strong><%= slot[:start].strftime('%H:%M') %></strong></td>
  42. <td><strong><%= slot[:end].strftime('%H:%M') %><strong></td>
  43. <% end %>
  44. <% else %>
  45. <th scope="row"><%= @wday_idx[wday] %></th>
  46. <% openings.each do |slot| %>
  47. <td><%= slot[:start].strftime('%H:%M') %></td>
  48. <td><%= slot[:end].strftime('%H:%M') %></td>
  49. <% end %>
  50. <% end %>
  51. </tr>
  52. <% end %>
  53. </tbody>
  54. </table>
  55. </div>
  56. </section>