many tiny changes
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
<%= simple_form_for @post do |f|%>
|
||||
<%= f.input :title, :label => false %>
|
||||
<%= f.input :text, :label => false %>
|
||||
<%= f.submit "Create Post" %>
|
||||
<% end %>
|
||||
@@ -1,6 +1,10 @@
|
||||
<h1>Editing blogpost</h1>
|
||||
<h1>Edit post</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @blogpost %> |
|
||||
<%= link_to 'Back', blogposts_path %>
|
||||
<%= simple_form_for @post do |f|%>
|
||||
<%= f.input :title, :label => false %>
|
||||
<%= f.input :text, :label => false %>
|
||||
<%= f.submit "Update Post", :id => "edit_create_post" %>
|
||||
<% end %>
|
||||
<div id="delete_post">
|
||||
<%= button_to "Delete post", @post, :method => "delete", :confirm => "Delete post forever?" %>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
<h1>New Post</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
<%= simple_form_for @post do |f|%>
|
||||
<%= f.input :title, :label => false %>
|
||||
<%= f.input :text, :label => false'%>
|
||||
<%= f.submit "Update Post", :id => "edit_create_post" %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<h1><%= @post.title %></h1>
|
||||
<span class="post-info"><%= link_to @post.user.name, @post.user %> on <%= @post.created_at.strftime("%e. %b %Y") %>
|
||||
<span class="post-info"><%= link_to @post.author.name, @post.author %> on <%= @post.created_at.strftime("%e. %b %Y") %>
|
||||
<% if current_user && current_user.rank >= rank_to_int("mod") %>
|
||||
- <%= link_to "edit", edit_blogpost_path(@post.id) %>
|
||||
<% end %>
|
||||
@@ -9,20 +9,7 @@
|
||||
</div>
|
||||
<div id="comments">
|
||||
<% @post.comments.each do |c| %>
|
||||
<div class="comment <%= "author" if c.user == @post.user %>">
|
||||
<span class="comment-info"><%= link_to c.user.name, c.user %> on <%= c.created_at.strftime("%e. %b %Y") %>
|
||||
<% if current_user && current_user.rank >= rank_to_int("mod") %>
|
||||
- <%= link_to "edit", edit_blogpost_comment_path(c.blogpost, c) %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="comment-content"><%= c.text %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if current_user %>
|
||||
<h3>New comment</h3>
|
||||
<%= simple_form_for [@post, @comment] do |f| %>
|
||||
<%= f.input :text, :label => false, :as => "text", :placeholder => "Comment" %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<%= render "comments/comment", :c => c %>
|
||||
<% end %>
|
||||
<%= render "comments/new" %>
|
||||
</div>
|
||||
8
app/views/comments/_comment.html.erb
Normal file
8
app/views/comments/_comment.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="comment <%= "author" if c.user == @post.user %>">
|
||||
<span class="comment-info"><%= link_to c.user.name, c.user %> <%= c.created_at.strftime("%e. %b %Y, %H:%m") %>
|
||||
<% if current_user && ((current_user.rank >= rank_to_int("mod") && current_user.rank.to_i >= c.user.rank.to_i) || (current_user == c.user)) %>
|
||||
<div class="editlink"><%= link_to "edit", edit_blogpost_comment_path(c.blogpost, c) %></div>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="comment-content"><%= c.text %></div>
|
||||
</div>
|
||||
7
app/views/comments/_new.html.erb
Normal file
7
app/views/comments/_new.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<% if current_user %>
|
||||
<h3>New comment</h3>
|
||||
<%= simple_form_for [@post, @comment] do |f| %>
|
||||
<%= f.input :text, :label => false, :as => "text", :placeholder => "Comment" %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -5,6 +5,7 @@
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= favicon_link_tag "favicon.ico" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
</head>
|
||||
<body>
|
||||
<%= render "/layouts/head" %>
|
||||
|
||||
Reference in New Issue
Block a user