<%
  show_user_selection ||= false
  show_project_selection ||= false
  owner ||= User.owner
  show_archived ||= false
  projects ||= []
  users ||= []
  user_limit ||= 1
  project_limit ||= 5
  form_path ||= {}
%>

<%= render partial: 'easy_trial_expiration/trial_expiration_js' %>

<div>
  <%= form_tag form_path, html: {class: 'form-box tabular'} do |f| %>
    <% if show_user_selection %>
      <%= check_box_tag('active[all_users]', 1, false, id: 'checkbox_all_users_selected', hidden: true) %>
      <%= render partial: 'easy_trial_expiration/user_selection', locals: {owner: owner, users: users, user_limit: user_limit} %>
    <% end %>
    <% if show_project_selection %>
      <%= check_box_tag('active[all_projects]', 1, false, id: 'checkbox_all_projects_selected', hidden: true) %>
      <%= render partial: 'easy_trial_expiration/project_selection', locals: {hidden: show_user_selection, projects: projects, project_limit: project_limit, show_archived: show_archived} %>
    <% end %>
  <% end %>
</div>
