docbrown/app/views/internal/response_templates/index.html.erb
Andy Zhao 494ad153ab
Add response templates for internal usage (#6676)
* Add internal response template controller

* Add response template policy and spec

* Add response template views for internal

* Add missing html oops, and some padding

* Use arrays instead of %w because spaces

* Link to user in index list

* Add actual HTML oops

* Allow success flash to be displayed

* Add tag moderator trait

* Remove unnecessary .all

* Use constant to avoid duplication

* Use URL helpers over manual string URLs

* Use appropriate renders and URLs

* Follow conventional CRUD and use form_with

* Add internal request spec for response_templates

* Add missing view file oops

* Use table view for index and bootstrap styles

* Redirect to index after create

* Use clearer messaging for labels

* Validate email types to use only plain text and html
2020-03-20 11:32:55 -04:00

30 lines
916 B
Text

<%= paginate @response_templates %>
<table class="table">
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Type Of</th>
<th scope="col">User ID</th>
</tr>
</thead>
<tbody>
<% @response_templates.each do |response_template| %>
<tr>
<td>
<a href="<%= edit_internal_response_template_path(response_template.id) %>"><%= response_template.title %>
</td>
<td>
<%= response_template.type_of %>
</td>
<td>
<% if response_template.user_id.present? %>
<a href="<%= internal_user_path(response_template.user_id) %>"><%= response_template.user_id %></a>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @response_templates %>
<a href="<%= new_internal_response_template_path %>" class="btn btn-primary" role="button">Create a New Response Template</a>