课程大纲的左侧栏base,新建课程大纲、新建班级的调整

This commit is contained in:
cxt 2016-06-28 15:13:04 +08:00
parent 3c21e8fcba
commit 383483de26
29 changed files with 599 additions and 20 deletions

View File

@ -715,6 +715,7 @@ class CoursesController < ApplicationController
@trackers = Tracker.sorted.all
@course = Course.new
@course.safe_attributes = params[:course]
@syllabus = Syllabus.where("id = #{params[:syllabus_id].to_i}").first if params[:syllabus_id]
# month = Time.now.month
render :layout => 'new_base'
else

View File

@ -8,8 +8,43 @@ class SyllabusesController < ApplicationController
end
def show
@courses = @syllabus.courses
#@courses = @syllabus.courses
respond_to do |format|
format.js
format.html{render :layout => 'base_syllabus'}
format.api
end
end
def new
if User.current.login?
@syllabus = Syllabus.new
render :layout => 'new_base'
else
redirect_to signin_url
end
end
def create
if User.current.user_extensions.identity
@syllabus = Syllabus.new
@syllabus.title = params[:title]
@syllabus.eng_name = params[:eng_name]
@syllabus.user_id = User.current.id
if @syllabus && @syllabus.save
respond_to do |format|
flash[:notice] = l(:notice_successful_create)
format.html {redirect_to syllabus_path(@syllabus)}
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'syllabuses', :action => 'show', :id => @syllabus.id) }
end
else
respond_to do |format|
flash[:notice] = l(:notice_create_failed)
format.html { redirect_to new_syllabus_path } #Added by young
format.api { render_validation_errors(@syllabus) }
end
end
end
end
private

View File

@ -13,6 +13,7 @@ class TagsController < ApplicationController
include ForumsHelper
include AttachmentsHelper
include ContestsHelper
include SyllabusesHelper
include ActsAsTaggableOn::TagsHelper
include TagsHelper
include FilesHelper
@ -529,6 +530,8 @@ class TagsController < ApplicationController
@obj = Course.find_by_id(@obj_id)
when '10'
@obj = Attachment.find_by_id(@obj_id)
when '11'
@obj = Syllabus.find_by_id(@obj_id)
else
@obj = nil
end
@ -619,6 +622,9 @@ class TagsController < ApplicationController
when '9' then
@obj = Course.find_by_id(obj_id)
@obj_pages, @courses_results, @results_count = for_pagination(get_courses_by_tag(selected_tags))
when '11' then
@obj = Syllabus.find_by_id(obj_id)
@obj_pages, @syllabuses_results, @results_count = for_pagination(get_syllabuses_by_tag(selected_tags))
else
@obj = nil
end
@ -684,6 +690,8 @@ class TagsController < ApplicationController
return 'Course'
when '10'
return 'Attachment'
when '11'
return 'Syllabus'
else
render_error :message => e.message
return

View File

@ -667,6 +667,22 @@ module CoursesHelper
is_current_term || is_next_term
end
#课程大纲下拉框
def syllabus_option
type = []
option1 = []
option1 << "请选择课程"
option1 << 0
type << option1
Syllabus.all.each do |syllabus|
option = []
option << syllabus.title
option << syllabus.id
type << option
end
type
end
#获取课程动态
def get_course_activity courses, activities
@course_ids=activities.keys()

View File

@ -1,2 +1,5 @@
module SyllabusesHelper
def get_syllabuses_by_tag(tag_name)
Syllabus.tagged_with(tag_name).order('updated_at desc')
end
end

View File

@ -23,6 +23,8 @@ module TagsHelper
@obj= Course.find_by_id(obj_id)
when '10'
@obj = Attachment.find_by_id(obj_id)
when '11'
@obj = Syllabus.find_by_id(obj_id)
else
raise Exception, '[TagsHelper] ===> tag type unknow.'
end

View File

@ -1,5 +1,7 @@
class Syllabus < ActiveRecord::Base
acts_as_taggable
belongs_to :user
has_many :courses
attr_accessible :description, :title
attr_accessible :description, :title, :eng_name, :type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
end

View File

@ -201,6 +201,7 @@ class CoursesService
#@course.safe_attributes(current_user,params[:course])
#@course.password = params[:course][:password]
@course.tea_id = current_user.id
@course.syllabus_id = params[:syllabus_id].to_i
@course.term = params[:term]
@course.time = params[:time]
@course.end_term = params[:end_term]

View File

@ -4,12 +4,22 @@
<div class="hwork_new">
<ul>
<%= labelled_form_for @course do |f| %>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label>
<% if @syllabus.nil? %>
<%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
<% else %>
<span><%=@syllabus.title %></span>
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
<% end %>
<!--<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name('new');">-->
<span class="c_red" id="new_syllabus_notice" style="display: none;">请选择课程大纲</span>
</li>
<div class="cl"></div>
<li class="ml45">
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name('new');">
<span class="c_red" id="new_course_name_notice" style="display: none;">课程名称不能为空且至少有两个字符</span>
<span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
</li>
<div class="cl"></div>
<li class="ml45">
@ -49,13 +59,13 @@
<li class=" mb5 ml80">
<label >公开&nbsp;&nbsp;</label>
<input id="course_is_public" name="course[is_public]" type="checkbox" value="1">
<span class="c_grey">(选中后课外用户可见该课程,否则仅对课内成员可见)</span>
<span class="c_grey">(选中后班级外用户可见该班级,否则仅对班级内成员可见)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">
<label >学生列表公开&nbsp;&nbsp;</label>
<input id="course_open_student" name="course[open_student]" type="checkbox" value="1">
<span class="c_grey">(选中后课外用户可见学生列表,否则仅对课内成员可见)</span>
<span class="c_grey">(选中后班级外用户可见学生列表,否则仅对班级内成员可见)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">

View File

@ -0,0 +1,25 @@
<div class="pr_info_logo fl mb5">
<%= image_tag("../images/syllabus.jpg",width:"60px", height: "60px") %>
</div>
<div class="fl ml15">
<p class="homepageImageName mb5"><%=@syllabus.title %></p>
<div class="cl"></div>
</div>
<div class="cl"></div>
<div>
<div class="mb5">
<% 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 %>
</div>
</div>
<div class="pr_info_foot ">
教师(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank">10</a><span>|</span>
学生(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank">10</a><span>|</span>
资源(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank">100</a></div>
<div class="cl"></div>

View File

@ -47,7 +47,7 @@
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'fr fb', :title => '发布帖子',:target => '_blank' %>
<div class="cl"></div>
</li>
<% if User.current == @user %>
<% if User.current == user %>
<li class="subNavRow">
<% if count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
@ -84,7 +84,7 @@
<% end%>
<script type="text/javascript">
var coursecount = <%= @user.courses.visible.where("is_delete =?", 0).count %>;
var coursecount = <%= user.courses.visible.where("is_delete =?", 0).count %>;
var courseshowcount = document.getElementsByClassName("coursesLineGrey").length;
if((coursecount <= courseshowcount)&&(coursecount > 5) ){

View File

@ -0,0 +1,158 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'syllabus','new_user','prettify',:media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify'%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 在生成的公式图片上去掉Math定义的右键菜单$$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
</head>
<body onload="prettyPrint();">
<% is_current_user = User.current.logged? && User.current == @user%>
<div class="navContainer">
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
<div class="cl"></div>
<div class="homepageContentContainer">
<div class="homepageContent">
<div class="homepageLeft">
<div class="homepagePortraitContainer mt15">
<%=render :partial => 'layouts/syllabus_info' %>
</div>
<div class="homepageLeftMenuContainer">
<ul class="syllabus_leftinfo">
<a href="javascript:void(0);" class="fr"><img src="../images/signature_edit.png" width="12" height="12" /></a><div class="cl"></div>
<li><label >创建教师:</label><span><%=@syllabus.user.show_name %></span></li>
<li><label>课程性质:</label>
<select class="syllabus_select fl">
<option value="公共必修课" selected="selected">公共必修课</option>
<option value="学科必修课">学科必修课</option>
<option value="专业选修课">专业选修课</option>
<option value="实践必修课">实践必修课</option>
<option value="实践选修课">实践选修课</option>
</select>
<div class="cl"></div>
</li>
<li><label >学分:</label><input class="syllabus_input fl" placeholder="5学分"><div class="cl"></div></li>
<li><label>总学时:</label><input class="syllabus_input_min fl" placeholder="50 ">学时 <div class="cl"></div></li>
<li><label>理论学时:</label><input class="syllabus_input_min fl" placeholder="10"> 学时<div class="cl"></div></li>
<li><label>实践学时:</label><input class="syllabus_input fl" placeholder="5学时"><div class="cl"></div></li>
<li><label>适用专业:</label><input class="syllabus_input fl" placeholder="UI设计"><div class="cl"></div></li>
<li><label>选修课程:</label><input class="syllabus_input fl" placeholder="工业设计史"><div class="cl"></div></li>
</ul>
<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li>
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" >班级</a>
<div class="courseMenu" id="courseMenu">
<ul>
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_course_menu" >
<li>
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "menuGrey"%>
</li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li>
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
</li>
</ul>
</li>
</ul>
</div>
</div>
<% courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>">
<div id="homepageLeftMenuCourses">
<ul>
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => User.current, :page => 0} %>
<!--<li class="homepageLeftMenuCoursesLine" ><a href="javascript:void(0);" class="coursesLineGrey hidden">设计学院设计管理班级3(2016夏)</a></li>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey hidden">工程学院设计管理班级1(2015夏)</a></li>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey hidden">工程学院设计管理班级1(2015夏)</a></li>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey hidden">工程学院设计管理班级1(2015夏)</a></li>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey hidden">工程学院设计管理班级1(2015夏)</a></li>
<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li>-->
</ul>
</div>
<% if !courses.empty? %>
<div class="homepageLeftMenuMore" id="user_hide_course">
<a href="javascript:void(0);" class="homepageLeftMenuHideIcon" id="hide_show_courseicon" onclick="leftCourseslistChange();"></a>
</div>
<% end %>
</div>
</div>
<div class="project_Label">
<h4 class="mb5" >标签:</h4>
<div class="tag_h">
<%= render :partial => 'tags/syllabus_tag', :locals => {:obj => @syllabus,:object_flag => "11"}%>
</div>
<div class="cl"></div>
</div>
<div class="fontGrey2 mt10 ml20">访问计数 343 自2016年5月</div>
</div><!--left end -->
<div class="homepageRight">
<%= yield %>
</div>
</div>
<%= render :partial => 'layouts/new_feedback' %>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<script type="text/javascript">
$(function(){
$('#user_hide_course').hide();
});
$("#courseMenu").mouseenter(function(){
$("#topnav_course_menu").show();
});
$("#courseMenu").mouseleave(function(){
$("#topnav_course_menu").hide();
});
function leftCourseslistChange(){
$('#homepageLeftMenuCourses').slideToggle();
$('#hide_show_courseicon').toggleClass("homepageLeftMenuHideIcon");
$('#hide_show_courseicon').toggleClass("homepageLeftMenuMoreIcon");
}
</script>
</body>
</html>

View File

@ -13,7 +13,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'public', 'leftside', 'courses','header','prettify', 'org'%>
<%= stylesheet_link_tag 'public', 'leftside', 'courses','header','prettify', 'org', 'syllabus'%>
<%= javascript_include_tag "course","header",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -198,7 +198,10 @@
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_course_menu">
<li>
<%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
<%= link_to "新建课程", new_syllabus_path(:host=> Setting.host_course), :class => "menuGrey"%>
</li>
<li>
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
</li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li>

View File

@ -0,0 +1,27 @@
<div class="project_r_h02">
<h2 class="project_h2">新建课程</h2>
</div>
<div class="hwork_new">
<ul>
<%= labelled_form_for @syllabus do |f| %>
<li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="title" id="new_syllabus_name" class="name_input" maxlength="100" onkeyup="regex_syllabus_name();">
<span class="c_red" id="new_syllabus_name_notice" style="display: none;">课程名称不能为空且至少有两个字符</span>
</li>
<div class="cl"></div>
<li class="ml45">
<label><span class="c_white">*</span>&nbsp;<%= l(:label_tags_course_eng_name)%>&nbsp;&nbsp;</label>
<input type="text" name="eng_name" id="new_syllabus_eng_name" class="name_input" maxlength="100">
<!--<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>-->
</li>
<div class="cl"></div>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_syllabus();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
<div class="cl"></div>
</li>
<% end%>
</ul>
</div><!--talknew end-->
<div class="cl"></div>

View File

View File

@ -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>

View File

@ -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%>

View File

@ -19,6 +19,9 @@ $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
:locals => {:obj => @obj,:non_list_all => false, :object_flag => @object_flag}) %>');
<% elsif @object_flag == '11'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_syllabus_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
<% else%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');

View File

@ -38,6 +38,10 @@ $('#tags_name2').val("");
$('#tags_name').val("");
<% elsif @obj_flag == '10'%>
//$("#put-tag-form-<%#=@obj.class%>-<%#=@obj.id%>").hide();
<% elsif @obj_flag == '11'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_syllabus_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#tags_name4').val("");
<% else%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');

View File

@ -329,7 +329,7 @@ zh:
permission_manage_subtasks: 管理子任务
permission_view_journals_for_messages: 查看留言
permission_view_courses: 查看课程
permission_new_course: 新建课程
permission_new_course: 新建班级
permission_configure_course: 配置课程
permission_close_course: 关闭/重开
permission_new_assignment: 新建任务
@ -1265,7 +1265,9 @@ zh:
label_delete_confirm: 确认删除?
label_tags_bid: 需求名称
label_tags_course_name: 课程名称
label_tags_syllabus_name: 课程名称
label_tags_course_name: 班级名称
label_tags_course_eng_name: 英文名称
label_tags_bid_description: 需求描述
label_tags_issue_description: 问题描述
label_tags_all_objects: 所有
@ -1692,7 +1694,7 @@ zh:
label_new_join_group: 加入当前分班
label_new_course_password: 课程密码
label_new_course_school: 开课学校
label_new_course_description: 课程描述
label_new_course_description: 班级描述
label_homework_description: 作业描述
label_new_join_order: 请输入课程密码
label_task_submit_form_accessory: 作业最终以附件形式提交

View File

@ -1071,6 +1071,18 @@ RedmineApp::Application.routes.draw do
match 'courses/search'
match '/contests/search', :via => [:get, :post]
#课程大纲路由设置
resources :syllabuses do
member do
end
collection do
end
end
# add by nwb
# 课程路由设置
resources :courses do

View File

@ -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

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160624032138) do
ActiveRecord::Schema.define(:version => 20160627074232) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -1539,6 +1539,18 @@ ActiveRecord::Schema.define(:version => 20160624032138) do
add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true
add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id"
create_table "quality_analyses", :force => true do |t|
t.integer "project_id"
t.string "author_login"
t.string "rep_identifier"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "sonar_version", :default => 0
t.string "path"
t.string "branch"
t.string "language"
end
create_table "queries", :force => true do |t|
t.integer "project_id"
t.string "name", :default => "", :null => false
@ -1853,8 +1865,16 @@ ActiveRecord::Schema.define(:version => 20160624032138) do
t.string "title"
t.text "description"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "eng_name"
t.integer "type"
t.integer "credit"
t.integer "hours"
t.integer "theory_hours"
t.integer "practice_hours"
t.string "applicable_major"
t.string "pre_course"
end
add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id"

BIN
public/images/syllabus.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -182,10 +182,22 @@ function regex_course_password(str)
return false;
}
}
//验证课程大纲
function regex_syllabus_option(str) {
var obj = document.getElementById(str + "_syllabus_id");
var syllabus = obj.options[obj.selectedIndex];
if(parseInt(syllabus.value) == 0) {
$("#"+str+"_syllabus_notice").show();
return false;
} else{
$("#"+str+"_syllabus_notice").hide();
return true;
}
}
//提交新建课程
function submit_new_course()
{
if(regex_course_name('new')&&regex_course_class_period('new')&&regex_time_term('new'))
if(regex_syllabus_option('new')&&regex_course_name('new')&&regex_course_class_period('new')&&regex_time_term('new'))
{
$("#new_course").submit();
}
@ -193,11 +205,35 @@ function submit_new_course()
function submit_edit_course(id)
{
if(regex_course_name('edit')&&regex_course_class_period('edit')&&regex_time_term('edit'))
if(regex_syllabus_option('edit')&&regex_course_name('edit')&&regex_course_class_period('edit')&&regex_time_term('edit'))
{
$("#edit_course_"+id).submit();
}
}
//新建课程大纲
function submit_new_syllabus()
{
if(regex_syllabus_name())
{
$("#new_syllabus").submit();
}
}
function regex_syllabus_name() {
var name = $.trim($("#new_syllabus_name").val());
if(name.length < 2)
{
$("#new_syllabus_name_notice").show();
return false;
}
else
{
$("#new_syllabus_name_notice").hide();
return true;
}
}
//课程讨论区
function regexTopicSubject() {
var name = $("#message_subject").val();

View File

@ -0,0 +1,9 @@
//显示更多的班级
function show_more_course(url){
$.get(
url,
{ page: $("#course_page_num").val() },
function (data) {
}
);
}

View File

@ -1426,4 +1426,6 @@ a.pages-big{ width:50px;}
.H60 {height:60px !important;}
.W420 {width:420px;}
.W300 {width:300px !important;}
.W600{ width:600px;}
.W600{ width:600px;}
.syllabus_input {width: 290px; border: 1px solid #64bdd9; height: 30px;}

View File

@ -0,0 +1,155 @@
/****标签(和资源库的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;
}
.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; }
.icons_sy_setting{background: url(../images/syllabus/icons_syllabus.png) -51px -33px no-repeat; width:20px; height:20px; display:block; }
.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;}
.category{ }
.list_title{padding:10px 0; border-bottom:1px solid #ddd;}
.category a,.category 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;}