Newer
Older
dmpopidor / app / views / plans / _edit_details.html.erb
@briley briley on 11 Jul 2017 7 KB finished up project details page
<% javascript('views/plans/show.js') %>

<%= form_for plan, html: {method: :put, class: "roadmap-form"} do |f| %>
  <div class="edit-plan-left">
    <fieldset class="standard padded">
      <div class="form-input">
        <%= f.label "#{_('Project Title')}", for: :title, class: 'required' %>
        <%= f.text_field :title, class: "input-extra-large left-indent", 'data-toggle': "tooltip", 
                'data-content': _('If applying for funding, state the name exactly as in the grant proposal.') %>
        <div class="under-input">
          <input type="checkbox" id="is_test" class="left-indent"<%= @plan.is_test? ? ' checked=true' : '' %> />
          <label class="inline checkbox-label regular-text" for="is_test">
            <%= _('mock project for testing, practice, or educational purposes') %>
          </label>
        </div>
      </div>
      
      <div class="form-input">
        <%= f.label "#{_('Funder')}", for: :funder_name %>
        <%= f.text_field :funder_name, class: "input-large left-indent" %>
      </div>
      
      <div class="form-input">
        <%= f.label :grant_number %>
        <%= f.text_field :grant_number, class: 'input-small left-indent', 'data-toggle': "tooltip", 
                'data-content': _('Grant reference number if applicable [POST-AWARD DMPs ONLY]') %>
      </div>
  
      <div class="form-input">
        <%= f.label _('Project Abstract'), for: :description %>
        <%= f.text_area :description, class: "left-indent" %>
        <%= tinymce(selector: "#plan_description", content_css: asset_path('application.css')) %>
        <div class="inline">
          <a href="#" data-toggle="popover" rel: "popover" data-html: "true" role="button" 
             data-content="<%= _("<h4>Questions to consider:</h4><ul><li>- What is the nature of your research project?</li><li>- What research questions are you addressing? </li><li>- For what purpose are the data being collected or created? </li></ul><h4>Guidance:</h4><p>Briefly summarise the type of study (or studies) to help others understand the purposes for which the data are being collected or created.</p>") %>"
             aria-label="<%= _('More information: Guidance') %>">
          <span class="fa fa-question-circle" aria-hidden="true"></span></a>
        </div>
      </div>
  
      <div class="form-input">
        <%= f.label _('ID'), for: :identifier %>
        <%= f.text_field :identifier, class: 'input-medium left-indent', 'data-toggle': "tooltip", 
                'data-content': _('A pertinent ID as determined by the funder and/or institution.') %>
      </div>
  
      <div class="form-separator"></div>
  
      <div>
        <label class="no-colon"><strong><%= _('Principal Investigator') %></strong></label>
      </div>

      <div class="form-input">
        <%= f.label _('Name'), for: :principal_investigator, 'aria-label': _('Principal Investigator Name') %>
        <%= f.text_field :principal_investigator, class: 'input-medium left-indent' %>
      </div>

      <div class="form-input">
        <%= f.label _('ORCID ID'), for: :principal_investigator_identifier, 'aria-label': _('Principal Investigator ORCID ID') %>
        <%= f.text_field :principal_investigator_identifier, class: 'input-medium left-indent' %>
      </div>

      <div class="form-input">
        <%= f.label _('Email'), for: :principal_investigator_email, 'aria-label': _('Principal Investigator Email') %>
        <%= f.email_field :principal_investigator_email, class: 'input-medium left-indent' %>
      </div>

      <br />
      <div>
        <%= f.label(:data_contact, raw("<strong>#{_('Data Contact Person')}</strong>"), class: 'no-colon') %>
      </div>
      <div>
        <input type="checkbox" id="show-data-contact" class="left-indent"<%= (@plan.data_contact.blank? && @plan.data_contact_email.blank? ? ' checked="checked"' : '') %> />
        <label class="inline checkbox-label" for="show-data-contact">
          <%= _('Same as Principal Investigator') %>
        </label>
      </div>
      <div class="form-input data-contact-info">
        <%= f.label _('Name'), for: :data_contact, 'aria-label': _('Data Contact Name') %>
        <%= f.text_field :data_contact, class: 'input-medium left-indent' %>
      </div>
      
      <div class="form-input data-contact-info">
        <%= f.label _('Email'), for: :data_contact_email, 'aria-label': _('Data Contact Email') %>
        <%= f.email_field :data_contact_email, class: 'input-medium left-indent' %>
      </div>
      
      <br />
      <br />
      <div class="form-input">
        <div class="button-spacer">&nbsp;</div>
        <%= submit_tag(_('Save'), class: 'form-submit') %>
      </div>
    </fieldset>
  </div>

  <div class="edit-plan-right">
    <div class="bordered left-indent">
      <h2><%= _('Plan Guidance Configuration') %></h2>
      <p><%= _('To help you write your plan, %{application_name} can show you guidance from a variety of organisations.') % {application_name: Rails.configuration.branding[:application][:name]} %></p>
      <p><%= _('Select up to 3 organisations to see their guidance.') %></p>

      <ul id="priority-guidance-orgs">
        <% @important_ggs.each do |org, groups| %>
          <% if groups && groups.size == 1 %>
						<li>
              <%= check_box_tag "guidance_group_ids[]", groups[0].id, @selected_guidance_groups.include?(groups[0].id) %>
              <%= f.label org.name, for: groups[0].id, class: 'inline checkbox-label regular-text' %>
						</li>
          <% elsif groups %>
						<li>
              <input type="checkbox" disabled>
              <label class="inline checkbox-label regular-text"><%= org.name %></label>
						</li>
            <% groups.each do |group| %>
              <li class="under-input">
                <span>└─ </span> 
                <%= check_box_tag "guidance_group_ids[]", group.id, @selected_guidance_groups.include?(group.id) %>
                <%= f.label group.name, for: group.id, class: "left-indent checkbox-label regular-text" %>
              </li>
            <% end %>
          <% end%>
        <% end %>
			</ul>

      <a href="#" id="show-other-guidance-orgs"><%= _('See guidance from additional organisations') %></a>

      <ul id="other-guidance-orgs" style="display: none;">
        <% @all_ggs_grouped_by_org.each do |org, groups| %>
          <% if groups && groups.size == 1 %>
						<li>
              <%= check_box_tag "guidance_group_ids[]", groups[0].id, @selected_guidance_groups.include?(groups[0].id) %>
              <%= f.label org.name, for: groups[0].id, class: "left-indent checkbox-label regular-text" %>
						</li>
          <% elsif groups %>
						<li>
              <input type="checkbox" disabled>
              <label class="inline checkbox-label regular-text"><%= org.name %></label>
						</li>
            <% groups.each do |group| %>
              <li class="under-input">
                <span>└─ </span>
                <%= check_box_tag "guidance_group_ids[]", group.id, @selected_guidance_groups.include?(group.id) %>
                <%= f.label group.name, for: group.id, class: "left-indent checkbox-label regular-text" %>
              </li>
            <% end %>
          <% end %>
        <% end %>
			</ul>
    </div>
  </div>
<% end %>

<%= tinymce :content_css => asset_path('application.css') %>