crowdAI/crowdai

View on GitHub
app/concepts/participant_clef_task/views/participant_unregistered.erb

Summary

Maintainability
Test Coverage
<div class='row' data-cell='ParticipantClefTask::Cell::ListDetail'>
  <div class='article markdown-wrap'>
    <% if eua_required? %>
      <h2>Complete the EUA</h2>
      <p>In order to obtain access to the dataset in this challenge you are required to fill in and sign an End User Agreement (EUA) document.</p>
      <p>Please perform the following steps:</p>
      <ul>
        <li>Download the EUA document and print it</li>
        <li>Fill in the required information in the EUA document and sign it</li>
        <li>Scan and re-upload the EUA document</li>
      </ul>
      <p>Upon the approval of your completed EUA document by an ImageCLEF organizer, you will obtain access to the dataset. You will also be automatically registered with CLEF, the main organizer of all CLEF labs.</p>
    <% else %>
      <h2>Get Access</h2>
      <p>By agreeing you are considered as registered for this challenge's task. The registration data will be shared with CLEF.</p>
    <% end %>

  </div>
</div>

<div class="row">
  <% if eua_required? %>
    <%= form_for form_obj,
          url: participant_clef_tasks_path,
          validate: true,
          html: { class: 'sgl-col' },
          method: :post do |f| %>
        <%= f.hidden_field :clef_task_id, value: clef_task.id %>
        <%= f.hidden_field :challenge_id, value: challenge_id %>
      <fieldset>
        <label>End User Agreement file</label>
        <% if eua_required? %>
          <%= link_to clef_task.eua_file.url,
                target: :_blank,
                id: 'eua-file',
                data: { :'clef-task-id' => clef_task.id } do %>
            <i class="fa fa-file-pdf-o fa-2x" aria-hidden="true"></i>
          <% end %>
        <% else %>
          <span>EUA file not available</span>
        <% end %>
        <br/><br/>
        <div class="upload">
          <%# if participant_clef_task && participant_clef_task.eua_file.present? %>
            <!--<span>You have already uploaded an EUA. If you wish to replace it, you can upload a new file</span>-->
            <%#= link_to 'Current EUA', participant_clef_task.eua_file.file.url %>
          <%# else %>
            <span>Upload your signed EUA here</span>
          <%# end %>
          <%= f.file_field :eua_file, class: 'file-upload' %>
          <span>PDF only, 10MB limit</span>
        </div>
      </fieldset>

      <fieldset>
        <div class="button-group">
          <%= f.submit 'Submit', class: 'btn btn-primary' %>
          <%= link_to '#', class: "btn btn-secondary", validate: false do %>
            Cancel
          <% end %>
        </div>
      </fieldset>
    <% end %>
  <% else %>   <!-- IF NO EUA REQUIRED -->
  <%= form_for form_obj,
        url: participant_clef_tasks_path,
        validate: true,
        html: { class: 'sgl-col' },
        method: :post do |f| %>
      <%= f.hidden_field :clef_task_id, value: clef_task.id %>
      <%= f.hidden_field :challenge_id, value: challenge_id %>
      <%= f.submit 'Agree', class: 'btn btn-primary' %>
  <%end%>

  <% end %>

</div>