* Trusted users can use moderator response templates * Iron out container reveal logic * Explanatory comment on controller endpoint confusion
25 lines
1.4 KiB
Text
25 lines
1.4 KiB
Text
<%= form_with(model: [:admin, response_template], local: true, html: { class: "crayons-card p-6" }) do |f| %>
|
|
<div class="form-group">
|
|
<%= f.label :type_of, "Type of Response Template" %>
|
|
<% type_of_options = [["Trusted User Comment", "mod_comment"], ["Personal Comment", "personal_comment"], %w[Email email_reply], ["Abuse Report Email", "abuse_report_email_reply"]] %>
|
|
<%= f.select :type_of, options_for_select(type_of_options, response_template.type_of), html: { required: true }, class: "form-control" %>
|
|
</div>
|
|
<div class="form-group">
|
|
<%= f.label :title %>
|
|
<%= f.text_field :title, value: response_template.title, class: "form-control" %>
|
|
</div>
|
|
<div class="form-group">
|
|
<%= f.label :content, "Response template body" %>
|
|
<%= f.text_area :content, class: "form-control" %>
|
|
</div>
|
|
<div class="form-group">
|
|
<%= f.label :content_type, "Content Type (for ex. Markdown)", value: response_template.content %>
|
|
<% content_type_options = [%w[Markdown body_markdown], ["Plain Text", "plain_text"], %w[HTML html]] %>
|
|
<%= f.select :content_type, options_for_select(content_type_options, response_template.content_type || "plain_text"), class: "form-control" %>
|
|
</div>
|
|
<div class="form-group">
|
|
<%= f.label :user_id, "User ID - Add ID to restrict usage for a single user" %>
|
|
<%= f.text_field :user_id, value: response_template.user_id, class: "form-control" %>
|
|
</div>
|
|
<%= f.submit class: "btn btn-primary" %>
|
|
<% end %>
|