You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_new.html.erb 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <%
  2. title =
  3. if watchables.present?
  4. l(:"permission_add_#{watchables.first.class.name.underscore}_watchers")
  5. else
  6. l(:permission_add_issue_watchers)
  7. end
  8. -%>
  9. <h3 class="title"><%= title %></h3>
  10. <%= form_tag(watchables.present? ? watchers_path : watchers_append_path,
  11. :remote => true,
  12. :method => :post,
  13. :id => 'new-watcher-form') do %>
  14. <% if watchables.present? %>
  15. <%= hidden_field_tag 'object_type', watchables.first.class.name.underscore %>
  16. <% watchables.each do |watchable| %>
  17. <%= hidden_field_tag 'object_id[]', watchable.id %>
  18. <% end %>
  19. <% end %>
  20. <%= hidden_field_tag 'project_id', @project.id if @project %>
  21. <p><%= label_tag 'user_search', l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p>
  22. <%= javascript_tag(
  23. "observeSearchfield(
  24. 'user_search',
  25. 'users_for_watcher',
  26. '#{escape_javascript(
  27. url_for(
  28. :controller => 'watchers',
  29. :action => 'autocomplete_for_user',
  30. :object_type => (watchables.present? ? watchables.first.class.name.underscore : nil),
  31. :object_id => (watchables.present? ? watchables.map(&:id) : nil),
  32. :project_id => @project
  33. )
  34. )}'
  35. )"
  36. ) %>
  37. <div id="users_for_watcher">
  38. <%= principals_check_box_tags('watcher[user_ids][]', users) %>
  39. </div>
  40. <p class="buttons">
  41. <%= submit_tag l(:button_add), :name => nil, :onclick => "hideModal(this);" %>
  42. <%= link_to_function l(:button_cancel), "hideModal(this);" %>
  43. </p>
  44. <% end %>