Merge branch 'develop' into cxt_course

This commit is contained in:
cxt 2016-01-29 18:20:58 +08:00
commit e8bed9c4e1
52 changed files with 628 additions and 240 deletions

View File

@ -34,6 +34,12 @@ class AtController < ApplicationController
find_homework(id)
when 'Topic'
find_topic(id)
when 'JournalsForMessage'
find_journals_for_message(id)
when 'Principal'
find_principal(id)
when 'All'
nil
else
nil
end
@ -120,7 +126,11 @@ class AtController < ApplicationController
#JournalsForMessage
def find_journals_for_message(id)
jounrnal = JournalsForMessage.find(id)
find_at_users(jounrnal.jour_type, jounrnal.jour_id)
if jounrnal.jour_type == 'Principal'
[jounrnal.user] + (JournalsForMessage.where(m_reply_id: id).map(&:user) || [])
else
find_at_users(jounrnal.jour_type, jounrnal.jour_id)
end
end
#Poll
@ -129,8 +139,6 @@ class AtController < ApplicationController
#Journal
def find_journal(id)
journal = Journal.find(id)
find_at_users(journal.journalized_type, journal.journalized_id)
end
#Document
@ -145,7 +153,6 @@ class AtController < ApplicationController
#Principal
def find_principal(id)
end
#BlogComment

View File

@ -55,8 +55,8 @@ class BlogCommentsController < ApplicationController
if params[:in_act]
redirect_to user_path(params[:user_id])
else
if params[:is_homepage]
redirect_to user_blogs_path(params[:user_id])
if @article.id.eql?(User.find(params[:user_id]).blog.homepage_id)
redirect_to user_path(params[:user_id])
else
redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
end

View File

@ -109,7 +109,8 @@ class OrgSubfieldsController < ApplicationController
if SubfieldSubdomainDir.find_by_sql(sql).count == 0
if @org_subfield.subfield_subdomain_dir
@sub_dir = @org_subfield.subfield_subdomain_dir
@sub_dir.update_attribute(:name, params[:sub_dir_name])
@sub_dir = SubfieldSubdomainDir.update(@sub_dir.id, :name => params[:sub_dir_name])
#@sub_dir.update_attribute(:name, params[:sub_dir_name])
else
@sub_dir = SubfieldSubdomainDir.create(:org_subfield_id => @org_subfield.id, :name => params[:sub_dir_name])
end

View File

@ -302,7 +302,7 @@ class OrganizationsController < ApplicationController
def org_resources_subfield
@org = Organization.find(params[:id])
if params[:send_type].present? and params[:send_type] == 'news'
if params[:send_type].present? and (params[:send_type] == 'news' or params[:send_type] == 'message')
@subfield = @org.org_subfields.where("field_type = 'Post'")
else
@subfield = @org.org_subfields.where('field_type = "Resource" ')

View File

@ -1854,16 +1854,6 @@ class UsersController < ApplicationController
def share_news_to_project
news = News.find(params[:send_id])
project_ids = params[:project_ids]
# project_ids.each do |project_id|
# if Project.find(project_id).news.map(&:id).exclude?(news.id)
# project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now)
# news.attachments.each do |attach|
# project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
# :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
# :is_public => attach.is_public, :quotes => 0)
# end
# end
# end
project_ids.each do |project_id|
project = Project.find(project_id)
if project.news.map(&:id).exclude?(news.id)
@ -1889,6 +1879,53 @@ class UsersController < ApplicationController
OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'News', :org_act_id => org_news.id, :user_id => User.current.id)
end
def share_message_to_course
@message = Message.find(params[:send_id])
course_ids = params[:course_ids]
course_ids.each do |course_id|
course = Course.find(course_id)
if course.news.map(&:id).exclude?(@message.id)
message = Message.create(:board_id => course.boards.first.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
@message.attachments.each do |attach|
message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
:downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
:is_public => attach.is_public, :quotes => 0)
end
end
end
end
def share_message_to_project
@message = Message.find(params[:send_id])
project_ids = params[:project_ids]
project_ids.each do |project_id|
project = Project.find(project_id)
if project.news.map(&:id).exclude?(@message.id)
message = Message.create(:board_id => project.boards.first.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
@message.attachments.each do |attach|
message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
:downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
:is_public => attach.is_public, :quotes => 0)
end
end
end
end
def share_message_to_org
field_id = params[:subfield]
@message = Message.find(params[:send_id])
@message.quotes = @message.quotes.nil? ? 1 : (@message.quotes + 1)
@message.save
board = OrgSubfield.find(field_id).boards.first
mes = Message.create(:board_id => board.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
@message.attachments.each do |attach|
mes.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
:downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
:is_public => attach.is_public, :quotes => 0)
end
OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'Message', :org_act_id => mes.id, :user_id => User.current.id)
end
def change_org_subfield
end
@ -2130,9 +2167,9 @@ class UsersController < ApplicationController
end
elsif params[:type] == "4" #附件
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc")
end
elsif params[:type] == "5" #用户资源
if User.current.id.to_i == params[:id].to_i
@ -2238,7 +2275,7 @@ class UsersController < ApplicationController
@user = User.current
if !params[:search].nil? #发送到有栏目类型为资源的组织中
search = "%#{params[:search].to_s.strip.downcase}%"
if params[:send_type].present? and params[:send_type] == 'news'
if params[:send_type].present? and (params[:send_type] == 'news' or params[:send_type] == 'message')
@orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Post'").count > 0}
else
@orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}

