commit
bdaa9983e3
@ -1,2 +1,72 @@
|
||||
# encoding: utf-8
|
||||
module SyllabusesHelper
|
||||
def get_syllabuses_by_tag(tag_name)
|
||||
Syllabus.tagged_with(tag_name).order('updated_at desc')
|
||||
end
|
||||
|
||||
def teacher_count syllabus
|
||||
count = 0
|
||||
courses = syllabus.courses
|
||||
unless courses.empty?
|
||||
courses.each do |c|
|
||||
count += TeacherAndAssistantCount c
|
||||
end
|
||||
end
|
||||
count
|
||||
end
|
||||
|
||||
def student_count syllabus
|
||||
count = 0
|
||||
courses = syllabus.courses
|
||||
unless courses.empty?
|
||||
courses.each do |c|
|
||||
count += studentCount c
|
||||
end
|
||||
end
|
||||
count
|
||||
end
|
||||
|
||||
def file_count syllabus
|
||||
count = 0
|
||||
courses = syllabus.courses
|
||||
unless courses.empty?
|
||||
courses.each do |c|
|
||||
count += visable_attachemnts_incourse(c).count
|
||||
end
|
||||
end
|
||||
count
|
||||
end
|
||||
|
||||
#课程性质下拉框
|
||||
def syllabus_type
|
||||
type = []
|
||||
option1 = []
|
||||
option2 = []
|
||||
option3 = []
|
||||
option4 = []
|
||||
option5 = []
|
||||
option6 = []
|
||||
|
||||
option1 << "请选择"
|
||||
option1 << 1
|
||||
option2 << "公共必修课"
|
||||
option2 << 2
|
||||
option3 << "学科必修课"
|
||||
option3 << 3
|
||||
option4 << "专业选修课"
|
||||
option4 << 4
|
||||
option5 << "实践必修课"
|
||||
option5 << 5
|
||||
option6 << "实践选修课"
|
||||
option6 << 6
|
||||
|
||||
type << option1
|
||||
type << option2
|
||||
type << option3
|
||||
type << option4
|
||||
type << option5
|
||||
type << option6
|
||||
|
||||
type
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,46 @@
|
||||
# encoding: utf-8
|
||||
class Syllabus < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
include ApplicationHelper
|
||||
acts_as_taggable
|
||||
acts_as_attachable
|
||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
|
||||
belongs_to :user
|
||||
has_many :courses
|
||||
attr_accessible :description, :title
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
attr_accessible :description, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
|
||||
safe_attributes 'title', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course'
|
||||
|
||||
def delete_kindeditor_assets
|
||||
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::SYLLABUS
|
||||
end
|
||||
|
||||
def syllabus_type_str
|
||||
case self.syllabus_type
|
||||
when 1
|
||||
type = "公共必修课"
|
||||
when 2
|
||||
type = "学科必修课"
|
||||
when 3
|
||||
type = "专业选修课"
|
||||
when 4
|
||||
type = "实践必修课"
|
||||
when 5
|
||||
type = "实践选修课"
|
||||
end
|
||||
type
|
||||
end
|
||||
|
||||
###添加回复
|
||||
def self.add_syllabus_jour(user, notes, id , options = {})
|
||||
syllabus = Syllabus.find(id)
|
||||
if options.count == 0
|
||||
jfm = syllabus.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0)
|
||||
else
|
||||
jfm = syllabus.journals_for_messages.build(options)
|
||||
end
|
||||
jfm.save
|
||||
jfm
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,58 @@
|
||||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?) %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :class => 'fr', :onclick => "show_edit_base_info();"%>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<li><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 %>
|
||||
<li><label>课程性质:</label><%=syllabus.syllabus_type_str %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.credit.nil? || syllabus.credit == '' %>
|
||||
<li><label>学分:</label><%=syllabus.credit %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.hours.nil? || syllabus.hours == '' %>
|
||||
<li><label>总学时:</label><%=syllabus.hours %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.theory_hours.nil? || syllabus.theory_hours == '' %>
|
||||
<li><label>理论学时:</label><%=syllabus.theory_hours %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.practice_hours.nil? || syllabus.practice_hours == '' %>
|
||||
<li><label>实践学时:</label><%=syllabus.practice_hours %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.applicable_major.nil? || syllabus.applicable_major == '' %>
|
||||
<li><label>适用专业:</label><%=syllabus.applicable_major %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.pre_course.nil? || syllabus.pre_course == '' %>
|
||||
<li><label>先修课程:</label><%=syllabus.pre_course %></li>
|
||||
<% end %>
|
||||
|
||||
<% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == '' %>
|
||||
<li class="none none_attr"><label>课程性质:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.credit.nil? || syllabus.credit == '' %>
|
||||
<li class="none none_attr"><label>学分:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.hours.nil? || syllabus.hours == '' %>
|
||||
<li class="none none_attr"><label>总学时:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.theory_hours.nil? || syllabus.theory_hours == '' %>
|
||||
<li class="none none_attr"><label>理论学时:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.practice_hours.nil? || syllabus.practice_hours == '' %>
|
||||
<li class="none none_attr"><label>实践学时:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.applicable_major.nil? || syllabus.applicable_major == '' %>
|
||||
<li class="none none_attr"><label>适用专业:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.pre_course.nil? || syllabus.pre_course == '' %>
|
||||
<li class="none none_attr"><label>先修课程:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?) %>
|
||||
<span class="homepageLeftMenuMore"><a href="javascript:void(0);" data-init="0" onclick="toggle_all_syllabus_attr();" class="homepageLeftMenuMoreIcon" id="show_all_syllabus_attr"></a></span>
|
||||
<% end %>
|
||||
<script>
|
||||
function show_edit_base_info() {
|
||||
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_edit_info', :locals => {:syllabus => @syllabus}) %>");
|
||||
}
|
||||
</script>
|
@ -0,0 +1,27 @@
|
||||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
||||
<%= form_for('syllabus',:url => update_base_info_syllabus_path(syllabus.id),:remote => true) do |f|%>
|
||||
<a href="javascript:void(0);" onclick="update_syllabus_info();" id="submit_edit_info" class="fr">保存</a>
|
||||
<!--<a href="javascript:void(0);" onclick="reset_syllabus_info();" id="submit_reset_info" class="fr mr10">取消</a>-->
|
||||
<div class="cl"></div>
|
||||
<li><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<li><label>课程性质:</label>
|
||||
<%= select_tag :syllabus_type,options_for_select(syllabus_type,syllabus.syllabus_type), {:id=>"syllabus_type_input", :class=>"syllabus_select"} %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li><label >学分:</label>
|
||||
<input id="syllabus_credit_input" class="syllabus_input_min fl" name="credit" placeholder="5" value="<%=syllabus.credit %>"> 学分
|
||||
<span class="none c_red ml5" id="syllabus_credit_notice">请输入正整数</span><div class="cl"></div>
|
||||
</li>
|
||||
<li><label>总学时:</label><input id="syllabus_hours_input" class="syllabus_input_min fl" name="hours" placeholder="50" value="<%=syllabus.hours %>"> 学时
|
||||
<span class="none c_red ml5" id="syllabus_hours_notice">请输入正整数</span><div class="cl"></div>
|
||||
</li>
|
||||
<li><label>理论学时:</label><input id="syllabus_theory_hours_input" class="syllabus_input_min fl" name="theory_hours" placeholder="10" value="<%=syllabus.theory_hours %>"> 学时
|
||||
<span class="none c_red ml5" id="syllabus_theory_hours_notice">请输入正整数</span><div class="cl"></div>
|
||||
</li>
|
||||
<li><label>实践学时:</label><input id="syllabus_practice_hours_input" class="syllabus_input_min fl" name="practice_hours" placeholder="5" value="<%=syllabus.practice_hours %>"> 学时
|
||||
<span class="none c_red ml5" id="syllabus_practice_hours_notice">请输入正整数</span><div class="cl"></div>
|
||||
</li>
|
||||
<li><label>适用专业:</label><input id="syllabus_applicable_major_input" class="syllabus_input fl" name="applicable_major" placeholder="UI设计" value="<%=syllabus.applicable_major %>"><div class="cl"></div></li>
|
||||
<li><label>选修课程:</label><input id="syllabus_pre_course_input" class="syllabus_input fl" name="pre_course" placeholder="工业设计史" value="<%=syllabus.pre_course %>"><div class="cl"></div></li>
|
||||
<% end %>
|
||||
</ul>
|
@ -0,0 +1,8 @@
|
||||
<% if syllabus.eng_name && !syllabus.eng_name.empty? %>
|
||||
<span><%= syllabus.eng_name %></span>
|
||||
<% else%>
|
||||
<span class="fontGrey">课程英文名称</span>
|
||||
<% end %>
|
||||
<% if User.current == syllabus.user %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_eng_name();"%>
|
||||
<% end %>
|
@ -0,0 +1,47 @@
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
<% end %>
|
||||
<div class="RightBanner" >
|
||||
<p >课程信息</p>
|
||||
</div>
|
||||
<div class="HomeWork">
|
||||
<p class="f16 mb10">课程信息</p>
|
||||
<div class="HomeWorkCon">
|
||||
<%= labelled_form_for @syllabus, :url =>syllabus_path(@syllabus),
|
||||
:html => {:nhname=>'form',:multipart => true, :id => 'syllabus-form'} do |f| %>
|
||||
<div>
|
||||
<div id="syllabus_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
|
||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
|
||||
<%= f.kindeditor :description, :editor_id => 'syllabus_description_editor',
|
||||
:owner_id => @syllabus.nil? ? 0: @syllabus.id,
|
||||
:owner_type => OwnerTypeHelper::SYLLABUS,
|
||||
:width => '100%',
|
||||
:height => 300,
|
||||
:minHeight=>300,
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'syllabus_content',
|
||||
:class => 'talk_text fl',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<div class="cl"></div>
|
||||
<p id="description_notice_span"></p>
|
||||
</div>
|
||||
|
||||
<div class="mt5">
|
||||
<div class="fl" id="syllabus_attachments">
|
||||
<%= render :partial => 'attachments/form_course', :locals => {:container => @syllabus, :isReply => false} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_syllabus();">发送</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="window.location.href = '<%=syllabus_path(@syllabus)%>';">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div><!--HomeWork end-->
|
@ -0,0 +1,3 @@
|
||||
$("#syllabus_eng_name_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus} %>");
|
||||
$("#syllabus_eng_name_show").show();
|
||||
$("#syllabus_eng_name_edit").hide();
|
@ -0,0 +1 @@
|
||||
<%= render :partial => 'syllabus_course_list'%>
|
@ -0,0 +1 @@
|
||||
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'syllabus_course_list') %>');
|
@ -0,0 +1,2 @@
|
||||
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_edit_info', :locals => {:syllabus => @syllabus}) %>");
|
||||
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus}) %>");
|
@ -0,0 +1,5 @@
|
||||
<div id="tags">
|
||||
<div id="tags_show">
|
||||
<%= render :partial => "tags/tag_syllabus_new_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,28 @@
|
||||
<% @tags = obj.reload.tag_list %>
|
||||
<% if non_list_all && @tags.size > 0 %>
|
||||
|
||||
<% else %>
|
||||
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
|
||||
<% if @tags.size > 0 %>
|
||||
<% @tags.each do |tag| %>
|
||||
<span class="re_tag f_l " id="tag">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
|
||||
<span class="del">
|
||||
<%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if obj.user == User.current %>
|
||||
</span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if User.current.logged?%>
|
||||
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();"><%= l(:label_add_tag)%></a>
|
||||
<span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
|
||||
<%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
|
||||
<%= f.text_field :name ,:id => "tags_name4",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
|
||||
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
|
||||
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
|
||||
<input type="button" class="submit f_l" onclick="$('#tags_name4').parent().submit();" />
|
||||
<% end %>
|
||||
</span>
|
||||
<% end%>
|
@ -0,0 +1,112 @@
|
||||
<div class="syllabus_box" id="course-list">
|
||||
<h2 class="syllabus_h2_top"><span class="icon_course fl mt7 mr5"></span>课程列表</h2>
|
||||
<div class="syllabus_category">
|
||||
<span class="grayTxt fl">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fl", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fl", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fl", :remote => true %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fl", :remote => true %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<% if @syllabus.any? %>
|
||||
<% @syllabus.each_with_index do |syllabus, index|%>
|
||||
<div class="syllabus_courses_box">
|
||||
<% courses = @courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS time").order("time desc") %>
|
||||
<div class="syllabus_courses_list">
|
||||
<div class="<%=index == 0 ? 'sy_courses_open' : 'sy_courses_close' %>">
|
||||
<span class="<%=index == 0 ? 'icons_sy_open' : 'icons_sy_close' %> fl mr5"></span>
|
||||
<h3 class="syllabus_courses_title fl"><%=syllabus.title %></h3>
|
||||
</div>
|
||||
<%=link_to '', syllabus_path(syllabus.id), :class => 'icons_sy_setting fr',:target => '_blank', :title => '查看课程' %>
|
||||
<p class="fl sy_p_grey">更新时间:<%=format_date syllabus.updated_at %>
|
||||
<span class="mr10"></span>创建老师:<%=syllabus.user.show_name %>
|
||||
<span class="mr10"></span>班级:<%=courses.count %>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="syllabus_class_box <%=index == 0 ? '' : 'none' %>">
|
||||
<ul id="syllabus_course_ul_<%=syllabus.id %>">
|
||||
<% unless courses.nil? %>
|
||||
<% courses.each_with_index do |course, i| %>
|
||||
<li class="syllabus_class_list <%=i > 2 ? 'none' : '' %>">
|
||||
<a href="<%=course_path(course.id) %>" target="_blank">
|
||||
<span class="icons_sy_cir "></span>
|
||||
<div class="fl">
|
||||
<div class="syllabus_class_w ">
|
||||
<p class="syllabus_class_title fl"><%=course.name %></p>
|
||||
<span class="fr sy_p_grey">主讲老师:<%=course.teacher.show_name %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="">
|
||||
<p class="fl grayTxt ">更新:<%=format_date(Time.at(course.time)) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
|
||||
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(@course).count %></span><span>资源</span></p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="icons_sy_arrow fl mt19 ml10" ></span>
|
||||
<div class="cl"></div>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if courses.count > 3 %>
|
||||
<li class="syllabus_class_list_more" id="syllabus_class_list_more_<%=syllabus.id %>">
|
||||
<a href="javascript:void(0);" id="expand_list_<%=syllabus.id %>" data-init="0" onclick="expand_course_list(<%=syllabus.id %>,'#syllabus_course_ul_<%=syllabus.id %> li','#expand_list_<%=syllabus.id %>',<%=courses.count %>)">共<%=courses.count %>个课程,点击全部展开</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div><!--syllabus_class_box end-->
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function() {
|
||||
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight) {
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".syllabus_box").height() + diffHeight;
|
||||
$(".syllabus_box").css("height", tmpHeight);
|
||||
}
|
||||
$(".sy_courses_open").toggle(function(){
|
||||
//$(this).hide();
|
||||
$(this).parent().next().hide();
|
||||
$(this).children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
|
||||
//$(this).parent().next().show();
|
||||
},function(){
|
||||
$(this).parent().next().show();
|
||||
$(this).children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close");
|
||||
});
|
||||
$(".sy_courses_close").toggle(function(){
|
||||
//$(this).hide();
|
||||
$(this).parent().next().show();
|
||||
$(this).children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close");
|
||||
//$(this).parent().next().show();
|
||||
},function(){
|
||||
$(this).parent().next().hide();
|
||||
$(this).children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
|
||||
});
|
||||
});
|
||||
</script>
|
@ -1 +1 @@
|
||||
<%= render :partial => 'users/user_course_list'%>
|
||||
<%= render :partial => 'users/user_syllabus_list'%>
|
||||
|
@ -1 +1 @@
|
||||
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_course_list') %>');
|
||||
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_syllabus_list') %>');
|
@ -1 +1 @@
|
||||
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user, :page => @page} )%>");
|
||||
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user,:type=>@type,:page => @page, :all_count => @all_count} )%>");
|
||||
|
@ -0,0 +1,12 @@
|
||||
class AddColumnToSyllabus < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :syllabuses, :eng_name, :string
|
||||
add_column :syllabuses, :type, :integer
|
||||
add_column :syllabuses, :credit, :integer
|
||||
add_column :syllabuses, :hours, :integer
|
||||
add_column :syllabuses, :theory_hours, :integer
|
||||
add_column :syllabuses, :practice_hours, :integer
|
||||
add_column :syllabuses, :applicable_major, :string
|
||||
add_column :syllabuses, :pre_course, :string
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddVisitsToSyllabus < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :syllabuses, :visits, :integer, :default => 0
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddDesStatusToSyllabus < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :syllabuses, :des_status, :integer, :default => 0
|
||||
end
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
class RenameSyllabusColumn < ActiveRecord::Migration
|
||||
def up
|
||||
rename_column :syllabuses, :type, :syllabus_type
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 21 KiB |
@ -0,0 +1,111 @@
|
||||
//显示更多的班级
|
||||
function show_more_course(url){
|
||||
$.get(
|
||||
url,
|
||||
{ page: $("#course_page_num").val() },
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function regex_sylla_description() {
|
||||
syllabus_description_editor.sync();
|
||||
var name = syllabus_description_editor.html();
|
||||
if (name.length == 0) {
|
||||
$("#description_notice_span").text("描述不能为空");
|
||||
$("#description_notice_span").css('color', '#ff0000');
|
||||
$("#description_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$("#description_notice_span").text("填写正确");
|
||||
$("#description_notice_span").css('color', '#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submit_syllabus() {
|
||||
if (regex_sylla_description()) {
|
||||
$("#syllabus-form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
//编辑英文名称
|
||||
function show_edit_eng_name() {
|
||||
$("#syllabus_eng_name_show").hide();
|
||||
$("#syllabus_eng_name_edit").show();
|
||||
$("#syllabus_eng_name_edit").focus();
|
||||
}
|
||||
|
||||
//编辑英文名称之后提交
|
||||
function edit_syllabus_eng_name(url){
|
||||
$.get(
|
||||
url,
|
||||
{ eng_name: $("#syllabus_eng_name_edit").val() },
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//编辑资源描述之后提交
|
||||
function edit_file_description(url,id){
|
||||
$.get(
|
||||
url,
|
||||
{id: id ,description: $("#file_description_edit_"+id).val() },
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//展开所有属性
|
||||
function toggle_all_syllabus_attr(){
|
||||
var btn = $("#show_all_syllabus_attr");
|
||||
var target = $("#all_syllabus_attr li");
|
||||
var none = $("#all_syllabus_attr li.none_attr");
|
||||
if(btn.data('init')=='0'){
|
||||
btn.data('init',1);
|
||||
btn.removeClass('homepageLeftMenuMoreIcon');
|
||||
btn.addClass('homepageLeftMenuHideIcon');
|
||||
target.show();
|
||||
}else{
|
||||
btn.data('init',0);
|
||||
btn.addClass('homepageLeftMenuMoreIcon');
|
||||
btn.removeClass('homepageLeftMenuHideIcon');
|
||||
none.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function update_syllabus_info(){
|
||||
if(regex_syllabus_credit('credit') && regex_syllabus_credit('hours') && regex_syllabus_credit('theory_hours') && regex_syllabus_credit('practice_hours')) {
|
||||
$("#submit_edit_info").parent().submit();
|
||||
}
|
||||
}
|
||||
|
||||
function regex_syllabus_credit(str){
|
||||
var num = $.trim($("#syllabus_"+str+"_input").val());
|
||||
var regex = /^\d*$/;
|
||||
if(num.length > 0)
|
||||
{
|
||||
if (regex.test(num)) {
|
||||
if(parseInt(num) > 0)
|
||||
{
|
||||
$("#syllabus_"+str+"_notice").hide();
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
$("#syllabus_"+str+"_notice").show();
|
||||
$("#syllabus_"+str+"_input").focus();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$("#syllabus_"+str+"_notice").show();
|
||||
$("#syllabus_"+str+"_input").focus();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
/****标签(和资源库的tag样式一致)***/
|
||||
.project_Label{ width:218px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px; border:1px solid #dddddd;}
|
||||
.project_Label_New {width:218px; padding-left:10px; background:#fff; margin-top:15px; margin-bottom:10px;}
|
||||
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
|
||||
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
|
||||
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
|
||||
.re_tag{ width: auto; padding:0 5px; padding-top:2px; height:20px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; }
|
||||
.re_tag a{ color:#0d90c3;}
|
||||
.tag_h{ }
|
||||
.tag_h span,.tag_h a{ margin-bottom:5px;}
|
||||
/*信息*/
|
||||
.project_info{ background:#fff; padding:10px 8px; width:222px; margin-bottom:10px; border:1px solid #dddddd;}
|
||||
.pr_info_id{ width:137px; color:#5a5a5a; font-size:14px; margin-top:5px;}
|
||||
.pr_info_logo{ border:1px solid #eaeaea; width:60px; height:60px; padding:1px;}
|
||||
.pr_info_logo:hover{ border:1px solid #297fb8; }
|
||||
|
||||
/*课程大纲*/
|
||||
input.syllabus_input{
|
||||
border:none;
|
||||
width:150px;
|
||||
height:25px;
|
||||
line-height:25px;
|
||||
color:#333;
|
||||
}
|
||||
input.syllabus_input_min{
|
||||
border:none;
|
||||
width:30px;
|
||||
height:25px;
|
||||
line-height:25px;
|
||||
color:#333;
|
||||
}
|
||||
.syllabus_select{
|
||||
border:1px solid #ccc;
|
||||
margin-left:5px;
|
||||
}
|
||||
.syllabus_leftinfo {
|
||||
margin:10px 10px 0 10px;
|
||||
width:220px;
|
||||
}
|
||||
.syllabus_leftinfo li{
|
||||
line-height:25px;
|
||||
}
|
||||
.syllabus_leftinfo label{
|
||||
display:block;
|
||||
width:60px;
|
||||
text-align:right;
|
||||
float:left;
|
||||
line-height:25px;
|
||||
}
|
||||
.syllabusbox{
|
||||
position:relative;
|
||||
width: 718px;
|
||||
color: #4b4b4b;
|
||||
padding:30px 15px;
|
||||
margin-bottom: 10px;
|
||||
background: #fff;
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
.syllabuscon_title{
|
||||
color:#000; text-align:center;
|
||||
}
|
||||
.syllabuscon_txt p{
|
||||
font-size:14px;
|
||||
line-height:1.9;
|
||||
color:#000;
|
||||
}
|
||||
.syllabuscon_txt_title{
|
||||
font-weight:bold;
|
||||
margin:10px 0;
|
||||
}
|
||||
.syllabusbox_tishi{
|
||||
font-size:14px;
|
||||
width:733px;
|
||||
color:#cb7c01;
|
||||
padding:10px 0 0 15px;
|
||||
margin-bottom:10px;
|
||||
background:#fff7d1;
|
||||
border:1px solid #fcd9b4;
|
||||
height:34px;
|
||||
}
|
||||
a.syllabusbox_a_blue{
|
||||
color:#3b94d6 !important;
|
||||
}
|
||||
.syllabus_leftinfo p{
|
||||
line-height:25px;
|
||||
width:150px;
|
||||
overflow:hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
.syllabus_info_tishi{
|
||||
font-size:16px;
|
||||
width:400px;
|
||||
margin:100px auto;
|
||||
}
|
||||
.syllabus_info_tishi a{
|
||||
color:#3b94d6;
|
||||
}
|
||||
|
||||
/*课程大纲-课程列表*/
|
||||
.icon_course{ background: url(../images/syllabus/icons_syllabus.png) 0 -35px no-repeat; width:18px; height:15px; display:block;}
|
||||
.icons_sy_open{background: url(../images/syllabus/icons_syllabus.png) 0 -53px no-repeat; width:20px; height:23px; display:block; cursor:pointer; }
|
||||
.icons_sy_close{background: url(../images/syllabus/icons_syllabus.png) -26px -53px no-repeat; width:20px; height:23px; display:block; }
|
||||
.syllabus_courses_box {position:relative;}
|
||||
.icons_sy_setting{background: url(../images/syllabus/icons_syllabus.png) -51px -33px no-repeat; width:20px; height:20px; display:block; position:absolute; right:10px; top:10px; }
|
||||
.icons_sy_setting:hover{background: url(../images/syllabus/icons_syllabus.png) -25px -33px no-repeat; }
|
||||
.icons_sy_cir{background: url(../images/syllabus/icons_syllabus.png) 0px -82px no-repeat; width:15px; height:15px; display:block; position:absolute; left:-8px; top:25px;}
|
||||
.icons_sy_arrow{background: url(../images/syllabus/icons_syllabus.png) -31px -81px no-repeat; width:20px; height:20px; display:block; }
|
||||
.syllabus_h2_top{ font-size:18px; color:#333; font-weight:normal; padding:10px 15px;border-bottom:1px solid #e7e7e7; }
|
||||
.syllabus_category{ padding:10px 15px; background-color:#f6f6f6; border-bottom:1px solid #e7e7e7;}
|
||||
.syllabus_box{ width:750px; border:1px solid #e7e7e7; background-color:#fff;}
|
||||
.syllabus_courses_list{ padding:15px; border-bottom:1px solid #e7e7e7; cursor:pointer;}
|
||||
.syllabus_courses_list:hover{ background:#f6fafd;}
|
||||
.syllabus_courses_title{ font-size:16px; color:#333; width:650px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
.sy_p_grey{ margin-left:25px; color:#888; margin-top:5px; font-size:12px;}
|
||||
.syllabus_class_box{ padding-left:30px; background:#f6f6f6;}
|
||||
.syllabus_class_list{ padding:12px 0 12px 15px; height:44px;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7; position:relative;}
|
||||
.syllabus_class_list:hover{ background:#ececec;}
|
||||
.syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;}
|
||||
.syllabus_class_list_more:hover{ background:#ececec;}
|
||||
.syllabus_class_list_more a{ color:#ff7e00;}
|
||||
.syllabus_class_title{ font-size:14px; color:#333; width:500px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
.syllabus_class_w{ width:650px;}
|
||||
.dis {display:block;}
|
||||
.undis {display:none;}
|
||||
|
||||
/*班级列表界面(用的博客列表的样式)*/
|
||||
.listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; }
|
||||
.bloglistbox{ min-height:690px;}
|
||||
.list-h2{ font-size:16px; font-weight:bold; color:#000; padding-bottom:5px;}
|
||||
.category2{ }
|
||||
.list_title{padding:10px 0; border-bottom:1px solid #ddd;}
|
||||
.category2 a,.category2 span{ float:left; margin-right:5px;}
|
||||
.grayTxt{ color:#9093a6;}
|
||||
.sortTxt{ color:#000;}
|
||||
.sortTxt:hover{ color:#28be6c;}
|
||||
a.sortupbtn{ background: url(../images/syllabus/icons_syllabus.png) 0 3px no-repeat; width:12px; height:17px; display:block; margin-right:10px; cursor:pointer;}
|
||||
a.sortdownbtn{ background: url(../images/syllabus/icons_syllabus.png) 0 -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; }
|
||||
a.sort_no{ background: url(../images/syllabus/icons_syllabus.png) -16px -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; }
|
||||
.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;}
|
||||
a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:708px;}
|
||||
a:hover.list-title{ color:#269ac9;}
|
||||
.c_red{ font-weight:normal; font-size:12px;}
|
||||
.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;}
|
||||
.list-file li{ line-height:1.9;}
|
||||
.list-info span{ margin-left:5px;}
|
||||
.pages a{ display:block; border:1px solid #d1d1d1; color:#888; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; }
|
||||
.pages a:hover{ background-color:#3b94d6; border:1px solid #3b94d6; color:#fff;}
|
||||
a.pages-big{ width:50px;}
|
||||
.pages .active{ background-color:#3b94d6; border:1px solid #3b94d6; color:#fff;}
|
||||
.pages{width:330px; margin:20px auto 10px;}
|
||||
a.course-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:590px;}
|
||||
a:hover.course-title{ color:#269ac9;}
|
||||
|
||||
/*新建页面*/
|
||||
.name_input{ border:1px solid #64bdd9; height:16px; width:310px; background:#fff; margin-bottom:10px; padding:5px;}
|
Loading…
Reference in new issue