From b8f27b51c0e1f413e1c102f2e7c8e2c68fb2c161 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 1 Aug 2014 11:37:14 +0800 Subject: [PATCH 01/45] =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/course.html.erb | 10 ++-- db/schema.rb | 97 +++++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 21 deletions(-) diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 3aca2c350..ae90ba3d7 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -169,13 +169,15 @@ (<%= link_to "#{files_count}份", course_files_path(course) %>资料) -
((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "\n\n
" << @content + #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> " + #@content << @memo.content.to_s.strip.gsub(%r{\n\n((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" + #@content_html = textilizable(@content) + @temp = Memo.new + @temp.content = @content end def new @@ -34,12 +40,13 @@ class MemosController < ApplicationController end def create + @quote = params[:quote][:quote] @memo = Memo.new(params[:memo]) @memo.forum_id = params[:forum_id] @memo.author_id = User.current.id @memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads])) - + @memo.content = @quote + @memo.content respond_to do |format| if @memo.save format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" } diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index b364440c9..451e04d3d 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class MessagesController < ApplicationController + include ApplicationHelper menu_item :boards default_search_scope :messages before_filter :find_board, :only => [:new, :preview,:edit] @@ -80,10 +81,12 @@ class MessagesController < ApplicationController if params[:reply][:content] == "" (redirect_to board_message_path(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return) end + @quote = params[:quote][:quote] @reply = Message.new @reply.author = User.current @reply.board = @board @reply.safe_attributes = params[:reply] + @reply.content = @quote + @reply.content @topic.children << @reply #@topic.update_attribute(:updated_on, Time.now) if !@reply.new_record? @@ -143,8 +146,18 @@ class MessagesController < ApplicationController @subject = @message.subject @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') - @content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " - @content << @message.content.to_s.strip.gsub(%r{((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" + #@content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " + #@temp = Message.new + ##@temp.content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}> " + #@content << @message.content.to_s.strip.gsub(%r{((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" + #@content_html = textilizable(@content) + #@temp.content = @content_html + @content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}
" + @content << @message.content.to_s.strip.gsub(%r{((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "
" << @content + @temp = Message.new + @temp.content = @content + end def preview diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7220f3ccb..cba7784bc 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -41,7 +41,7 @@ class UsersController < ApplicationController :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_new_score_index, :influence_new_score_index, :score_new_index] before_filter :auth_user_extension, only: :show - #before_filter :rest_user_score, only: :show + before_filter :rest_user_score, only: :show accept_api_auth :index, :show, :create, :update, :destroy,:tag_save , :tag_saveEx #william @@ -794,7 +794,9 @@ class UsersController < ApplicationController praise_num(@user) changeset_num(@user) document_num(@user) - + attachment_num(@user) + issue_done_ratio_num(@user) + post_issue_num(@user) end #验证是否显示课程 diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb index ba055ddf4..de7b2d6ec 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -600,7 +600,7 @@ module UserScoreHelper end def praise_num(user,project=nil) - if project.nil? + if !project.nil? pts = PraiseTread.where("praise_tread_object_type = 'Issue' || praise_tread_object_type = 'Message' and praise_or_tread = 1").all result = [] result1 = [] @@ -674,7 +674,7 @@ module UserScoreHelper update_score(option_number) end - def document_num(user,project=nil?) + def document_num(user,project=nil) if project.nil? Document.includes(:user).where("user_id = '#{user.id}'").all.count else @@ -689,14 +689,13 @@ module UserScoreHelper option_number.attachment = Attachment.includes(:author).where("author_id = '#{user.id}'").all.count update_score(option_number) end - #===================here to continue============================ + def attachment_num(user,project=nil) if project.nil? - Attachment.includes(:author).where("author_id = '#{user.id}'").all.count + Attachment.includes(:author,:container).where("author_id = '#{user.id}' and container_type = 'Project'").all.count else Attachment.includes(:author,:container).where("author_id = '#{user.id}' and container_type = 'Project' and container_id = #{project.id}").all.count end - end #更新缺陷完成度次数 @@ -706,8 +705,13 @@ module UserScoreHelper update_score(option_number) end - def issue_done_ratio_num(user,project) - Journal.joins(:details, :user).where("#{JournalDetail.table_name}.prop_key = 'done_ratio' and #{User.table_name}.id = '#{user.id}'").count + def issue_done_ratio_num(user,project=nil) + if project.nil? + Journal.joins(:details, :user).where("#{JournalDetail.table_name}.prop_key = 'done_ratio' and #{User.table_name}.id = '#{user.id}'").count + else + Journal.joins(:issue,:details,:user).where("#{Issue.table_name}.project_id = '#{project.id}' and #{JournalDetail.table_name}.prop_key = 'done_ratio' and #{User.table_name}.id = '#{user.id}'").count + end + end #更新发布缺陷次数 @@ -718,6 +722,11 @@ module UserScoreHelper end def post_issue_num(user,project=nil) - Issue.includes(:author).where("author_id = '#{user.id}'").all.count + if project.nil? + Issue.includes(:author).where("author_id = '#{user.id}'").all.count + else + Issue.includes(:author).where("author_id = '#{user.id}' and project_id = '#{project.id}'").all.count + end + end end diff --git a/app/views/memos/_reply_box.html.erb b/app/views/memos/_reply_box.html.erb index e0c6acf13..18cfa032d 100644 --- a/app/views/memos/_reply_box.html.erb +++ b/app/views/memos/_reply_box.html.erb @@ -2,6 +2,9 @@ <%= f.hidden_field :subject, :required => true, value: @memo.subject %> <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> + + + <%= text_area :quote,:quote,:style => 'display:none' %> <%= label_tag(l(:label_reply_plural)) %>: <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %> diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb index 73e36ee82..a72b7ac9e 100644 --- a/app/views/memos/quote.js.erb +++ b/app/views/memos/quote.js.erb @@ -1,2 +1,4 @@ -ckeditor.setData("<%= raw escape_javascript(@content) %>"); +//ckeditor.setData("<%= raw escape_javascript(@content) %>"); +$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>"); +$('#quote_quote').html("<%= raw escape_javascript(@content) %>"); showAndScrollTo("new_memo", "cke_editor01"); \ No newline at end of file diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index c7c557f9a..4208d3061 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -32,7 +32,9 @@ <%= f.select :board_id, boards_options_for_select(@message.course.boards) %> <% end %> <% end %> + + <%= text_area :quote,:quote,:style => 'display:none' %><%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %> <%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content' %>
diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb index fe4bed91a..f8ec37d75 100644 --- a/app/views/messages/quote.js.erb +++ b/app/views/messages/quote.js.erb @@ -1,4 +1,7 @@ $('#message_subject').val("<%= raw escape_javascript(@subject) %>"); -$('#message_content').val("<%= raw escape_javascript(@content) %>"); +$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>"); +//$('#message_content').val("<#%= raw escape_javascript(@content) %>"); +$('#quote_quote').html("<%= raw escape_javascript(@content) %>"); + showAndScrollTo("reply", "message_content"); $('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight; From 2505cb30c49bab53bb1eadce116c9955aa3ddef2 Mon Sep 17 00:00:00 2001 From: z9hangDate: Fri, 1 Aug 2014 14:31:51 +0800 Subject: [PATCH 04/45] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=B8=8D=E6=8D=A2=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/themes/redpenny-master/stylesheets/application.css | 1 + 1 file changed, 1 insertion(+) diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 3a6c53223..7f9aca109 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -489,6 +489,7 @@ color: #000000; margin-bottom: 30px; border-right:1px solid #C6E9F1; overflow:auto; + word-wrap:break-word; /*by young*/ -moz-box-shadow:#C6E9F1 1px 1px 2px; -webkit-box-shadow:2px 2px 0px -2px #C6E9F1; From 9e5f7e6fc625f0678805968906242c8ddaba0ede Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 1 Aug 2014 14:36:41 +0800 Subject: [PATCH 05/45] =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/softapplications_controller.rb | 4 ++-- app/models/softapplication.rb | 2 +- db/schema.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index f2b0a0c83..067465b40 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -156,8 +156,8 @@ class SoftapplicationsController < ApplicationController format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]), notice: l(:notice_attendingcontest_work_successfully_created) } # format.json { render json: @softapplication, status: :created, location: @softapplication } else - format.js { render status: 406 } - format.html { render action: "new" } + #format.js { render status: 406 } + format.html { render action: "contests/show_attendingcontest" } # format.json { render json: @softapplication.errors, status: :unprocessable_entity } end end diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb index a572a22ba..0234bc118 100644 --- a/app/models/softapplication.rb +++ b/app/models/softapplication.rb @@ -11,7 +11,7 @@ class Softapplication < ActiveRecord::Base belongs_to :project has_many :contests, :through => :contesting_softapplications - validates_length_of :name, :maximum => 125 + validates_length_of :name, :maximum => 25 validates_length_of :application_developers, :maximum => 125 validates_length_of :android_min_version_available, :maximum => 125 diff --git a/db/schema.rb b/db/schema.rb index 7643adb4b..9407794f4 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 => 20140730024419) do +ActiveRecord::Schema.define(:version => 20140801034242) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From aa0caff0778e0b208996312c8b3b0672dec0dcdd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 1 Aug 2014 14:37:44 +0800 Subject: [PATCH 06/45] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=BB=8D=E4=B8=BA=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=E7=9A=84=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20140801034242_change_boards_name.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 db/migrate/20140801034242_change_boards_name.rb diff --git a/db/migrate/20140801034242_change_boards_name.rb b/db/migrate/20140801034242_change_boards_name.rb new file mode 100644 index 000000000..3f4593710 --- /dev/null +++ b/db/migrate/20140801034242_change_boards_name.rb @@ -0,0 +1,20 @@ +# -*coding:utf-8 -*- +class ChangeBoardsName < ActiveRecord::Migration + def up + boards = Board.where("project_id <> -1 and name like '%课程讨论区%'") + boards.each do |board| + board.name = "项目讨论区" + board.description = "项目讨论区" + board.save(:validate => false) + end + end + + def down + boards = Board.where("project_id <> -1 and name like '%项目讨论区%'") + boards.each do |board| + board.name = " 课程讨论区" + board.description = " 课程讨论区" + board.save(:validate => false) + end + end +end From 087105ad9e009ece275d897f8ce52fbdf22b3385 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 1 Aug 2014 14:55:25 +0800 Subject: [PATCH 07/45] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E9=95=BF=E4=B8=B2?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E4=B8=8D=E6=8D=A2=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/themes/redpenny-master/stylesheets/application.css | 1 + 1 file changed, 1 insertion(+) diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 7f9aca109..0f8113054 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -904,6 +904,7 @@ hr p { font-size: 13px; + word-break: break-all; /*position: static;/*gcm*/ } /*end*/ From 54a246b6e6f73c6b974ed3c2e5fea0dfb50a6d89 Mon Sep 17 00:00:00 2001 From: linhk <304431313@qq.com> Date: Fri, 1 Aug 2014 15:46:05 +0800 Subject: [PATCH 08/45] =?UTF-8?q?=E4=B8=AD=E5=9B=BD=E9=AB=98=E6=A0=A1?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=96=87=E6=9C=ACEnter=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/school/index.html.erb | 8 ++- db/schema.rb | 97 +++++++++++++++++++++++++++------ 2 files changed, 87 insertions(+), 18 deletions(-) diff --git a/app/views/school/index.html.erb b/app/views/school/index.html.erb index 47ac3f968..6c1eafd6d 100644 --- a/app/views/school/index.html.erb +++ b/app/views/school/index.html.erb @@ -71,6 +71,12 @@ }) } + + function word_keydown(e){ + if(e&& e.keyCode==13){ + ssearch(); + } + } @@ -85,7 +91,7 @@请选择省份: -+ diff --git a/db/schema.rb b/db/schema.rb index 72e6ccba9..7643adb4b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -177,6 +177,58 @@ ActiveRecord::Schema.define(:version => 20140730024419) do add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + create_table "code_review_assignments", :force => true do |t| + t.integer "issue_id" + t.integer "change_id" + t.integer "attachment_id" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.string "action_type" + t.integer "changeset_id" + end + + create_table "code_review_project_settings", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "updated_by" + t.boolean "hide_code_review_tab", :default => false + t.integer "auto_relation", :default => 1 + t.integer "assignment_tracker_id" + t.text "auto_assign" + t.integer "lock_version", :default => 0, :null => false + t.boolean "tracker_in_review_dialog", :default => false + end + + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "code_reviews", :force => true do |t| + t.integer "project_id" + t.integer "change_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "line" + t.integer "updated_by_id" + t.integer "lock_version", :default => 0, :null => false + t.integer "status_changed_from" + t.integer "status_changed_to" + t.integer "issue_id" + t.string "action_type" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.integer "attachment_id" + t.integer "file_count", :default => 0, :null => false + t.boolean "diff_all" + end + create_table "comments", :force => true do |t| t.string "commented_type", :limit => 30, :default => "", :null => false t.integer "commented_id", :default => 0, :null => false @@ -367,9 +419,9 @@ ActiveRecord::Schema.define(:version => 20140730024419) do t.string "web_title" t.string "title" t.text "description" - t.string "page_type" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.string "page_type" t.integer "sort_type" t.integer "image_width", :default => 107 t.integer "image_height", :default => 63 @@ -795,18 +847,18 @@ ActiveRecord::Schema.define(:version => 20140730024419) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + t.integer "replies_count", :default => 0 t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 t.string "url" t.string "username" t.string "userhomeurl" @@ -830,6 +882,19 @@ ActiveRecord::Schema.define(:version => 20140730024419) do add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + create_table "rich_rich_files", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "rich_file_file_name" + t.string "rich_file_content_type" + t.integer "rich_file_file_size" + t.datetime "rich_file_updated_at" + t.string "owner_type" + t.integer "owner_id" + t.text "uri_cache" + t.string "simplified_type", :default => "file" + end + create_table "roles", :force => true do |t| t.string "name", :limit => 30, :default => "", :null => false t.integer "position", :default => 1 @@ -880,10 +945,11 @@ ActiveRecord::Schema.define(:version => 20140730024419) do t.string "url" t.string "title" t.integer "share_type" - 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 "project_id" t.integer "user_id" + t.string "description" end create_table "softapplications", :force => true do |t| @@ -989,8 +1055,8 @@ ActiveRecord::Schema.define(:version => 20140730024419) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "identity" t.string "technical_title" + t.integer "identity" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1048,9 +1114,6 @@ ActiveRecord::Schema.define(:version => 20140730024419) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "level" - t.integer "file" - t.integer "issue" end create_table "user_statuses", :force => true do |t| From 5a2d0ce649cdc0959db7360e050eda38b115f61b Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 1 Aug 2014 15:52:18 +0800 Subject: [PATCH 09/45] =?UTF-8?q?issue#1077=20=E6=96=B0=E5=BB=BA=E7=AB=9E?= =?UTF-8?q?=E8=B5=9B=E7=9A=84=E5=A5=96=E9=87=91=E6=8D=A2=E8=A1=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E9=95=BF=E5=BA=A6=E7=BA=A6=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/_form_contest.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/contests/_form_contest.html.erb b/app/views/contests/_form_contest.html.erb index 5dc824d28..79c531969 100644 --- a/app/views/contests/_form_contest.html.erb +++ b/app/views/contests/_form_contest.html.erb @@ -23,12 +23,12 @@ <%= l(:label_bids_form_contest_new_description) %>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Contest::NAME_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_name)}" %>
-<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_description)}" %>
+<%= f.text_area :description, :rows => 5, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_description)}" %>
<%= f.text_field :password, :size => 60, :style => "width:488px;margin-left: 10px;" %>
- <%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %> + <%= f.text_area :budget, :required => true, :size => 60,:rows => 4,:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :style => "width:490px;", :placeholder => l(:label_bids_reward_what) %>
From acb41158e79776f68e72580fa3eee852fc1a6bb5 Mon Sep 17 00:00:00 2001 From: z9hangDate: Fri, 1 Aug 2014 16:01:16 +0800 Subject: [PATCH 10/45] =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20=E7=99=BB=E9=99=86=E6=97=B6=E8=87=AA=E5=8A=A8=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=E7=99=BB=E9=99=86=E5=90=8D=E5=89=8D=E5=90=8E=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- app/models/user.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c4b72f584..f47ba446e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -525,7 +525,7 @@ class ApplicationController < ActionController::Base # # @return [boolean, string] name of the layout to use or false for no layout def use_layout - request.xhr? ? false : 'base' + request.xhr? ? false : 'users_base' end def invalid_authenticity_token diff --git a/app/models/user.rb b/app/models/user.rb index 195346e7c..b64d0efd7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -324,7 +324,7 @@ class User < Principal # Returns the user that matches provided login and password, or nil #登录,返回用户名与密码匹配的用户 def self.try_to_login(login, password) - login = login.to_s + login = login.to_s.lstrip.rstrip password = password.to_s # Make sure no one can sign in with an empty login or password From 63cfa9b35aacaad44ea8c5a7fe3b2f8656cd683d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 1 Aug 2014 16:14:00 +0800 Subject: [PATCH 11/45] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=89=93=E5=8C=85?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E7=9A=84ajax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework_list.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 2009d1252..fee568b90 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -8,7 +8,7 @@
<%= l(:label_task_plural)%>(<%= @homework_list.count%>) - <%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher && @bid.homeworks.count > 0) %> + <%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher && @bid.homeworks.count > 0) %> @@ -106,7 +106,7 @@提交文件: <% if is_evaluation || is_teacher%> - <%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework, :remote => true%> + <%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%> <% else %> 未开启互评功能作业不允许下载 <% end %> From ff02c4f9f2bf844b093ba52201b1988211296065 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 1 Aug 2014 17:43:06 +0800 Subject: [PATCH 12/45] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=80=81=E5=B8=88=E3=80=81=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E4=BA=BA=E6=95=B0=E4=B8=8E=E8=AF=BE=E7=A8=8B=E4=B8=AD=E8=80=81?= =?UTF-8?q?=E5=B8=88=E3=80=81=E5=AD=A6=E7=94=9F=E6=95=B0=E9=87=8F=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E4=B8=BB=E9=A1=B5=E8=AF=BE=E7=A8=8B=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E4=B8=AD=E6=98=BE=E7=A4=BA=E7=9A=84=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=BA=BA=E6=95=B0=E4=B8=8E=E8=AF=BE=E7=A8=8B=E6=80=BB=E4=BA=BA?= =?UTF-8?q?=E6=95=B0=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 25 +++++++++++++++++++------ app/views/welcome/course.html.erb | 6 +++--- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 84aff1c25..aad350d22 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -98,11 +98,11 @@ module CoursesHelper end - alias teacherCountOrigin teacherCount - def teacherCount project - count = teacherCountOrigin project - garble count - end + #alias teacherCountOrigin teacherCount + #def teacherCount project + # count = teacherCountOrigin project + # garble count + #end # 注意:此方法有问题,速度慢且结果不准 # alias studentCountOrigin studentCount @@ -114,7 +114,7 @@ module CoursesHelper # 学生人数计算 # add by nwb def studentCount course - count = course.student.count + count = searchStudent(course).count#course.student.count if count <= 5 result = count.to_s elsif count < 10 && count > 5 @@ -125,6 +125,19 @@ module CoursesHelper result end + #课程成员数计算 + def memberCount course + count = searchStudent(course).count + searchTeacherAndAssistant(course).count + if count <= 5 + result = count.to_s + elsif count < 10 && count > 5 + result = "5+" + else + result = (count-count % 10).to_s + "+" + end + result + end + def eventToLanguageCourse event_type, course case event_type when "issue-note" diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 3aca2c350..46a6d03a1 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -123,7 +123,7 @@ [<%= get_course_term course %>] <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> - (<%= "#{studentCount(course)}人" %>) + (<%= "#{memberCount(course)}人" %>) <% files_count = course.attachments.count.to_s %> (<%= link_to "#{files_count}份", course_files_path(course) %>资料)@@ -164,7 +164,7 @@[<%= get_course_term course %>] <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> - (<%= "#{studentCount(course)}人" %>) + (<%= "#{memberCount(course)}人" %>) <% files_count = course.attachments.count.to_s %> (<%= link_to "#{files_count}份", course_files_path(course) %>资料)@@ -209,7 +209,7 @@[<%= get_course_term course %>] <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> - (<%= "#{studentCount(course)}人" %> ) + (<%= "#{memberCount(course)}人" %> ) <% files_count = course.attachments.count.to_i.to_s %> (<%= link_to "#{files_count}份", course_files_path(course) %>资料)From 25cfb7aa717d0a475a39eea5ed44e6f336bdf9f0 Mon Sep 17 00:00:00 2001 From: linhk <304431313@qq.com> Date: Sat, 2 Aug 2014 14:43:05 +0800 Subject: [PATCH 13/45] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B0=B7=E6=AD=8C?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E6=96=B0=E5=BB=BA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E6=96=87=E6=9C=AC=E6=A1=86=E4=BC=9A=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=A1=AB=E5=86=99=E7=BC=93=E5=AD=98=E5=86=85=E5=AE=B9=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/_form_create.html.erb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/views/repositories/_form_create.html.erb b/app/views/repositories/_form_create.html.erb index 669f47071..d8c30143e 100644 --- a/app/views/repositories/_form_create.html.erb +++ b/app/views/repositories/_form_create.html.erb @@ -5,7 +5,12 @@ background-color:gray; border:none } - + <%= error_messages_for 'repository' %>@@ -22,7 +27,10 @@ border:none <% end %><%= f.check_box :is_default, :label => :field_repository_is_default %>
-<%= f.text_field :identifier, :required=>true, :disabled => @repository.identifier_frozen?, :label => l(:label_repository_name)%> + +
+ +<%= f.text_field :identifier,:required=>true,:type=>"hidden", :disabled => @repository.identifier_frozen?, :label => l(:label_repository_name)%> <% unless @repository.identifier_frozen? %> <%= l(:text_length_between, :min => 1, :max => Repository::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_repository_identifier_info).html_safe %> From 5a5ac28833a2ec72c6b9c8f5183e6677886d3714 Mon Sep 17 00:00:00 2001 From: zhanghaitao
Date: Sat, 2 Aug 2014 15:16:51 +0800 Subject: [PATCH 14/45] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/users.html.erb | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/app/views/admin/users.html.erb b/app/views/admin/users.html.erb index 41df178d8..834c9f6c2 100644 --- a/app/views/admin/users.html.erb +++ b/app/views/admin/users.html.erb @@ -26,9 +26,9 @@ -+
-
+ <%= sort_header_tag('login', :caption => l(:field_login)) %> <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %> <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %> @@ -40,16 +40,25 @@ ++ + + + + + + + <% for user in @users -%> "> - From 69f7f97bf88e391c9abc2a1557d937abfa99f6e8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 2 Aug 2014 17:05:56 +0800 Subject: [PATCH 15/45] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=BB=E9=A1=B5=E7=BC=BA=E9=99=B7=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E8=B6=85=E5=87=BA=E9=A1=B5=E9=9D=A2=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index c4e0ef98d..a12627792 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -278,12 +278,15 @@ <% end %><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %> -<%= h(user.firstname) %> -<%= h(user.lastname) %> -<%= mail_to(h(user.mail)) %> -<%= checked_image user.admin? %> -<%= format_time(user.created_on) %> -<%= format_time(user.last_login_on) unless user.last_login_on.nil? %> + + + + + + +<%= change_status_link(user) %> <%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> - From 80b2a2dc45c05a0bdd96cfc7fc91d3e0a65c516f Mon Sep 17 00:00:00 2001 From: z9hang- ++ + <%= textilizable act, :description %> Date: Mon, 4 Aug 2014 12:23:20 +0800 Subject: [PATCH 16/45] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E8=B4=B4=E5=90=A7=E6=96=B0=E5=BB=BA=E5=B8=96=E5=AD=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E4=BF=AE=E6=AD=A3=E8=AF=BE=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 7 ++++++- app/helpers/project_score_helper.rb | 8 ++++++++ app/views/courses/_course.html.erb | 2 +- db/schema.rb | 15 +-------------- 4 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 app/helpers/project_score_helper.rb diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 587b198d7..7f71c2085 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -40,7 +40,12 @@ class MemosController < ApplicationController end def create - @quote = params[:quote][:quote] + unless params[:quote].nil? + @quote = params[:quote][:quote] + else + @quote = "" + end + @memo = Memo.new(params[:memo]) @memo.forum_id = params[:forum_id] @memo.author_id = User.current.id diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb new file mode 100644 index 000000000..3df2e05b5 --- /dev/null +++ b/app/helpers/project_score_helper.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +class ProjectScoreHelper + #缺陷数量 + def issue_num project + + end + +end \ No newline at end of file diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index 8e1a7950d..ddf08c3fb 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -44,7 +44,7 @@ <%= content_tag('span', "#{garble @course.members.count}", :class => "info") %> <%#= content_tag('span', l(:label_x_member, :count => @course.members.count)) %> - <%= content_tag('span', l(:label_x_member, :count => studentCount(@course)+teacherCount(@course))) %> + <%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>
diff --git a/db/schema.rb b/db/schema.rb index 7643adb4b..a721633fd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -419,9 +419,9 @@ ActiveRecord::Schema.define(:version => 20140730024419) do t.string "web_title" t.string "title" t.text "description" + t.string "page_type" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "page_type" t.integer "sort_type" t.integer "image_width", :default => 107 t.integer "image_height", :default => 63 @@ -882,19 +882,6 @@ ActiveRecord::Schema.define(:version => 20140730024419) do add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - create_table "roles", :force => true do |t| t.string "name", :limit => 30, :default => "", :null => false t.integer "position", :default => 1 From 9cb026ed39289051c548d142c522394e568956dc Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 4 Aug 2014 15:01:39 +0800 Subject: [PATCH 17/45] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=84=E8=AE=BA=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notificationcomments_controller.rb | 13 +++++++++++-- app/models/notificationcomment.rb | 1 + app/views/contestnotifications/show.html.erb | 16 +++++++++++++++- config/routes.rb | 8 +++++++- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/app/controllers/notificationcomments_controller.rb b/app/controllers/notificationcomments_controller.rb index 80500ab10..43cad6cbb 100644 --- a/app/controllers/notificationcomments_controller.rb +++ b/app/controllers/notificationcomments_controller.rb @@ -1,4 +1,7 @@ class NotificationcommentsController < ApplicationController + def show + + end # default_search_scope :contestnotifications # model_object Contestnotifications # before_filter :authorize @@ -20,8 +23,14 @@ class NotificationcommentsController < ApplicationController end def destroy - @contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy - redirect_to contest_contestnotification_path(@contestnotifications) + @contest = Contest.find(params[:contest_id]) + @contestnotification = Contestnotification.find(params[:contestnotification_id]) + notificaioncomments = Notificationcomment.find(params[:id]) + notificaioncomments.destroy if notificaioncomments + #@contestnotifications = notificaioncomments.Contestnotification + #@contest = @contestnotifications.contest + #@contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy + redirect_to contest_contestnotification_path(@contest,@contestnotification) end end diff --git a/app/models/notificationcomment.rb b/app/models/notificationcomment.rb index 9cc658f22..ce4227a00 100644 --- a/app/models/notificationcomment.rb +++ b/app/models/notificationcomment.rb @@ -4,6 +4,7 @@ class Notificationcomment < ActiveRecord::Base include Redmine::SafeAttributes belongs_to :notificationcommented, :polymorphic => true#, :counter_cache => true belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' + belongs_to :Contestnotification validates_presence_of :notificationcommented, :author, :notificationcomments diff --git a/app/views/contestnotifications/show.html.erb b/app/views/contestnotifications/show.html.erb index eea4cc204..b6ac88008 100644 --- a/app/views/contestnotifications/show.html.erb +++ b/app/views/contestnotifications/show.html.erb @@ -69,7 +69,21 @@
- <%= link_to_user(notificationcomment.author) if notificationcomment.respond_to?(:author) %> <%= l(:label_project_newadd) %><%= l(:label_comment_plural) %> ++ + <%= link_to_user(notificationcomment.author) if notificationcomment.respond_to?(:author) %> + + + <%= l(:label_project_newadd) %> + + <%= l(:label_comment_plural) %> + ++ <% if notificationcomment.author==User.current|| User.current.admin? %> + <%= link_to(l(:label_bid_respond_delete), contest_contestnotification_notificationcomment_path(@contest, @contestnotification,notificationcomment), + :method => :delete,:confirm => l(:text_are_you_sure), :title => l(:button_delete)) %> + <% end %> + diff --git a/config/routes.rb b/config/routes.rb index af70b76da..1e75ac23a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -83,6 +83,10 @@ RedmineApp::Application.routes.draw do end end + #resources :notificationcomments do + # + #end + #resources :contestnotifications, :only => [:index, :show, :edit, :update, :destroy] # match '/contestnotifications/:id/notificationcomments', :to => 'notificationcomments#create', :via => :post # match '/contestnotifications/:id/notificationcomments/:notificationcomment_id', :to => 'notificationcomments#destroy', :via => :delete @@ -91,7 +95,9 @@ RedmineApp::Application.routes.draw do resources :contests, only: [:index] do resources :contestnotifications do # get 'preview', on: :collection - resources :notificationcomments + resources :notificationcomments do + + end end collection do From 8b3b1bdcfa2ab1de2e42667eb004b92890930489 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 4 Aug 2014 15:36:19 +0800 Subject: [PATCH 18/45] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E6=97=B6=E6=B3=A8=E6=84=8F?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/softapplications/_form.html.erb b/app/views/softapplications/_form.html.erb index 17cb20598..4e38981f8 100644 --- a/app/views/softapplications/_form.html.erb +++ b/app/views/softapplications/_form.html.erb @@ -113,7 +113,7 @@ <%= render :partial => 'attachments/form' %> 1、<%=l(:label_upload_softapplication_packets_mustpacketed)%>
-
2、<%=l(:label_upload_softapplication_photo_condition)%><%=l(:label_updated_caution)%>
+ From 94f6e871b1d5eeca7e10d611e90014bafb1162c1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 4 Aug 2014 15:49:23 +0800 Subject: [PATCH 19/45] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=97=B6=E4=BC=81=E4=B8=9A=E5=90=8D=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E8=8B=B1=E6=96=87=E4=B8=94=E6=8F=90=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84BUG=20#1130?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 2 +- config/locales/en.yml | 4 +++- config/locales/zh.yml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 3ed947cbf..6a937b376 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -82,7 +82,7 @@ diff --git a/config/locales/en.yml b/config/locales/en.yml index e1b93f649..9012dab4d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -229,7 +229,7 @@ en: field_description: Description field_summary: Summary field_is_required: Required - field_firstname: First name + field_firstname: Name field_lastname: Last name field_mail: Email field_job_category: Job category # added by bai @@ -1799,3 +1799,5 @@ en: # ajax异步验证 modal_valid_passing: can be used. + + label_company_name: Company Name diff --git a/config/locales/zh.yml b/config/locales/zh.yml index d6756474f..bc4809c91 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2016,6 +2016,7 @@ zh: label_contest_work_list: 参赛作品列表 label_attending_contest: 我要参赛 label_contest_notification: 竞赛通知 + label_company_name: 企业名 label_coursefile_sharingarea: 课程资源共享区 label_sort_by_activity: 按动态数排序 From 5f3ab0322b1d7975f6254eca2441e35ebb9aaf53 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 4 Aug 2014 16:04:36 +0800 Subject: [PATCH 20/45] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=E6=8F=90=E7=A4=BA=20#1127?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/en.yml | 2 +- config/locales/zh.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 9012dab4d..d8ebfb9f1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1707,7 +1707,7 @@ en: label_upload_softapplication_packets: Upload-apppacket label_upload_softapplication_photo: Upload-appphoto label_upload_softapplication_packets_mustpacketed: Works code and ralated-document must be packaged before upload. - label_upload_softapplication_photo_condition: Need upload 0~4 works screenshot, each is less than 5M, photo format such as gif,jpg,png etc. + label_upload_softapplication_photo_condition: The best works. 0~4 (redundant pictures would not show page), each is less than 5M, photo format such as gif,jpg,png etc. label_updated_caution: Note:if you edit the work, the uploaded screenshot and package will be deleted, please re-load! label_softapplication_name: App-name label_work_name: Work name diff --git a/config/locales/zh.yml b/config/locales/zh.yml index bc4809c91..174f47193 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1975,7 +1975,7 @@ zh: label_upload_softapplication_packets: 上传应用软件包 label_upload_softapplication_photo: 上传产品截图 label_upload_softapplication_packets_mustpacketed: 作品相关代码及相关说明文件必须打包后以压缩包的形式上传,便于上传和下载 ; - label_upload_softapplication_photo_condition: 作品截图需上传0~4张;格式为gif/jpg/png, 每张小于5M + label_upload_softapplication_photo_condition: 作品截图最好0~4张(多余图片不会再展示页面上显示);格式为gif/jpg/png, 每张小于5M label_updated_caution: 注意:若编辑参赛作品,则之前上传的软件包和截图都将被删除,请重新上传! label_softapplication_name: 应用名称 label_work_name: 作品名称 From 426ea23d6e35d55814fec86046407b986ef62bfa Mon Sep 17 00:00:00 2001 From: z9hangDate: Mon, 4 Aug 2014 17:30:29 +0800 Subject: [PATCH 21/45] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 11 ++++++++--- app/views/memos/_reply_box.html.erb | 2 +- app/views/memos/quote.js.erb | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 7f71c2085..d7510c385 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -40,12 +40,17 @@ class MemosController < ApplicationController end def create - unless params[:quote].nil? - @quote = params[:quote][:quote] - else + + if params[:quote].nil? @quote = "" + else + @quote = params[:quote] end + #unless params[:quote].nil? + # @quote = params[:quote][:quote] + #end + @memo = Memo.new(params[:memo]) @memo.forum_id = params[:forum_id] @memo.author_id = User.current.id diff --git a/app/views/memos/_reply_box.html.erb b/app/views/memos/_reply_box.html.erb index 18cfa032d..9dddf5be4 100644 --- a/app/views/memos/_reply_box.html.erb +++ b/app/views/memos/_reply_box.html.erb @@ -4,7 +4,7 @@ <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> - <%= text_area :quote,:quote,:style => 'display:none' %> + <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> <%= label_tag(l(:label_reply_plural)) %>: <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %> diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb index a72b7ac9e..d2e8c1d17 100644 --- a/app/views/memos/quote.js.erb +++ b/app/views/memos/quote.js.erb @@ -1,4 +1,4 @@ //ckeditor.setData("<%= raw escape_javascript(@content) %>"); $('#message_quote').html("<%= raw escape_javascript(@temp.content) %>"); -$('#quote_quote').html("<%= raw escape_javascript(@content) %>"); +$('#quote').val("<%= raw escape_javascript(@content) %>"); showAndScrollTo("new_memo", "cke_editor01"); \ No newline at end of file From 8c8127c8d97a694699c01167f51910ed18adf421 Mon Sep 17 00:00:00 2001 From: chenmin <19763783@qq.com> Date: Mon, 4 Aug 2014 17:36:04 +0800 Subject: [PATCH 22/45] =?UTF-8?q?1016=20=E4=BF=AE=E5=A4=8D=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E6=98=BE=E7=A4=BA=E7=95=8C=E9=9D=A2=E7=A9=BA=E8=A1=8C?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/course.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 46a6d03a1..63fdfc078 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -92,15 +92,15 @@ - <% if User.current.logged? %> +
该学校未开设任何课程,您可以查看其他学校课程
+ <% end %> - <% find_all_new_hot_course(9, @school_id).map do |course| %>- /,"") %>>
From 37e5bdee22ee0caf350e63fd4cf8cc3e93d02a21 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 4 Aug 2014 17:36:07 +0800 Subject: [PATCH 23/45] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=E5=86=85=E5=AE=B9=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84BUG=20#1128?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 569 +++++++++++++++++----------------- config/locales/en.yml | 1 + 2 files changed, 287 insertions(+), 283 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index a12627792..20f64dc3f 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -43,292 +43,295 @@ <% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %> <% act = e.act %> <% unless act.nil? %> --
+ <% end %> <% end %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index d8ebfb9f1..8e3b8d0f0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1801,3 +1801,4 @@ en: modal_valid_passing: can be used. label_company_name: Company Name + notice_account_invalid_creditentials_new: You have not to the mailbox activation From 65174ad8efb62a9365671d8763a9d30ccb2ecb32 Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Tue, 5 Aug 2014 09:19:05 +0800 Subject: [PATCH 24/45] =?UTF-8?q?=E9=A1=B9=E7=9B=AE--wiki--=E9=87=8D?= =?UTF-8?q?=E5=AE=9A=E5=90=91/=E9=87=8D=E5=91=BD=E5=90=8D=EF=BC=9A?= =?UTF-8?q?=E2=80=9C=E9=87=8D=E2=80=9D=E5=AD=97=E8=A2=AB=E6=8E=A9=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/newrepo.html.erb | 2 +- app/views/wiki/rename.html.erb | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/repositories/newrepo.html.erb b/app/views/repositories/newrepo.html.erb index 0461d5768..0c95a0335 100644 --- a/app/views/repositories/newrepo.html.erb +++ b/app/views/repositories/newrepo.html.erb @@ -2,5 +2,5 @@- <%= image_tag(url_to_avatar(e.user), :class => "avatar") %> -- - <% case e.act_type %> - <% when 'JournalsForMessage' %> - <% if User.current.login == e.user.try(:login) %> - <%# if e.user_id == act.jour.id %> + <% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%> +
+- - -
- - <%# else %> - - <%# end %> - <% else %> -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %> - <%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> - +<%= image_tag(url_to_avatar(e.user), :class => "avatar") %> ++ + <% case e.act_type %> + <% when 'JournalsForMessage' %> + <% if User.current.login == e.user.try(:login) %> + <%# if e.user_id == act.jour.id %> +
++ + <%# else %> + + <%# end %> + <% else %> ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %> + <%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> + ++ + <% end %> ++ <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= + link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> + ++ + ++ +<%= textilizable act.notes %>
+ +<%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %> +++ + <% when 'Bid' %> ++ ++ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> ++ ++ <% if act.reward_type == 3 && @show_course == 1%> + <% if e.user == User.current %> + ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %><%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + + <% else %> ++ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + + <% end %> + <% else %> + <% if e.user == User.current %> ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %><%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + + <% else %> ++ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + + <% end %> + <% end %> ++ ++ +<%= act.description.html_safe %>
+ + <% when 'Journal' %> ++ ++ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> +++ <%= link_to l(:label_find_all_comments), respond_path(e.act_id) %><%= l(:label_comments_count, :count => e.act.commit) %> +++ <% if e.user == User.current %> + ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> + + <% else %> ++ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> + + <% end %> ++ <% if act.notes.nil? %> + <% desStr = '' %> + <% else %> + <% desStr=act.notes.html_safe %> + <% end %> + ++ <%= desStr %>
++ + <% when 'Changeset' %> ++ ++ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> ++ ++ <% if e.user == User.current %> + ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %> + + <% else %> ++ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %> + + <% end %> ++ ++ +<%= act.long_comments.html_safe %>
+ + <% when 'Message' %> ++ ++ <%= format_time(e.act.committed_on) %> +++ <%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %><%= l(:label_comments_count, :count => e.act.count) %> +++ <% if e.user == User.current %> + ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> + + <% else %> ++ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> + + <% end %> ++ ++ +<%= h act.content.truncate(240, omission: '...') %>
++ + <% when 'Principal' %> ++ ++ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> ++ ++ <% if e.user == User.current %> + ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_new_user) %> + + <% else %> ++ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_user) %> + + <% end %> ++ ++ + + <% when 'News' %> ++ ++ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> ++ ++ <% if e.user == User.current %> + ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> + + <% else %> ++ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> + + <% end %> ++ ++ +<%= act.description.html_safe %>
+ + <% when 'Issue' %> ++ ++ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> +++ <%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.comments_count) %> +++ <% if e.user == User.current %> + ++ + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> + + + <%= l(:label_i_new_activity) %> + + <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> + + <% else %> ++ + <%= link_to(h(e.user), user_path(e.user_id)) %> + + + <%= l(:label_new_activity) %> + + <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> + + <% end %> ++ ++ + <%= textilizable act, :description %> + + ++ + <% when 'Contest' %> ++ ++ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> +++ <%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.journals.count) %> +++ <% if e.user == User.current && @show_contest == 1%> + ++ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> + + <% else %> ++ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> + + <% end %> ++ ++ <%= h act.description %>
++ + <% else %> + <%# f=1 %> + <% end %> ++ + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> ++- - <% end %> -- <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= - link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> - -- - -- -<%= textilizable act.notes %>
-<%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %> --- - <% when 'Bid' %> -- -- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -- -- <% if act.reward_type == 3 && @show_course == 1%> - <% if e.user == User.current %> - -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %><%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> - - <% else %> -- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> - - <% end %> - <% else %> - <% if e.user == User.current %> -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %><%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> - - <% else %> -- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> - - <% end %> - <% end %> -- -- -<%= act.description.html_safe %>
- - <% when 'Journal' %> -- -- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> --- <%= link_to l(:label_find_all_comments), respond_path(e.act_id) %><%= l(:label_comments_count, :count => e.act.commit) %> --- <% if e.user == User.current %> - -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> - - <% else %> -- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %> - - <% end %> -- <% if act.notes.nil? %> - <% desStr = '' %> - <% else %> - <% desStr=act.notes.html_safe %> - <% end %> - -- <%= desStr %>
-- - <% when 'Changeset' %> -- -- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -- -- <% if e.user == User.current %> - -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %> - - <% else %> -- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %> - - <% end %> -- -- -<%= act.long_comments.html_safe %>
- - <% when 'Message' %> -- -- <%= format_time(e.act.committed_on) %> --- <%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %><%= l(:label_comments_count, :count => e.act.count) %> --- <% if e.user == User.current %> - -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> - - <% else %> -- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %> - - <% end %> -- -- -<%= h act.content.truncate(240, omission: '...') %>
-- - <% when 'Principal' %> -- -- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -- -- <% if e.user == User.current %> - -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_new_user) %> - - <% else %> -- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_user) %> - - <% end %> -- -- - - <% when 'News' %> -- -- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> -- -- <% if e.user == User.current %> - -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> - - <% else %> -- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> - - <% end %> -- -- -<%= act.description.html_safe %>
- - <% when 'Issue' %> -- -- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> --- <%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.comments_count) %> --- <% if e.user == User.current %> - -- - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> - - - <%= l(:label_i_new_activity) %> - - <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> - - <% else %> -- - <%= link_to(h(e.user), user_path(e.user_id)) %> - - - <%= l(:label_new_activity) %> - - <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> - - <% end %> -- -- - <%= textilizable act, :description %> - - -- - <% when 'Contest' %> -- -- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> --- <%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.journals.count) %> --- <% if e.user == User.current && @show_contest == 1%> - -- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> - - <% else %> -- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> - - <% end %> -- -- <%= h act.description %>
-- - <% else %> - <% f=1 %> - <% end %> -- - <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> --<%= l(:label_repository_new_repos) %>
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form'} do |f| %> <%= render :partial => 'form_create', :locals => {:f => f} %> - + <% end %> \ No newline at end of file diff --git a/app/views/wiki/rename.html.erb b/app/views/wiki/rename.html.erb index ee0e49594..1ce11ee83 100644 --- a/app/views/wiki/rename.html.erb +++ b/app/views/wiki/rename.html.erb @@ -1,5 +1,10 @@ <%= wiki_page_breadcrumb(@page) %> - +<%= h @original_title %>
<%= error_messages_for 'page' %> @@ -9,7 +14,7 @@ :html => { :method => :post } do |f| %><%= f.text_field :title, :required => true, :size => 100 %>
-<%= f.check_box :redirect_existing_links %>
+<%= f.check_box :redirect_existing_links %>
<%= f.select :parent_id, content_tag('option', '', :value => '') + wiki_page_options_for_select( From 2c77d1b4cf5df9a214d1ca9b249fd74bfd14dc7a Mon Sep 17 00:00:00 2001 From: z9hang
Date: Tue, 5 Aug 2014 11:10:41 +0800 Subject: [PATCH 25/45] =?UTF-8?q?=E8=AE=BF=E9=97=AE=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 14 +++++++++++++- app/helpers/project_score_helper.rb | 5 +++++ app/models/attachment.rb | 2 +- .../files/_course_show_all_attachment.html.erb | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index a8ba3d426..e619ef843 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -40,7 +40,19 @@ class FilesController < ApplicationController render :layout => !request.xhr? elsif params[:course_id] @isproject = false - @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)] + + if params[:sort] + @oder = params[:sort].split(",")[0] + @order_by = @oder.split(":")[0] + @order_tyoe = @oder.split(":")[1] + if @order_by == "size" + @order_by = "filesize" + end + @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@order_by} #{@order_tyoe}").find(@course.id)] + else + @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)] + end + render :layout => 'base_courses' end end diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index 3df2e05b5..fe7c8307e 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -2,7 +2,12 @@ class ProjectScoreHelper #缺陷数量 def issue_num project + project.issues.count + end + #缺陷留言数量 + def issue_journal_num project + project end end \ No newline at end of file diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 85f36fc5f..67e46eb5e 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -193,7 +193,7 @@ class Attachment < ActiveRecord::Base def show_suffix_type suffix = 'other' temp = self.suffix_type.downcase - if self.attachmentstype.suffixArr.include?(temp) + if self.attachmentstype && self.attachmentstype.suffixArr.include?(temp) suffix = temp end suffix diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb index f94ddc20b..abece1ae1 100644 --- a/app/views/files/_course_show_all_attachment.html.erb +++ b/app/views/files/_course_show_all_attachment.html.erb @@ -43,7 +43,7 @@ <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.typeName %> + <%= file.attachmentstype.typeName unless file.attachmentstype.nil? %> <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> From 8b217735c3f736709a6f54ba3b9fa81b43c01436 Mon Sep 17 00:00:00 2001 From: chenmin <19763783@qq.com> Date: Tue, 5 Aug 2014 12:00:39 +0800 Subject: [PATCH 26/45] =?UTF-8?q?1029=20=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index a8ba3d426..a2d791017 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -40,7 +40,19 @@ class FilesController < ApplicationController render :layout => !request.xhr? elsif params[:course_id] @isproject = false - @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)] + @order = params[:sort].split(",")[0]; + @orderBy = @order.split(":")[0]; + @orderType = @order.split(":")[1]; + if @orderBy=="size" + @orderBy="filesize" + elsif @orderBy=="field_file_dense" + @orderBy="is_public" + elsif @orderBy=="attach_type" + @orderBy="attachtype" + elsif @orderBy=="content_type" + @orderBy="attachtype" + end + @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)] render :layout => 'base_courses' end end From 3862f857f78bfdf792d53c51fad8009c3f9e7c81 Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Tue, 5 Aug 2014 14:02:39 +0800 Subject: [PATCH 27/45] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=BD=93=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=9B=9E=E5=A4=8D=E6=9D=A1=E4=BB=B6=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=8E=92=E5=88=97=E6=AC=A1=E5=BA=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index d7510c385..1e537ff75 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -84,7 +84,7 @@ class MemosController < ApplicationController @reply_pages = Paginator.new @reply_count, pre_count, page @replies = @memo.children. includes(:author, :attachments). - reorder("#{Memo.table_name}.created_at ASC"). + reorder("#{Memo.table_name}.created_at DESC"). limit(@reply_pages.per_page). offset(@reply_pages.offset). all From fbe3e535b4c4af1759c1cfab6d08cbd8fe96b51f Mon Sep 17 00:00:00 2001 From: chenmin <19763783@qq.com> Date: Tue, 5 Aug 2014 15:23:01 +0800 Subject: [PATCH 28/45] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=8E=92=E5=BA=8Fbug=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=E6=97=B6=E9=97=B4=E6=AE=B5?= =?UTF-8?q?=E7=BA=A6=E6=9D=9Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 4 +++- app/controllers/files_controller.rb | 21 +++++++++++++++++---- app/views/courses/show.html.erb | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 85dfba8cf..6989b0b4f 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -624,7 +624,9 @@ class CoursesController < ApplicationController "show_course_journals_for_messages" => true } @date_to ||= Date.today + 1 - @date_from = @date_to - @days-1.years + # + @date_from = (@date_to - @days) > @course.created_at.to_date ? (@date_to - @days) : @course.created_at.to_date + #@date_from = @date_to - @days-1.years @author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id])) # 决定显示所用用户或单个用户活动 @activity = Redmine::Activity::Fetcher.new(User.current, :course => @course, diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index a2d791017..9e41f467b 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -40,9 +40,17 @@ class FilesController < ApplicationController render :layout => !request.xhr? elsif params[:course_id] @isproject = false - @order = params[:sort].split(",")[0]; - @orderBy = @order.split(":")[0]; - @orderType = @order.split(":")[1]; + + if params[:sort] + if params[:sort].include?":" + @orderBy = params[:sort].split(":")[0]; + @orderType = params[:sort].split(":")[1].split(",")[0]; + else + @orderBy = params[:sort].split(",")[0]; + @orderType = "asc"; + end + end + if @orderBy=="size" @orderBy="filesize" elsif @orderBy=="field_file_dense" @@ -52,7 +60,12 @@ class FilesController < ApplicationController elsif @orderBy=="content_type" @orderBy="attachtype" end - @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)] + + if @orderBy + @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)] + else + @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)] + end render :layout => 'base_courses' end end diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 8b713476e..deb590d1f 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -2,7 +2,7 @@ - <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %> + <%= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
<% @events_by_day.keys.sort.reverse.each do |day| %> From 7907edf168a3b999c24e87775dba49d388cf3e8e Mon Sep 17 00:00:00 2001 From: z9hangDate: Tue, 5 Aug 2014 16:39:33 +0800 Subject: [PATCH 29/45] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=BE=97=E5=88=86=E8=A7=84=E5=88=99=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReadMe.txt | 5 ++ app/controllers/projects_controller.rb | 1 + app/controllers/welcome_controller.rb | 2 +- app/helpers/project_score_helper.rb | 64 ++++++++++++++++++- app/views/bids/_homework_list.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 29 +-------- .../_code_submit_score_index.html.erb | 7 +- app/views/projects/_file_score_index.html.erb | 7 +- .../projects/_issue_score_index.html.erb | 13 ++-- app/views/projects/_news_score_index.html.erb | 8 +-- app/views/projects/_project.html.erb | 46 +++---------- .../projects/_project_score_index.html.erb | 34 ++-------- .../_projects_topic_score_index.html.erb | 10 +-- .../projects/_show_projects_score.html.erb | 40 ++---------- .../projects/show_projects_score.html.erb | 39 ++--------- app/views/welcome/index.html.erb | 28 +------- .../stylesheets/application.css | 6 +- 17 files changed, 116 insertions(+), 225 deletions(-) diff --git a/ReadMe.txt b/ReadMe.txt index 722b4cd37..b5822682b 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -70,3 +70,8 @@ kw: undefined image_width bundle exec rake db:migrate:down version=20140725062302 bundle exec rake db:migrate:up version=20140725062302 + +=================================[2014-07-19]===================================== +kw: Mysql2::Error,洢,CALL sp_project_status_cursor(); +bundle exec rake db:migrate:down version=20130828004955 +bundle exec rake db:migrate:up version=20130828004955 diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 9b2481c1b..76be5d51f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -75,6 +75,7 @@ class ProjectsController < ApplicationController helper :watchers # helper :watcherlist helper :words + helper :project_score ### added by william include ActsAsTaggableOn::TagsHelper diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index c7cbf217d..4a0586c95 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -18,7 +18,7 @@ class WelcomeController < ApplicationController include ApplicationHelper include WelcomeHelper - + helper :project_score caches_action :robots # before_filter :fake, :only => [:index, :course] before_filter :entry_select, :only => [:index] diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index fe7c8307e..923a3da72 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -1,5 +1,5 @@ # encoding: utf-8 -class ProjectScoreHelper +module ProjectScoreHelper #缺陷数量 def issue_num project project.issues.count @@ -7,7 +7,67 @@ class ProjectScoreHelper #缺陷留言数量 def issue_journal_num project - project + project.issue_changes.count + end + + #新闻数量 + def news_num project + project.news.count + end + + #文档数量 + def document_num project + project.documents.count + end + + #代码提交数量 + def changesets_num project + project.changesets.count + end + + #讨论区帖子数量 + def board_message_num project + board_message_count = 0 + project.boards.each do |board| + board_message_count += board.messages_count + end + board_message_count + end + + #缺陷得分 + def issue_score project + i_num = issue_num project + i_j_num = issue_journal_num project + i_num * 4 + i_j_num + end + + # 新闻得分 + def news_score project + n_num = news_num project + n_num + end + + #文档得分 + def document_score project + d_num = document_num project + d_num * 4 + end + + #代码提交得分 + def changesets_score project + c_num = changesets_num project + c_num * 4 + end + + #讨论区帖子得分 + def board_message_score project + b_m_num = board_message_num project + b_m_num * 2 + end + + #项目得分 + def project_scores project + (issue_score project) + (news_score project) + (document_score project) + (changesets_score project) + (board_message_score project) end end \ No newline at end of file diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 2009d1252..9e8aceaff 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -96,7 +96,7 @@ 项目得分: ;"> - <%= homework.project.nil? ? "N/A" : project_score(homework.project) %> + <%= homework.project.nil? ? "N/A" : project_scores(homework.project) %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index fa20bdff6..b8bede1fb 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -62,37 +62,10 @@ <%= link_to @project.name, project_path(@project)%>- - <% issue_count = @project.issues.count %> - <% issue_journal_count = @project.issue_changes.count %> - <% issue_score = issue_count * 0.2 %> - <% issue_journal_score = issue_journal_count * 0.1 %> - <% finall_issue_score = issue_score + issue_journal_score %> - - <% new_count = @project.news.count %> - <% new_score = new_count * 0.1 %> - <% finall_new_score = new_score %> - - <% document_count = @project.documents.count %> - <% file_score = document_count * 0.1 %> - <% finall_file_score = file_score %> - - <% changeset_count = @project.changesets.count %> - <% code_submit_score = changeset_count * 0.3 %> - <% finall_code_submit_score = code_submit_score %> - - <% board_message_count = 0 %> - <% @project.boards.each do |board| %> - <% board_message_count += board.messages_count %> - <% end %> - <% topic_score = board_message_count * 0.1 %> - <% finall_topic_score = topic_score %> - - <% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %> <% if @project.project_type == 0 %> <%= l(:label_project_grade)%> : - <%= link_to(format("%.2f" , finall_project_score ).to_f, {:controller => 'projects', + <%= link_to(format("%.2f" , project_scores(@project) ).to_i, {:controller => 'projects', :action => 'show_projects_score', :remote => true, :id => @project.id diff --git a/app/views/projects/_code_submit_score_index.html.erb b/app/views/projects/_code_submit_score_index.html.erb index 238993afe..802779967 100644 --- a/app/views/projects/_code_submit_score_index.html.erb +++ b/app/views/projects/_code_submit_score_index.html.erb @@ -1,7 +1,4 @@ -<% changeset_count = @project.changesets.count %> -<% code_submit_score = changeset_count * 0.3 %> -<% finall_code_submit_score = code_submit_score %> -<%= l(:label_code_submit_number) %> * 0.3 = <%= changeset_count %> * 0.3 = <%= format("%.2f" , code_submit_score).to_f %>-<%= l(:label_code_submit_score) %> = <%= format("%.2f" , finall_code_submit_score).to_f %>+<%= l(:label_code_submit_number) %> * 4 = <%= changesets_num(@project) %> * 4 = <%= format("%.2f" , changesets_score(@project)).to_i %>+<%= l(:label_code_submit_score) %> = <%= format("%.2f" , changesets_score(@project)).to_i %>\ No newline at end of file diff --git a/app/views/projects/_file_score_index.html.erb b/app/views/projects/_file_score_index.html.erb index 3b4810f65..ce80ddbd2 100644 --- a/app/views/projects/_file_score_index.html.erb +++ b/app/views/projects/_file_score_index.html.erb @@ -1,7 +1,4 @@ -<% document_count = @project.documents.count %> -<% file_score = document_count * 0.1 %> -<% finall_file_score = file_score %> -<%= l(:label_file_number) %> * 0.1 = <%= document_count %> * 0.1 = <%= format("%.2f" , file_score).to_f %>-<%= l(:label_file_score) %> = <%= format("%.2f" , finall_file_score).to_f %>+<%= l(:label_file_number) %> * 4 = <%= document_num(@project) %> * 4 = <%= format("%.2f" , document_score(@project)).to_i %>+<%= l(:label_file_score) %> = <%= format("%.2f" , document_score(@project)).to_i %>\ No newline at end of file diff --git a/app/views/projects/_issue_score_index.html.erb b/app/views/projects/_issue_score_index.html.erb index 8ca3d240c..7353ce5a3 100644 --- a/app/views/projects/_issue_score_index.html.erb +++ b/app/views/projects/_issue_score_index.html.erb @@ -1,11 +1,6 @@ -<% issue_count = @project.issues.count %> -<% issue_journal_count = @project.issue_changes.count %> -<% issue_score = issue_count * 0.2 %> -<% issue_journal_score = issue_journal_count * 0.1 %> -<% finall_issue_score = issue_score + issue_journal_score %> -<%= l(:label_issue_number) %> * 0.2 = <%= issue_count %> * 0.2 = <%= format("%.2f" , issue_score).to_f %>-<%= l(:label_issue_journal_number) %> * 0.1 = <%= issue_journal_count %> * 0.1 = <%= format("%.2f" , issue_journal_score).to_f %>-<%= l(:label_issue_score) %> = <%= format("%.2f" , issue_score).to_f %> + <%= format("%.2f" , issue_journal_score).to_f %> - = <%= format("%.2f" , finall_issue_score).to_f %>+<%= l(:label_issue_number) %> * 4 = <%= issue_num(@project) %> * 4 = <%= format("%.2f" , issue_num(@project) * 4).to_i %>+<%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(@project) %> * 1 = <%= format("%.2f" , issue_journal_num(@project)).to_i %>+<%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(@project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(@project)).to_i %> + = <%= format("%.2f" , issue_score(@project)).to_i %>\ No newline at end of file diff --git a/app/views/projects/_news_score_index.html.erb b/app/views/projects/_news_score_index.html.erb index 0f374b871..b3d66efeb 100644 --- a/app/views/projects/_news_score_index.html.erb +++ b/app/views/projects/_news_score_index.html.erb @@ -1,7 +1,5 @@ -<% new_count = @project.news.count %> -<% new_score = new_count * 0.1 %> -<% finall_new_score = new_score %> -<%= l(:label_new_number) %> * 0.1 = <%= new_count %> * 0.1 = <%= format("%.2f" , new_score).to_f %>-<%= l(:label_news_score) %> = <%= format("%.2f" , finall_new_score).to_f %>+ +<%= l(:label_new_number) %> * 1 = <%= news_num(@project) %> * 1 = <%= format("%.2f" , news_score(@project)).to_i %>+<%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %>\ No newline at end of file diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 41ad2a62c..e9a733ece 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -18,37 +18,37 @@-
+
- + <%= link_to @project.watcher_users.count, project_watcherlist_path(project)%> -+ <%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %> - + <%= link_to "#{@project.members.count}", project_member_path(@project)%> -+ <%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %> - + <%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %> -+ <%= content_tag('span', l(:label_since_last_commits)) %> - @@ -124,37 +124,11 @@+ <% #find_project_repository @project %> <%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %> -+ <%= content_tag('span', l(:label_commit_on)) %> - <% issue_count = @project.issues.count %> - <% issue_journal_count = @project.issue_changes.count %> - <% issue_score = issue_count * 0.2 %> - <% issue_journal_score = issue_journal_count * 0.1 %> - <% finall_issue_score = issue_score + issue_journal_score %> - - <% new_count = @project.news.count %> - <% new_score = new_count * 0.1 %> - <% finall_new_score = new_score %> - - <% document_count = @project.documents.count %> - <% file_score = document_count * 0.1 %> - <% finall_file_score = file_score %> - - <% changeset_count = @project.changesets.count %> - <% code_submit_score = changeset_count * 0.3 %> - <% finall_code_submit_score = code_submit_score %> - - <% board_message_count = 0 %> - <% @project.boards.each do |board| %> - <% board_message_count += board.messages_count %> - <% end %> - <% topic_score = board_message_count * 0.1 %> - <% finall_topic_score = topic_score %> - - <% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %> <% if @project.project_type !=1 %> <%= l(:label_project_grade)%>: - <%= link_to(format("%.2f" , finall_project_score ).to_f, + <%= link_to(format("%.2f" , project_scores(@project) ).to_i, {:controller => 'projects', :action => 'show_projects_score', :remote => true, :id => @project.id}, :style=>"color: #EC6300;") %> diff --git a/app/views/projects/_project_score_index.html.erb b/app/views/projects/_project_score_index.html.erb index ab0dc18ca..4a94867fc 100644 --- a/app/views/projects/_project_score_index.html.erb +++ b/app/views/projects/_project_score_index.html.erb @@ -1,36 +1,10 @@ -<% issue_count = @project.issues.count %> -<% issue_journal_count = @project.issue_changes.count %> -<% issue_score = issue_count * 0.2 %> -<% issue_journal_score = issue_journal_count * 0.1 %> -<% finall_issue_score = issue_score + issue_journal_score %> - -<% new_count = @project.news.count %> -<% new_score = new_count * 0.1 %> -<% finall_new_score = new_score %> - -<% document_count = @project.documents.count %> -<% file_score = document_count * 0.1 %> -<% finall_file_score = file_score %> - -<% changeset_count = @project.changesets.count %> -<% code_submit_score = changeset_count * 0.3 %> -<% finall_code_submit_score = code_submit_score %> - -<% board_message_count = 0 %> -<% @project.boards.each do |board| %> -<% board_message_count += board.messages_count %> -<% end %> -<% topic_score = board_message_count * 0.1 %> -<% finall_topic_score = topic_score %> - -<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %> <%= l(:label_projects_score) %>diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index f8c7f880d..31fb0432a 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -79,33 +79,7 @@ <%=project.description.truncate(100, omission: '...')%>= <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> + <%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %>-= <%= format("%.2f" , finall_issue_score).to_f %> + <%= format("%.2f" , finall_new_score).to_f %> + - <%= format("%.2f" , finall_file_score).to_f %> + <%= format("%.2f" , finall_code_submit_score).to_f %> + - <%= format("%.2f" , topic_score).to_f %>-= <%= format("%.2f" , finall_project_score).to_f %>+= <%= format("%.2f" , issue_score(@project)).to_i %> + <%= format("%.2f" , news_score(@project)).to_i %> + + <%= format("%.2f" , document_score(@project)).to_i %> + <%= format("%.2f" , changesets_score(@project)).to_i %> + + <%= format("%.2f" , board_message_score(@project)).to_i %>+= <%= format("%.2f" , project_scores(@project)).to_i %>\ No newline at end of file diff --git a/app/views/projects/_projects_topic_score_index.html.erb b/app/views/projects/_projects_topic_score_index.html.erb index 1e059007a..909f93a09 100644 --- a/app/views/projects/_projects_topic_score_index.html.erb +++ b/app/views/projects/_projects_topic_score_index.html.erb @@ -1,10 +1,4 @@ -<% board_message_count = 0 %> -<% @project.boards.each do |board| %> -<% board_message_count += board.messages_count %> -<% end %> -<% topic_score = board_message_count * 0.1 %> -<% finall_topic_score = topic_score %> -<%= l(:label_topic_number) %> * 0.1 = <%= board_message_count %> * 0.1 = <%= topic_score %>-<%= l(:label_topic_score) %> = <%= format("%.2f" , finall_topic_score).to_f %>+<%= l(:label_topic_number) %> * 2 = <%= board_message_num(@project) %> * 2 = <%= board_message_score(@project) %>+<%= l(:label_topic_score) %> = <%= format("%.2f" , board_message_score(@project)).to_i %>\ No newline at end of file diff --git a/app/views/projects/_show_projects_score.html.erb b/app/views/projects/_show_projects_score.html.erb index d135cfbdb..95c93d520 100644 --- a/app/views/projects/_show_projects_score.html.erb +++ b/app/views/projects/_show_projects_score.html.erb @@ -1,30 +1,4 @@ -<% issue_count = @project.issues.count %> -<% issue_journal_count = @project.issue_changes.count %> -<% issue_score = issue_count * 0.2 %> -<% issue_journal_score = issue_journal_count * 0.1 %> -<% finall_issue_score = issue_score + issue_journal_score %> - -<% new_count = @project.news.count %> -<% new_score = new_count * 0.1 %> -<% finall_new_score = new_score %> - -<% document_count = @project.documents.count %> -<% file_score = document_count * 0.1 %> -<% finall_file_score = file_score %> - -<% changeset_count = @project.changesets.count %> -<% code_submit_score = changeset_count * 0.3 %> -<% finall_code_submit_score = code_submit_score %> - -<% board_message_count = 0 %> -<% @project.boards.each do |board| %> -<% board_message_count += board.messages_count %> -<% end %> -<% topic_score = board_message_count * 0.1 %> -<% finall_topic_score = topic_score %> - -<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %><%= l(:label_projects_score) %>
@@ -40,7 +14,7 @@diff --git a/app/views/projects/show_projects_score.html.erb b/app/views/projects/show_projects_score.html.erb index 95a7085d4..94f3dfaf8 100644 --- a/app/views/projects/show_projects_score.html.erb +++ b/app/views/projects/show_projects_score.html.erb @@ -1,30 +1,5 @@ -<% issue_count = @project.issues.count %> -<% issue_journal_count = @project.issue_changes.count %> -<% issue_score = issue_count * 0.2 %> -<% issue_journal_score = issue_journal_count * 0.1 %> -<% finall_issue_score = issue_score + issue_journal_score %> -<% new_count = @project.news.count %> -<% new_score = new_count * 0.1 %> -<% finall_new_score = new_score %> - -<% document_count = @project.documents.count %> -<% file_score = document_count * 0.1 %> -<% finall_file_score = file_score %> - -<% changeset_count = @project.changesets.count %> -<% code_submit_score = changeset_count * 0.3 %> -<% finall_code_submit_score = code_submit_score %> - -<% board_message_count = 0 %> -<% @project.boards.each do |board| %> - <% board_message_count += board.messages_count %> -<% end %> -<% topic_score = board_message_count * 0.1 %> -<% finall_topic_score = topic_score %> - -<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>@@ -51,27 +25,27 @@
- <%= l(:label_projects_score) %> + <%= format("%.2f" , finall_project_score ).to_f %> <%= format("%.2f" , project_scores(@project) ).to_i %>
- <%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> : - <%= format("%.2f" , finall_project_score ).to_f %> + <%= format("%.2f" , project_scores(@project) ).to_i %>
- <%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> : - <%= format("%.2f" , finall_issue_score).to_f %> + <%= format("%.2f" , issue_score(@project)).to_i %>
- <%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> : - <%= format("%.2f" , finall_new_score).to_f %> + <%= format("%.2f" , news_score(@project)).to_i %>
- <%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> : - <%= format("%.2f" , finall_file_score).to_f %> + <%= format("%.2f" , document_score(@project)).to_i %>
- <%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> : - <%= format("%.2f" , finall_code_submit_score).to_f %> + <%= format("%.2f" , changesets_score(@project)).to_i %>
- <%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> : - <%= format("%.2f" , finall_topic_score).to_f %> + <%= format("%.2f" , board_message_score(@project)).to_i %>
<%= h html_title %> @@ -56,7 +31,7 @@@@ -67,27 +42,27 @@
- <%= l(:label_projects_score) %> + <%= format("%.2f" , finall_project_score ).to_f %> <%= format("%.2f" , project_scores(@project) ).to_i %>
- <%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> : - <%= format("%.2f" , finall_project_score ).to_f %> + <%= format("%.2f" , project_scores(@project) ).to_i %>
- <%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> : - <%= format("%.2f" , finall_issue_score).to_f %> + <%= format("%.2f" , issue_score(@project)).to_i %>
- <%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> : - <%= format("%.2f" , finall_new_score).to_f %> + <%= format("%.2f" , news_score(@project)).to_i %>
- <%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> : - <%= format("%.2f" , finall_file_score).to_f %> + <%= format("%.2f" , document_score(@project)).to_i %>
- <%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> : - <%= format("%.2f" , finall_code_submit_score).to_f %> + <%= format("%.2f" , changesets_score(@project)).to_i %>
- <%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> : - <%= format("%.2f" , finall_topic_score).to_f %> + <%= format("%.2f" , board_message_score(@project)).to_i %>
- <%# issue_count = project.issues.count %> - <%# issue_journal_count = project.issue_changes.count %> - <%# issue_score = issue_count * 0.2 %> - <%# issue_journal_score = issue_journal_count * 0.1 %> - <%# finall_issue_score = issue_score + issue_journal_score %> - - <%# new_count = project.news.count %> - <%# new_score = new_count * 0.1 %> - <%# finall_new_score = new_score %> - - <%# document_count = project.documents.count %> - <%# file_score = document_count * 0.1 %> - <%# finall_file_score = file_score %> - - <%# changeset_count = project.changesets.count %> - <%# code_submit_score = changeset_count * 0.3 %> - <%# finall_code_submit_score = code_submit_score %> - - <%# board_message_count = 0 %> - <%# project.boards.each do |board| %> - <%# board_message_count += board.messages_count %> - <%# end %> - <%# topic_score = board_message_count * 0.1 %> - <%# finall_topic_score = topic_score %> - - <%# finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %> - <%= content_tag "span", l(:label_project_score)+ ":" + project_score(project), + <%= content_tag "span", l(:label_project_score)+ ":" + project_scores(project).to_s, :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;", :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", :class => "tooltip", diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 0f8113054..9baa5526c 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -1070,10 +1070,10 @@ overflow: hidden; .information { margin-top: 20px; - margin-left: 607px; + margin-left: 690px; float: left; height: auto; - width: 300px; + width: 280px; font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/ color: rgb(0, 0, 0); font-size: 13px; @@ -1232,7 +1232,7 @@ p.stats { .licences { float: left; height: 18px; - width: 260px; + width: 200px; font-size: 13px; font-family: '微软雅黑',helvetica,arial,sans-serif; /*modify by men*/ line-height: 18px; From d8964d81a845d8c604c3995344289cf167c7881a Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Tue, 5 Aug 2014 17:13:50 +0800 Subject: [PATCH 30/45] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B3=A8=E5=86=8Clastn?= =?UTF-8?q?ame=E8=B6=85=E9=95=BF=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/user.rb b/app/models/user.rb index b64d0efd7..78bfc75f0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -174,6 +174,7 @@ class User < Principal validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT validates_length_of :firstname, :maximum => 30 + validates_length_of :lastname, :maximum => 30 validates_format_of :mail, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true validates_length_of :mail, :maximum => MAIL_LENGTH_LIMIT, :allow_nil => true validates_confirmation_of :password, :allow_nil => true From 1ca64474784f35a4004ad5810c1c093aa21e6eb4 Mon Sep 17 00:00:00 2001 From: z9hangDate: Tue, 5 Aug 2014 17:31:05 +0800 Subject: [PATCH 31/45] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E3=80=81=E6=96=B0=E9=97=BB=E3=80=81=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=E7=AD=89=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=9F=A5=E7=9C=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/boards_controller.rb | 1 + app/controllers/issues_controller.rb | 1 + app/controllers/news_controller.rb | 1 + app/controllers/repositories_controller.rb | 1 + app/views/layouts/base_projects.html.erb | 1 + 5 files changed, 5 insertions(+) diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 40674b53f..72e134fbf 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -26,6 +26,7 @@ class BoardsController < ApplicationController helper :sort include SortHelper helper :watchers + helper :project_score def index #modify by nwb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index edff1888b..9d734db37 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -52,6 +52,7 @@ class IssuesController < ApplicationController include IssuesHelper helper :timelog include Redmine::Export::PDF + helper :project_score def index retrieve_query diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 650f65555..9437889b2 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -29,6 +29,7 @@ class NewsController < ApplicationController helper :watchers helper :attachments + helper :project_score def index case params[:format] diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 7588eef21..92e897ae3 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -39,6 +39,7 @@ class RepositoriesController < ApplicationController before_filter :check_hidden_repo, :only => [:show, :stats, :revisions, :revision, :diff ] helper :repositories include RepositoriesHelper + helper :project_score #@root_path = RepositoriesHelper::ROOT_PATH diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index b8bede1fb..004aabc51 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -1,3 +1,4 @@ + <% @nav_dispaly_project_label = 1 @nav_dispaly_forum_label = 1 %> <% #@nav_dispaly_project_label = 1 %> From 05186c85903fed4bf56f5b53b3299d656b8c268e Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 6 Aug 2014 11:46:38 +0800 Subject: [PATCH 32/45] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E5=AD=98=E6=95=B0=E6=8D=AE=E5=BA=93=20=E6=9C=89=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=A7=AF=E5=88=86=E5=BC=95=E8=B5=B7=E7=9A=84=E7=B3=BB?= =?UTF-8?q?=E5=88=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/calendars_controller.rb | 1 + app/controllers/documents_controller.rb | 1 + app/controllers/files_controller.rb | 1 + app/controllers/gantts_controller.rb | 1 + app/controllers/issue_categories_controller.rb | 2 ++ app/controllers/messages_controller.rb | 1 + app/controllers/projects_controller.rb | 6 +++--- app/controllers/repositories_controller.rb | 1 + app/controllers/versions_controller.rb | 1 + app/controllers/wiki_controller.rb | 1 + app/helpers/project_score_helper.rb | 15 ++++++++++++++- app/models/project_status.rb | 2 +- 12 files changed, 28 insertions(+), 5 deletions(-) diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index 2b6797b4f..167fa124a 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -27,6 +27,7 @@ class CalendarsController < ApplicationController include QueriesHelper helper :sort include SortHelper + helper :project_score def show if params[:year] and params[:year].to_i > 1900 diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 2b92c32bb..721ae07ce 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -26,6 +26,7 @@ class DocumentsController < ApplicationController before_filter :authorize_document helper :attachments + helper :project_score def index @sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category' diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 9e41f467b..4efa5a85d 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -24,6 +24,7 @@ class FilesController < ApplicationController helper :sort include SortHelper + helper :project_score def index #sort_init 'filename', 'asc' diff --git a/app/controllers/gantts_controller.rb b/app/controllers/gantts_controller.rb index e404ed425..ee132ac29 100644 --- a/app/controllers/gantts_controller.rb +++ b/app/controllers/gantts_controller.rb @@ -29,6 +29,7 @@ class GanttsController < ApplicationController helper :sort include SortHelper include Redmine::Export::PDF + helper :project_score def show @gantt = Redmine::Helpers::Gantt.new(params) diff --git a/app/controllers/issue_categories_controller.rb b/app/controllers/issue_categories_controller.rb index 3bc0ff245..472514cb9 100644 --- a/app/controllers/issue_categories_controller.rb +++ b/app/controllers/issue_categories_controller.rb @@ -26,6 +26,8 @@ class IssueCategoriesController < ApplicationController before_filter :authorize accept_api_auth :index, :show, :create, :update, :destroy + helper :project_score + def index respond_to do |format| format.html { redirect_to_settings_in_projects } diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 451e04d3d..e840664b4 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -28,6 +28,7 @@ class MessagesController < ApplicationController helper :watchers helper :attachments include AttachmentsHelper + helper :project_score REPLIES_PER_PAGE = 25 unless const_defined?(:REPLIES_PER_PAGE) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 76be5d51f..3f6827159 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -494,10 +494,10 @@ class ProjectsController < ApplicationController project_info = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id) user_grades = UserGrade.create(:user_id => User.current.id, :project_id => @project.id) Rails.logger.debug "UserGrade created: #{user_grades.to_json}" - if params[:project][:is_public] == '1' - project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :project_type => @project.project_type) + #if params[:project][:is_public] == '1' + project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :project_type => @project.project_type,:grade => 0) Rails.logger.debug "ProjectStatus created: #{project_status.to_json}" - end + #end @project.members << m @project.project_infos << project_info #end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 92e897ae3..5274bb105 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -207,6 +207,7 @@ class RepositoriesController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_to settings_project_path(@project, :tab => 'repositories') end + end def destroy diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 0bbbd1bd6..3641e0c61 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -29,6 +29,7 @@ class VersionsController < ApplicationController helper :custom_fields helper :projects + helper :project_score def index respond_to do |format| diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 65f58da00..39b3b1753 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -44,6 +44,7 @@ class WikiController < ApplicationController include AttachmentsHelper helper :watchers include Redmine::Export::PDF + helper :project_score # List of pages, sorted alphabetically and by parent (hierarchy) def index diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index 923a3da72..c4c42af24 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -67,7 +67,20 @@ module ProjectScoreHelper #项目得分 def project_scores project - (issue_score project) + (news_score project) + (document_score project) + (changesets_score project) + (board_message_score project) + result = (issue_score project) + (news_score project) + (document_score project) + (changesets_score project) + (board_message_score project) + pss = ProjectStatus.where("project_id = '#{project.id}'") + if pss.nil? || pss.count == 0 + ps = ProjectStatus.new + ps.grade = result + ps.project = project + ps.watchers_count = project.watcher_users.count + ps.save + else + ps = pss.first + ps.grade = result + ps.save + end + result end end \ No newline at end of file diff --git a/app/models/project_status.rb b/app/models/project_status.rb index 09200e36a..c3d306c58 100644 --- a/app/models/project_status.rb +++ b/app/models/project_status.rb @@ -1,5 +1,5 @@ class ProjectStatus < ActiveRecord::Base - attr_accessible :changesets_count, :watchers_count, :project_id, :project_type + attr_accessible :changesets_count, :watchers_count, :project_id, :project_type,:grade belongs_to :project belongs_to :watchers belongs_to :changesets From 23c9d5381e34fc46a73e7f66aa5af5edd0b6216a Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Wed, 6 Aug 2014 14:41:22 +0800 Subject: [PATCH 33/45] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=A1=AB=E5=86=99=E4=BF=A1=E6=81=AF=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E4=BF=9D=E7=95=99=20=E4=BF=AE=E6=94=B9=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E8=A7=81=E9=9D=A2=E4=BC=81=E4=B8=9A=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=A7=93=E3=80=81=E5=90=8D=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E9=94=99=E8=AF=AFBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 13 ++++++-- app/views/account/register.html.erb | 44 +++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 085ee0c60..c05d1172c 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -102,7 +102,14 @@ class AccountController < ApplicationController # User self-registration def register # @root_path="/home/pdl/redmine-2.3.2-0/apache2/" -# +# + @cache_identityy = params[:identity]||"" #身份 + @cache_no = params[:no]||"" #学号 + @cache_technical_title = params[:technical_title]||"" #教师职称 + @cache_province = params[:province]||"" #省份 + @cache_city = params[:city]||"" #城市 + @cache_enterprise_name = params[:enterprise_name]||"" #企业 + (redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration] if request.get? session[:auth_source_registration] = nil @@ -112,8 +119,8 @@ class AccountController < ApplicationController @user = User.new @user.safe_attributes = user_params if params[:identity] == "2" # 2 企业 - @user.firstname = params[:enterprise_name] - @user.lastname = l(:field_enterprise) + #@user.firstname = params[:enterprise_name] + #@user.lastname = l(:field_enterprise) end @user.admin = false @user.register diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index 260d53744..21c8c11b9 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -193,7 +193,40 @@ From 0eca547ec55c87c1a2c02f3f1f4de2cc06035b5e Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 6 Aug 2014 15:03:43 +0800 Subject: [PATCH 34/45] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=81=E7=89=88=E6=9C=AC=E5=BA=93=3D=E3=80=8B=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=B7=AE=E5=88=AB=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E6=96=87=E4=BB=B6=E6=88=96=E4=BF=AE=E8=AE=A2?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=97=B6=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 12 +++++++++++- lib/tasks/project_score.rake | 0 .../app/controllers/code_review_controller.rb | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 lib/tasks/project_score.rake diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 5274bb105..ef4c9b061 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -206,8 +206,15 @@ class RepositoriesController < ApplicationController @repository.committer_ids = params[:committers].values.inject({}) {|h, c| h[c.first] = c.last; h} flash[:notice] = l(:notice_successful_update) redirect_to settings_project_path(@project, :tab => 'repositories') + elsif request.get? + respond_to do |format| + format.html{ + render :layout => "project_base" + } end + + end end def destroy @@ -414,7 +421,10 @@ class RepositoriesController < ApplicationController Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}-#{current_language}") unless read_fragment(@cache_key) @diff = @repository.diff(@path, @rev, @rev_to) - show_error_not_found unless @diff + unless @diff + show_error_not_found + return + end end @changeset = @repository.find_changeset_by_name(@rev) diff --git a/lib/tasks/project_score.rake b/lib/tasks/project_score.rake new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/redmine_code_review/app/controllers/code_review_controller.rb b/plugins/redmine_code_review/app/controllers/code_review_controller.rb index 33f5a203a..83a2602fd 100644 --- a/plugins/redmine_code_review/app/controllers/code_review_controller.rb +++ b/plugins/redmine_code_review/app/controllers/code_review_controller.rb @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class CodeReviewController < ApplicationController + layout "project_base" unloadable before_filter :find_project, :authorize, :find_user, :find_setting, :find_repository From 22335b23a66d5f068128012256664302c761b42c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 6 Aug 2014 15:10:53 +0800 Subject: [PATCH 35/45] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E7=94=B3=E8=AF=B7=E9=A1=B9=E7=9B=AE=E6=97=B6?= =?UTF-8?q?=E5=9C=A8=E7=94=B3=E8=AF=B7=E5=88=97=E8=A1=A8=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84BUG=20#1180?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/members_helper.rb | 7 +++++-- app/views/files/_course_show_all_attachment.html.erb | 2 +- app/views/messages/_course_show.html.erb | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index 134b7c007..ecfb097e9 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -53,10 +53,13 @@ module MembersHelper # 当前申请加入的成员名单 def render_principals_for_applied_members(project) - scope = Principal.active.sorted.applied_members(project).like(params[:q]) + scope = project.applied_projects.map(&:user) principal_count = scope.count principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page'] - principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all + offset ||= principal_pages.offset + principals = scope[offset, 10] + #principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all + #principals = ApplicationController.new.paginateHelper scope,10 s = content_tag('div', principals_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals') diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb index f94ddc20b..8f6fbc395 100644 --- a/app/views/files/_course_show_all_attachment.html.erb +++ b/app/views/files/_course_show_all_attachment.html.erb @@ -21,7 +21,7 @@ <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> - + diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 243406a3c..4db903b88 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -104,6 +104,8 @@ <%= textilizable(@topic, :content) %> <%= link_to_attachments @topic, :author => false %> + <%# options = {:author => true, :deletable => @topic.author.eql?(User.current)} %> + <%#= render :partial => 'attachments/app_link', :locals => {:attachments => @topi.attachments, :options => options} %>