Skip to content

Commit

Permalink
Refactor content type selection in new paper form
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed May 18, 2023
1 parent c094665 commit d213dcc
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions app/views/papers/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<%= form_for paper do |f| %>
<div class="form-group">
<%= render partial: "shared/errors", locals: { object: paper } if paper.errors.any? %>
<%- if paper_types.present? %>
<dl class="clear full">
<dt><%= f.label :kind, "Type" %></dt>
<dt><%= f.select :kind, paper_types %></dt>
</dl>
<%- end %>
</div>

<%- if paper_types.present? %>
<div class="form-group">
<div class="row">
<div class="col">
<%= f.label :kind, "Type of content" %>
<%= f.select(:kind, paper_types, {}, class: "form-control") %>
</div>
<div class="col">
</div>
</div>
</div>
<%- end %>

<div class="form-group">
<div class="row">
<div class="col">
Expand Down

0 comments on commit d213dcc

Please sign in to comment.