-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces admin interface for comments
Paginated view of all comments with the ability to delete them.
- Loading branch information
1 parent
a12fb2d
commit a9ef269
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
- content_for :title do | ||
Comments | ||
|
||
.row | ||
.col-sm-12 | ||
- if @comments.any? | ||
.row | ||
.col-sm-12 | ||
%table.table.table-hover | ||
%thead | ||
%th Date | ||
%th User | ||
%th Comment | ||
%th Project | ||
%th Actions | ||
- @comments.each do |comment| | ||
%tr | ||
%td | ||
= comment.updated_at | ||
%td | ||
- if comment.commenter | ||
= link_to user_path(comment.commenter) do | ||
= comment.commenter.name | ||
- else | ||
Deleted User | ||
%td | ||
= comment.text | ||
%td | ||
- if comment.commentable | ||
= link_to project_path(comment.commentable) do | ||
= comment.project.title | ||
- else | ||
Deleted Project/Comment | ||
%td | ||
.btn-group | ||
= link_to comment_path(comment), method: :delete, data: { confirm: 'Are you sure you want to delete this comment?' }, class: 'btn btn-danger' do | ||
Delete Comment | ||
.row | ||
.col-sm-12 | ||
.text-center | ||
= paginate @comments | ||
- else | ||
No comments yet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters