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'
# 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

View File

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

View File

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

View File

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

View File

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