diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index c00f223c9..6d3574309 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -19,8 +19,8 @@ class WelcomeController < ApplicationController caches_action :robots def index - @news = News.latest User.current - @projects = Project.latest User.current + # @news = News.latest User.current + # @projects = Project.latest User.current #by young (redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration] if request.get? @@ -60,10 +60,10 @@ class WelcomeController < ApplicationController end #add by huang - @memberships = @user.memberships.all(:conditions => Project.visible_condition(User.current)) + # @memberships = @user.memberships.all(:conditions => Project.visible_condition(User.current)) - events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20) - @events_by_day = events.group_by(&:event_date) + # events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20) + # @events_by_day = events.group_by(&:event_date) # end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 55f18459e..03900753b 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -19,18 +19,18 @@ module WelcomeHelper - def newbieTopiclist - find_all_topic_by_board_id - end + # def newbieTopiclist + # find_all_topic_by_board_id + # end - def newbieTopicStickyList - find_all_topic_by_board_id 1 - end + # def newbieTopicStickyList + # find_all_topic_by_board_id 1 + # end - def find_project_by_topic topic - board = find_board_by_topic(topic) - find_project_by_board board - end + # def find_project_by_topic topic + # board = find_board_by_topic(topic) + # find_project_by_board board + # end def find_all_hot_project sort_project_by_hot @@ -48,30 +48,30 @@ module WelcomeHelper sort_contest_by_hot end def time_tag_welcome(time) - text = distance_of_time_in_words(Time.now, time) - content_tag('span', text, :title => format_time(time)) - end + text = distance_of_time_in_words(Time.now, time) + content_tag('span', text, :title => format_time(time)) + end private - def search_project - Project.find_by_identifier "newbie_faq" - end + # def search_project + # Project.find_by_identifier "newbie_faq" + # end - def find_all_topic_by_board_id sticky = 0, limit = 30 - project = search_project - return [] if(project.nil? or project.boards.nil?) - board_id = project.boards.first.id - logger.debug "[WelcomeHelper] ===> find_all_topic_by_board_id=> project.id:#{project.id}, board_id:#{board_id}, sticky:#{sticky}" - Message.where("board_id = :board_id and sticky=:sticky", :board_id => board_id, :sticky => sticky ).limit(limit) - end + # def find_all_topic_by_board_id sticky = 0, limit = 30 + # project = search_project + # return [] if(project.nil? or project.boards.nil?) + # board_id = project.boards.first.id + # logger.debug "[WelcomeHelper] ===> find_all_topic_by_board_id=> project.id:#{project.id}, board_id:#{board_id}, sticky:#{sticky}" + # Message.where("board_id = :board_id and sticky=:sticky", :board_id => board_id, :sticky => sticky ).limit(limit) + # end - def find_board_by_topic topic - Board.find_by_id(topic.board_id) - end - def find_project_by_board board - Project.find_by_id(board.project_id) - end + # def find_board_by_topic topic + # Board.find_by_id(topic.board_id) + # end + # def find_project_by_board board + # Project.find_by_id(board.project_id) + # end def sort_project_by_hot sort_project_by_hot_rails 0, 'grade DESC' diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index b38ecb358..f79c44ae9 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -32,7 +32,7 @@
- <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%> -
-- <%= project.description.truncate(50, omission: '...') %> -
- -- <%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{contest.name}")%> -
-- <%= contest.description.truncate(50, omission: '...') %> -
- -+ <%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{contest.name}")%> +
++ <%= contest.description.truncate(50, omission: '...') %> +
+- <%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{bid.name}")%> -
-- <%= bid.description.truncate(50, omission: '...') %> -
-+ <%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{bid.name}")%> +
++ <%= bid.description.truncate(50, omission: '...') %> +
+- <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%> -
-- <%= project.description.truncate(50, omission: '...') %> -
-+ <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%> +
++ <%= project.description.truncate(50, omission: '...') %> +
+