View File

@ -51,7 +51,7 @@ module ApplicationHelper
def link_to_user_version(version, options = {})
return '' unless version && version.is_a?(Version)
link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => " f16 fb c_dblue "
link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, :class => "linkBlue"
end
# 判断课程是否为精品课程

View File

@ -47,7 +47,11 @@ class AtMessage < ActiveRecord::Base
"回复帖子: "
end + at_message.subject
when 'JournalsForMessage'
"作业: #{at_message.jour.name} 中留言"
if at_message.jour_type == 'Principal'
"留言: 在#{at_message.at_user.show_name}主页中留言"
else
"作业: #{at_message.jour.name} 中留言"
end
else
logger.error "error type: #{at_message_type}"
end
@ -92,7 +96,12 @@ class AtMessage < ActiveRecord::Base
when 'Message'
{controller: :boards, action: :show, project_id: at_message.board.project, id: at_message.board}
when 'JournalsForMessage'
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
if at_message.jour_type == 'Principal'
{controller: :users, action: :user_messages, id: at_message.at_user}
else
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
end
else
logger.error "error type: #{at_message_type}"
end

View File

@ -1,4 +1,5 @@
class SubfieldSubdomainDir < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :org_subfield
validates_exclusion_of :name, :in => %w(setting members org_document_comments)
end

View File

@ -185,20 +185,6 @@
}
function org_id_click(){
var sendText = $("input[name='org_id']:checked").next().text();
var orgDirection = "目标地址:"
$(".orgDirection").text(orgDirection + sendText);
}
function subfield_click(){
var sendText = $("input[name='org_id']:checked").next().text();
var orgDirection = "目标地址:"
var sendColumn = $("input[name='subfield']:checked").next().text();
$(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
}
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({

View File

@ -5,7 +5,7 @@
<div class="fl">
<ul>
<li class="navHomepageMenu fl">
<%= link_to "首页",user_activities_path(User.current.id), :class => "c_white f16 db p10"%>
<%= link_to "首页",user_activities_path(User.current.id), :class => "c_white f16 db p10", :title => "回到个人首页"%>
</li>
<li class="navHomepageMenu fl">
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>User.current.id,:type=>1)%>" class="c_white f16 db p10">资源库</a></li>
@ -102,7 +102,7 @@
</div>
<div class="navHomepageNews">
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank" %>
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
<% if User.current.count_new_message >0 %>
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
<% end %>

View File

@ -60,7 +60,7 @@
) if @message.course_destroyable_by?(User.current) %>
</li>
<% end %>
<li> <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
</ul>
</li>
</ul>
@ -175,4 +175,4 @@
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
</script>
</script>

View File

@ -58,7 +58,7 @@
}
$(function() {
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>");
init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>");
showNormalImage('message_description_<%= @topic.id %>');
});
</script>
@ -68,7 +68,7 @@
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
</div>
<div class="postThemeWrap">
<% if @message.org_subfield_editable_by?(User.current) %>
<% if User.current.logged? %>
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
@ -89,6 +89,7 @@
:class => 'postOptionLink'
) if @message.org_subfield_editable_by?(User.current) %>
</li>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');",:class => 'postOptionLink'%></li>
<!--<li> <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>-->
</ul>
</li>
@ -204,4 +205,4 @@
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
</script>
</script>

View File

@ -115,7 +115,7 @@
) if @message.destroyable_by?(User.current) %>
</li>
<% end %>
<li> <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %></li>
</ul>
</li>
</ul>

View File

