aac_settings.mustache 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <%
  2. # Copyright (C) 2015 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <div class="content-box auth-form-container--new"
  19. id="<%= "#{aac.auth_type}_form" if aac.new_record? %>"
  20. <%= hidden(true) if aac.new_record? %>>
  21. <div class="grid-row">
  22. <div class="col-xs-12 col-lg-11 off-lg-1">
  23. <% url = aac.new_record? ? account_authentication_providers_url(account) :
  24. account_authentication_provider_url(account, aac) %>
  25. <%= form_for(aac,
  26. as: :authentication_provider,
  27. url: url,
  28. html: {
  29. id: "#{aac.new_record? ? 'new' : 'edit'}_#{presenter.id_suffix(aac)}",
  30. class: "ic-Form-group ic-Form-group--horizontal authentication_provider_form"
  31. }) do |f| %>
  32. <%= f.hidden_field :auth_type, value: aac.auth_type, id: nil %>
  33. <%= f.hidden_field :id, id: nil %>
  34. <h3><%= aac.class.display_name %></h3>
  35. <% if !aac.new_record? %>
  36. <p><%= mt "You can log in directly with this provider by going to %{url}",
  37. url: url_for(presenter.login_url_options(aac)) %></p>
  38. <% end %>
  39. <%= render partial: "#{aac.auth_type}_fields",
  40. locals: {aac: aac, presenter: presenter, f: f}%>
  41. <% if aac.class.recognized_federated_attributes != [] %>
  42. <%= render partial: "federated_attributes", locals: { aac: aac, presenter: presenter, f: f } %>
  43. <% end %>
  44. <% if presenter.configs.length > 1 %>
  45. <div class="ic-Form-control">
  46. <%= f.label(:position,
  47. t('Position'),
  48. class: 'ic-Label',
  49. for: "aac_position_#{presenter.id_suffix(aac)}") %>
  50. <%= f.select(:position,
  51. presenter.position_options(aac),
  52. {},
  53. class: "ic-Input",
  54. id: "aac_position_#{presenter.id_suffix(aac)}") %>
  55. </div>
  56. <% end %>
  57. <div class="ic-Form-actions">
  58. <% if !aac.new_record? && @current_pseudonym.authentication_provider != aac %>
  59. <%= link_to(account_authentication_provider_url(account, aac),
  60. method: "delete",
  61. rel: 'nofollow',
  62. id: "delete-aac-#{aac.id}",
  63. data: {
  64. confirm: t('Are you sure?'),
  65. disable_with: t('deleting...')
  66. },
  67. class: 'Button Button--danger') do %>
  68. {{#t}}Delete{{/t}}
  69. <% end %>
  70. <% end %>
  71. <%= f.button t('Save'), class: "Button Button--primary" %>
  72. </div>
  73. <% end %>
  74. </div>
  75. </div>
  76. </div>