crowdAI/crowdai

View on GitHub
app/views/challenges/form/_submissions.html.erb

Summary

Maintainability
Test Coverage
<div class="row">
  <%= form_for [@organizer,@challenge], html: { class: "dbl-col" } do |f| %>
    <% @challenge.errors.full_messages.each do |error| %>
      <p><%= error %></p>
    <% end %>

    <p>This page configures the optional online submissions page, if the challenge requires it.</p><br/>

    <% if @organizer.clef? %>
      <%= render partial: 'challenges/form/clef_fields', locals: { f: f } %>
    <% end %>

    <fieldset>
    <div class="twin-container" data-controller='challenge-submission'>
      <div class="twin-field">
        <fieldset class="checkbox">
          <div>
            <%= f.check_box :online_submissions,
                  {data:
                    { target: 'challenge-submission.online',
                    action: 'click->challenge-submission#toggleOnline' }
                  }, "true", "false" %>
            <%= f.label :online_submissions, 'Online Submissions Permitted?' %>
          </div>
        </fieldset>
      </div>
      <div class="twin-field">
        <fieldset class="checkbox">
          <div>
            <%= f.check_box :post_challenge_submissions,
                  { data:
                    { target: 'challenge-submission.post'
                    }
                  }, "true", "false" %>
            <%= f.label :post_challenge_submissions, 'Post Challenge Submissions Permitted?' %>
          </div>
        </fieldset>
      </div>
    </div>

    <label>Submission Instructions</label>
    <%= markdown_editor do |m| %>
      <%= f.text_area :submission_instructions_markdown, class: "txt-med" %>
    <% end %>

    <p>This license text is displayed on the submission upload page during and after the challenge</p>
    <%= markdown_editor do |m| %>
      <%= f.text_area :license_markdown, class: "txt-med", placeholder: "Please upload your submissions and include a detailed description of the methodology, techniques and insights leveraged with this submission. After the end of the challenge, these comments will be made public, and the submitted code and models will be freely available to other crowdAI participants. All submitted content will be licensed under Creative Commons (CC)." %>
    <% end %>

    <%= render partial: 'challenges/form/submit_buttons',
          locals: { f: f } %>
  <% end %>
</div>