@ -178,20 +178,6 @@
}
function org_id_click(){
var sendText = $("input[name='org_id']:checked").next().text();
var orgDirection = "目标地址:"
$(".orgDirection").text(orgDirection + sendText);
}
function subfield_click(){
var sendText = $("input[name='org_id']:checked").next().text();
var orgDirection = "目标地址:"
var sendColumn = $("input[name='subfield']:checked").next().text();
$(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
}
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({

View File

@ -1,11 +1,6 @@
<% if @exist == false %>
<% if @exist == false and @sub_dir.valid? %>
$('#sub_dir_show_<%= @org_subfield.id %>').html('<%= @sub_dir.name %>');
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @sub_dir.name %>');
// $('#sub_dir_show_<%= @org_subfield.id %>').show();
// $('#sub_dir_edit_<%= @org_subfield.id %>').hide();
<% else %>
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @org_subfield.subfield_subdomain_dir.nil? ? '': @org_subfield.subfield_subdomain_dir.name %>');
// alert("该目录已存在,请重新输入");
// $('#sub_dir_edit_<%#= @org_subfield.id %>').find('input').val('<%#= @org_subfield.subfield_subdomain_dir.nil? ? "未设置":@org_subfield.subfield_subdomain_dir.name %>');
// $('#sub_dir_edit_<%#= @org_subfield.id %>').focus();
<% end %>

View File

@ -13,7 +13,6 @@
<% end %>
TO
<%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%>
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.board.org_subfield.name %>(项目讨论区)</a>-->
</div>
<div class="homepagePostTitle break_word">
<% if activity.parent_id.nil? %>
@ -44,6 +43,31 @@
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<% if User.current.logged? %>
<ul class="homepagePostSettiongText">
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'message')") %></li>
<li>
<%= link_to(
l(:button_edit),
{:controller => 'messages', :action => 'edit', :id => activity, :board_id => activity.board_id},
:class => 'postOptionLink'
) if activity.org_subfield_editable_by?(User.current) %>
</li>
<li>
<%= delete_link(
{:controller => 'messages', :action => 'destroy', :id => activity, :board_id => activity.board_id},
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if activity.org_subfield_editable_by?(User.current) %>
</li>
</ul>
<% end %>
</li>
</ul>
</div>
</div>
<div class="cl"></div>
</div>

View File

@ -30,14 +30,15 @@
</li>
<li class=" mb5 ml80">
<label >公开&nbsp;&nbsp;</label>
<input id="organization_is_public" name="organization[is_public]" type="checkbox" value="1" checked="checked">
<input id="organization_is_public" name="organization[is_public]" onblur="disable_down($(this), $('#organization_alow_download'), $('#allow_down_hint'));" type="checkbox" value="1" checked="checked">
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)</span>
<div class="cl"></div>
</li>
<li class=" mb5" style="margin-left:40px; ">
<label >允许游客下载:</label>
<input id="organization_alow_download" name="organization[allow_guest_download]" type="checkbox" value="1" checked="checked">
<input id="organization_alow_download" name="organization[allow_guest_download]" type="checkbox" value="1" checked="checked">
<span class="c_grey">(打钩为允许游客下载文件)</span>
<span class="c_green f12" id="allow_down_hint"></span>
<div class="cl"></div>
</li>
<li class=" ml125" >

View File

@ -63,11 +63,12 @@
</div>
<div class="cl"></div>
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span>
<input type="checkbox" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
<input type="checkbox" id="is_public" onblur="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
</div>
<div class="orgRow mb10 mt5"><span style="margin-left:10px;">下载支持&nbsp;: </span>
<input type="checkbox" style="margin-top:5px;" name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
<input id="allow_download" type="checkbox" style="margin-top:5px;" <%= @organization.is_public? ? "":"DISABLED" %> name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
&nbsp;<span>允许游客下载</span>
<span class="c_green f12" id="allow_down_hint"><%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %></span>
</div>
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org(<%=@organization.id %>);">保存</a>
<% end %>
@ -187,4 +188,13 @@
$("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入");
}
}
// $(document).ready(function(){
// if ( $("#is_public").attr("checked") != true){
// alert($(this).attr("checked"));
// $("#allow_download").attr("checked", false);
// $("#allow_download").attr("disabled", true);
// $("#allow_down_hint").html("");
// }
// });
</script>

View File

@ -59,9 +59,9 @@
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="width150"><%=x["result"]%></span>
<span class="width150"><pre><%=x["result"]%></pre></span>
<span class="w60">正确输出:</span>
<span class="width150"><%=x["output"]%></span>
<span class="width150"><pre><%=x["output"]%></pre></span>
<div class="cl"></div>
<% else %>
<span class="w150 c_green">测试正确!</span>

View File

@ -3,7 +3,7 @@
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<span class="re_tag f_l" style="cursor:pointer"> <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<a title="<%= obj.container_type == 'Course' ? '双击可编辑' : '' %> " ondblclick="rename_tag($(this),'<%= tag %>',<%= obj.id%>,<%= object_flag%>);"><%= tag %></a>
<a title="双击可编辑" ondblclick="rename_tag($(this),'<%= tag %>',<%= obj.id%>,<%= object_flag%>);"><%= tag %></a>
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
<% case object_flag %>
<% when '10' %>

View File

@ -79,9 +79,7 @@
) if activity.course_destroyable_by?(User.current) %>
</li>
<% end %>
<li>
<%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %>
</li>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
</ul>
</li>
</ul>

View File

@ -0,0 +1,13 @@
<a href="javascript:void(0);" class="CloseBtn" title="关闭弹框"></a>
<div class="ni_con">
<p id="switch_homework_type_notice" class="fontGrey">
</p>
<div class="ni_btn">
<a href="javascript:" class="tijiao" id="switch_type" style="margin-bottom: 20px;" >
继&nbsp;&nbsp;续
</a>
<a href="javascript:" class="tijiao" id="cancel_switch" style="margin-bottom: 20px;">
取&nbsp;&nbsp;消
</a>
</div>
</div>

View File

@ -12,7 +12,8 @@
:minHeight=>100,
:input_html => { :id => 'jour_content',
:class => 'talk_text fl',
:maxlength => 5000 }%>
:maxlength => 5000 }
%>
<div class="cl"></div>
<p id="jour_content_span"></p>
</li>

View File

@ -52,7 +52,7 @@
</div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<%# 局部刷新修改xissue属性 %>
<% if is_project_manager?(User.current, activity.project) %>
<% if User.current.member_of?(activity.project) %>
<% unless params[:action] == "index" %>
<div id="div_user_issue_detail_<%=activity.id %>">
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>

View File

