index.erb 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <div>
  2. <button id="reload_photos" type="button">reload photos</button>
  3. <select id="show_license">
  4. <% @show_licenses.each do |show_license| %>
  5. <option <% if show_license == @user.show_license %>selected <% end %>value="<%= show_license.id %>"><%= show_license.name %></option>
  6. <% end %>
  7. </select>
  8. <select id="show_privacy">
  9. <% @show_privacies.each do |show_privacy, name| %>
  10. <option <% if show_privacy == @user.show_privacy %>selected <% end %>value="<%= show_privacy %>"><%= name %></option>
  11. <% end %>
  12. </select>
  13. <select id="show_ignored">
  14. <% @show_ignoreds.each do |show_ignored, name| %>
  15. <option <% if show_ignored == @user.show_ignored %>selected <% end %>value="<%= show_ignored %>"><%= name %></option>
  16. <% end %>
  17. </select>
  18. </div>
  19. <div id="photos" grid style="height: 66vh; overflow-y: auto;"></div>
  20. <div>
  21. <select id="select_license">
  22. <option value="" selected>select license</option>
  23. <% @licenses.each do |license| %>
  24. <option value="<%= license.id %>"><%= license.name %></option>
  25. <% end %>
  26. </select>
  27. <button disabled id="apply_license" type="button">apply license</button>
  28. <span id="license_link"></span>
  29. </div>
  30. <script>
  31. var licenses = <%= @licenses.to_json %>;
  32. </script>
  33. <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  34. <script src="/js/app.js"></script>