Skip to content

Commit 7fa3f33

Browse files
Merge pull request #46 from OmeletWithoutEgg/main
Add button to view single post
2 parents c315e56 + 7169733 commit 7fa3f33

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/views/comments/_show_comment.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<%= post_user(comment) %>
1111
</div>
1212
<% if effective_admin? or (current_user&.id == comment.user_id and not @contest) %>
13-
<%= link_to "Edit", edit_polymorphic_path(comment_object), class:'btn btn-primary btn-xs' %>
13+
<%= link_to "View", polymorphic_path(comment_object), class:'btn btn-primary btn-xs' %>
14+
<%= link_to "Edit", edit_polymorphic_path(comment_object), class:'btn btn-info btn-xs' %>
1415
<%= link_to "Delete", polymorphic_path(comment_object), method: :delete, data:{confirm:"Sure?"}, class:'btn btn-danger btn-xs' %>
1516
<% end %>

app/views/posts/_show_post.html.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
(private post)
3131
<% end %>
3232
</div>
33+
<%= link_to "View Post", contest_adaptive_polymorphic_path([post]), class:'btn btn-primary btn-xs'%>
3334
<% if allow_edit(post) %>
34-
<%= link_to "Edit Post", contest_adaptive_polymorphic_path([post], action: :edit), class:'btn btn-primary btn-xs'%>
35+
<%= link_to "Edit Post", contest_adaptive_polymorphic_path([post], action: :edit), class:'btn btn-info btn-xs'%>
3536
<%= link_to "Delete Post", polymorphic_path(post_object), method: :delete, data: {confirm:"Sure?"}, class:'btn btn-danger btn-xs' %>
3637
<% end %>
3738
<% if post.comments.present? %>
@@ -49,7 +50,7 @@
4950
<% end %><%# if post.comments.present? %>
5051
<% if user_signed_in? and (effective_admin? or not @contest) and (not @problem or @problem.discussion_enabled?) %>
5152
<div class="new_comment" style="display:inline">
52-
<button class="new_comment btn btn-info btn-xs">New Comment</button>
53+
<button class="new_comment btn btn-success btn-xs">New Comment</button>
5354
<div class="new_comment_form well well-lg" style="margin-top: 1rem; margin-bottom: 0; padding-top: 1rem;">
5455
<%= render partial: 'comment_form', locals: {post: post} %>
5556
</div><%# new_comment_form %>

0 commit comments

Comments
 (0)