-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
104 additions
and
75 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
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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<tr> | ||
<td> | ||
<%= markdown(comment.Body) %> | ||
</td> | ||
</tr> | ||
<li class="media media-small"> | ||
<img class="mr-3" src='<%= commentAvatarURL(comment) %>' alt='<%= commentAuthor(comment) %>'> | ||
<div class="media-body"> | ||
<h6 class="mt-0"><%= commentAuthor(comment) %> <span class="time-ago"><%= timeAgo(comment.CreatedAt) %></h6> | ||
<%= markdown(comment.Body) %> | ||
</div> | ||
</li> |
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<div class="py-4 mb-2"> | ||
<h3 class="d-inline-block">Comments</h3> | ||
<h5 class="d-inline-block">Comments</h5> | ||
</div> | ||
|
||
<table id="comment-list" class="table table-hover table-bordered"> | ||
<tbody> | ||
<%= for (comment) in comments { %> | ||
<tr> | ||
<td> | ||
<ul id="comment-list" class="list-unstyled"> | ||
<%= for (comment) in comments { %> | ||
<li class="media media-small"> | ||
<img class="mr-3" src='<%= commentAvatarURL(comment) %>' alt='<%= commentAuthor(comment) %>'> | ||
<div class="media-body"> | ||
<h6 class="mt-0"><%= commentAuthor(comment) %> <span class="time-ago"><%= timeAgo(comment.CreatedAt) %></h6> | ||
<%= markdown(comment.Body) %> | ||
</td> | ||
</tr> | ||
<% } %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</li> | ||
<% } %> | ||
</ul> | ||
|
||
<%= remoteFormFor(comment, {action: postCommentsPath({post_id: comment.PostID}), method: "POST"}) { %> | ||
<%= f.TextAreaTag("Body", {rows: 4}) %> | ||
<button class="btn btn-success" role="submit">Post</button> | ||
<%= f.TextAreaTag("Body", {rows: 4, label: "New comment"}) %> | ||
<button class="btn btn-sm btn-success" role="submit">Submit</button> | ||
<% } %> |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
$('#comment-list').append('<%= partial("comments/item.plush.html", { "comment": comment }) %>'); | ||
$('#comment-list').append('<%= partial("comments/item.plush.html") %>'); | ||
$('#comment-Body').val(''); |
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 |
---|---|---|
@@ -1,59 +1,37 @@ | ||
<div class="py-4 mb-2"> | ||
<h3 class="d-inline-block">Post Details</h3> | ||
|
||
<div class="float-right"> | ||
<%= linkTo(postsPath(), {class: "btn btn-info"}) { %> | ||
Back to all Posts | ||
<% } %> | ||
<%= if (authorized) { %> | ||
<%= linkTo(editPostPath({ post_id: post.ID }), {class: "btn btn-warning", body: "Edit"}) %> | ||
<%= linkTo(postPath({ post_id: post.ID }), {class: "btn btn-danger", "data-method": "DELETE", "data-confirm": "Are you sure?", body: "Destroy"}) %> | ||
<% } %> | ||
</div> | ||
<div class="float-right"> | ||
<%= linkTo(postsPath(), {class: "btn btn-info"}) { %> | ||
Back to all Posts | ||
<% } %> | ||
<%= if (authorized) { %> | ||
<%= linkTo(editPostPath({ post_id: post.ID }), {class: "btn btn-warning", body: "Edit"}) %> | ||
<%= linkTo(postPath({ post_id: post.ID }), {class: "btn btn-danger", "data-method": "DELETE", "data-confirm": "Are you sure?", body: "Destroy"}) %> | ||
<% } %> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
<ul class="list-group mb-2 "> | ||
|
||
|
||
<li class="list-group-item pb-1"> | ||
<label class="small d-block">Author</label> | ||
<p class="d-inline-block"><%= postAuthor(post) %></p> | ||
</li> | ||
|
||
|
||
<li class="list-group-item pb-1"> | ||
<label class="small d-block">Title</label> | ||
<p class="d-inline-block"><%= post.Title %></p> | ||
</li> | ||
|
||
|
||
|
||
<li class="list-group-item pb-1"> | ||
<label class="small d-block">Body</label> | ||
<p class="d-inline-block"><%= markdown(post.Body) %></p> | ||
</li> | ||
|
||
|
||
|
||
<li class="list-group-item pb-1"> | ||
<label class="small d-block">Votes</label> | ||
<p class="d-inline-block"><%= post.Votes %></p> | ||
</li> | ||
<div class="media"> | ||
<img class="mr-3" src='<%= postAvatarURL(post) %>' alt="<%= postAuthor(post) %>"> | ||
<div class="media-body"> | ||
<h3 class="d-inline-block"><%= post.Title %></h3> | ||
<h6 class="mt-0"><%= postAuthor(post) %> <span class="time-ago"><%= timeAgo(post.CreatedAt) %></span></h6> | ||
<%= markdown(post.Body) %> | ||
</div> | ||
</div> | ||
|
||
|
||
</ul> | ||
|
||
<div id="comments"> | ||
|
||
<script type="text/javascript"> | ||
window.onload = function () { | ||
$.ajax({ | ||
method: 'GET', | ||
url: '<%= postCommentsPath({post_id: post.ID}) %>', | ||
dataType: 'script', | ||
contentType: 'text/javascript' | ||
}); | ||
} | ||
</script> | ||
<script type="text/javascript"> | ||
window.onload = function () { | ||
$.ajax({ | ||
method: 'GET', | ||
url: '<%= postCommentsPath({post_id: post.ID}) %>', | ||
dataType: 'script', | ||
contentType: 'text/javascript' | ||
}); | ||
} | ||
</script> |