Convert .html.erb templates to .html.slim
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
<%= form_for(@comment) do |f| %>
|
||||
<% if @comment.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@comment.errors.count, "error") %> prohibited this comment from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @comment.errors.full_messages.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :user_id %><br>
|
||||
<%= f.text_field :user_id %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :file_id %><br>
|
||||
<%= f.text_field :file_id %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :row %><br>
|
||||
<%= f.number_field :row %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :column %><br>
|
||||
<%= f.number_field :column %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :text %><br>
|
||||
<%= f.text_field :text %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
33
app/views/comments/_form.html.slim
Normal file
33
app/views/comments/_form.html.slim
Normal file
@@ -0,0 +1,33 @@
|
||||
= form_for(@comment) do |f|
|
||||
- if @comment.errors.any?
|
||||
#error_explanation
|
||||
h2
|
||||
= pluralize(@comment.errors.count, "error")
|
||||
| prohibited this comment from being saved:
|
||||
|
||||
ul
|
||||
- @comment.errors.full_messages.each do |message|
|
||||
li= message
|
||||
|
||||
.field
|
||||
= f.label :user_id
|
||||
br/
|
||||
= f.text_field :user_id
|
||||
.field
|
||||
= f.label :file_id
|
||||
br/
|
||||
= f.text_field :file_id
|
||||
.field
|
||||
= f.label :row
|
||||
br/
|
||||
= f.number_field :row
|
||||
.field
|
||||
= f.label :column
|
||||
br/
|
||||
= f.number_field :column
|
||||
.field
|
||||
= f.label :text
|
||||
br/
|
||||
= f.text_field :text
|
||||
.actions
|
||||
= f.submit
|
@@ -1,6 +0,0 @@
|
||||
<h1>Editing comment</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @comment %> |
|
||||
<%= link_to 'Back', comments_path %>
|
7
app/views/comments/edit.html.slim
Normal file
7
app/views/comments/edit.html.slim
Normal file
@@ -0,0 +1,7 @@
|
||||
h1 Editing comment
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @comment
|
||||
| |
|
||||
= link_to 'Back', comments_path
|
@@ -1,33 +0,0 @@
|
||||
<h1>Listing comments</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>File</th>
|
||||
<th>Row</th>
|
||||
<th>Column</th>
|
||||
<th>Text</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @comments.each do |comment| %>
|
||||
<tr>
|
||||
<td><%= comment.user %></td>
|
||||
<td><%= comment.file %></td>
|
||||
<td><%= comment.row %></td>
|
||||
<td><%= comment.column %></td>
|
||||
<td><%= comment.text %></td>
|
||||
<td><%= link_to 'Show', comment %></td>
|
||||
<td><%= link_to 'Edit', edit_comment_path(comment) %></td>
|
||||
<td><%= link_to 'Destroy', comment, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Comment', new_comment_path %>
|
24
app/views/comments/index.html.slim
Normal file
24
app/views/comments/index.html.slim
Normal file
@@ -0,0 +1,24 @@
|
||||
h1 Listing comments
|
||||
|
||||
table
|
||||
thead
|
||||
tr
|
||||
th User
|
||||
th File
|
||||
th Row
|
||||
th Column
|
||||
th Text
|
||||
th colspan="3"
|
||||
tbody
|
||||
- @comments.each do |comment|
|
||||
tr
|
||||
td= comment.user
|
||||
td= comment.file
|
||||
td= comment.row
|
||||
td= comment.column
|
||||
td= comment.text
|
||||
td= link_to 'Show', comment
|
||||
td= link_to 'Edit', edit_comment_path(comment)
|
||||
td= link_to 'Destroy', comment, method: :delete, data: confirm: 'Are you sure?'
|
||||
br/
|
||||
= link_to 'New Comment', new_comment_path
|
@@ -1,5 +0,0 @@
|
||||
<h1>New comment</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', comments_path %>
|
5
app/views/comments/new.html.slim
Normal file
5
app/views/comments/new.html.slim
Normal file
@@ -0,0 +1,5 @@
|
||||
h1 New comment
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', comments_path
|
@@ -1,29 +0,0 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>User:</strong>
|
||||
<%= @comment.user %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>File:</strong>
|
||||
<%= @comment.file %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Row:</strong>
|
||||
<%= @comment.row %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Column:</strong>
|
||||
<%= @comment.column %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Text:</strong>
|
||||
<%= @comment.text %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_comment_path(@comment) %> |
|
||||
<%= link_to 'Back', comments_path %>
|
25
app/views/comments/show.html.slim
Normal file
25
app/views/comments/show.html.slim
Normal file
@@ -0,0 +1,25 @@
|
||||
p#notice= notice
|
||||
|
||||
p
|
||||
strong User:
|
||||
= @comment.user
|
||||
|
||||
p
|
||||
strong File:
|
||||
= @comment.file
|
||||
|
||||
p
|
||||
strong Row:
|
||||
= @comment.row
|
||||
|
||||
p
|
||||
strong Column:
|
||||
= @comment.column
|
||||
|
||||
p
|
||||
strong Text:
|
||||
= @comment.text
|
||||
|
||||
= link_to 'Edit', edit_comment_path(@comment)
|
||||
| |
|
||||
= link_to 'Back', comments_path
|
Reference in New Issue
Block a user