This commit is contained in:
nwb 2014-06-24 09:55:48 +08:00
commit 9e0ae72ab7
5 changed files with 23 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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