index.erb 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <%# flickrlicense -- A thingy to update Flickr photo licenses
  2. Copyright (C) 2017 Douglas Thrift
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as published
  5. by the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. %>
  14. <div id="error" title="error"></div>
  15. <div>
  16. <button disabled id="reload_photos" type="button">reload photos</button>
  17. <select disabled id="show_license">
  18. <option <% unless @user.show_license %>selected <% end %>value="">show photos with any license</option>
  19. <% @licenses.each do |license| %>
  20. <option <% if license == @user.show_license %>selected <% end %>value="<%= license.id %>"><%= license.name %></option>
  21. <% end %>
  22. </select>
  23. <select disabled id="show_privacy">
  24. <% @show_privacies.each do |show_privacy, name| %>
  25. <option <% if show_privacy == @user.show_privacy %>selected <% end %>value="<%= show_privacy %>"><%= name %></option>
  26. <% end %>
  27. </select>
  28. <select disabled id="show_ignored">
  29. <% @show_ignoreds.each do |show_ignored, name| %>
  30. <option <% if show_ignored == @user.show_ignored %>selected <% end %>value="<%= show_ignored %>"><%= name %></option>
  31. <% end %>
  32. </select>
  33. </div>
  34. <div grid id="photos">
  35. <div class="spinner"></div>
  36. </div>
  37. <div>
  38. <select disabled id="select_license">
  39. <option value="" selected>select license</option>
  40. <% @licenses.each do |license| %>
  41. <option value="<%= license.id %>"><%= license.name %></option>
  42. <% end %>
  43. </select>
  44. <button disabled id="apply_license" type="button">apply license</button>
  45. <span id="license_link"></span> to <span id="selected_count">0</span> <span id="selected_noun">photos</span>
  46. </div>
  47. <script>
  48. var licenses = <%= @licenses.to_json %>;
  49. </script>
  50. <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  51. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
  52. <script src="/js/app.js"></script>