security, user index

This commit is contained in:
jomo
2013-06-24 16:49:58 +02:00
parent b4f2dc5fab
commit c5dfdbeb8f
13 changed files with 125 additions and 140 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
<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.id) %>
- <%= link_to "edit", edit_blogpost_comment_path(c.blogpost, c) %>
<% end %>
</span>
<div class="comment-content"><%= c.text %></div>
-17
View File
@@ -1,17 +0,0 @@
<%= 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 %>
+5 -5
View File
@@ -1,6 +1,6 @@
<h1>Editing comment</h1>
<h1>Edit comment</h1>
<%= render 'form' %>
<%= link_to 'Show', @comment %> |
<%= link_to 'Back', comments_path %>
<%= simple_form_for [@comment.blogpost, @comment] do |f| %>
<%= f.input :text, :label => false, :as => "text", :placeholder => "Comment" %>
<%= f.submit %>
<% end %>
-21
View File
@@ -1,21 +0,0 @@
<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
@@ -1,5 +0,0 @@
<h1>New comment</h1>
<%= render 'form' %>
<%= link_to 'Back', comments_path %>
-5
View File
@@ -1,5 +0,0 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_comment_path(@comment) %> |
<%= link_to 'Back', comments_path %>
+14 -4
View File
@@ -1,4 +1,14 @@
<h1>Listing users</h1>
<% @users.each do |u| %>
<%= link_to u.name, u %> (<%= u.ign %>)
<% end %>
<h1>All users</h1>
<div id="userlist">
<% @users.each do |u| %>
<div class="list-user">
<%= link_to u do %>
<%= image_tag(avatar_url(u.id, 64), :class => "avatar", :alt => "avatar") %>
<div class="user-info">
<span class="user-name"><%= u.name %></span>
<span class="user-ign"><%= u.ign %></span>
</div>
<% end %>
</div>
<% end %>
</div>