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'
|
||||
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
# gem 'therubyracer', :platforms => :ruby
|
||||
gem 'therubyracer', :platforms => :ruby
|
||||
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
end
|
||||
|
|
|
@ -158,10 +158,11 @@ module WelcomeHelper
|
|||
end
|
||||
|
||||
def find_miracle_project(sum, max_rate)
|
||||
max = sum*(max_rate.to_f/10)
|
||||
c1 = find_new_project(sum).to_a.dup
|
||||
c2 = find_all_hot_project(sum).to_a.dup
|
||||
(c2.take(sum-max)+c1.take(max)).take(sum)
|
||||
#max = sum*(max_rate.to_f/10)
|
||||
#c1 = find_new_project(sum).to_a.dup
|
||||
#c2 = find_all_hot_project(sum).to_a.dup
|
||||
#(c2.take(sum-max)+c1.take(max)).take(sum)
|
||||
find_all_hot_project(sum).to_a.dup
|
||||
end
|
||||
|
||||
def find_new_course limit=15
|
||||
|
@ -332,7 +333,7 @@ module WelcomeHelper
|
|||
end
|
||||
|
||||
#取得所有活动
|
||||
def find_all_activities limit=6
|
||||
def find_all_activities limit=6
|
||||
# users = []
|
||||
# activities = Activity.find_by_sql("select distinct user_id from activities order by id DESC limit #{limit}" )
|
||||
# activities.each { |activity|
|
||||
|
|
|
@ -147,7 +147,7 @@ end %>
|
|||
|
||||
<div style="clear: both;"></div>
|
||||
<% if @issue.editable? %>
|
||||
<div id="update" style="display:none;">
|
||||
<div id="update">
|
||||
<h3><%= l(:button_update) %></h3>
|
||||
<%= render :partial => 'edit' %>
|
||||
</div>
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
<!-- end -->
|
||||
<tr><td class="score">
|
||||
<!-- <tr><td class="score">
|
||||
<%= l(:label_user_grade)%>:
|
||||
<%= link_to(format("%.2f" , finall_user_score).to_f, {:controller => 'users',
|
||||
:action => 'show_score',
|
||||
|
@ -130,7 +130,7 @@
|
|||
}, :style => 'color :#E8770D;') %>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end -->
|
||||
-->
|
||||
|
||||
</table></td>
|
||||
</tr>
|
||||
|
|
|
@ -88,10 +88,21 @@ module Redmine
|
|||
def events_welcome(from = nil, to = nil, options={})
|
||||
e = []
|
||||
@options[:limit] = options[:limit]
|
||||
|
||||
@scope.each do |event_type|
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue