diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 865987767..3d38ddbf8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -645,6 +645,8 @@ class UsersController < ApplicationController @obj = Issue.find_by_id(@obj_id) when '4' then @obj = Bid.find_by_id(@obj_id) + when '5' then + @obj = Forum.find_by_id(@obj_id) else @obj = nil end diff --git a/app/models/forum.rb b/app/models/forum.rb index 8a15171dc..993c00b23 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -14,4 +14,7 @@ class Forum < ActiveRecord::Base validates_length_of :description, maximum: 255 validates :name, :uniqueness => true + acts_as_taggable + scope :by_join_date, order("created_at DESC") + end diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb index e5bd3b140..eb55e0711 100644 --- a/app/views/forums/_forum_list.html.erb +++ b/app/views/forums/_forum_list.html.erb @@ -25,7 +25,14 @@
讨论区 | +讨论区 | <%= l(:label_user_location) %> : | -+ | <% if User.current.logged? %> <%= link_to("新建讨论区", new_forum_path, :class => 'icon icon-add') %> - <% end %> - | -- + <% end %> | +|
<%= link_to "forge.trustie.net/forums", forums_path %> | -<%=link_to l(:field_homepage), home_path %> > <%=link_to "讨论区", forums_path %> | +<%= link_to l(:field_homepage), home_path %> > <%= link_to "讨论区", forums_path %> |