Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
Tim 2016-10-08 17:38:57 +08:00
commit f1e7e54816
6 changed files with 17 additions and 7 deletions

View File

@ -418,7 +418,7 @@ class CoursesService
course.send(:safe_attributes=, params[:course], current_user)
#course.safe_attributes = params[:course]
#course.password = params[:course][:password]
course.syllabus_id = params[:syllabus_id].to_i
#course.syllabus_id = params[:syllabus_id].to_i
course.time = params[:time]
course.term = params[:term]
course.end_time = params[:end_time]

View File

@ -166,13 +166,13 @@
<% else%>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">
<a href="<%=url_for(:controller => 'users', :action => 'user_courselist',:id=>@user.id)%>" class=" f14 c_blue02">
TA的课程
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.visible.count%>)</span>
</a>
</div>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">
<a href="<%=url_for(:controller => 'users', :action => 'user_projectlist',:id=>@user.id)%>" class=" f14 c_blue02">
TA的项目
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.visible.count%>)</span>
</a>

View File

@ -1,6 +1,6 @@
<% if @polls.empty? %>
alert('您目前其他课程无问卷可导入');
alert('您的其它班级下没有问卷可供导入');
<% else %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>');

View File

@ -42,7 +42,9 @@
<% else %>
<a href="javascript:void(0)" class="fr sy_btn_grey mr5" title="该老师已在本课程下创建了班级,不能删除">删除</a>
<% end %>
<% if i != 0 && i < count - 1 %>
<% if i == 0 && count == 1 %>
&nbsp;
<% elsif i != 0 && i < count - 1 %>
<%= link_to('下移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'down'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '下移') %>
<%= link_to('上移', {:controller => 'syllabus_member', :action => 'update_rank', :id => member.id, :syllabus => @syllabus.id, :opr => 'up'},:remote => true, :method => 'post', :class => "fr sy_btn_blue mr5", :title => '上移') %>
<% elsif i < count - 1 %>

View File

@ -13,11 +13,11 @@
<div id="sy_tab_con_3">
<div class="sy_new_tablebox clear">
<%= render :partial => 'syllabus_member_list' %>
<% if User.current == @syllabus.user %>
<% if User.current == @syllabus.user || User.current.admin? %>
<a href="javascript:void(0);" class="fl sy_btn_green" onclick="toggle_search();">添加成员</a>
<% end %>
</div>
<% if User.current == @syllabus.user %>
<% if User.current == @syllabus.user || User.current.admin? %>
<div class="sy_new_tchbox clear <%= @show == 1 ? '' : 'undis' %>" id="sy_search_box">
<%= form_tag url_for(:controller => 'syllabus_member', :action => 'create', :syllabus => @syllabus),:id => 'syllabus_member_add_form', :remote => true do |f|%>
<input hidden="hidden" value="true" name="flag">

View File

@ -5,6 +5,14 @@
$(function() {
sd_create_editor_from_data(<%= @syllabus.id %>, null, "100%", "<%= @syllabus.class.to_s %>");
showNormalImage('syllabus_description_<%= @syllabus.id %>');
$("#syllabus_description_<%= @syllabus.id%> p,#syllabus_description_<%= @syllabus.id%> span,#syllabus_description_<%= @syllabus.id%> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
autoUrl('syllabus_description_<%= @syllabus.id %>');
});
</script>