Refactor creating a new report to use a ReportsController
It's really a report that the user is creating, the issue is created indirectly. Similar refactoring will be required for issue comments.
This commit is contained in:
parent
948fd8c8fa
commit
d7612f42d0
5 changed files with 49 additions and 60 deletions
42
app/views/reports/new.html.erb
Normal file
42
app/views/reports/new.html.erb
Normal file
|
@ -0,0 +1,42 @@
|
|||
<% content_for :heading do %>
|
||||
<h1>Report <%= reportable_url(@report.issue.reportable) %></h1>
|
||||
<% end %>
|
||||
|
||||
<div class="disclaimer">
|
||||
<ul>
|
||||
<%= t('issues.new.disclaimer.intro') %>:
|
||||
<li> <%= t('issues.new.disclaimer.not_just_mistake') %> </li>
|
||||
<li> <%= t('issues.new.disclaimer.unable_to_fix') %> </li>
|
||||
<li> <%= t('issues.new.disclaimer.resolve_with_user') %> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%= form_for(@report) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<fieldset>
|
||||
<%= f.fields_for @report.issue do |issue_form| %>
|
||||
<%= issue_form.hidden_field :reportable_id %>
|
||||
<%= issue_form.hidden_field :reportable_type %>
|
||||
<% end %>
|
||||
|
||||
<div class='form-row' style='width:600px'>
|
||||
<p><%= t('issues.new.select') %>:</p>
|
||||
|
||||
<div class="new-report-form">
|
||||
<% @report_strings_yaml.each do |k,v| %>
|
||||
<div style="padding-left:5px">
|
||||
<%= radio_button_tag :report_type, v[:type].to_s %>
|
||||
<%= label_tag v[:details].to_s %> <br/>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<%= text_area :report, :details, :cols => 20, :rows => 3, placeholder: t('issues.new.details'), required: true %>
|
||||
</div>
|
||||
|
||||
<div class='buttons'>
|
||||
<%= submit_tag %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
Loading…
Add table
Add a link
Reference in a new issue