Merge branch 'welcome' into develop
This commit is contained in:
commit
f14f73414e
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -47,78 +47,95 @@ module WelcomeHelper
|
|||
def find_all_hot_contest
|
||||
sort_contest_by_hot
|
||||
end
|
||||
|
||||
def find_all_event_type event
|
||||
case event.event_type
|
||||
when 'news'
|
||||
'新闻'
|
||||
when 'issue'
|
||||
'缺陷'
|
||||
when 'attachment'
|
||||
'附件'
|
||||
when 'message'
|
||||
'主题'
|
||||
when 'reply'
|
||||
'回复'
|
||||
when 'bid'
|
||||
'众包'
|
||||
else
|
||||
event.event_type
|
||||
end
|
||||
end
|
||||
|
||||
def time_tag_welcome(time)
|
||||
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
|
||||
return sort_project_by_hot_rails 0
|
||||
sort_project_by_hot_rails 0, 'grade DESC'
|
||||
end
|
||||
|
||||
def sort_course_by_hot
|
||||
return sort_project_by_hot_rails 1
|
||||
sort_project_by_hot_rails 1, 'course_ac_para DESC'
|
||||
end
|
||||
|
||||
def sort_bid_by_hot
|
||||
return sort_bid_by_hot_rails 1
|
||||
sort_bid_by_hot_rails 1
|
||||
end
|
||||
|
||||
def sort_contest_by_hot
|
||||
return sort_bid_by_hot_rails 2
|
||||
sort_bid_by_hot_rails 2
|
||||
end
|
||||
#取得所有活动
|
||||
def find_all_activities limit=10
|
||||
users = []
|
||||
activities = Activity.find_by_sql("select distinct user_id from activities order by id DESC limit #{limit}" )
|
||||
activities.each { |activity|
|
||||
users << activity.user_id
|
||||
}
|
||||
user_objs = User.find_by_sql("SELECT * FROM users WHERE (users.id IN #{"(" << users.join(',') << ")"} )")
|
||||
activity = Redmine::Activity::Fetcher.new(user_objs)
|
||||
def find_all_activities limit=5
|
||||
# users = []
|
||||
# activities = Activity.find_by_sql("select distinct user_id from activities order by id DESC limit #{limit}" )
|
||||
# activities.each { |activity|
|
||||
# users << activity.user_id
|
||||
# }
|
||||
# user_objs = User.find_by_sql("SELECT * FROM users WHERE (users.id IN #{"(" << users.join(',') << ")"} )")
|
||||
activity = Redmine::Activity::Fetcher.new(nil)
|
||||
|
||||
activity.events_welcome(nil, nil, {:limit => limit})
|
||||
end
|
||||
|
||||
#取得论坛数据
|
||||
def find_hot_forum_topics limit=10
|
||||
Memo.order('replies_count DESC').where('replies_count <> 0').limit(limit)
|
||||
Memo.order('replies_count DESC').where('replies_count <> 0').limit(limit)
|
||||
end
|
||||
|
||||
def sort_project_by_hot_rails project_type
|
||||
limit = 10
|
||||
project_type == 0 ? Project.find_by_sql("
|
||||
def sort_project_by_hot_rails project_type=0, order_by='grade DESC', limit=15
|
||||
Project.find_by_sql("
|
||||
SELECT p.id, p.name, p.description, p.identifier, t.project_id
|
||||
FROM projects AS p RIGHT OUTER JOIN (
|
||||
SELECT project_id,grade FROM project_statuses
|
||||
WHERE project_type = #{project_type} ORDER BY grade DESC LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
||||
: Project.find_by_sql("
|
||||
SELECT p.id, p.name, p.description, p.identifier, t.project_id
|
||||
FROM projects AS p RIGHT OUTER JOIN (
|
||||
SELECT project_id,grade FROM project_statuses
|
||||
WHERE project_type = #{project_type} ORDER BY course_ac_para DESC LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
||||
WHERE project_type = #{project_type} ORDER BY #{order_by} LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
||||
end
|
||||
|
||||
def sort_bid_by_hot_rails reward_type
|
||||
limit = 10
|
||||
Bid.visible.where('reward_type = ?', reward_type).reorder('bids.commit desc').limit(limit).all
|
||||
def sort_bid_by_hot_rails reward_type, limit = 10
|
||||
Bid.visible.where('reward_type = ?', reward_type).reorder('bids.commit desc').limit(limit)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -4,11 +4,11 @@ class Forum < ActiveRecord::Base
|
|||
has_many :memos, :dependent => :destroy
|
||||
belongs_to :creator, :class_name => "User", :foreign_key => 'creator_id'
|
||||
safe_attributes 'name',
|
||||
'description',
|
||||
'topic_count',
|
||||
'memo_count',
|
||||
'last_memo_id',
|
||||
'creator_id'
|
||||
'description',
|
||||
'topic_count',
|
||||
'memo_count',
|
||||
'last_memo_id',
|
||||
'creator_id'
|
||||
validates_presence_of :name, :creator_id
|
||||
validates_length_of :name, maximum: 50
|
||||
validates_length_of :description, maximum: 255
|
||||
|
@ -16,5 +16,17 @@ class Forum < ActiveRecord::Base
|
|||
|
||||
acts_as_taggable
|
||||
scope :by_join_date, order("created_at DESC")
|
||||
|
||||
|
||||
def reset_counters!
|
||||
self.class.reset_counters!(id)
|
||||
end
|
||||
|
||||
# Updates topic_count, memo_count and last_memo_id attributes for +board_id+
|
||||
def self.reset_counters!(forum_id)
|
||||
forum_id = forum_id.to_i
|
||||
update_all("topic_count = (SELECT COUNT(*) FROM #{Memo.table_name} WHERE forum_id=#{forum_id} AND parent_id IS NULL)," +
|
||||
" memo_count = (SELECT COUNT(*) FROM #{Memo.table_name} WHERE forum_id=#{forum_id} AND parent_id IS NOT NULL)," +
|
||||
" last_memo_id = (SELECT MAX(id) FROM #{Memo.table_name} WHERE forum_id=#{forum_id})",
|
||||
["id = ?", forum_id])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class Memo < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
belongs_to :forums
|
||||
belongs_to :forum
|
||||
belongs_to :author, :class_name => "User", :foreign_key => 'author_id'
|
||||
|
||||
validates_presence_of :author_id, :forum_id, :subject
|
||||
|
@ -13,10 +13,10 @@ class Memo < ActiveRecord::Base
|
|||
acts_as_attachable
|
||||
belongs_to :last_reply_id, :class_name => 'Memo', :foreign_key => 'last_reply_id'
|
||||
# acts_as_searchable :column => ['subject', 'content'],
|
||||
# #:include => { :forums => :p}
|
||||
# #:include => { :forum => :p}
|
||||
# #:project_key => "#{Forum.table_name}.project_id"
|
||||
# :date_column => "#{table_name}.created_at"
|
||||
# acts_as_event :title => Proc.new {|o| "#{o.forums.name}: #{o.subject}"},
|
||||
# acts_as_event :title => Proc.new {|o| "#{o.forum.name}: #{o.subject}"},
|
||||
# :description => :content,
|
||||
# :group => :parent,
|
||||
# :type => Proc.new {|o| o.parent_id.nil? ? 'message' : 'reply'},
|
||||
|
@ -29,7 +29,7 @@ class Memo < ActiveRecord::Base
|
|||
"subject",
|
||||
"content",
|
||||
"forum_id",
|
||||
"last_reply_id",
|
||||
"last_memo_id",
|
||||
"lock",
|
||||
"parent_id",
|
||||
"replies_count",
|
||||
|
@ -39,8 +39,8 @@ class Memo < ActiveRecord::Base
|
|||
# after_update :update_memos_forum
|
||||
after_destroy :reset_counters!
|
||||
# after_create :send_notification
|
||||
after_save :plusParentAndForum
|
||||
after_destroy :minusParentAndForum
|
||||
# after_save :plusParentAndForum
|
||||
# after_destroy :minusParentAndForum
|
||||
|
||||
# scope :visible, lambda { |*args|
|
||||
# includes(:forum => ).where()
|
||||
|
@ -62,7 +62,7 @@ class Memo < ActiveRecord::Base
|
|||
if parent && parent.id
|
||||
Memo.update_all({:last_reply_id => parent.children.maximum(:id)}, {:id => parent.id})
|
||||
end
|
||||
# forums.reset_counters!
|
||||
forum.reset_counters!
|
||||
end
|
||||
|
||||
def sticky=(arg)
|
||||
|
|
|
@ -32,16 +32,16 @@
|
|||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @forums.each do |forum| %>
|
||||
< % @forums.each do |forum| %>
|
||||
<tr>
|
||||
<td><%= forum.name %></td>
|
||||
<td><%= forum.description %></td>
|
||||
<td><%= forum.creator.show_name %></td>
|
||||
<td><%= link_to 'Show', forum %></td>
|
||||
<td><%= link_to 'Edit', edit_forum_path(forum) %></td>
|
||||
<td><%= link_to 'Destroy', forum, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td>< %= forum.name %></td>
|
||||
<td>< %= forum.description %></td>
|
||||
<td>< %= forum.creator.show_name %></td>
|
||||
<td>< %= link_to 'Show', forum %></td>
|
||||
<td>< %= link_to 'Edit', edit_forum_path(forum) %></td>
|
||||
<td>< %= link_to 'Destroy', forum, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
< % end %>
|
||||
</table>
|
||||
|
||||
<br /> -->
|
||||
|
|
|
@ -97,227 +97,126 @@
|
|||
<%= stylesheet_link_tag 'welcome' %>
|
||||
<div class="body_resize">
|
||||
|
||||
<!-- <div class="right">
|
||||
<div class="home"><%= l :label_hot_project%></div>
|
||||
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[5]) %>
|
||||
<div class="project">
|
||||
<%=link_to( project.name, project_path(project.project_id), :class => "nowrap" )%>
|
||||
<p><%= project.description %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="left">
|
||||
<div class="home" ><%= l :label_newbie_faq %></div>
|
||||
<% newbieTopicStickyList.each do |topic| break if(topic == newbieTopicStickyList[6])%>
|
||||
<div class="project">
|
||||
<%=link_to( topic.subject, board_message_path(find_board_by_topic(topic),topic), :class => "nowrap" )%>
|
||||
<span class="grey"><strong><em>[ <%=find_project_by_topic(topic) %> ]</em></strong></span>
|
||||
</div>
|
||||
<% end %>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="left" style="float: left; height: 445px;">
|
||||
<ul class="welcome-message-list" style="width: 90%;">
|
||||
<div class="left" style="float: left; height: 445px; width: 50%;">
|
||||
<ul class="welcome-message-list" style="width: 90%; ">
|
||||
<h3 style="">论坛热帖</h3>
|
||||
<div class="welcome-box-list">
|
||||
<li class="message-brief-intro">
|
||||
<span style="color:gray">新建DIV测试项目对于本项目的作用</span> <span style="margin-left: 10px; color: green">yanpc</span><span style="margin-left:10px; color:blue">1分钟前</span>
|
||||
</li>
|
||||
<li class="message-brief-intro">
|
||||
<span style="color:gray">热烈祝贺论坛新版本上线,欢迎大家提交bug</span><span style="margin-left: 10px; color: green">yanpc</span><span style="margin-left:10px; color:blue">5分钟前</span>
|
||||
</li>
|
||||
<li class="message-brief-intro">
|
||||
<span style="color:gray">论坛全新改版,增加许多功能啦,欢迎大家提交bug</span><span style="margin-left: 10px; color: green">yanpc</span><span style="margin-left:10px; color:blue">半小时前</span>
|
||||
</li>
|
||||
<li class="message-brief-intro">
|
||||
<span style="color:gray">网站主页改版,欢迎大家提交意见和建议</span><span style="margin-left: 10px; color: green">yanpc</span><span style="margin-left:10px; color:blue">2013-11-12</span>
|
||||
</li>
|
||||
<li class="message-brief-intro">
|
||||
<span style="color:gray">网站持续更新中,以期给大家带来更好的用户体验</span><span style="margin-left: 10px; color: green">yanpc</span><span style="margin-left:10px; color:blue">2013-11-9</span>
|
||||
</li>
|
||||
<li class="message-brief-intro">
|
||||
<span style="color:gray">网站上线第一次发帖,欢迎大家来盖楼</span><span style="margin-left: 10px; color: green">yanpc</span><span style="margin-left:10px; color:blue">2013-11-9</span>
|
||||
<% find_hot_forum_topics.each do |topic|%>
|
||||
<li class="message-brief-intro" style="height: 25px;">
|
||||
<div style="display: inline-block; float: left;">
|
||||
<img src="/images/list-icon.png"></img>
|
||||
</div>
|
||||
<div style="display: inline-block;float: left;">
|
||||
<span style="color:gray"><%= link_to topic.subject.truncate(30, omission: '...'), forum_memo_path(topic.forum_id,topic.id), :class => "gray" %></span>
|
||||
<span style="margin-left: 10px; color: green">
|
||||
<%= link_to topic.author, user_path(topic.author) %>
|
||||
</span>
|
||||
<span style="margin-left:10px; color:blue"><%= time_tag_welcome topic.created_at %>前</span>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right" style="float: right; margin-right: -80px; height: 445px;">
|
||||
<div class="right" style="float: right; margin-right: -10px; height: 445px; width: 50%; ">
|
||||
<ul class="user-welcome-message-list" style="width: 80%; margin-top: 80px;">
|
||||
<h3 style="margin-left: -5px;">用户动态</h3>
|
||||
<div class="user-message-box-list">
|
||||
<% find_all_activities.each do |event| %>
|
||||
<li style="display: block;height:60px;">
|
||||
<div class="inner-right" style="float: left; height: 100%;">
|
||||
<img class="avatar-3" style="width: 40px; height: 40px; margin-top:10px;" src="/images/avatars/User/4861?1385345302"></img>
|
||||
<div class="inner-right" style="float: left; height: 100%; ">
|
||||
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
||||
</div>
|
||||
<div class="inner-right" style="float: right; width:88%; height: 100%;">
|
||||
<span style="color: green;">yanpc</span> 发表了评论:<span style="color: blue;">热烈庆祝OW2圆满结束,让我们一起期待下一届的OW2比赛吧!</span>
|
||||
<p><span>1分钟前</span> <span>评论(4)</span></p>
|
||||
</div>
|
||||
</li>
|
||||
<li style="display: block;height:60px;">
|
||||
<div class="inner-right" style="float: left; height: 100%;">
|
||||
<img class="avatar-3" style="width: 40px; height: 40px; margin-top:10px;" src="/images/avatars/User/4861?1385345302"></img>
|
||||
</div>
|
||||
<div class="inner-right" style="float: right; width:88%; height: 100%;">
|
||||
<span style="color: green;">yanpc</span> 发表了评论:<span style="color: blue;">热烈庆祝OW2圆满结束,让我们一起期待下一届的OW2比赛吧!</span>
|
||||
<p><span>1分钟前</span> <span>评论(4)</span></p>
|
||||
</div>
|
||||
</li>
|
||||
<li style="display: block; height:60px;">
|
||||
<div class="inner-right" style="float: left; height: 100%;">
|
||||
<img class="avatar-3" style="width: 40px; height: 40px; margin-top:10px;" src="/images/avatars/User/4861?1385345302"></img>
|
||||
</div>
|
||||
<div class="inner-right" style="float: right; width:88%; height: 100%;">
|
||||
<span style="color: green;">yanpc</span> 发表了评论:<span style="color: blue;">热烈庆祝OW2圆满结束,让我们一起期待下一届的OW2比赛吧!</span>
|
||||
<p><span>1分钟前</span> <span>评论(4)</span></p>
|
||||
</div>
|
||||
</li>
|
||||
<li style="display: block;height:60px;">
|
||||
<div class="inner-right" style="float: left; height: 100%;">
|
||||
<img class="avatar-3" style="width: 40px; height: 40px; margin-top:10px;" src="/images/avatars/User/4861?1385345302"></img>
|
||||
</div>
|
||||
<div class="inner-right" style="float: right; width:88%; height: 100%;">
|
||||
<span style="color: green;">yanpc</span> 发表了评论:<span style="color: blue;">热烈庆祝OW2圆满结束,让我们一起期待下一届的OW2比赛吧!</span>
|
||||
<p><span>1分钟前</span> <span>评论(4)</span></p>
|
||||
</div>
|
||||
</li>
|
||||
<li style="display: block;height:60px;">
|
||||
<div class="inner-right" style="float: left; height: 100%;">
|
||||
<img class="avatar-3" style="width: 40px; height: 40px; margin-top:10px;" src="/images/avatars/User/4861?1385345302"></img>
|
||||
</div>
|
||||
<div class="inner-right" style="float: right; width:88%; height: 100%;">
|
||||
<span style="color: green;">yanpc</span> 发表了评论:<span style="color: blue;">热烈庆祝OW2圆满结束,让我们一起期待下一届的OW2比赛吧!</span>
|
||||
<p><span>1分钟前</span> <span>评论(4)</span></p>
|
||||
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
|
||||
<span style="color: green;"><%= link_to event.event_author, user_path(event.event_author), :style => "color:green;" %></span> 发表了<%= find_all_event_type event %>:<span style="color: blue;"><%= link_to truncate(event.event_description, length: 30, omission:'...'), event.event_url %>
|
||||
</span>
|
||||
<p><span style="color: rgb(172, 174, 177)"><%= time_tag_welcome event.event_datetime %>前</span> <!-- <span>评论(4)</span></p> -->
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||
<h2>热门项目</h2>
|
||||
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
||||
<li class="current">
|
||||
<a class="" href="javascript:void(0);">今日</a>
|
||||
<h2>热门项目</h2>
|
||||
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[15]) %>
|
||||
<li style="background-image:none;">
|
||||
<div style="float: left;">
|
||||
<%= image_tag url_to_avatar(project), :class => "avatar-4" %>
|
||||
</div>
|
||||
<div style="float: left; margin-left: 10px; width: 360px;">
|
||||
<p class="layout">
|
||||
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<span class="d-p-project-intro" ><%= project.description.truncate(50, omission: '...') %></span>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="javascript:void(0);">本周</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="javascript:void(0);">本月</a>
|
||||
</li>
|
||||
</ul> -->
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[5]) %>
|
||||
<li style="background-image:none;">
|
||||
<p class="layout">
|
||||
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<span class="d-p-project-intro"><%= project.description %></span>
|
||||
</p>
|
||||
<!-- <p class="layout">
|
||||
<span><%= project.members.count%></span>
|
||||
</p> -->
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<h2>热门竞赛</h2>
|
||||
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
||||
<li class="current">
|
||||
<a class="" href="javascript:void(0);">今日</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="javascript:void(0);">本周</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="javascript:void(0);">本月</a>
|
||||
</li>
|
||||
</ul> -->
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
|
||||
<li style="background-image:none;">
|
||||
<p class="layout">
|
||||
<%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{contest.name}")%>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<span class="d-p-project-intro"><%= contest.description %></span>
|
||||
</p>
|
||||
<!-- <p style="margin-top: -10px;">
|
||||
<span><%= contest.created_on %></span>
|
||||
</p> -->
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<h2>热门竞赛</h2>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
|
||||
<li style="background-image:none;">
|
||||
<p class="layout">
|
||||
<%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{contest.name}")%>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<span class="d-p-project-intro"><%= contest.description.truncate(50, omission: '...') %></span>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" >
|
||||
<h2>最新众包</h2>
|
||||
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
||||
<li class="current">
|
||||
<a class="" href="javascript:void(0);">今日</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="javascript:void(0);">本周</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="javascript:void(0);">本月</a>
|
||||
</li>
|
||||
</ul> -->
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
|
||||
<li style="background-image:none;">
|
||||
<p class="layout">
|
||||
<%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{bid.name}")%>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<span class="d-p-project-intro"><%= bid.description %></span>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<h2>热门众包</h2>
|
||||
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
|
||||
<li style="background-image:none;">
|
||||
<p class="layout">
|
||||
<%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{bid.name}")%>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<span class="d-p-project-intro"><%= bid.description.truncate(50, omission: '...') %></span>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<h2>热门课程</h2>
|
||||
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
||||
<li class="current">
|
||||
<a class="" href="javascript:void(0);">今日</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="javascript:void(0);">本周</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="" href="javascript:void(0);">本月</a>
|
||||
</li>
|
||||
</ul> -->
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %>
|
||||
<li style="background-image:none;">
|
||||
<p class="layout">
|
||||
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<span class="d-p-project-intro"><%= project.description %></span>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<h2>热门课程</h2>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %>
|
||||
<li style="background-image:none;">
|
||||
<p class="layout">
|
||||
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<span class="d-p-project-intro"><%= project.description.truncate(50, omission: '...') %></span>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
|
@ -328,43 +227,4 @@
|
|||
|
||||
|
||||
|
||||
<!-- <div>
|
||||
<table width="700" border="0" align="center" style="padding-top: 0px">
|
||||
<tr>
|
||||
<td colspan="5" align="center" style="padding-bottom: 10px; font-size: 18px; font-color: #5c5c5c ; font-family: 微软雅黑"><%= l(:label_welcome_leave_message) %> <strong><%= toggle_link l(:label_welcome_click_me), 'put-bid-form', {:focus => 'new_form_project_message'} %></strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="5" align="center" ><div class="homepage_underline"></div></td></tr>
|
||||
<tr>
|
||||
<td colspan="5" align="center">
|
||||
<div id="put-bid-form" style="display: none">
|
||||
<%= form_for('new_form', :method => :post, :url => {:controller => 'words', :action => 'add_project_respond'}) do |f|%>
|
||||
<table border="0" width="525px" align="center" >
|
||||
<tr>
|
||||
<td>
|
||||
<%= f.text_area 'project_message',
|
||||
:rows => 3,
|
||||
:cols => 65,
|
||||
:value => "#{l(:label_welcome_my_respond)}",
|
||||
:onfocus => "clearInfo('new_form_project_message','#{l(:label_welcome_my_respond)}')",
|
||||
:onblur => "showInfo('new_form_project_message','#{l(:label_welcome_my_respond)}')",
|
||||
:style => "resize: none;",
|
||||
:class => 'noline'%>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" width="525px" align="center">
|
||||
<tr>
|
||||
<td align="right"> <%= submit_tag l(:button_submit), :name => nil , :class => "bid_btn" %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ module Redmine
|
|||
end
|
||||
|
||||
if provider_options.has_key?(:permission)
|
||||
user1 = User.find_by_login('user')
|
||||
user1 = User.find_by_admin(true)
|
||||
scope = scope.scoped(:conditions => Project.allowed_to_condition(user1, provider_options[:permission] || :view_project, options))
|
||||
elsif respond_to?(:visible)
|
||||
scope = scope.visible(user1, options)
|
||||
|
|
|
@ -203,7 +203,7 @@ Redmine::MenuManager.map :top_menu do |menu|
|
|||
menu.push :software_user, {:controller => 'users', :action => 'index'}
|
||||
menu.push :contest_innovate, {:controller => 'bids', :action => 'contest', :project_type => 1}
|
||||
menu.push :requirement_enterprise, {:controller => 'bids', :action => 'index'}
|
||||
menu.push :project_module_forums, {:controller => 'forums', :action => 'index'}
|
||||
menu.push :project_module_forums, :forums_path
|
||||
|
||||
|
||||
# menu.push :investor, :home_path
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
|
@ -155,7 +155,7 @@ li {
|
|||
color: #999999;
|
||||
background: center -1px no-repeat;
|
||||
line-height: 20px;
|
||||
padding: 0px 9px;
|
||||
padding: 5px 5px 0px 9px;
|
||||
width: 440px;
|
||||
cursor: pointer;
|
||||
font: 12px/1.5 tahoma,arial,\5b8b\4f53;
|
||||
|
@ -191,6 +191,19 @@ p.layout {
|
|||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.avatar-3 {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.message-brief-intro .gray{
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.avatar-4 {
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
}
|
||||
/*p.clr, .clr { clear:both; padding:0; margin:0; background:none;}*/
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue