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
+5
View File
@@ -0,0 +1,5 @@
<%= simple_form_for @post do |f|%>
<%= f.input :title %>
<%= f.input :text %>
<%= f.submit %>
<% end %>
+6
View File
@@ -0,0 +1,6 @@
<h1>Editing blogpost</h1>
<%= render 'form' %>
<%= link_to 'Show', @blogpost %> |
<%= link_to 'Back', blogposts_path %>
+11
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>
+3
View File
@@ -0,0 +1,3 @@
<h1>New Blogpost</h1>
<%= render 'form' %>
+27
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>
+17
View File
@@ -0,0 +1,17 @@
<%= form_for(@comment) do |f| %>
<% if @comment.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@comment.errors.count, "error") %> prohibited this comment from being saved:</h2>
<ul>
<% @comment.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
+6
View File
@@ -0,0 +1,6 @@
<h1>Editing comment</h1>
<%= render 'form' %>
<%= link_to 'Show', @comment %> |
<%= link_to 'Back', comments_path %>
+21
View File
@@ -0,0 +1,21 @@
<h1>Listing comments</h1>
<table>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<% @comments.each do |comment| %>
<tr>
<td><%= link_to 'Show', comment %></td>
<td><%= link_to 'Edit', edit_comment_path(comment) %></td>
<td><%= link_to 'Destroy', comment, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Comment', new_comment_path %>
+5
View File
@@ -0,0 +1,5 @@
<h1>New comment</h1>
<%= render 'form' %>
<%= link_to 'Back', comments_path %>
+5
View File
@@ -0,0 +1,5 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_comment_path(@comment) %> |
<%= link_to 'Back', comments_path %>
+13
View File
@@ -0,0 +1,13 @@
<div id="head">
<%= link_to(root_path) do %>
<div id="logo"></div>
<% end %>
<div id="userinfo">
<% if !current_user.nil? %>
<%= link_to image_tag(Tools.avatar_url(current_user.id, 32), :class => "avatar"), current_user %>
<%= link_to image_tag("logout.png"), logout_path %>
<% else %>
<%= link_to "Log in", login_path, :action => "new" %>
<% end %>
</div>
</div>
+9 -5
View File
@@ -1,14 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Site</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<title>Redstoner</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= csrf_meta_tags %>
<%= favicon_link_tag "favicon.ico" %>
</head>
<body>
<%= render "/layouts/head" %>
<%= "<div id='alert'>#{alert}</div>".html_safe if alert %>
<%= "<div id='notice'>#{notice}</div>".html_safe if notice %>
<div id="main-content">
<%= yield %>
</div>
</body>
</html>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

+8
View File
@@ -0,0 +1,8 @@
<h1>Log in</h1>
<%= form_tag login_path do |f| %>
<%= label_tag :email %><br/>
<%= text_field_tag :email %><br/>
<%= label_tag :password %><br/>
<%= password_field_tag :password %><br/>
<%= submit_tag %>
<% end %>
+8
View File
@@ -0,0 +1,8 @@
<%= simple_form_for @user do |f| %>
<%= f.input :name %>
<%= f.input :ign %>
<%= f.input :email %>
<%= f.input :password %>
<%= f.input :password_confirmation %>
<%= f.submit %>
<% end %>
+6
View File
@@ -0,0 +1,6 @@
<h1>Editing user</h1>
<%= render 'form' %>
<%= link_to 'Show', @user %> |
<%= link_to 'Back', users_path %>
+4
View File
@@ -0,0 +1,4 @@
<h1>Listing users</h1>
<% @users.each do |u| %>
<%= link_to u.name, u %> (<%= u.ign %>)
<% end %>
+5
View File
@@ -0,0 +1,5 @@
<h1>New user</h1>
<%= render 'form' %>
<%= link_to 'Back', users_path %>
+10
View File
@@ -0,0 +1,10 @@
<div id="user-info"%>
<%= image_tag Tools.avatar_url(@user.id, 128), :class => "user-avatar", :alt => "avatar" %><br/>
<% if @user.banned %>
<span class="user-banned">This user is banned!</span>
<% end %>
IGN: <%= @user.ign %><br/>
Rank: <%= Tools.int_to_rank(@user.rank) %><br/>
Joined: <%= @user.created_at.strftime("%e. %b %Y") %><br/>
Last IP: <%= @user.last_ip %><br/>
About: <%= @user.about.blank? ? "<span class=\"no-about\">nothing</span>".html_safe : @user.about %>