Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
9e0ae72ab7
2
Gemfile
2
Gemfile
|
@ -32,7 +32,7 @@ group :assets do
|
||||||
gem 'coffee-rails', '~> 3.2.1'
|
gem 'coffee-rails', '~> 3.2.1'
|
||||||
|
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
# gem 'therubyracer', :platforms => :ruby
|
gem 'therubyracer', :platforms => :ruby
|
||||||
|
|
||||||
gem 'uglifier', '>= 1.0.3'
|
gem 'uglifier', '>= 1.0.3'
|
||||||
end
|
end
|
||||||
|
|
|
@ -158,10 +158,11 @@ module WelcomeHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_miracle_project(sum, max_rate)
|
def find_miracle_project(sum, max_rate)
|
||||||
max = sum*(max_rate.to_f/10)
|
#max = sum*(max_rate.to_f/10)
|
||||||
c1 = find_new_project(sum).to_a.dup
|
#c1 = find_new_project(sum).to_a.dup
|
||||||
c2 = find_all_hot_project(sum).to_a.dup
|
#c2 = find_all_hot_project(sum).to_a.dup
|
||||||
(c2.take(sum-max)+c1.take(max)).take(sum)
|
#(c2.take(sum-max)+c1.take(max)).take(sum)
|
||||||
|
find_all_hot_project(sum).to_a.dup
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_new_course limit=15
|
def find_new_course limit=15
|
||||||
|
@ -332,7 +333,7 @@ module WelcomeHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
#取得所有活动
|
#取得所有活动
|
||||||
def find_all_activities limit=6
|
def find_all_activities limit=6
|
||||||
# users = []
|
# users = []
|
||||||
# activities = Activity.find_by_sql("select distinct user_id from activities order by id DESC limit #{limit}" )
|
# activities = Activity.find_by_sql("select distinct user_id from activities order by id DESC limit #{limit}" )
|
||||||
# activities.each { |activity|
|
# activities.each { |activity|
|
||||||
|
|
|
@ -147,7 +147,7 @@ end %>
|
||||||
|
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
<% if @issue.editable? %>
|
<% if @issue.editable? %>
|
||||||
<div id="update" style="display:none;">
|
<div id="update">
|
||||||
<h3><%= l(:button_update) %></h3>
|
<h3><%= l(:button_update) %></h3>
|
||||||
<%= render :partial => 'edit' %>
|
<%= render :partial => 'edit' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
<tr><td class="score">
|
<!-- <tr><td class="score">
|
||||||
<%= l(:label_user_grade)%>:
|
<%= l(:label_user_grade)%>:
|
||||||
<%= link_to(format("%.2f" , finall_user_score).to_f, {:controller => 'users',
|
<%= link_to(format("%.2f" , finall_user_score).to_f, {:controller => 'users',
|
||||||
:action => 'show_score',
|
:action => 'show_score',
|
||||||
|
@ -130,7 +130,7 @@
|
||||||
}, :style => 'color :#E8770D;') %>
|
}, :style => 'color :#E8770D;') %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- end -->
|
-->
|
||||||
|
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -88,10 +88,21 @@ module Redmine
|
||||||
def events_welcome(from = nil, to = nil, options={})
|
def events_welcome(from = nil, to = nil, options={})
|
||||||
e = []
|
e = []
|
||||||
@options[:limit] = options[:limit]
|
@options[:limit] = options[:limit]
|
||||||
|
|
||||||
@scope.each do |event_type|
|
@scope.each do |event_type|
|
||||||
constantized_providers(event_type).each do |provider|
|
constantized_providers(event_type).each do |provider|
|
||||||
e += provider.find_events1(event_type, @user, from, to, @options)
|
cur_objs = provider.find_events1(event_type, @user, from, to, @options)
|
||||||
|
cur_objs.each do |cur_obj|
|
||||||
|
if cur_obj.class == Issue
|
||||||
|
if cur_obj.project != nil && cur_obj.project.project_status != nil
|
||||||
|
e += [cur_obj]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
e += [cur_obj]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if e.count > options[:limit]
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue