diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index c42944947..38ae662fc 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -502,45 +502,7 @@ class CoursesController < ApplicationController end - def get_course_activity courses, activities - @course_ids=activities.keys() - days = Setting.activity_days_default.to_i - date_to ||= Date.today + 1 - date_from = date_to - days-1.years - - #file_count - Attachment.where(container_id: @course_ids, container_type: Course).where("created_on>?", date_from).each do |attachment| - activities[attachment.container_id]+=1 - end - - #message_count - Board.where(course_id: @course_ids).each do |board| -# activities[board.course_id]+=1 - activities[board.course_id]+=board.messages.where("updated_on>?", date_from).count - end - - #news - News.where(course_id: @course_ids).where("created_on>?",date_from).each do |news| - activities[news.course_id]+=1 - end - - #feedbackc_count - JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess| - activities[jourformess.jour_id]+=1 - end - - #activities!=0 - i=0; - courses.each do |course| - id=course.id - if activities[id]==0 - activities[id]=1 - end - end - - return activities - end def toggleCourse @course_prefs = Course.find_by_extra(@course.extra) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index f8b4578eb..031f78277 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -235,6 +235,7 @@ class FilesController < ApplicationController elsif @course @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)] end + show_attachments @containers @attachtype = params[:type].to_i @contenttype = params[:contentType].to_s diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ee42c2c6a..f3ab77603 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -42,7 +42,7 @@ class ProjectsController < ApplicationController before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar] before_filter :file, :statistics, :watcherlist - before_filter :find_project_repository, :only => [:show] + #before_filter :find_project_repository, :only => [:show] # 除非项目内人员,不可查看成员, TODO: 完了写报表里去 before_filter :memberAccess, only: :member @@ -106,7 +106,7 @@ class ProjectsController < ApplicationController def index #调用存储过程更新提交次数 - ActiveRecord::Base.connection.execute("CALL sp_project_status_cursor();") + #ActiveRecord::Base.connection.execute("CALL sp_project_status_cursor();") #Modified by nie @project_type = params[:project_type].to_i per_page_option = 10 diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb index de686493b..a317f82de 100644 --- a/app/controllers/trackers_controller.rb +++ b/app/controllers/trackers_controller.rb @@ -21,7 +21,7 @@ class TrackersController < ApplicationController before_filter :require_admin, :except => :index before_filter :require_admin_or_api_request, :only => :index accept_api_auth :index - + include CoursesHelper def index respond_to do |format| format.html { @@ -37,8 +37,13 @@ class TrackersController < ApplicationController def new @tracker ||= Tracker.new(params[:tracker]) @trackers = Tracker.sorted.all - @projects = Project.all + @projects = Project.where("project_type = #{Project::ProjectType_project}").all @courses = Course.all + @course_activity_count=Hash.new + @courses.each do |course| + @course_activity_count[course.id]=0 + end + @course_activity_count=get_course_activity @courses,@course_activity_count end def create @@ -58,7 +63,8 @@ class TrackersController < ApplicationController def edit @tracker ||= Tracker.find(params[:id]) - @projects = Project.all + @projects = Project.where("project_type = #{Project::ProjectType_project}").all + @courses = Course.all end def update diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 98b24bc12..d15036fa0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -46,6 +46,7 @@ class UsersController < ApplicationController #william before_filter :require_login, :only => [:tag_save,:tag_saveEx] + #before_filter :refresh_changests, :only =>[:user_activities,:user_courses,:user_projects,:user_newfeedback] helper :sort @@ -68,6 +69,17 @@ class UsersController < ApplicationController # fq helper :words + + def refresh_changests + if !(@user.nil?) && !(@user.memberships.nil?) + @user.memberships.each do |member| + unless member.project.nil? + member.project.repository.fetch_changesets if Setting.autofetch_changesets? + end + end + end + end + #added by young def user_projects diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index d075f67ae..a005b299b 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -480,4 +480,45 @@ module CoursesHelper type end + #获取课程动态 + def get_course_activity courses, activities + @course_ids=activities.keys() + + days = Setting.activity_days_default.to_i + date_to ||= Date.today + 1 + date_from = date_to - days-1.years + + #file_count + Attachment.where(container_id: @course_ids, container_type: Course).where("created_on>?", date_from).each do |attachment| + activities[attachment.container_id]+=1 + end + + #message_count + Board.where(course_id: @course_ids).each do |board| +# activities[board.course_id]+=1 + activities[board.course_id]+=board.messages.where("updated_on>?", date_from).count + end + + #news + News.where(course_id: @course_ids).where("created_on>?",date_from).each do |news| + activities[news.course_id]+=1 + end + + #feedbackc_count + JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess| + activities[jourformess.jour_id]+=1 + end + + #activities!=0 + i=0; + courses.each do |course| + id=course.id + if activities[id]==0 + activities[id]=1 + end + end + + return activities + end + end diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index bdb070cc2..104cd16cb 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -71,11 +71,24 @@ module ProjectScoreHelper pss = ProjectScore.where("project_id = '#{project.id}'") if pss.nil? || pss.count == 0 ps = ProjectScore.new + ps.issue_num = issue_num(project) + ps.board_message_num = board_message_num(project) + ps.changeset_num = changesets_num(project) + ps.documents_num = documents_num(project) + ps.issue_journal_num = issue_journal_num(project) + ps.news_num = news_num(project) + ps.score = result ps.project = project ps.save else ps = pss.first + ps.issue_num = issue_num(project) + ps.board_message_num = board_message_num(project) + ps.changeset_num = changesets_num(project) + ps.documents_num = documents_num(project) + ps.issue_journal_num = issue_journal_num(project) + ps.news_num = news_num(project) ps.score = result ps.save end @@ -95,4 +108,15 @@ module ProjectScoreHelper end end + def get_project_score project + pss = ProjectScore.where("project_id = '#{project.id}'") + ps = nil + if pss.nil? || pss.count == 0 + ps = nil + else + ps = pss.first + end + ps + end + end \ No newline at end of file diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 123de1bf3..b9ce4acf5 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -63,7 +63,7 @@ class Changeset < ActiveRecord::Base includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args)) } - after_create :scan_for_issues,:be_user_score # user_score + after_create :scan_for_issues,:refresh_changests#:be_user_score # user_score after_update :be_user_score after_destroy :down_user_score before_create :before_create_cs @@ -305,9 +305,9 @@ class Changeset < ActiveRecord::Base # update user score def be_user_score UserScore.project(:push_code, self.user,self, { changeset_id: self.id }) - #更新用户等级 - UserLevels.update_user_level(self.user) unless self.user.nil? + #更新用户等级 + UserLevels.update_user_level(self.user) update_changeset(self.user,1) update_changeset(self.user,2,self.repository.project) end @@ -321,4 +321,11 @@ class Changeset < ActiveRecord::Base update_changeset(self.user,2,self.repository.project) end + #刷新本次提交(补全相关信息如:user_id等) + def refresh_changests + unless self.repository.nil? + self.repository.fetch_changesets if Setting.autofetch_changesets? + end + end + end diff --git a/app/models/option_number.rb b/app/models/option_number.rb index 8ba32a575..0ddea1bff 100644 --- a/app/models/option_number.rb +++ b/app/models/option_number.rb @@ -1,4 +1,14 @@ class OptionNumber < ActiveRecord::Base attr_accessible :attachment, :changeset, :document, :follow, :issue_done_ratio, :issues_status, :memo, :messages_for_issues, :post_issue, :praise_by_one, :praise_by_three, :praise_by_two, :replay_for_memo, :replay_for_message, :score_type, :total_score, :tread, :tread_by_one, :tread_by_three, :tread_by_two, :user_id + def self.get_user_option_number user_id + result = nil + unless user_id.nil? + ons = OptionNumber.find_all_by_user_id(user_id); + unless (ons .nil? && ons.count > 0) + result = ons.first + end + end + result + end end diff --git a/app/models/tracker.rb b/app/models/tracker.rb index d487de67e..6a0069975 100644 --- a/app/models/tracker.rb +++ b/app/models/tracker.rb @@ -32,6 +32,7 @@ class Tracker < ActiveRecord::Base end has_and_belongs_to_many :projects + has_and_belongs_to_many :courses has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id' acts_as_list diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index ca33b7516..35e066d45 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -37,7 +37,7 @@
- 共有 <%=link_to @topics.count %> 个贴子 + 共有 <%=link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子 <%= link_to l(:label_message_new), new_board_message_path(@board), diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index ef1afd27e..8cd46c35b 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -43,7 +43,7 @@
- 共有 <%= link_to @topics.count %> 个贴子 + 共有 <%= link_to @topic_count,:controller => 'boards',:action => 'index' %> 个贴子 <% if @project.enabled_modules.where("name = 'boards'").count > 0 %> <%= link_to l(:label_message_new), diff --git a/app/views/files/_course_sort_by_attachtypel.html.erb b/app/views/files/_course_sort_by_attachtypel.html.erb index f0f6c8270..c13d76620 100644 --- a/app/views/files/_course_sort_by_attachtypel.html.erb +++ b/app/views/files/_course_sort_by_attachtypel.html.erb @@ -37,7 +37,7 @@ <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.typeName %> + <%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %>   <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb index d3723c340..eb7ffffec 100644 --- a/app/views/files/_sort_by_attachtypel.html.erb +++ b/app/views/files/_sort_by_attachtypel.html.erb @@ -37,7 +37,7 @@ <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.typeName %> + <%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %>   <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index e116a800f..de10036de 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -92,33 +92,6 @@ <% end %> - - <%# messages_count = @user.messages.count %> - <%# messages_score = messages_count * 0.05%> - <%# finall_messages_score = messages_score %> - - <%# journals_count = @user.journals.count %> - <%# journals_score = journals_count * 0.1 %> - <%# user_changesets_count = @user.changesets.count %> - <%# user_changesets_score = user_changesets_count * 0.3 %> - <%# finall_user_project_score = journals_score + user_changesets_score %> - - <%# journals_for_messages_count = @user.journals_messages.count %> - <%# activities_count = @user.activities.count %> - <%# journals_for_messages_score = journals_for_messages_count * 0.05 %> - <%# activities_score = activities_count * 0.2 %> - <%# finall_activity_score = journals_for_messages_score + activities_score %> - - <%# news_count = @user.news.count %> - <%# news_score = news_count * 0.1 %> - <%# wiki_contents_count = @user.wiki_contents.count %> - <%# wiki_contents_score = wiki_contents_count * 0.1 %> - <%# comments_count = @user.comments.count %> - <%# comments_score = comments_count * 0.1 %> - <%# finall_influence_score = news_score + wiki_contents_score + comments_score %> - <%# finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %> - -
<%= render :partial => 'users/user_score', :locals => {:user => @user}%> diff --git a/app/views/praise_tread/_praise_tread.html.erb b/app/views/praise_tread/_praise_tread.html.erb index e0ad6fd9b..696b204f9 100644 --- a/app/views/praise_tread/_praise_tread.html.erb +++ b/app/views/praise_tread/_praise_tread.html.erb @@ -38,15 +38,28 @@ <% else %> - - - - - - -
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), - :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %> <%= get_praise_num(obj)%> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread", - :action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %>
+ + <% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %> + + + + + + +
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), + :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %><%= get_praise_num(obj)%><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %>
+ <% else %> + + + + + + +
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), + :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %> <%= get_praise_num(obj)%> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread", + :action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %>
+ <% end %> + <% end %> @@ -105,19 +118,36 @@ <% else %> - - - - - - - - - - -
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), - :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %>
<%= get_praise_num(obj)%>
<%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread", - :action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %>
+ <% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %> + + + + + + + + + + + +
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), + :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %>
<%= get_praise_num(obj)%>
<%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %>
+ <% else %> + + + + + + + + + + +
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)), + :controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %>
<%= get_praise_num(obj)%>
<%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread", + :action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %>
+ <% end %> + <% end %> diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 92e20f9e4..004fb38ac 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -46,7 +46,7 @@ - <%= content_tag('span', "#{changesets_num(@project)}", :class => "info") %> + <%= content_tag('span', "#{get_project_score(@project).nil? ? 0:get_project_score(@project).changeset_num}", :class => "info") %> <%= content_tag('span', l(:label_commit_on)) %> @@ -87,7 +87,7 @@ <% end %>
-
+
<% if(@project.project_type==1)%> diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 2e9b3d217..b20b383ef 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -52,7 +52,7 @@ <%= l(:label_tag) %>: <% if User.current.logged? %> - <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'name'} %> + <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form', {:focus => 'tags_name'} %> <% end %>
@@ -62,7 +62,7 @@ <%= form_for "tag_for_save",:remote=>true,:url=>tag_path, :update => "tags_show", :complete => '$("#put-tag-form").hide();' do |f| %> - <%= f.text_field :name ,:id => "name",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length %> + <%= f.text_field :name ,:id => "tags_name",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length %> <%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%> <%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%> <%= f.submit l(:button_project_tags_add),:class => "small" %> diff --git a/app/views/tags/_tag_name.html.erb b/app/views/tags/_tag_name.html.erb index 38b8ac85c..01889f1f3 100644 --- a/app/views/tags/_tag_name.html.erb +++ b/app/views/tags/_tag_name.html.erb @@ -22,7 +22,7 @@ <% i += 1 %> <% end %> - <%= link_to l(:label_more_tags), :action => "show", :id => obj.id %> + <%= link_to l(:label_more_tags),:controller => "tags", :action => "show", :id => obj.id %> <% else %> diff --git a/app/views/trackers/_form.html.erb b/app/views/trackers/_form.html.erb index 9039bba68..5acd0da1b 100644 --- a/app/views/trackers/_form.html.erb +++ b/app/views/trackers/_form.html.erb @@ -1,6 +1,6 @@ <%= error_messages_for 'tracker' %> -
+

