crowdAI/crowdai

View on GitHub
app/views/articles/form/_details.html.erb

Summary

Maintainability
Test Coverage
<div class="row">
  <%= form_for article, validate: true, html: { class: "sgl-col", multipart: true } do |f| %>
  <fieldset>
    <%= f.label :article, 'Title' %>
    <%= f.text_field :article %>

    <label>Tutorial Image</label>
    <div class="upload">
      <%= concept(Image::Cell,article,klass: 'img-thumb') %>
      <%= f.file_field :image_file, class: 'file-upload' %>
      <% if article.image_file.present? %>
        <%= link_to 'Delete', article_remove_image_path(article) %>
      <% end %>
      <span>Your image will be cropped if necessary. 5MB limit</span>
    </div>

    <%= f.label :summary, 'Short description' %>
    <%= f.text_area :summary, class: "txt-sml", placeholder: "Add a short description"  %>

    <%= f.label :notebook_url, 'Notebook repository' %>
    <%= f.text_field :notebook_url %>
  </fieldset>

  <fieldset class="checkbox">
    <div>
      <%= f.check_box :published, {
            disabled: !(policy(article).activate?)
          }, "true", "false" %>
      <label for="">Published?</label>
    </div>
  </fieldset>

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