@ -1,115 +1,115 @@
<script>
$(document).ready(function(){
$(".pro_info_p,.proInfoP").mouseover(function(){
$(this).children(".pic_edit2").css("display","inline-block");
});
$(".pro_info_p,.proInfoP").mouseout(function(){
$(this).children(".pic_edit2").css("display","none");
});
$(".pic_edit2").click(function(){
$(this).parent().hide();
$(this).parent().next().show();
});
$(".issueEdit").blur(function(){
$(this).hide();
$(this).prev().show();
var editValue = $(this).children("option:selected").text();
$(this).prev().children(":first").text(editValue);
});
function stopPropagation(e) {
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
};
$(document).bind('click',function(){
$('.issueEdit').css('display','none');
$('.proInfoP,.pro_info_p').show();
});
$('.issueEdit,.pic_edit2').bind('click',function(e){
stopPropagation(e);
});
});
function remote_function(id) {
$(id).submit();
}
</script>
<div class="cl"></div>
<div class="proInfoBox2 mb10 mt10">
<ul class="fl">
<%#= labelled_fields_for :issue, @issue do |f| %>
<%#= f.select :status_id, ([["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0])),
{:include_blank => false, :selected => @status_id ? @status_id : 0 },
{:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %>
<%# end %>
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
<li>
<p class="label03">&nbsp;状态&nbsp;&nbsp;:&nbsp;</p>
<p class="proInfoP"><span><%= activity.status.name %></span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a></p>
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{:include_blank => false, :selected => @status_id ? @status_id : 0 },
{:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"}
)
%>
</li>
<% end %>
<div class="cl"></div>
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
<li>
<p class="label03">&nbsp;指派&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p">
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %>
<a href="javascript:void(0)" class="pic_edit2 ml5" style="vertical-align:top;"></a></span>
<%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project),
{ :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0},
{:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"}) %>
</li>
<% end %>
<div class="cl"></div>
</ul>
<ul class="fl">
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
<li>
<p class="label03">&nbsp;优先级&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:70px;"><span><%= activity.priority.name %></span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a> </span>
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
{:include_blank => false,:selected=>@priority_id ? @priority_id : 0},
{:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %>
</li>
<% end %>
<div class="cl"></div>
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
<li>
<p class="label03">&nbsp;完成度&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:70px;"><span><%= activity.done_ratio %>%</span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a> </span>
<%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
{:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %>
<% end %>
</li>
<div class="cl"></div>
</ul>
<ul class="fl ">
<li>
<p class="label03" style="width:50px;">&nbsp;开始&nbsp;&nbsp;:&nbsp;</p>
<p class="proInfoP" style="width:100px;"><span><%= format_date(activity.start_date) %></span></p>
</li>
<div class="cl"></div>
<li>
<p class="label03" style="width:50px;">&nbsp;周期&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:100px;"><%= l_hours(activity.estimated_hours) %></span> </li>
<div class="cl"></div>
</ul>
<ul class="fl ml20">
<li>
<p class="label03">&nbsp;计划完成&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:120px;"><span><%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %></span></span> </li>
<div class="cl"></div>
<li>
<p class="label03">&nbsp;目标版本&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:120px;"><%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %> </span> </li>
<div class="cl"></div>
</ul>
<!--pro_info_box end-->
<script>
$(document).ready(function(){
$(".pro_info_p,.proInfoP").mouseover(function(){
$(this).children(".pic_edit2").css("display","inline-block");
});
$(".pro_info_p,.proInfoP").mouseout(function(){
$(this).children(".pic_edit2").css("display","none");
});
$(".pic_edit2").click(function(){
$(this).parent().hide();
$(this).parent().next().show();
});
$(".issueEdit").blur(function(){
$(this).hide();
$(this).prev().show();
var editValue = $(this).children("option:selected").text();
$(this).prev().children(":first").text(editValue);
});
function stopPropagation(e) {
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
};
$(document).bind('click',function(){
$('.issueEdit').css('display','none');
$('.proInfoP,.pro_info_p').show();
});
$('.issueEdit,.pic_edit2').bind('click',function(e){
stopPropagation(e);
});
});
function remote_function(id) {
$(id).submit();
}
</script>
<div class="cl"></div>
<div class="proInfoBox2 mb10 mt10">
<ul class="fl">
<%#= labelled_fields_for :issue, @issue do |f| %>
<%#= f.select :status_id, ([["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0])),
{:include_blank => false, :selected => @status_id ? @status_id : 0 },
{:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %>
<%# end %>
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %>
<li>
<p class="label03">&nbsp;状态&nbsp;&nbsp;:&nbsp;</p>
<p class="proInfoP"><span><%= activity.status.name %></span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a></p>
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{:include_blank => false, :selected => @status_id ? @status_id : 0 },
{:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit",:style=>"white-space:nowrap; overflow:hidden;"}
)
%>
</li>
<% end %>
<div class="cl"></div>
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
<li>
<p class="label03">&nbsp;指派&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p" style="width:130px;">
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:100px; display:inline-block;" %>
<a href="javascript:void(0)" class="pic_edit2 ml5" style="vertical-align:top;"></a></span>
<%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project),
{ :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0},
{:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"undis issueEdit", :style => "width:130px;"}) %>
</li>
<% end %>
<div class="cl"></div>
</ul>
<ul class="fl">
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
<li>
<p class="label03">&nbsp;优先级&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:70px;"><span><%= activity.priority.name %></span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a> </span>
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
{:include_blank => false,:selected=>@priority_id ? @priority_id : 0},
{:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %>
</li>
<% end %>
<div class="cl"></div>
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
<li>
<p class="label03">&nbsp;完成度&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:70px;"><span><%= activity.done_ratio %>%</span> <a href="javascript:void(0)" class="pic_edit2 ml5"></a> </span>
<%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
{:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %>
<% end %>
</li>
<div class="cl"></div>
</ul>
<ul class="fl ">
<li>
<p class="label03" style="width:50px;">&nbsp;开始&nbsp;&nbsp;:&nbsp;</p>
<p class="proInfoP" style="width:70px;"><span><%= format_date(activity.start_date) %></span></p>
</li>
<div class="cl"></div>
<li>
<p class="label03" style="width:50px;">&nbsp;周期&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:70px;"><%= l_hours(activity.estimated_hours) %></span> </li>
<div class="cl"></div>
</ul>
<ul class="fl ml20">
<li>
<p class="label03">&nbsp;计划完成&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:100px;"><span><%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %></span></span> </li>
<div class="cl"></div>
<li>
<p class="label03">&nbsp;目标版本&nbsp;&nbsp;:&nbsp;</p>
<span class="proInfoP" style="width:100px;"><%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %> </span> </li>
<div class="cl"></div>
</ul>
<!--pro_info_box end-->
</div>

View File

@ -71,9 +71,7 @@
) if activity.destroyable_by?(User.current) %>
</li>
<% end %>
<li>
<%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %>
</li>
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
</ul>
</li>
</ul>

View File

@ -0,0 +1,56 @@
<div class="boxContainer">
<div>
<div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');">
<option value="1">课程</option>
<option value="2">项目</option>
<option value="3">组织</option>
</select>
</div>
<div class="cl"></div>
</div>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div class="fl">
<%= form_tag search_user_course_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入课程ID或者名称搜索" class="searchResourcePopup" />
<script>
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','message')
</script>
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
<% end %>
</div>
<%= form_tag share_message_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %>
<div>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<div class="courseReferContainer">
<% if !courses.empty? %>
<% courses.each do |course| %>
<ul class="courseSend">
<li class="" style="display:inline-block">
<input name="course_ids[]" type="checkbox" value="<%= course.id %>" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName"><%= truncate(course.name,:lendght=>25) + '['+course.time.to_s+course.term + ']'%></li>
</ul>
<% end %>
</div>
</div>
<div>
<div class="courseSendSubmit">
<!--<a href="javascript:void(0);" class="sendSourceText">确定</a>-->
<%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %>
</div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText mt10" onclick="hideModal();">取消</a></div>
</div>
<div class="cl"></div>
<% end %>
</div>

View File

@ -0,0 +1,59 @@
<div >
<div class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');">
<option value="1">课程</option>
<option value="2">项目</option>
<option value="3" selected>组织</option>
</select>
</div>
<%= form_tag search_user_org_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" name="serach" id="search_org_input" value="<%=@search %>" placeholder="输入名称搜索" class="orgSendSearch mt15" />
<script>
observeSearchfieldOnInput('search_org_input','<%= search_user_org_user_path(user)%>','<%= send_id %>','<%= send_ids%>','message')
</script>
<% end %>
<div class="cl"></div>
</div>
<%= form_tag share_message_to_org_user_path(user),:remote=>true,:id=>'orgs_list_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<div class="sectionWrap fl mr15">
<ul class="fontGrey3 sectionContent">
<% unless @orgs.empty? %>
<% @orgs.each do |org|%>
<li>
<label>
<input type="radio" name="org_id" value="<%= org.id%>" onchange="change_org_subfield('<%= org_resources_subfield_organization_path(:id=>org.id,:send_type => params[:send_type])%>')" class="mt3 fl mr5" />
<span><%= org.name%></span></label>
</li>
<%end%>
<%end%>
</ul>
</div>
<div class="columnWrap">
<ul class="columnContent">
<!--<span class="fontBlue pl10">请在左侧选择要转发的位置</span>-->
<!--<li style="background-color:#f1f1f1; color:#555555; padding-top:2px; padding-bottom:2px;">请选择栏目:</li>-->
<%= render :partial => 'users/org_resources_subfield',:locals => {:subfield=>nil}%>
<!--<li>-->
<!--<label>-->
<!--<input type="radio" name="sendColumn" class="mt3 fl mr5" />-->
<!--<span>动态</span></label>-->
<!--</li>-->
</ul>
</div>
<div class="cl"></div>
<div class="orgDirection mb10 break_word" style="white-space: nowrap;-o-text-overflow:ellipsis;text-overflow: ellipsis;overflow: hidden">目标地址:</div>
<div class="courseSendSubmit mr15">
<%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();',:onclick=>"check_des(event);" %>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" onclick="hideModal();" class="sendSourceText">取消</a>
</div>
<div class="cl"></div>
<%end %>

View File

@ -0,0 +1,53 @@
<div class="boxContainer">
<div>
<div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','message');">
<option value="1">课程</option>
<option value="2" selected>项目</option>
<option value="3">组织</option>
</select>
</div>
<div class="cl"></div>
</div>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div class="fl">
<%= form_tag search_user_project_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" id="search_project_input" value="<%= @search %>" name="search" placeholder="输入项目ID或者名称搜索" class="searchResourcePopup" />
<script>
observeSearchfieldOnInput('search_project_input','<%= search_user_project_user_path(user)%>','<%= send_id %>','<%= send_ids %>','message')
</script>
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
<% end %>
</div>
<%= form_tag share_message_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %>
<div>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<div class="courseReferContainer">
<% if !projects.empty? %>
<% projects.each do |project| %>
<ul class="courseSend">
<li class="" style="display:inline-block">
<input name="project_ids[]" type="checkbox" value="<%= project.id %>" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName"><%= project.name%></li>
</ul>
<% end %>
</div>
</div>
<div>
<div class="courseSendSubmit">
<!--<a href="javascript:void(0);" class="sendSourceText">确定</a>-->
<%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %>
</div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a></div>
</div>
<div class="cl"></div>
<% end %>
</div>

View File

@ -6,11 +6,16 @@
</div>
<div class="fl">
<p class="homepageImageName mb5 hidden" style="max-width:88px;font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;"><%= user %></p>
<span class="homepageImageSex"></span>
<% if (user.user_extensions && (user.user_extensions.identity != 2) ) %>
<span class="<%= user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></span>
<% end %>
<!--<span class="homepageImageSex"></span>-->
<div class="cl"></div>
<p class="mb8 c_dark f14">
<span class="mr15 hidden fl ml15" style="max-width:90px;"><%= user.show_name %></span>
<%= user.user_extensions.technical_title %>
<% if user.user_extensions && user.user_extensions.identity %>
<%= get_user_roll(user) %>
<% end %>
</p>
</div>
<div class="cl"></div>

View File

@ -16,7 +16,7 @@
<p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计。</p>
</div>
<div class="courseSendSubmit">
<a href="javascript:void(0);" class="group_btn sendSourceText">确定</a>
<a href="javascript:void(0);" class="group_save_btn sendSourceText">确定</a>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText linkGrey6" id="cancel_group">取消</a>

View File

@ -72,11 +72,15 @@
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
<%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr15",:title=>"请从资源库中选择文件作为作品的附件",:remote => true%>
<% if defined?(has_program) && has_program %>
<a href="javascript:void(0);" class="ProBtn fl mt3" title="请设置编程语言和输入测试集">编程</a>
<span class="fl C_lgrey mt3 program_detail_info mr15"></span>
<div id="program_setting" class="fl">
<a href="javascript:void(0);" class="ProBtn fl mt3"title="请设置编程语言和输入测试集">编程</a>
<span class="fl C_lgrey mt3 program_detail_info mr15"></span>
</div>
<% end %>
<% if defined?(has_group) && has_group %>
<a href="javascript:void(0);" class="groupBtn fl mt3" title="请设置分组作业的相关参数">分组</a>
<div id="group_setting" class="fl">
<a href="javascript:void(0);" class="groupBtn fl mt3" title="请设置分组作业的相关参数">分组</a>
</div>
<% end %>
</div>

View File

@ -9,9 +9,11 @@
} else {
$("#anonymous_comment").attr('checked',false);
}
$("#BluePopupBox a.BlueCirBtn").click();
<% if edit_mode && homework.is_program_homework? %>
$("#BluePopupBox a.BlueCirBtn").click();
<% end %>
<% if edit_mode && homework.is_group_homework? %>
$("#GroupPopupBox a.group_btn").click();
$("#GroupPopupBox a.group_save_btn").click();
<% end %>
});
function checked_val() {
@ -141,4 +143,10 @@
<div class="BluePopupBox" style="display:none;" id="GroupPopupBox">
<%= render :partial => 'users/user_group_attr', :locals => {:edit_mode => edit_mode, :homework=>homework}%>
</div>
</div>
<% unless edit_mode %>
<div class="BluePopupBox" style="display:none;" id="NoticePopupBox">
<%= render :partial => 'users/homework_type_notice', :locals => {:edit_mode => edit_mode, :homework=>homework}%>
</div>
<% end %>

View File

@ -42,7 +42,7 @@
<% if activity.user == User.current || User.current.admin?%>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<li class="<%= activity.private == 1 ? 'whiteSettingIcon' : 'homepagePostSettingIcon' %>">
<ul class="homepagePostSettiongText">
<li>
<%= link_to(l(:label_bid_respond_delete),

View File

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<%#= javascript_include_tag "init_KindEditor","user" %>
<% end %>
<style type="text/css">

View File

@ -12,7 +12,7 @@
<%= ma.content %>
</li>
<li class="homepageHomeworkContentWarn fl">
<%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请",
<%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"申请已批准",
agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ),
:id => "agree_apply_subdomain_#{ma.id}",
:method => 'post',

View File

@ -22,9 +22,9 @@
<! if(results[i]["status"]!=0){ !>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><!=results[i]["result"]!></span>
<span class="W200"><pre><!=results[i]["result"]!></pre></span>
<span class="w60">正确输出:</span>
<span class="W200"><!=results[i]["output"]!></span>
<span class="W200"><pre><!=results[i]["output"]!></pre></span>
<div class="cl"></div>
</li>
<!}else{!>
@ -121,9 +121,9 @@
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><%=x["result"]%></span>
<span class="W200"><pre><%=x["result"]%></pre></span>
<span class="w60">正确输出:</span>
<span class="W200"><%=x["output"]%></span>
<span class="W200"><pre><%= x["output"] %></pre></span>
<div class="cl"></div>
</li>
<% else %>

View File

@ -11,8 +11,10 @@
//$("#upload_box").css('display','block');
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% else %>
<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_popup' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% elsif params[:send_type] == 'message' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();

View File

@ -1,7 +1,9 @@
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% else %>
<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% elsif params[:send_type] == 'message' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();

View File

@ -1,7 +1,9 @@
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
<% else %>
<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
<% elsif params[:send_type] == 'message' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();

View File

@ -0,0 +1,2 @@
hideModal();
alert("发送成功!");

View File

@ -0,0 +1,2 @@
hideModal();
alert("发送成功!");

View File

@ -0,0 +1,2 @@
hideModal();
alert("发送成功!");

View File

@ -17,9 +17,9 @@
<! if(results[i]["status"]!=0){ !>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><!=results[i]["result"]!></span>
<span class="W200"><pre><!=results[i]["result"]!></pre></span>
<span class="w60">正确输出:</span>
<span class="W200"><!=results[i]["output"]!></span>
<span class="W200"><pre><!=results[i]["output"]!></pre></span>
<div class="cl"></div>
</li>
<!}else{!>
@ -95,9 +95,9 @@
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><%=x["result"]%></span>
<span class="W200"><pre><%=x["result"]%></pre></span>
<span class="w60">正确输出:</span>
<span class="W200"><%=x["output"]%></span>
<span class="W200"><pre><%=x["output"]%></pre></span>
<div class="cl"></div>
</li>
<% else %>

View File

@ -542,6 +542,9 @@ RedmineApp::Application.routes.draw do
post 'share_news_to_course'
post 'share_news_to_project'
post 'share_news_to_org'
post 'share_message_to_course'
post 'share_message_to_project'
post 'share_message_to_org'
get 'resource_preview'
get 'rename_resource'
get 'search_user_project'
@ -1128,6 +1131,7 @@ RedmineApp::Application.routes.draw do
match "/system_log" ,:to => 'system_log#index'
match 'system_log/clear'
get 'upload_files_menu', :to => 'files#upload_files_menu'
get '/manual/feedback', to:redirect("http://forge.trustie.net/forums/1/memos/1168")
##ended by lizanle
resources :git_callback do

View File

@ -1862,6 +1862,25 @@ ActiveRecord::Schema.define(:version => 20160128024452) do
add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade"
add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count"
create_table "user_wechats", :force => true do |t|
t.integer "subscribe"
t.string "openid"
t.string "nickname"
t.integer "sex"
t.string "language"
t.string "city"
t.string "province"
t.string "country"
t.string "headimgurl"
t.string "subscribe_time"
t.string "unionid"
t.string "remark"
t.integer "groupid"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "users", :force => true do |t|
t.string "login", :default => "", :null => false
t.string "hashed_password", :limit => 40, :default => "", :null => false
@ -1937,6 +1956,14 @@ ActiveRecord::Schema.define(:version => 20160128024452) do
t.datetime "updated_at", :null => false
end
create_table "wechat_logs", :force => true do |t|
t.string "openid", :null => false
t.text "request_raw"
t.text "response_raw"
t.text "session_raw"
t.datetime "created_at", :null => false
end
create_table "wiki_content_versions", :force => true do |t|
t.integer "wiki_content_id", :null => false
t.integer "page_id", :null => false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -1032,6 +1032,7 @@ function subfield_click(){
$(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
}
//send_type:发送的类型file对应文件message对应帖子news对应通知或新闻
function observeSearchfieldOnInput(fieldId, url,send_id,send_ids, send_type) {
$('#'+fieldId).each(function() {
var $this = $(this);
@ -1107,6 +1108,7 @@ function show_send(id, user_id, send_type){
//id 发送的id
//发送的id数组
//send_type:发送的类型file对应文件message对应帖子news对应通知或新闻
function chooseSendType(res_id,res_ids, user_id, send_type){
sendType = $(".resourcesSendType").val();
@ -1135,3 +1137,17 @@ function chooseSendType(res_id,res_ids, user_id, send_type){
}
lastSendType = sendType;
}
//组织新建和配置中选择组织为私有后disbled掉允许游客下载选项
function disable_down(source, des, hint){
if (source.attr("checked")){
des.attr("disabled", false);
hint.html("");
}
else{
des.attr("checked", false);
des.attr("disabled", true);
hint.html("(私有组织不允许游客下载资源)");
}
}

View File

@ -10,16 +10,16 @@ function sd_create_editor(params){
resizeType : 1,minWidth:"1px",width:"94%",
height:"33px",// == undefined ? "30px":paramsHeight+"px",
minHeight:"33px",// == undefined ? "30px":paramsHeight+"px",
width:params.width,
items:['emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload'],
'|','imagedirectupload','more'],
afterChange:function(){//按键事件
var edit = this.edit;
var body = edit.doc.body;
edit.iframe.height(paramsHeight);
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight));
//this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight));
},
afterBlur:function(){
//params.toolbar_container.hide();

View File

@ -106,7 +106,46 @@ $(function(){
$('a.pic_date').on('click', function(){
$(this).parent().prev().first().focus();
})
$("#NoticePopupBox").dialog({
modal: true,
autoOpen: false,
dialogClass: 'BluePopupBox',
minWidth: 500
});
$('#NoticePopupBox').parent().resizable("disable");
$('#NoticePopupBox').parent().removeClass("ui-state-disabled");
$('#NoticePopupBox').parent().css("border","3px solid #269ac9").css("padding","10px");
$('a#switch_type').live('click', function(){
if($("input[name=homework_type]").val() == "3"){
$("#NoticePopupBox" ).dialog("close");
$("input[name=homework_type]").val(1);
$('span.group_detail_info').text('');
$("#group_setting a").removeClass("fontBlue2");
$("#BluePopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.CloseBtn").on('click', function(){
$("#BluePopupBox" ).dialog("close");
});
$('#textarea_input_test').focus();
} else if($("input[name=homework_type]").val() == "2") {
$("#NoticePopupBox" ).dialog("close");
$("input[name=homework_type]").val(1);
$('span.program_detail_info').text("");
$("span.program_detail_info").removeClass("fontBlue2");
$("#program_setting a").removeClass("fontBlue2");
$("#GroupPopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.popClose").on('click', function(){
$("#GroupPopupBox" ).dialog("close");
});
$("#cancel_group").on('click', function(){
$("#GroupPopupBox" ).dialog("close");
});
$('#min_num').focus();
}
});
$("#BluePopupBox").dialog({
modal: true,
@ -120,12 +159,25 @@ $(function(){
$('#BluePopupBox').parent().css("position","fixed");
$('a.ProBtn').live('click', function(){
$("#BluePopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.CloseBtn").on('click', function(){
$("#BluePopupBox" ).dialog("close");
});
$('#textarea_input_test').focus();
if($("input[name=homework_type]").val() == "3"){
$("#NoticePopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.CloseBtn").on('click', function(){
$("#NoticePopupBox" ).dialog("close");
});
$("#cancel_switch").on('click', function(){
$("#NoticePopupBox" ).dialog("close");
});
$("#switch_homework_type_notice").text("您的作业类型将改为“分组作业”,并且您的编程设置将被清除。请问是否继续?");
}
else {
$("#BluePopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.CloseBtn").on('click', function(){
$("#BluePopupBox" ).dialog("close");
});
$('#textarea_input_test').focus();
}
});
var saveProgramAnswers = function() {
@ -162,7 +214,9 @@ $(function(){
if (valid) {
$("input[name=homework_type]").val(2);
$('span.program_detail_info').text('('+language+''+test_numbers/2+'组测试)');
$('span.program_detail_info').text('('+language+'语言,'+test_numbers/2+'组测试)');
$("span.program_detail_info").addClass("fontBlue2");
$("#program_setting a").addClass("fontBlue2");
//保存js值
var data = {
language_type: $('select.language_type').val(),
@ -213,15 +267,28 @@ $(function(){
$('#GroupPopupBox').parent().css("border","3px solid #269ac9").css("padding","10px");
$('a.groupBtn').live('click', function(){
$("#GroupPopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.popClose").on('click', function(){
$("#GroupPopupBox" ).dialog("close");
});
$("#cancel_group").on('click', function(){
$("#GroupPopupBox" ).dialog("close");
});
$('#min_num').focus();
if($("input[name=homework_type]").val() == "2"){
$("#NoticePopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.CloseBtn").on('click', function(){
$("#NoticePopupBox" ).dialog("close");
});
$("#cancel_switch").on('click', function(){
$("#NoticePopupBox" ).dialog("close");
});
$("#switch_homework_type_notice").text("您的作业类型将改为“编程作业”,并且您的分组设置将被清除。请问是否继续?");
}
else {
$("#GroupPopupBox").dialog("open");
$(".ui-dialog-titlebar").hide();
$("a.popClose").on('click', function () {
$("#GroupPopupBox").dialog("close");
});
$("#cancel_group").on('click', function () {
$("#GroupPopupBox").dialog("close");
});
$('#min_num').focus();
}
});
var saveGroupAttr = function() {
@ -245,6 +312,7 @@ $(function(){
if (valid) {
$("input[name=homework_type]").val(3);
$('span.group_detail_info').text('分组人数:'+min+'-'+max+' 人');
$("#group_setting a").addClass("fontBlue2");
//保存js值
var data = {
base_on_project: base_on_project,
@ -259,7 +327,7 @@ $(function(){
return valid;
};
$("#GroupPopupBox a.group_btn").live('click', function(){
$("#GroupPopupBox a.group_save_btn").live('click', function(){
if(saveGroupAttr()){
if($( "#GroupPopupBox" ).dialog( "isOpen" )){
$("#GroupPopupBox").dialog( "close" );

View File

@ -195,6 +195,7 @@ a.c_green{ color:#28be6c;}
.fontBlue {color:#3498db;}
a.underline {text-decoration:underline;}
a.fontBlue {color:#297fb8;}
.fontBlue2 {color:#269ac9 !important;}
a.fontGrey {color:#cecece;}
a.fontGrey2 {color:#888888;}
a.linkOrange {color:#ff7143;}
@ -1456,3 +1457,6 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;}
.popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;}
.subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;}
.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;}
.whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}

View File

@ -225,6 +225,7 @@ a.c_green{ color:#28be6c;}
.fontGrey3 {color:#484848;}
.fontGrey4{color:#999999;}
.fontBlue {color:#3498db;}
.fontBlue2 {color:#269ac9 !important;}
a.underline {text-decoration:underline;}
a.fontBlue {color:#297fb8;}
a.fontGrey {color:#cecece;}
@ -1040,3 +1041,6 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectContent {color:#888888; line-height:18px; font-size:12px;}
.popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;}
.subjectContent p,.subjectContent div,.subjectContent em, .subjectContent span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important; color:#888888 !important; font-size:12px !important;}
.whiteSettingIcon {background:url(../images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;}
.whiteSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}