Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
64251f1093
|
@ -216,13 +216,13 @@ class AttachmentsController < ApplicationController
|
||||||
if @attachment.container.is_a?(News)
|
if @attachment.container.is_a?(News)
|
||||||
format.html { redirect_to_referer_or news_path(@attachment.container) }
|
format.html { redirect_to_referer_or news_path(@attachment.container) }
|
||||||
elsif @attachment.container.is_a?(StudentWorksScore)
|
elsif @attachment.container.is_a?(StudentWorksScore)
|
||||||
@is_destroy = true #根据ID删除页面对应的数据,js刷新页面
|
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面
|
||||||
format.js
|
format.js
|
||||||
elsif @attachment.container.is_a?(HomeworkCommon)
|
elsif @attachment.container.is_a?(HomeworkCommon)
|
||||||
@is_destroy = true #根据ID删除页面对应的数据,js刷新页面
|
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面
|
||||||
format.js
|
format.js
|
||||||
elsif @attachment.container.is_a?(StudentWork)
|
elsif @attachment.container.is_a?(StudentWork)
|
||||||
@is_destroy = true #根据ID删除页面对应的数据,js刷新页面
|
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面
|
||||||
format.js
|
format.js
|
||||||
elsif @attachment.container.is_a?(Message)
|
elsif @attachment.container.is_a?(Message)
|
||||||
format.html { redirect_to_referer_or new_board_message_path(@attachment.container) }
|
format.html { redirect_to_referer_or new_board_message_path(@attachment.container) }
|
||||||
|
@ -246,7 +246,7 @@ class AttachmentsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_homework
|
def delete_homework
|
||||||
|
|
|
@ -25,7 +25,7 @@ class UsersController < ApplicationController
|
||||||
menu_item :user_course, :only => :user_courses
|
menu_item :user_course, :only => :user_courses
|
||||||
menu_item :user_homework, :only => :user_homeworks
|
menu_item :user_homework, :only => :user_homeworks
|
||||||
menu_item :user_project, :only => [:user_projects, :watch_projects]
|
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 :requirement_focus, :only => :watch_contests
|
||||||
menu_item :user_newfeedback, :only => :user_newfeedback
|
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 :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,
|
: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_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]
|
: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
|
#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,
|
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,
|
: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_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]
|
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index]
|
||||||
before_filter :auth_user_extension, only: :show
|
before_filter :auth_user_extension, only: :show
|
||||||
|
@ -141,25 +141,25 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
##added by fq
|
##added by fq
|
||||||
def watch_bids
|
def watch_bids
|
||||||
cond = 'bids.reward_type <> 1'
|
# cond = 'bids.reward_type <> 1'
|
||||||
@bids = Bid.watched_by(@user).where('reward_type = ?', 1) # added by huang
|
# @bids = Bid.watched_by(@user).where('reward_type = ?', 1) # added by huang
|
||||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
# @offset, @limit = api_offset_and_limit({:limit => 10})
|
||||||
@bid_count = @bids.count
|
# @bid_count = @bids.count
|
||||||
@bid_pages = Paginator.new @bid_count, @limit, params['page']
|
# @bid_pages = Paginator.new @bid_count, @limit, params['page']
|
||||||
@offset ||= @bid_pages.reverse_offset
|
# @offset ||= @bid_pages.reverse_offset
|
||||||
unless @offset == 0
|
# unless @offset == 0
|
||||||
@bid = @bids.offset(@offset).limit(@limit).all.reverse
|
# @bid = @bids.offset(@offset).limit(@limit).all.reverse
|
||||||
else
|
# else
|
||||||
limit = @bid_count % @limit
|
# limit = @bid_count % @limit
|
||||||
@bid = @bids.offset(@offset).limit(limit).all.reverse
|
# @bid = @bids.offset(@offset).limit(limit).all.reverse
|
||||||
end
|
# end
|
||||||
|
#
|
||||||
respond_to do |format|
|
# respond_to do |format|
|
||||||
format.html {
|
# format.html {
|
||||||
render :layout => 'base_users'
|
# render :layout => 'base_users'
|
||||||
}
|
# }
|
||||||
format.api
|
# format.api
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
#new add by linchun
|
#new add by linchun
|
||||||
|
@ -215,24 +215,24 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# added by huang
|
# added by huang
|
||||||
def user_homeworks
|
def user_homeworks
|
||||||
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
# @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||||
@memberships = []
|
# @memberships = []
|
||||||
@membership.each do |membership|
|
# @membership.each do |membership|
|
||||||
if membership.project.project_type == 1
|
# if membership.project.project_type == 1
|
||||||
@memberships << membership
|
# @memberships << membership
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
@bid = []
|
# @bid = []
|
||||||
@memberships.each do |membership|
|
# @memberships.each do |membership|
|
||||||
@bid += membership.project.homeworks
|
# @bid += membership.project.homeworks
|
||||||
end
|
# end
|
||||||
@bid = @bid.group_by {|bid| bid.courses.first.id}
|
# @bid = @bid.group_by {|bid| bid.courses.first.id}
|
||||||
unless User.current.admin?
|
# unless User.current.admin?
|
||||||
if !@user.active?
|
# if !@user.active?
|
||||||
render_404
|
# render_404
|
||||||
return
|
# return
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -757,7 +757,7 @@ class UsersController < ApplicationController
|
||||||
when '3' then
|
when '3' then
|
||||||
@obj = Issue.find_by_id(@obj_id)
|
@obj = Issue.find_by_id(@obj_id)
|
||||||
when '4' then
|
when '4' then
|
||||||
@obj = Bid.find_by_id(@obj_id)
|
# @obj = Bid.find_by_id(@obj_id)
|
||||||
when '5' then
|
when '5' then
|
||||||
@obj = Forum.find_by_id(@obj_id)
|
@obj = Forum.find_by_id(@obj_id)
|
||||||
when '6'
|
when '6'
|
||||||
|
@ -800,7 +800,7 @@ class UsersController < ApplicationController
|
||||||
when '3' then
|
when '3' then
|
||||||
@obj = Issue.find_by_id(@obj_id)
|
@obj = Issue.find_by_id(@obj_id)
|
||||||
when '4' then
|
when '4' then
|
||||||
@obj = Bid.find_by_id(@obj_id)
|
# @obj = Bid.find_by_id(@obj_id)
|
||||||
when '5' then
|
when '5' then
|
||||||
@obj = Forum.find_by_id(@obj_id)
|
@obj = Forum.find_by_id(@obj_id)
|
||||||
when '6'
|
when '6'
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
}
|
}
|
||||||
showModal('ajax-modal', '513px');
|
showModal('ajax-modal', '513px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
$('#ajax-modal').parent().css("top","").css("left","");
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => project}) %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => project}) %>');
|
||||||
showModal('ajax-modal', '513px');
|
showModal('ajax-modal', '513px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
|
|
||||||
showModal('ajax-modal', '513px');
|
showModal('ajax-modal', '513px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
$('#ajax-modal').parent().css("top","").css("left","");
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -6,6 +6,6 @@
|
||||||
|
|
||||||
showModal('ajax-modal', '513px');
|
showModal('ajax-modal', '513px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
$('#ajax-modal').parent().css("top","30%").css("left","35%");
|
$('#ajax-modal').parent().css("top","30%").css("left","35%");
|
||||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -218,9 +218,8 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% unless @user.user_extensions.nil?&&@user.user_extensions.location.empty?%>
|
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style=" float: right" width="70px">
|
<td style=" float: right" width="70px">
|
||||||
<span style="float: right"> <%= l(:label_location) %>:</span>
|
<span style="float: right"> <%= l(:label_location) %>:</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
</span>
|
</span>
|
||||||
<% if @show_all%>
|
<% if @show_all%>
|
||||||
<input type="text" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName($(this),'<%= student_work_index_path(:homework => @homework.id)%>',event);">
|
<input type="text" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName($(this),'<%= student_work_index_path(:homework => @homework.id)%>',event);">
|
||||||
<a class="student_work_search fl" onclick="SearchByName($(this).prev(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
|
<a class="student_work_search fl" onclick="SearchByName_1($(this).prev(),'<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
|
||||||
<% end%>
|
<% end%>
|
||||||
<% if @is_teacher%>
|
<% if @is_teacher%>
|
||||||
<div class="fr">
|
<div class="fr">
|
||||||
|
|
|
@ -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 :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}
|
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user}
|
||||||
|
|
||||||
end
|
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 :activity, {:controller => 'users', :action => 'show', :host => Setting.host_name }
|
||||||
menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.host_user}
|
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 :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}
|
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -757,8 +757,8 @@ function goTopEx() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//匿评评分提示
|
|
||||||
$(function(){
|
$(function(){
|
||||||
|
//匿评评分提示
|
||||||
$(".student_score_info").bind("mouseover",function(e){
|
$(".student_score_info").bind("mouseover",function(e){
|
||||||
//alert($(this).html());
|
//alert($(this).html());
|
||||||
$(this).find("div").show();
|
$(this).find("div").show();
|
||||||
|
@ -769,6 +769,8 @@ $(function(){
|
||||||
//alert($(this).html());
|
//alert($(this).html());
|
||||||
$(this).find("div").hide();
|
$(this).find("div").hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#about_project label").eq(1).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
//匿评弹框取消按钮
|
//匿评弹框取消按钮
|
||||||
|
@ -793,11 +795,7 @@ function SearchByName(obj,url,event)
|
||||||
location.href = url + "&name=" + obj.val();
|
location.href = url + "&name=" + obj.val();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function SearchByName(obj,url)
|
function SearchByName_1(obj,url)
|
||||||
{
|
{
|
||||||
location.href = url + "&name=" + obj.val();
|
location.href = url + "&name=" + obj.val();
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function(){
|
|
||||||
$("#about_project label").eq(1).remove();
|
|
||||||
});
|
|
|
@ -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 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; }
|
.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;}
|
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;}
|
.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;}
|
a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;}
|
||||||
|
|
|
@ -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 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; }
|
#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;}
|
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;}
|
#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;}
|
a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;}
|
||||||
|
|
|
@ -438,3 +438,4 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
|
||||||
.tl{text-align: left;}
|
.tl{text-align: left;}
|
||||||
img{max-width: 100%;}
|
img{max-width: 100%;}
|
||||||
.attachments {clear: both;}
|
.attachments {clear: both;}
|
||||||
|
.is_public_checkbox{margin-left: 15px;margin-right: 10px;}
|
||||||
|
|
Loading…
Reference in New Issue