many tiny changes

This commit is contained in:
jomo
2013-06-25 02:53:12 +02:00
parent c5dfdbeb8f
commit ceb39bf0c3
22 changed files with 209 additions and 80 deletions

View File

@@ -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 %>

View File

@@ -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>

View File

@@ -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 %>

View File

@@ -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>

View 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>

View 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 %>

View File

@@ -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" %>