From 7bab135ac795e69001cc7fa89c8d90dae8260efc Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 5 Jun 2015 10:25:58 +0800 Subject: [PATCH 1/7] =?UTF-8?q?1=E3=80=81=E4=B8=8A=E4=BC=A0=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=97=B6=E5=85=AC=E5=BC=80=E5=8D=95=E9=80=89=E6=A1=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=202=E3=80=81=E8=AF=BE=E7=A8=8B=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6=E6=9C=89=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_file.html.erb | 2 +- public/stylesheets/courses.css | 2 -- public/stylesheets/project.css | 2 -- public/stylesheets/public.css | 1 + 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index ebccfcaf4..8283e15b7 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -31,7 +31,7 @@ } showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before(""); + $('#ajax-modal').before(""); $('#ajax-modal').parent().css("top","").css("left",""); $('#ajax-modal').parent().addClass("popbox_polls"); } diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 7d4436704..bbc6f5b55 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -380,8 +380,6 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;} .attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} .attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } a.remove-upload:hover {text-decoration:none !important;} -.attachments_fields input.is_public_checkbox {width:20px;} - .attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;} a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 6cba7011f..a32a050d7 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -241,8 +241,6 @@ blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;} #attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} #attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } a.remove-upload:hover {text-decoration:none !important;} -#attachments_fields input.is_public_checkbox {width:20px;} - #attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;} a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 306520f96..59431b3ad 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -438,3 +438,4 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} .tl{text-align: left;} img{max-width: 100%;} .attachments {clear: both;} +.is_public_checkbox{margin-left: 15px;margin-right: 10px;} From bf653fa94f37ec0fa0391167532cb814bc429e56 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 5 Jun 2015 10:31:51 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/index.html.erb | 2 +- public/javascripts/course.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 1cd665569..c9e8cd4c6 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -36,7 +36,7 @@ <% if @show_all%> - 搜索 + 搜索 <% end%> <% if @is_teacher%>
diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 0570ec437..74dceddc1 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -793,7 +793,7 @@ function SearchByName(obj,url,event) location.href = url + "&name=" + obj.val(); } } -function SearchByName(obj,url) +function SearchByName_1(obj,url) { location.href = url + "&name=" + obj.val(); } From c31e370ad62db1330dc298a058fbd49247f41544 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 5 Jun 2015 10:37:24 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=9A=E9=80=89=E4=BA=BA=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E3=80=81=E9=80=89=E5=85=A5=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E8=AF=BE=E7=A8=8B=E5=BC=B9=E5=87=BA=E6=A1=86?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/quote_resource_show.js.erb | 2 +- public/javascripts/course.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/files/quote_resource_show.js.erb b/app/views/files/quote_resource_show.js.erb index fa1f8f4ca..76025fbd2 100644 --- a/app/views/files/quote_resource_show.js.erb +++ b/app/views/files/quote_resource_show.js.erb @@ -6,6 +6,6 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); -$('#ajax-modal').before(""); +$('#ajax-modal').before(""); $('#ajax-modal').parent().css("top","").css("left",""); $('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 74dceddc1..b629530f0 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -757,8 +757,8 @@ function goTopEx() { } } -//匿评评分提示 $(function(){ + //匿评评分提示 $(".student_score_info").bind("mouseover",function(e){ //alert($(this).html()); $(this).find("div").show(); @@ -769,6 +769,8 @@ $(function(){ //alert($(this).html()); $(this).find("div").hide(); }); + + $("#about_project label").eq(1).remove(); }); //匿评弹框取消按钮 @@ -797,7 +799,3 @@ function SearchByName_1(obj,url) { location.href = url + "&name=" + obj.val(); } - -$(function(){ - $("#about_project label").eq(1).remove(); -}); \ No newline at end of file From 9d1100a9dfb0a6a56915ffc5602d54eb3ba628da Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 5 Jun 2015 10:50:43 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=86=85=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E9=80=89=E4=BA=BA=E6=88=91=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_project_file_new.html.erb | 2 +- app/views/files/quote_resource_show_project.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/files/_project_file_new.html.erb b/app/views/files/_project_file_new.html.erb index 1e217f991..878e6a75e 100644 --- a/app/views/files/_project_file_new.html.erb +++ b/app/views/files/_project_file_new.html.erb @@ -5,7 +5,7 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => project}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before(""); + $('#ajax-modal').before(""); $('#ajax-modal').parent().css("top","40%").css("left","36%"); $('#ajax-modal').parent().addClass("popbox_polls"); } diff --git a/app/views/files/quote_resource_show_project.js.erb b/app/views/files/quote_resource_show_project.js.erb index d1a44e90f..41dc19fc5 100644 --- a/app/views/files/quote_resource_show_project.js.erb +++ b/app/views/files/quote_resource_show_project.js.erb @@ -6,6 +6,6 @@ showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); -$('#ajax-modal').before(""); +$('#ajax-modal').before(""); $('#ajax-modal').parent().css("top","30%").css("left","35%"); $('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file From 8b0eb21d0828b7948a6a9056d94a3d5aea2ef2d6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 5 Jun 2015 11:17:00 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=96=E6=B6=88=EF=BC=8C=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=BF=9B=E5=85=A5=E4=B8=AA=E4=BA=BA=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 84 ++++++++++++++--------------- lib/redmine.rb | 4 +- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0382e7be0..23053a48e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -25,7 +25,7 @@ class UsersController < ApplicationController menu_item :user_course, :only => :user_courses menu_item :user_homework, :only => :user_homeworks menu_item :user_project, :only => [:user_projects, :watch_projects] - menu_item :requirement_focus, :only => :watch_bids + # menu_item :requirement_focus, :only => :watch_bids menu_item :requirement_focus, :only => :watch_contests menu_item :user_newfeedback, :only => :user_newfeedback @@ -36,14 +36,14 @@ class UsersController < ApplicationController # before_filter :can_show_course, :only => [:user_courses,:user_homeworks] - before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info, + before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_contests, :info, :user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index, :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,:update_score,:user_activities,:user_projects_index] #edit has been deleted by huang, 2013-9-23 before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, - :watch_bids, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, + :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :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,:user_projects_index] before_filter :auth_user_extension, only: :show @@ -141,25 +141,25 @@ class UsersController < ApplicationController ##added by fq def watch_bids - cond = 'bids.reward_type <> 1' - @bids = Bid.watched_by(@user).where('reward_type = ?', 1) # added by huang - @offset, @limit = api_offset_and_limit({:limit => 10}) - @bid_count = @bids.count - @bid_pages = Paginator.new @bid_count, @limit, params['page'] - @offset ||= @bid_pages.reverse_offset - unless @offset == 0 - @bid = @bids.offset(@offset).limit(@limit).all.reverse - else - limit = @bid_count % @limit - @bid = @bids.offset(@offset).limit(limit).all.reverse - end - - respond_to do |format| - format.html { - render :layout => 'base_users' - } - format.api - end + # cond = 'bids.reward_type <> 1' + # @bids = Bid.watched_by(@user).where('reward_type = ?', 1) # added by huang + # @offset, @limit = api_offset_and_limit({:limit => 10}) + # @bid_count = @bids.count + # @bid_pages = Paginator.new @bid_count, @limit, params['page'] + # @offset ||= @bid_pages.reverse_offset + # unless @offset == 0 + # @bid = @bids.offset(@offset).limit(@limit).all.reverse + # else + # limit = @bid_count % @limit + # @bid = @bids.offset(@offset).limit(limit).all.reverse + # end + # + # respond_to do |format| + # format.html { + # render :layout => 'base_users' + # } + # format.api + # end end #new add by linchun @@ -215,24 +215,24 @@ class UsersController < ApplicationController # added by huang def user_homeworks - @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current)) - @memberships = [] - @membership.each do |membership| - if membership.project.project_type == 1 - @memberships << membership - end - end - @bid = [] - @memberships.each do |membership| - @bid += membership.project.homeworks - end - @bid = @bid.group_by {|bid| bid.courses.first.id} - unless User.current.admin? - if !@user.active? - render_404 - return - end - end + # @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current)) + # @memberships = [] + # @membership.each do |membership| + # if membership.project.project_type == 1 + # @memberships << membership + # end + # end + # @bid = [] + # @memberships.each do |membership| + # @bid += membership.project.homeworks + # end + # @bid = @bid.group_by {|bid| bid.courses.first.id} + # unless User.current.admin? + # if !@user.active? + # render_404 + # return + # end + # end end @@ -757,7 +757,7 @@ class UsersController < ApplicationController when '3' then @obj = Issue.find_by_id(@obj_id) when '4' then - @obj = Bid.find_by_id(@obj_id) + # @obj = Bid.find_by_id(@obj_id) when '5' then @obj = Forum.find_by_id(@obj_id) when '6' @@ -800,7 +800,7 @@ class UsersController < ApplicationController when '3' then @obj = Issue.find_by_id(@obj_id) when '4' then - @obj = Bid.find_by_id(@obj_id) + # @obj = Bid.find_by_id(@obj_id) when '5' then @obj = Forum.find_by_id(@obj_id) when '6' diff --git a/lib/redmine.rb b/lib/redmine.rb index 60488b8d0..ba0fd0cee 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -451,7 +451,7 @@ Redmine::MenuManager.map :user_enterprise_menu do |menu| menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.host_name} - menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user} + # menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user} menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user} end @@ -459,7 +459,7 @@ Redmine::MenuManager.map :user_menu_self do |menu| menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.host_name } menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.host_user} menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.host_name} - menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user} + # menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user} menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user} end From f466084a17ab9d14956bd2bf2f31f45d22f636ec Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 5 Jun 2015 11:22:38 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=9C=B0=E5=8C=BA=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=B0=B1=E4=B8=8D=E6=98=BE=E7=A4=BA=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 269017eb8..0ebdea211 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -218,7 +218,7 @@ <% end %> - <% unless @user.user_extensions.nil?&&@user.user_extensions.location.empty?%> + <% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%> From 427553d4e5b03ef789a682928f7ed42a4c49d9bb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 5 Jun 2015 13:56:13 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=80=81=E5=B8=88=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E3=80=81=E5=AD=A6=E7=94=9F=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=97=B6=E5=88=A0=E9=99=A4=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=B2=A1=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 8 ++++---- app/views/layouts/base_users.html.erb | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index ec0480c19..353108dc7 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -216,13 +216,13 @@ class AttachmentsController < ApplicationController if @attachment.container.is_a?(News) format.html { redirect_to_referer_or news_path(@attachment.container) } elsif @attachment.container.is_a?(StudentWorksScore) - @is_destroy = true #根据ID删除页面对应的数据,js刷新页面 + @is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面 format.js elsif @attachment.container.is_a?(HomeworkCommon) - @is_destroy = true #根据ID删除页面对应的数据,js刷新页面 + @is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面 format.js elsif @attachment.container.is_a?(StudentWork) - @is_destroy = true #根据ID删除页面对应的数据,js刷新页面 + @is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面 format.js elsif @attachment.container.is_a?(Message) format.html { redirect_to_referer_or new_board_message_path(@attachment.container) } @@ -246,7 +246,7 @@ class AttachmentsController < ApplicationController end format.js - end + end end def delete_homework diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 0ebdea211..5686c9a1b 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -220,7 +220,6 @@ <% end %> <% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%> - <%= l(:label_location) %>: