index.html.erb 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <% content_for :title, "Credentials" -%>
  2. <div class='container'>
  3. <div class='row'>
  4. <div class='col-md-12'>
  5. <div class="page-header">
  6. <h2>
  7. Your Credentials
  8. </h2>
  9. </div>
  10. <blockquote>
  11. Credentials are used to store values used by many Agents. Examples might include "twitter_consumer_secret",
  12. "user_full_name", or "user_birthday".
  13. </blockquote>
  14. <table class='table table-striped'>
  15. <tr>
  16. <th><%= sortable_column 'credential_name', 'asc', name: 'Name' %></th>
  17. <th><%= sortable_column 'credential_value', 'asc', name: 'Value' %></th>
  18. </tr>
  19. <% @user_credentials.each do |user_credential| %>
  20. <tr>
  21. <td><%= user_credential.credential_name %></td>
  22. <td>
  23. <%= truncate user_credential.credential_value %>
  24. <div class="btn-group btn-group-xs" style="float: right">
  25. <%= link_to 'Edit', edit_user_credential_path(user_credential), class: "btn btn-default" %>
  26. <%= link_to 'Delete', user_credential_path(user_credential), method: :delete, data: {confirm: 'Are you sure?'}, class: "btn btn-default" %>
  27. </div>
  28. </td>
  29. </tr>
  30. <% end %>
  31. </table>
  32. <%= paginate @user_credentials, :theme => 'twitter-bootstrap-3' %>
  33. <br/>
  34. <div class="btn-group">
  35. <%= link_to new_user_credential_path, class: "btn btn-default" do %><span class="glyphicon glyphicon-plus"></span> New Credential<% end %>
  36. <%= link_to user_credentials_path(format: :json), class: "btn btn-default" do %><span class="glyphicon glyphicon-cloud-download"></span> Download Credentials<% end %>
  37. <%= link_to '#', data: { toggle: 'modal', target: '#credentials-upload' }, class: "btn btn-default credentials-upload-button" do %><span class="glyphicon glyphicon-upload"></span> Upload Credentials<% end %>
  38. </div>
  39. <div id="credentials-upload" class="modal fade" tabindex="-1" role="dialog">
  40. <div class="modal-dialog">
  41. <div class="modal-content">
  42. <%= form_tag import_user_credentials_path, multipart: true do %>
  43. <div class="modal-header">
  44. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  45. <h4 class="modal-title">Upload Credentials</h4>
  46. </div>
  47. <div class="modal-body">
  48. <p>Upload a credentials file that you have previously exported from a Huginn instance.</p>
  49. <%= file_field_tag :file, class: 'form-control' %>
  50. </div>
  51. <div class="modal-footer">
  52. <%= button_tag 'Cancel', class: 'btn btn-default', 'data-dismiss' => 'modal' %>
  53. <%= submit_tag 'Upload', class: 'btn btn-primary' %>
  54. </div>
  55. <% end %>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>