Newer
Older
dmpopidor / app / views / plans / new.html.erb
<% javascript "views/plans/new.js" %>

<h1><%= _('Create a new plan') %></h1>

<p>
  <%= _("Before you get started, we need to ask a few questions to set you up with the best DMP template for your needs.") %>
</p>

<div class="content">
  <%= form_for @plan, html: {method: :post, class: "roadmap-form padded bordered"}, remote: true do |f| %>
    <div id="create_plan">

      <!-- Plan name section -->
      <fieldset class="standard">
        <legend><%= _('What research project are you planning?') %></legend>
        
        <div class="form-left-side">
          <input type="text" id="plan_title" name="plan[title]" class="left-indent" 
                 data-toggle="tooltip" 
                 data-content="<%= _('If applying for funding, state the project title exactly as in the proposal.') %>" />

          <input type="checkbox" id="is_test" class="left-indent" />
          <label class="inline checkbox-label" for="is_test">
            <%= _('mock project for testing, practice, or educational purposes') %>
          </label>
        </div>
      </fieldset>

      <!-- Organisation selection -->
      <fieldset class="standard">
        <legend><%= _('Select the primary research organisation') %></legend>
      
        <div class="form-left-side">
          <%= render partial: "shared/accessible_combobox", 
                     locals: {name: 'plan[org_name]',
                              id: 'plan_org_name',
                              default_selection: @default_org,
                              models: @orgs,
                              attribute: 'name',
                              classes: 'input-full-width'} %>
        </div>
        
        <div class="form-right-side">
          <p class="inline"><strong>- <%= _('or') %> -</strong></p>
          <input type="checkbox" id="plan_no_org">
          <label for="plan_no_org" class="checkbox-label">
            <%= _('My research organisation is not on the list') %>
            <em><%= _(' or ') %></em><br />
            <%= _('no research organisation is associated with this plan')%>
          </label>
        </div>
      </fieldset>
    
      <!-- Funder selection -->
      <fieldset class="standard">
        <legend><%= _('Select the primary funding organisation') %></legend>
      
        <div class="form-left-side">
          <%= render partial: "shared/accessible_combobox", 
                     locals: {name: 'plan[funder_name]',
                              id: 'plan_funder_name',
                              default_selection: nil,
                              models: @funders,
                              attribute: 'name',
                              classes: 'input-full-width'} %>
        </div>
        <div class="form-right-side">
          <p class="inline"><strong>- <%= _('or') %> -</strong></p>
          <input type="checkbox" id="plan_no_funder" />
          <label for="plan_no_funder" class="checkbox-label">
            <%= _('No funder associated with this plan')%>
          </label>
        </div>
      </fieldset>

      <!-- Template selection -->
      <fieldset class="standard" id="available-templates">
      </fieldset>
    
    </div>
    
    <fieldset class="standard" id="available-templates">
      <div class="form-left-side">
        <input type="hidden" id="plan_template_id" name="plan[template_id]"></input>
        <input type="hidden" id="plan_visibility" name="plan[visibility" value="<%= @is_test ? 'is_test' : Rails.application.config.default_plan_visibility %>"></input>
    
        <%= render partial: 'shared/accessible_submit_button',
                   locals: {id: 'create_plan_submit', 
                            val: 'Create Plan', 
                            disabled_initially: true,
														classes: "left-indent",
                            tooltip: _('You can not continue until you have filled in all of the required information.')} %>
      </div>
    </fieldset>
  <% end %>
</div>