index.html.erb 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <div class='container'>
  2. <div class='row'>
  3. <div class='col-md-12'>
  4. <div class="page-header">
  5. <h2>
  6. Your Services
  7. </h2>
  8. </div>
  9. <p>
  10. Before you can authenticate with a service, you need to set it up. Have a look at the Huginn
  11. <%= link_to 'wiki', 'https://github.com/cantino/huginn/wiki/Configuring-OAuth-applications', target: :_blank %>
  12. for guidance.
  13. </p>
  14. <%- Devise.omniauth_providers.each { |provider| -%>
  15. <p><%= omniauth_button(provider) %></p>
  16. <%- } -%>
  17. <hr>
  18. <div class='table-responsive'>
  19. <table class='table table-striped events'>
  20. <tr>
  21. <th><%= sortable_column 'provider', 'asc' %></th>
  22. <th><%= sortable_column 'name', 'asc' %></th>
  23. <th><%= sortable_column 'global', name: 'Global?' %></th>
  24. <th></th>
  25. </tr>
  26. <% @services.each do |service| %>
  27. <tr>
  28. <td><%= omniauth_provider_name(service.provider) %></td>
  29. <td><%= service.name %></td>
  30. <td><%= yes_no(service.global) %></td>
  31. <td>
  32. <div class="btn-group btn-group-xs">
  33. <% if service.global %>
  34. <%= link_to 'Make private', toggle_availability_service_path(service), method: :post, data: { confirm: 'Are you sure you want to remove access to your data on this service for other users?'}, class: "btn btn-default" %>
  35. <% else %>
  36. <%= link_to 'Make global', toggle_availability_service_path(service), method: :post, data: { confirm: 'Are you sure you want to grant every user on this system access to your data on this service?'}, class: "btn btn-default" %>
  37. <% end %>
  38. <%= link_to 'Delete', service_path(service), method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-default btn-danger" %>
  39. </div>
  40. </td>
  41. </tr>
  42. <% end %>
  43. </table>
  44. </div>
  45. <%= paginate @services, :theme => 'twitter-bootstrap-3' %>
  46. </div>
  47. </div>
  48. </div>