This commit is contained in:
albert
2012-02-24 17:30:57 -05:00
parent 3d3d5b1401
commit c38bee6d16
4 changed files with 5 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
class ModActionsController < ApplicationController
def index
@mod_actions = ModAction.search(params[:search]).paginate(params[:page])
@mod_actions = ModAction.search(params[:search]).order("id desc").paginate(params[:page])
end
end

View File

@@ -75,6 +75,7 @@ class DText
str = str.gsub(/\bforum #(\d+)/i, %{<a href="/forum_posts/\\1">forum #\\1</a>})
str = str.gsub(/\bcomment #(\d+)/i, %{<a href="/comments/\\1">comment #\\1</a>})
str = str.gsub(/\bpool #(\d+)/i, %{<a href="/pools/\\1">pool #\\1</a>})
str = str.gsub(/\buser #(\d+)/i, %{<a href="/users/\\1">user #\\1</a>})
end
def self.parse_list(str, options = {})

View File

@@ -63,6 +63,7 @@ class User < ActiveRecord::Base
module InvitationMethods
def invite!(level)
if level.to_i <= Levels::CONTRIBUTOR
ModAction.create(:description => "invited user ##{id} (#{name})")
self.level = level
self.inviter_id = CurrentUser.id
save

View File

@@ -1,7 +1,7 @@
<div id="c-mod-actions">
<div id="a-index">
<h1>Mod Actions</h1>
<table class="striped">
<table class="striped" width="100%">
<thead>
<tr>
<th>Date</th>
@@ -12,7 +12,7 @@
<tbody>
<% @mod_actions.each do |mod_action| %>
<tr>
<td><%= mod_action.created_at %></td>
<td><%= compact_time mod_action.created_at %></td>
<td><%= link_to mod_action.creator.name, user_path(mod_action.creator) %></td>
<td><%= format_text(mod_action.description) %></td>
</tr>