From 4f00b12016333ce639dc190805d34b7cf6a62448 Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Sun, 24 Nov 2013 20:45:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E8=AE=BA=E5=9D=9B?= =?UTF-8?q?=E5=8A=A0tag=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 + app/models/forum.rb | 3 + app/views/forums/_forum_list.html.erb | 9 ++- app/views/forums/index.html.erb | 45 ++++++------- app/views/layouts/base_forums.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 2 +- app/views/tags/_tag.html.erb | 84 ++++++++++++------------ 7 files changed, 78 insertions(+), 69 deletions(-) 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 %> |