first release

This commit is contained in:
jomo
2013-05-31 22:26:22 +02:00
parent 149232ec0c
commit 8921d108e2
70 changed files with 1080 additions and 85 deletions

View File

@@ -0,0 +1,5 @@
<%= simple_form_for @post do |f|%>
<%= f.input :title %>
<%= f.input :text %>
<%= f.submit %>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing blogpost</h1>
<%= render 'form' %>
<%= link_to 'Show', @blogpost %> |
<%= link_to 'Back', blogposts_path %>

View File

@@ -0,0 +1,11 @@
<h1>Blog</h1>
<div id="posts">
<% @posts.each do |p| %>
<div id="post">
<div id="post-title"><h2><%= link_to p.title, p %></h2><span class="comment-counter"><%= link_to pluralize(p.comments.count, "Comment"), p %></span></div>
<span class="post-info">by <%= link_to p.user.name, p.user %> on <%= p.created_at.strftime("%e. %b %Y") %></span>
<div id="post-content"><%= RbbCode.new.convert(p.text).html_safe %></div>
</div>
<% end %>
<%= link_to 'New Blogpost', new_blogpost_path if current_user && current_user.rank >= Tools.rank_to_int(:mod) %>
</div>

View File

@@ -0,0 +1,3 @@
<h1>New Blogpost</h1>
<%= render 'form' %>

View File

@@ -0,0 +1,27 @@
<h1><%= @post.title %></h1>
<span class="post-info"><%= link_to @post.user.name, @post.user %> on <%= @post.created_at.strftime("%e. %b %Y") %>
<% if current_user.rank >= Tools.rank_to_int(:mod) %>
- <%= link_to "edit", edit_blogpost_path(@post.id) %>
<% end %>
</span>
<div id="post-content">
<%= RbbCode.new.convert(@post.text).html_safe %>
</div>
<div id="comments">
<% @post.comments.each do |c| %>
<div class="comment">
<span class="comment-info"><%= link_to c.user.name, c.user %> on <%= c.created_at.strftime("%e. %b %Y") %>
<% if current_user.rank >= Tools.rank_to_int(:mod) %>
- <%= link_to "edit", edit_blogpost_comment_path(c.id) %>
<% end %>
</span>
<div class="comment-content"><%= c.text %></div>
</div>
<% end %>
<% if current_user && current_user.rank >= Tools.rank_to_int(:visitor) %>
<h3>New comment</h3>
<%= simple_form_for [@post, @comment] do |f| %>
<%= f.input :text, :label => false, :as => "text", :placeholder => "Comment" %><%= f.submit %>
<% end %>
<% end %>
</div>