<%= f.text_field :name, :required => true %>

@@ -39,14 +39,27 @@ <%= submit_tag l(@tracker.new_record? ? :button_create : :button_save) %>
-
+
<% if @projects.any? %>
<%= l(:label_project_plural) %> +
<%= render_project_nested_lists(@projects) do |p| content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.include?(p), :id => nil) + ' ' + h(p)) end %> +
<%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %> +

<%= check_all_links 'tracker_project_ids' %>

+
<% end %> +
diff --git a/app/views/users/_score_new_index.html.erb b/app/views/users/_score_new_index.html.erb index 539c55f80..b79a57e71 100644 --- a/app/views/users/_score_new_index.html.erb +++ b/app/views/users/_score_new_index.html.erb @@ -6,5 +6,9 @@
= <%= format("%.2f" ,collaboration(option_num)).to_i %> + <%= format("%.2f" , influence(option_num) ).to_i %> + <%= "(" if skill(option_num) < 0 %> <%= format("%.2f" , skill(option_num)).to_i %> <%= ")" if skill(option_num) < 0 %> + <%= format("%.2f" , active(option_num)).to_i %>
-
= <%= format("%.2f" ,option_num.total_score).to_i %>
+ <% if (format("%.2f" ,collaboration(option_num)).to_i + format("%.2f" , influence(option_num) ).to_i + format("%.2f" , skill(option_num)).to_i + format("%.2f" , active(option_num)).to_i) < 0 %> +
<%= l(:lable_score_less_than_zero) %>
+ <% else %> +
= <%= format("%.2f" ,option_num.total_score).to_i %>
+ <% end %> diff --git a/app/views/users/_user_show.html.erb b/app/views/users/_user_show.html.erb index 3afdb8d96..d0c9e204b 100644 --- a/app/views/users/_user_show.html.erb +++ b/app/views/users/_user_show.html.erb @@ -1,32 +1,6 @@
<% for user in @users -%> - - <% messages_count = user.messages.count %> - <% messages_score = messages_count * 0.05%> - <% finall_messages_score = messages_score %> - - <% journals_count = user.journals.count %> - <% journals_score = journals_count * 0.1 %> - <% user_changesets_count = user.changesets.count %> - <% user_changesets_score = user_changesets_count * 0.3 %> - <% finall_user_project_score = journals_score + user_changesets_score %> - - <% journals_for_messages_count = user.journals_messages.count %> - <% activities_count = user.activities.count %> - <% journals_for_messages_score = journals_for_messages_count * 0.05 %> - <% activities_score = activities_count * 0.2 %> - <% finall_activity_score = journals_for_messages_score + activities_score %> - - <% news_count = user.news.count %> - <% news_score = news_count * 0.1 %> - <% wiki_contents_count = user.wiki_contents.count %> - <% wiki_contents_score = wiki_contents_count * 0.1 %> - <% comments_count = user.comments.count %> - <% comments_score = comments_count * 0.1 %> - <% finall_influence_score = news_score + wiki_contents_score + comments_score %> - <% finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %> -
<%= content_tag "p", "#{format_date(user.created_on)} #{l(:label_member_since)}", :class => "float_right member_since" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 602e7a659..ddae72799 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1807,3 +1807,5 @@ en: label_company_name: Company Name notice_account_invalid_creditentials_new: You have not to the mailbox activation + lable_unknow_type: Unknow type + lable_score_less_than_zero: Score less than 0, revised to 0 \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 674b88dbe..2fb7ef2bf 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1589,6 +1589,7 @@ zh: label_issue_tread_over: 我刚才踩过了~ label_issue_not_praise_over: 不能顶自己~ label_issue_not_treed_over: 不能踩自己~ + label_issues_score_not_enough: 积分不够,不能踩别人~ #end label_goto: 前往>> label_issue_appraise_over: 只能评价一次哦! @@ -2113,4 +2114,6 @@ zh: lable_memos_max_length: 帖子内容最大长度为65535个字符 lable_forums_max_length: 贴吧描述最大长度为65535个字符 + lable_unknow_type: 未知类型 + lable_score_less_than_zero: 得分小于0,修正为0 \ No newline at end of file diff --git a/db/migrate/20140826072838_project_score_add_cloumn.rb b/db/migrate/20140826072838_project_score_add_cloumn.rb new file mode 100644 index 000000000..1792273c1 --- /dev/null +++ b/db/migrate/20140826072838_project_score_add_cloumn.rb @@ -0,0 +1,19 @@ +class ProjectScoreAddCloumn < ActiveRecord::Migration + def up + add_column("project_scores","issue_num",:integer,:default => 0) + add_column("project_scores","issue_journal_num",:integer,:default => 0) + add_column("project_scores","news_num",:integer,:default => 0) + add_column("project_scores","documents_num",:integer,:default => 0) + add_column("project_scores","changeset_num",:integer,:default => 0) + add_column("project_scores","board_message_num",:integer,:default => 0) + end + + def down + remove_column("project_scores","issue_num") + remove_column("project_scores","issue_journal_num") + remove_column("project_scores","news_num") + remove_column("project_scores","documents_num") + remove_column("project_scores","changeset_num") + remove_column("project_scores","board_message_num") + end +end diff --git a/db/schema.rb b/db/schema.rb index e39644b3b..82a6ad97b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140814062455) do +ActiveRecord::Schema.define(:version => 20140826072838) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -741,8 +741,14 @@ ActiveRecord::Schema.define(:version => 20140814062455) do create_table "project_scores", :force => true do |t| t.string "project_id" t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 end create_table "project_statuses", :force => true do |t| diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 9d1a6bc93..5f4a3166e 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1634,7 +1634,7 @@ fieldset#filters td.field { width:230px; } fieldset#filters td.operator { width:180px; } fieldset#filters td.operator select {max-width:170px;} fieldset#filters td.values { white-space:nowrap; } -fieldset#filters td.values select {min-width:130px;} +fieldset#filters td.values select {min-width:130px;max-width: 220px;} fieldset#filters td.values input {height:1em;} fieldset#filters td.add-filter { text-align: right; vertical-align: top; } @@ -1725,8 +1725,8 @@ ul.projects li {list-style-type:none; #projects-index ul.projects div.root a.project {font-family:'微软雅黑', "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 14px; margin: 0 0 10px 0; } .my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; } -#notified-projects ul, #tracker_project_ids ul {max-height:250px; overflow-y:auto;} - +#notified-projects ul{max-height:250px; overflow-y:auto;} +#tracker_project_ids ul {max-height:250px; /*overflow-y:auto;*/} #related-issues li img {vertical-align:middle;} ul.properties {padding:0; font-size: 0.9em; color: #777;} diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 9baa5526c..098e02be2 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -1071,14 +1071,14 @@ overflow: hidden; .information { margin-top: 20px; margin-left: 690px; - float: left; + /*float: left;*/ height: auto; width: 280px; font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/ color: rgb(0, 0, 0); font-size: 13px; line-height: 18px; - position: absolute; + /*position: absolute;*/ } /* a.project { @@ -1216,6 +1216,15 @@ p.stats { padding-top: 10px; } +.add-info-project { + /*float: left;*/ + margin-top: 0px; + height: 20px; + width: 908px; + margin-bottom: 5px; + padding-top: 10px; +} + .main-language { float: left; height: 18px;