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

Conflicts:
	app/views/users/_user_syllabus_list.html.erb
This commit is contained in:
Tim 2016-07-01 13:56:07 +08:00
commit def0d79271
63 changed files with 2718 additions and 2467 deletions

View File

@ -1,3 +1,4 @@
# encoding: utf-8
class SyllabusesController < ApplicationController
include ApplicationHelper
helper :attachments
@ -5,7 +6,7 @@ class SyllabusesController < ApplicationController
include CoursesHelper
before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy]
before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist]
before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :update_base_info]
def index
user = User.current
@syllabuses = user.syllabuses
@ -71,7 +72,7 @@ class SyllabusesController < ApplicationController
#删除课程大纲的描述
def destroy
if @syllabus and @syllabus.courses.empty?
if @syllabus && @syllabus.courses.empty?
@syllabus.destroy
redirect_to user_path(User.current.id)
end
@ -122,6 +123,27 @@ class SyllabusesController < ApplicationController
end
end
#修改英文名称
def edit_syllabus_eng_name
if @syllabus
@syllabus.update_column("eng_name",params[:eng_name])
end
respond_to do |format|
format.js
end
end
#编辑属性
def update_base_info
if @syllabus
@syllabus.update_attributes(:credit => params[:credit], :hours => params[:hours], :theory_hours => params[:theory_hours], :practice_hours => params[:practice_hours], :applicable_major => params[:applicable_major], :pre_course => params[:pre_course])
@syllabus.update_attributes(:syllabus_type => params[:syllabus_type])
respond_to do |format|
format.js
end
end
end
private
def find_syllabus
@syllabus = Syllabus.find params[:id]

View File

@ -1372,7 +1372,7 @@ class UsersController < ApplicationController
@courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5).offset(@page * 5)
@all_count = @user.courses.visible.where("is_delete =?", 0).count
elsif @type == 'Syllabus'
@syllabus = Syllabus.where("id = #{params[:syllabus_id]}").first
@syllabus = Syllabus.where("id = #{params[:syllabus]}").first
@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).offset(@page * 5)
@all_count = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).count
end
@ -3205,7 +3205,7 @@ class UsersController < ApplicationController
# end
@syllabus.each do |syllabus|
count = 0
courses = @courses.select("syllabus_id = #{syllabus.id}")
courses = @courses.where("syllabus_id = #{syllabus.id}")
courses.each do |c|
count += (User.current.admin? || User.current.allowed_to?(:as_teacher,c)) ? (c.homework_commons.count + visable_attachemnts_incourse(c).count) : (c.homework_commons.where("publish_time <= '#{Date.today}'").count + visable_attachemnts_incourse(c).count)
end

View File

@ -1,3 +1,4 @@
# encoding: utf-8
module SyllabusesHelper
def get_syllabuses_by_tag(tag_name)
Syllabus.tagged_with(tag_name).order('updated_at desc')
@ -35,4 +36,37 @@ module SyllabusesHelper
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

View File

@ -32,7 +32,7 @@ module UsersHelper
def get_resource_type type
case type
when 'Course'
'课程资源'
'班级资源'
when 'Project'
'项目资源'
when 'Issue'
@ -122,11 +122,11 @@ module UsersHelper
when 'homework'
'作业消息'
when 'course_message'
'课程讨论'
'班级讨论'
when 'course_news'
'课程通知'
'班级通知'
when 'poll'
'课程问卷'
'班级问卷'
when 'issue'
'项目任务'
when 'forge_message'

View File

@ -1,3 +1,4 @@
# encoding: utf-8
class Syllabus < ActiveRecord::Base
include Redmine::SafeAttributes
include ApplicationHelper
@ -8,13 +9,29 @@ class Syllabus < ActiveRecord::Base
belongs_to :user
has_many :courses
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
attr_accessible :description, :title, :eng_name, :type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
safe_attributes 'title', 'description', 'eng_name', 'type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course'
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)

View File

@ -39,7 +39,7 @@
<%= number_to_human_size(resource.filesize)%>
</td>
<td style=" text-align: center;">
课程资源
班级资源
</td>
<td style=" text-align: center;">
<%= format_date(resource.created_on)%>

View File

@ -22,7 +22,7 @@
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner">
<div class="NewsBannerName">
课程问答区
班级问答区
</div>
</div>
<div nhname="topic_form">

View File

@ -98,7 +98,7 @@
<li class=" mb5 ml85">
<label >公开&nbsp;&nbsp;</label>
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox" value="<%=@course.is_public.to_i %>">
<span class="c_grey">(选中后班级外用户可见该课程,否则仅对班级内成员可见)</span>
<span class="c_grey">(选中后班级外用户可见该班级,否则仅对班级内成员可见)</span>
<div class="cl"></div>
</li>
<li class="ml85">

View File

@ -2,9 +2,9 @@
<ul class="rankList">
<h4>
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "课程活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => '' %>
<%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => '' %>
<% else %>
课程活跃度
班级活跃度
<% end %>
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
</h4>
@ -17,7 +17,7 @@
问答回复:回复数 x 1 <br/>
作业留言:留言数 x 1 <br/>
通知留言:留言数 x 1 <br/>
课程留言:留言数 x 1 <br/>
班级留言:留言数 x 1 <br/>
总得分为以上得分之和</div>
</div>
<% contributor_course_scor(course.id).each do |contributor_score| %>
@ -47,7 +47,7 @@
通知留言数 x 1 = <%= contributor_score.news_reply_num.to_i %> x 1 = <%= contributor_score.news_reply_num.to_i %></br>
<%# end %>
<%# unless contributor_score.journal_num.to_i == 0 %>
课程留言数 x 1 = <%= contributor_score.journal_num.to_i %> x 1 = <%= contributor_score.journal_num.to_i %></br>
班级留言数 x 1 = <%= contributor_score.journal_num.to_i %> x 1 = <%= contributor_score.journal_num.to_i %></br>
<%# end %>
<%# unless contributor_score.homework_journal_num.to_i == 0 %>
<%# end %>

View File

@ -3,9 +3,9 @@
<ul class="rankList">
<h4>
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "课程英雄榜", course_member_path(course, :role => 2), :class => '' %>
<%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => '' %>
<% else %>
<span>课程英雄榜</span>
<span>班级英雄榜</span>
<% end %>
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor:pointer;">积分规则</a></h4>
<div style="cursor:pointer;" class="numIntro undis">

View File

@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>快速进入课程通道</title>
<title>快速进入班级通道</title>
<style>
#popbox{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
#popbox div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
@ -49,8 +49,8 @@
<div id="popbox">
<div class="C" >
<div class="C_top">
<h2>快速加入课程通道</h2>
<p>只要持有课程邀请码,就可以快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦!</p>
<h2>快速加入班级通道</h2>
<p>只要持有班级邀请码,就可以快速加入所在班级。班级页面搜索不到的私有班级只能从此通道进入哦!</p>
</div>
<div class="C_form">
<%= form_tag({:controller => 'courses',
@ -62,11 +62,11 @@
<li>
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<span class="tips" style="width: 90px; display: inline-block;">课程邀请码:</span>
<span class="tips" style="width: 90px; display: inline-block;">班级邀请码:</span>
<input class="width190" style="margin-left: 0px;" name="invite_code" id="object_id" type="text" value="" >
<input type="text" style="display: none"/>
</li>
<li class="mB5">课程邀请码是所在课程页面中显示的邀请码</li>
<li class="mB5">班级邀请码是所在班级页面中显示的邀请码</li>
<li style="margin-top: 15px;">
<span style="margin-right: 5px;"><span style="margin-right:43px;">身</span><span>份</span></span>
<% if User.current.logged? && User.current.extensions && User.current.extensions.identity == 0%>

View File

@ -15,7 +15,7 @@
问答回帖数 x 1 = 0 x 1 = 0</br>
作业留言数 x 1 = 0 x 1 = 0</br>
通知留言数 x 1 = 0 x 1 = 0</br>
课程留言数 x 1 = 0 x 1 = 0</br>
班级留言数 x 1 = 0 x 1 = 0</br>
总得分0
</div>
<% else %>
@ -30,7 +30,7 @@
问答回帖数 x 1 = <%= act_score.message_reply_num.to_i %> x 1 = <%= act_score.message_reply_num.to_i %></br>
作业留言数 x 1 = <%= act_score.homework_journal_num.to_i %> x 1 = <%= act_score.homework_journal_num.to_i %></br>
通知留言数 x 1 = <%= act_score.news_reply_num.to_i %> x 1 = <%= act_score.news_reply_num.to_i %></br>
课程留言数 x 1 = <%= act_score.journal_num.to_i %> x 1 = <%= act_score.journal_num.to_i %></br>
班级留言数 x 1 = <%= act_score.journal_num.to_i %> x 1 = <%= act_score.journal_num.to_i %></br>
总得分:<%=total_score %>
</div>
<% end %>

View File

@ -70,7 +70,7 @@
<li class=" mb5 ml30">
<label >学生上传资源&nbsp;&nbsp;</label>
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" />
<span class="c_grey">(选中后允许学生上传课程资源,否则不允许)</span>
<span class="c_grey">(选中后允许学生上传班级资源,否则不允许)</span>
<div class="cl"></div>
</li>
<li class=" ml90" >

View File

@ -9,7 +9,7 @@
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner">
<div class="NewsBannerName">课程动态</div>
<div class="NewsBannerName">班级动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">

View File

@ -17,7 +17,7 @@
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectType fl">班级资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
@ -50,7 +50,7 @@
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectType fl">班级资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
@ -61,7 +61,7 @@
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectType fl">班级资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
@ -72,7 +72,7 @@
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectType fl">班级资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
@ -83,7 +83,7 @@
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectType fl">班级资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
@ -94,7 +94,7 @@
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectType fl">班级资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
@ -105,7 +105,7 @@
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectType fl">班级资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
@ -116,7 +116,7 @@
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectType fl">班级资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>

View File

@ -1,6 +1,6 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
<div class="upload_con">
<h2>将此课件引入我的课程资源库</h2>
<h2>将此课件引入我的班级资源库</h2>
<% if error == '403' %>
<div class="upload_box">
<div style="color: red;">您没有权限引用此资源</div>

View File

@ -48,7 +48,7 @@
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子"/>
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的班级、项目、用户、资源以及帖子"/>
<input type="hidden" name="search_type" id="type" value="all"/>
<input type="text" style="display: none;"/>
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>

View File

@ -9,9 +9,11 @@
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
</div>
<div class="pr_info_id fl f14">
<%= @course.name %></br>
<span class="hidden fl" style="max-width: 90px;" title="<%= @course.name %>"><%= @course.name %></span><span class="fl"><%=@course.is_public == 1 ? '(私有)' : '公开' %></span>
</br>
<div class="cl"></div>
<% if @course.syllabus%>
<a class="pr_info_name fb c_dark fl" href="<%= Setting.protocol%>://<%= Setting.host_name%>/syllabuses/<%= @course.syllabus_id%>" target="_blank">
<a class="pr_info_name fb c_dark fl hidden" style="max-width: 120px;" href="<%= Setting.protocol%>://<%= Setting.host_name%>/syllabuses/<%= @course.syllabus_id%>" target="_blank">
<%=@course.syllabus.title %>
</a>
<% end %>

View File

@ -12,7 +12,7 @@
<% elsif ma.course_message_type == "Comment" %>
<li><a href="<%=news_path(ma.course_message.commented.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 评论了通知:<%=ma.course_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>评论了通知:<%= ma.course_message.commented.title%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
<li><a href="<%= (!User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil?) ? new_student_work_path(:homework => ma.course_message.id) : student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程作业:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程作业:作业标题:<%= ma.course_message.name%></a></li>
<li><a href="<%= (!User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil?) ? new_student_work_path(:homework => ma.course_message.id) : student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了班级作业:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了班级作业:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了</a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
@ -52,12 +52,12 @@
<% elsif ma.course_message_type == "Message" %>
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
<% href = course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id) %>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%></a></li>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %><%= content%></a></li>
<% elsif ma.course_message_type == "StudentWorksScore" %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
<% elsif ma.course_message_type == "JournalsForMessage" %>
<% if ma.course_message.jour_type == 'Course' %>
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在课程中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在课程中留言了:<%= ma.course_message.notes.html_safe%></a></li>
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在班级中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在班级中留言了:<%= ma.course_message.notes.html_safe%></a></li>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%></a></li>
<% else %>
@ -70,21 +70,21 @@
<% elsif ma.course_message_type == "StudentWork" && ma.status == 2 %>
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 追加新附件了:作业标题:<%=ma.course_message.homework_common.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>追加新附件了:作业标题:<%=ma.course_message.homework_common.name %></a></li>
<% elsif ma.course_message_type == "Course" %>
<li><a href="<%=course_path(ma.course_message) %>" target="_blank" title="系统提示 您成功创建了课程:课程名称:<%=ma.course_message.name %>"><span class="shadowbox_news_user">系统提示 </span>您成功创建了课程:课程名称:<%=ma.course_message.name %></a></li>
<li><a href="<%=course_path(ma.course_message) %>" target="_blank" title="系统提示 您成功创建了班级:班级名称:<%=ma.course_message.name %>"><span class="shadowbox_news_user">系统提示 </span>您成功创建了班级:班级名称:<%=ma.course_message.name %></a></li>
<% elsif ma.course_message_type == "JoinCourseRequest" %>
<% content = User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}" %>
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的课程成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的课程成员申请:<%=content %></a></li>
<% content = User.find(ma.course_message_id).name+"申请成为班级\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}" %>
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的班级成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的班级成员申请:<%=content %></a></li>
<% elsif ma.course_message_type == "CourseRequestDealResult" %>
<% content = ma.status == 1 ? '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝' %>
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 课程申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>课程申请进度反馈:<%=content %></a></li>
<% content = ma.status == 1 ? '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝' %>
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 班级申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>班级申请进度反馈:<%=content %></a></li>
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 0 %>
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了课程<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了课程<%=ma.course.name %></a></li>
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了班级<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了班级<%=ma.course.name %></a></li>
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 1 %>
<li><a href="<%=user_path(ma.course_message_id) %>" target="_blank" title="系统提示 您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %>"><span class="shadowbox_news_user">系统提示 </span>您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %></a></li>
<li><a href="<%=user_path(ma.course_message_id) %>" target="_blank" title="系统提示 您增加了新的班级成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %>"><span class="shadowbox_news_user">系统提示 </span>您增加了新的班级成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %></a></li>
<% elsif ma.course_message_type == "RemoveFromCourse" %>
<li><a href="<%=member_course_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您移出了课程<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您移出了课程<%=ma.course.name %></a></li>
<li><a href="<%=member_course_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您移出了班级<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您移出了班级<%=ma.course.name %></a></li>
<% elsif ma.course_message_type == "Exercise" && ma.status == 2 %>
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程测验:测验题目:<%=ma.course_message.exercise_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程测验:测验题目:<%=ma.course_message.exercise_name %></a></li>
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了班级测验:测验题目:<%=ma.course_message.exercise_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了班级测验:测验题目:<%=ma.course_message.exercise_name %></a></li>
<% elsif ma.course_message_type == "Exercise" && ma.status == 3 %>
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了</a></li>
<% end %>

View File

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

View File

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

View File

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

View File

@ -10,19 +10,13 @@
</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 class="mb5" id="syllabus_eng_name_show">
<%= render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus}%>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑英文名称" id="syllabus_eng_name_edit" onblur="edit_syllabus_eng_name('<%= edit_syllabus_eng_name_syllabus_path(@syllabus.id)%>');"><%= @syllabus.eng_name %></textarea>
</div>
<div class="pr_info_foot ">
教师(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default"><%=teachers_num %></a><span>|</span>
学生(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default"><%=students_num %></a><span>|</span>
资源(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default"><%=files_num %></a></div>
教师(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的教师数"><%=teachers_num %></a><span>|</span>
学生(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的学生数"><%=students_num %></a><span>|</span>
资源(<a class="info_foot_num c_blue" href="javascript:void(0);" target="_blank" style="cursor: default" title="课程下全部班级的资源数"><%=files_num %></a></div>
<div class="cl"></div>

View File

@ -52,7 +52,7 @@
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子" onkeypress="search_in_header_I(event,$(this));"/>
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的班级、项目、用户、资源以及帖子" onkeypress="search_in_header_I(event,$(this));"/>
<input type="hidden" name="search_type" id="type" value="all"/>
<input type="text" style="display: none;"/>
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>

View File

@ -47,6 +47,12 @@
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'fr fb', :title => '发布帖子',:target => '_blank' %>
<div class="cl"></div>
</li>
<% if type=='User' && !course.syllabus.nil? %>
<li class="subNavRow">
<%= link_to "所属课程",syllabus_path(course.syllabus_id), :class => 'fl w48',:target => '_blank' %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current == user %>
<li class="subNavRow">
<% if count == 0 %>
@ -76,7 +82,7 @@
</li>
<% end %>
<% if courses.size == 5%>
<% if all_count > (page.to_i+1) * 5%>
<li class="homepageLeftMenuMore" id="user_show_more_course">
<input type="hidden" value="<%= page%>" id="course_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_course('<%= type=='User' ? user_courses4show_user_path(user.id,:type=>type) : user_courses4show_user_path(user.id,:type=>type,:syllabus=>@syllabus.id)%>');"></a>

View File

@ -47,29 +47,8 @@
</div>
<% update_visiti_count @syllabus %>
<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 class="homepageLeftMenuContainer" id="syllabus_base_info">
<%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %>
</div>
<div class="homepageLeftMenuContainer">
@ -102,12 +81,6 @@
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
<ul>
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => User.current,:all_count => all_count,:type =>'Syllabus',: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? %>
@ -159,6 +132,9 @@
$('#hide_show_courseicon').toggleClass("homepageLeftMenuMoreIcon");
}
function show_edit_base_info() {
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_edit_info', :locals => {:syllabus => @syllabus}) %>");
}
</script>
</body>
</html>

View File

@ -203,7 +203,7 @@
<% end %>
<% end %>
<% if (get_join_course_count(@user) != 0) %>
<li>加入课程&nbsp;:</li>
<li>加入班级&nbsp;:</li>
<% end %>
<% if @user.user_extensions.identity == 1 %>
<li>参加匿评&nbsp;:</li>

View File

@ -205,14 +205,14 @@
</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"%>
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
</li>
</ul>
</li>
</ul>
</div>
<% else%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入课程"%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入班级"%>
<% end%>
<% end%>
</div>

View File

@ -21,7 +21,7 @@
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner">
<div class="NewsBannerName">
课程通知
班级通知
</div>
</div>
<% if @course && User.current.allowed_to?(:manage_news, @course) %>

View File

@ -12,7 +12,7 @@
<%= link_to activity.try(:teacher).try(:realname), user_url_in_org(activity.tea_id), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to activity.name.to_s+" | 课程", course_url_in_org(activity.id), :class => "newsBlue ml15" %>
<%= link_to activity.name.to_s+" | 班级", course_url_in_org(activity.id), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.name, course_url_in_org(activity.id), :class => "postGrey" %>

View File

@ -12,7 +12,7 @@
<% else %>
<%= link_to activity.try(:user).try(:realname), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)" -->
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_url_in_org(activity.course.id), :class => "newsBlue ml15"%>
<%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_url_in_org(activity.course.id), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"-->
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :class => "postGrey"%>

View File

@ -12,7 +12,7 @@
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_url_in_org(activity.course.id), :class => "newsBlue ml15 mr5"%>
<%= link_to activity.course.name.to_s+" | 班级问答区", course_boards_url_in_org(activity.course.id), :class => "newsBlue ml15 mr5"%>
</div>
<div class="homepagePostTitle hidden m_w530 fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->

View File

@ -11,7 +11,7 @@
<% else %>
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)"-->
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_url_in_org(activity.course.id), :class => "newsBlue ml15" %>
<%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_url_in_org(activity.course.id), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :class => "postGrey" %>

View File

@ -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();

View File

@ -5,14 +5,14 @@
<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();">
<label><span class="c_red">*</span>&nbsp;课程名称&nbsp;&nbsp;</label>
<input type="text" name="title" id="new_syllabus_name" class="name_input" placeholder="例如:设计管理" 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">
<input type="text" name="eng_name" id="new_syllabus_eng_name" placeholder="例如Management of design" class="name_input" maxlength="100">
<!--<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>-->
</li>
<div class="cl"></div>

View File

@ -54,7 +54,9 @@
</div>
<div class="cl"></div>
<% end %>
<% end %>
<div class="fr fontGrey2">更新时间:<%=format_time @syllabus.updated_at %><div></div></div>
<div class="cl"></div>
<% end %>
<% count=@syllabus.journals_for_messages.count %>
<div class="homepagePostReply">

View File

@ -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}) %>");

View File

@ -4,7 +4,7 @@
<div class="page-header">
<div class="jumbotron">
<h1>课程作业列表</h1>
<h1>班级作业列表</h1>
<p class="lead">测试页面提供</p>
</div>
<% @courses.each do |course| %>

View File

@ -12,7 +12,7 @@
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to activity.course.name.to_s+" | 课程资源", course_files_path(activity.course), :class => "newsBlue ml15" %>
<%= link_to activity.course.name.to_s+" | 班级资源", course_files_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, course_files_path(activity.course), :class => "postGrey" %>

View File

@ -12,7 +12,7 @@
<%= link_to activity.try(:teacher).try(:realname), user_path(activity.tea_id), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to activity.name.to_s+" | 课程", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
<%= link_to activity.name.to_s+" | 班级", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>

View File

@ -23,7 +23,7 @@
<td class="td_w70 ">
<a href="<%= user_path(item.teacher) %>" title="<%= item.teacher.show_name %>"><%= item.teacher.show_name %></a>
</td>
<td class="td_w60 ">课程作业:</td>
<td class="td_w60 ">班级作业:</td>
<td class="td_w110 "><a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>"><%= item.homework_commons.count %></a></td>
</tr>
<tr>
@ -45,7 +45,7 @@
<% elsif User.current.member_of_course? item %>
<a href="<%=url_for(:controller => 'homework_common', :action => 'index',:course=>item.id, :host=>Setting.host_course)%>" target="_blank" class="blue_n_btn fr mt20">提交作品</a>
<% elsif User.current.logged?%>
<%= link_to "加入课程",try_join_path(:object_id => item.id), :class => "blue_n_btn fr mt20", :remote => "true",:id => "try_join_course_link"%>
<%= link_to "加入班级",try_join_path(:object_id => item.id), :class => "blue_n_btn fr mt20", :remote => "true",:id => "try_join_course_link"%>
<% end %>
<div class="cl"></div>
</div>

View File

@ -9,7 +9,7 @@
<div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)" -->
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
<%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle hidden fl m_w505"> <!--+"(作业名称)"-->
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>

View File

@ -9,7 +9,7 @@
<%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %>
TO
<% course=Course.find(activity.jour_id) %>
<%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
<%= link_to course.name.to_s+" | 班级留言", course_feedback_path(course), :class => "newsBlue ml15" %>
</div>
<!--<div class="homepagePostTitle break_word list_style upload_img">
<%# if activity.parent %>

View File

@ -8,7 +8,7 @@
<div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
TO
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
<%= link_to activity.course.name.to_s+" | 班级问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
</div>
<div class="homepagePostTitle hidden m_w530 fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->

View File

@ -8,7 +8,7 @@
<div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)"-->
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
<%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>

View File

@ -7,9 +7,9 @@
<ul class="homepagePostTypeHomework fl">
<li class="f14"><strong>课程消息</strong></li>
<li><%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "homepagePostTypeAssignment postTypeGrey" %></li>
<li><%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "homepagePostTypeForum postTypeGrey" %></li>
<li><%= link_to "课程通知",user_message_path(User.current, :type => 'course_news'), :class => "homepagePostTypeNotice postTypeGrey" %></li>
<li><%= link_to "课程问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li>
<li><%= link_to "班级讨论",user_message_path(User.current, :type => 'course_message'), :class => "homepagePostTypeForum postTypeGrey" %></li>
<li><%= link_to "班级通知",user_message_path(User.current, :type => 'course_news'), :class => "homepagePostTypeNotice postTypeGrey" %></li>
<li><%= link_to "班级问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li>
</ul>
</li>

View File

@ -43,7 +43,7 @@
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了课程作业:</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了班级作业:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<% if !User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil? %>
@ -65,7 +65,7 @@
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.show_name + "老师")%>刚刚发布了一个作业:
</p>
<ul class="ul_normal_color">
<li>课程名称:<%= ma.course_message.course.name %>
<li>班级名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red"><%= ma.course_message.name %></span></li>
<li>发布时间:<span style="color:Red;"><%= DateTime.parse(ma.course_message.created_at.to_s).strftime('%Y-%m-%d %H:%M').to_s %></span></li>
@ -81,7 +81,7 @@
<% else %>
<p><%= User.current.lastname + User.current.firstname %>同学您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:</p>
<ul class="ul_normal_color">
<li>课程名称:<%= ma.course_message.course.name %>
<li>班级名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;23:59</span></li>
@ -117,7 +117,7 @@
<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师发布的作业截止日期快到了:
</p>
<ul class="ul_normal_color">
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>班级名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;23:59</span></li>
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;&nbsp;23:59</span></li>
@ -154,7 +154,7 @@
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>开启了匿评,作业详情如下:
</p>
<ul class="ul_normal_color">
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>班级名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
<li>匿评截止:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li>
@ -185,7 +185,7 @@
该作业已经关闭了匿评。作业信息如下:
</p>
<ul class="ul_grey">
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>班级名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<%= ma.course_message.name %></li>
</ul>
<p></p>
@ -221,7 +221,7 @@
</p>
<ul class="ul_normal_color">
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)</li>
<li>班级名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time%>&nbsp;&nbsp;23:59</span></li>
</ul>
@ -292,7 +292,7 @@
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl">
<%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
<%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %></span></li>
<%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %></span></li>
<% if ma.course_message.parent_id.nil? %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course_message.subject, course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),
@ -359,7 +359,7 @@
<%= ma.course_message.reviewer_role == 3? "匿名用户" : (ma.course_message.user.show_name + "老师")%><%= ma.status == 0? "评阅了您的作品":"重新评阅了您的作品"%>。详情如下:
</p>
<ul class="ul_normal_color">
<li>课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)</li>
<li>班级名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%=ma.course_message.student_work.homework_common.name %></span></li>
<% content = ma.content.gsub("作业评分:","").split("&nbsp;&nbsp;&nbsp; 评语:")%>
<li>作品评分:<span style="color:Red;"><%= content[0] %>分</span></li>
@ -384,7 +384,7 @@
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a>
</li>
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在课程中留言了:</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在班级中留言了:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
@ -450,7 +450,7 @@
<ul class="ul_normal_color">
<li>回复内容:<span style="color:red;"><%= ma.course_message.notes %></span></li>
<li>您的评论:<span style="color:red;"><%= ma.course_message.jour.comment %></span></li>
<li>课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)</li>
<li>班级名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)</li>
<li>作业标题:<span style="color:Red;"><%=ma.course_message.jour.student_work.homework_common.name %></span></li>
</ul>
</div>
@ -479,7 +479,7 @@
<%= User.current.allowed_to?(:as_teacher,ma.course_message.homework_common.course) ? '老师':'同学'%>您好!由于迟交作业,您及您的作品都不能参与以下作业的匿评。作业详情如下:
</p>
<ul class="ul_grey">
<li>课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)</li>
<li>班级名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)</li>
<li>作业标题:<%= ma.course_message.homework_common.name %></li>
<li>提交截止:<%= ma.course_message.homework_common.end_time %>&nbsp;23:59</li>
<li>提交时间:<%= format_time(ma.course_message.created_at) %></li>
@ -541,29 +541,29 @@
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您成功创建了课程</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您成功创建了班级</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to "课程名称:" + ma.course_message.name, course_path(ma.course_message),
<%= link_to "班级名称:" + ma.course_message.name, course_path(ma.course_message),
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<!--:onmouseover => "message_titile_show($(this),event)",-->
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a></li>
<div style="display: none" class="message_title_red system_message_style">
<p>
<%= User.current.lastname + User.current.firstname %>老师您好!您成功创建了一个课程,详情如下:
<%= User.current.lastname + User.current.firstname %>老师您好!您成功创建了一个班级,详情如下:
</p>
<p>课程名称:<%= ma.course_message.name %></p>
<p>班级名称:<%= ma.course_message.name %></p>
<p>开课学期:<%= ma.course_message.time.to_s + '年' + ma.course_message.term %></p>
<p>课程ID<span style="color:red;"><%= ma.course_message.id %></span></p>
<p>课程密码:<span style="color:red;"><%= ma.course_message.password %></span></p>
<p>班级ID<span style="color:red;"><%= ma.course_message.id %></span></p>
<p>班级密码:<span style="color:red;"><%= ma.course_message.password %></span></p>
<p>学时总数:<%= ma.course_message.class_period %></p>
<p>创建时间:<%= format_time(ma.course_message.created_at) %></p>
<p>您可以点击左上角的“配置”按钮,修改课程基本信息添加及删除课程成员。您也可以把课程ID及密码告诉学生和其他成员让他们输入ID及密码加入课程。</p>
<p>您可以点击左上角的“配置”按钮,修改班级基本信息,添加及删除班级成员。您也可以把邀请码告诉学生和其他成员,让他们输入邀请码加入班级。</p>
<% if ma.course_message.is_public %>
<p>您的课程是公开的,所有人都能访问您的课程。若不想设置为公开,您可以在配置中设置。</p>
<p>您的班级是公开的,所有人都能访问您的班级。若不想设置为公开,您可以在配置中设置。</p>
<% else %>
<p>您的课程是私有的,非课程成员不能访问您的课程。如果想设置为公开,您可以在配置中设置。</p>
<p>您的班级是私有的,非班级成员不能访问您的班级。如果想设置为公开,您可以在配置中设置。</p>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
@ -580,13 +580,13 @@
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
课程申请进度反馈:</span>
班级申请进度反馈:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.status == 1 ?
'您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过'
'您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过'
:
'您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝', course_path(Course.find(ma.course_id)),
'您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝', course_path(Course.find(ma.course_id)),
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<!--:onmouseover => "message_titile_show($(this),event)",-->
<!--:onmouseout => "message_titile_hide($(this))" %>-->
@ -595,10 +595,10 @@
</li>
<div style="display: none" class="message_title_red system_message_style">
<p>
<%= User.current.lastname + User.current.firstname %>老师您好!您已成功加入课程<%= Course.find(ma.course_id).name%>。
<%= User.current.lastname + User.current.firstname %>老师您好!您已成功加入班级<%= Course.find(ma.course_id).name%>。
</p>
<p>申请课程<%= Course.find(ma.course_id).name%></p>
<div class="fl">课程描述:</div>
<p>申请班级<%= Course.find(ma.course_id).name%></p>
<div class="fl">班级描述:</div>
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe %></div>
<p>申请职位:<%= ma.content == '9' ? "教师" : "教辅"%></p>
</div>
@ -614,7 +614,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.course_message_id), user_path(User.find(ma.course_message_id)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了课程</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您加入了班级</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course.name, course_member_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -625,14 +625,14 @@
<div style="display: none" class="message_title_red system_message_style">
<% if ma.course.is_public? || User.current.member_of_course?(ma.course) || User.current.admin? %>
<% teacher = User.find(ma.course_message_id) %>
<p><%= teacher.show_name %>(<%= teacher %>)老师把您加入了课程,详情如下:</p>
<p>课程名称:<%= ma.course.name %></p>
<p><%= teacher.show_name %>(<%= teacher %>)老师把您加入了班级,详情如下:</p>
<p>班级名称:<%= ma.course.name %></p>
<p>开课学期:<%= ma.course.time.to_s + '年'+ ma.course.term %></p>
<p>课程ID<%= ma.course.id %></p>
<p>班级ID<%= ma.course.id %></p>
<p>课时总数:<%= ma.course.class_period %></p>
<% else %>
<p>
您已经被移出该私有课程,非课程成员没有权限访问私有课程
您已经被移出该私有班级,非班级成员没有权限访问私有班级
</p>
<% end %>
</div>
@ -648,7 +648,7 @@
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您增加了新的课程成员:</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您增加了新的班级成员:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")", user_path(ma.course_message_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -658,15 +658,15 @@
</li>
<div style="display: none" class="message_title_red system_message_style">
<% if ma.course.is_public? || User.current.member_of_course?(ma.course) || User.current.admin? %>
<p>您增加了新的课程成员,详情如下:</p>
<p>您增加了新的班级成员,详情如下:</p>
<p>成员:<%= User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")" %></p>
<p>课程名称:<%= ma.course.name %></p>
<p>班级名称:<%= ma.course.name %></p>
<p>开课学期:<%= ma.course.time.to_s + '年'+ ma.course.term %></p>
<p>课程ID<%= ma.course.id %></p>
<p>班级ID<%= ma.course.id %></p>
<p>课时总数:<%= ma.course.class_period %></p>
<% else %>
<p>
您已经被移出该私有课程,非课程成员没有权限访问私有课程
您已经被移出该私有班级,非班级成员没有权限访问私有班级
</p>
<% end %>
</div>
@ -682,7 +682,7 @@
</li>
<li class="homepageNewsPubType fl">
<%=link_to User.find(ma.course_message_id), user_path(User.find(ma.course_message_id)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了课程</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">将您移出了班级</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course.name, member_course_path(ma.course), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -692,8 +692,8 @@
</li>
<div style="display: none" class="message_title_red system_message_style">
<% if ma.course.is_public? || User.current.member_of?(ma.course) || User.current.admin? %>
<p>您已被<%= User.find(ma.course_message_id).show_name %>老师移出了课程,详情如下:</p>
<p>课程名称:<%= ma.course.name %></p>
<p>您已被<%= User.find(ma.course_message_id).show_name %>老师移出了班级,详情如下:</p>
<p>班级名称:<%= ma.course.name %></p>
<p>开课学期:<%= ma.course.time.to_s + '年'+ ma.course.term %></p>
<% if !ma.content.nil? %>
<p>担任角色:<%= ma.content %></p>
@ -701,7 +701,7 @@
<p>学时总数:<%= ma.course.class_period %></p>
<% else %>
<p>
您已经被移出该私有课程,非课程成员没有权限访问私有课程
您已经被移出该私有班级,非班级成员没有权限访问私有班级
</p>
<% end %>
</div>
@ -715,7 +715,7 @@
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl">
<span><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %></span><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了课程测验 </span></li>
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %></span><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了班级测验 </span></li>
<li class="homepageNewsContent fl">
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<!--:onmouseover =>"message_titile_show($(this),event)",-->
@ -725,10 +725,10 @@
<div style="display: none" class="message_title_red system_message_style">
<p>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>发布了课程测验 ,测验详情如下:
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>发布了班级测验 ,测验详情如下:
</p>
<ul class="ul_normal_color">
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>班级名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>测验标题:<%= ma.course_message.exercise_name %></li>
<!--<li>测验描述:<%#= ma.course_message.exercise_description %></li>-->
<!--<li>测验状态:<%#= ma.course_message.exercise_status == 1 ? '未发布':'已发布'%></li>-->
@ -763,15 +763,15 @@
<div style="display: none" class="message_title_red system_message_style">
<p>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>发布的课程测验截止时间快到了,测验详情如下:
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>发布的班级测验截止时间快到了,测验详情如下:
</p>
<ul class="ul_normal_color">
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>班级名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>测验标题:<%= ma.course_message.exercise_name %></li>
<li>截止时间:<%= ma.course_message.end_time.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S") %></li>
<li>答题时长:<%= ma.course_message.time == -1 ? '无限制' : ma.course_message.time.to_s + '分钟' %></li>
<p>请及时完成课程测验,辛苦啦!</p>
<p>请及时完成班级测验,辛苦啦!</p>
</ul>
</div>
<li class="homepageHomeworkContentWarn fl">截止时间快到啦 </li>

View File

@ -5,7 +5,7 @@
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 1, :search => @switch_search) %>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a>
</li>
<li>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">课程资源 </a>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">班级资源 </a>
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
</li>
<li>

View File

@ -17,7 +17,7 @@
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<li><%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
<li><%= link_to "课程留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li><%= link_to "班级留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
<% end %>

View File

@ -33,7 +33,7 @@
<ul class="fl">
<li class="f16 mb5">
<a href="<%= course_path(item.id)%>" class="fontGrey3 fl"><%= item.try(:highlight).try(:name) ? item.highlight.name[0].html_safe : item.name %></a>
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag">课程</span></div>
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag">班级</span></div>
<div class="cl"></div>
</li>
<li class="fontGrey3 mb5"><%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description %></li>

View File

@ -2,16 +2,16 @@
<% courses.each do |course|%>
<ul class="searchContent">
<li class="fl">
<%= link_to image_tag(url_to_avatar(Course.find(course.id)), :width => "75", :height => "75",:class=>'searchCourseImage'), course_path(course.id), :alt => "课程图片" %>
<%= link_to image_tag(url_to_avatar(Course.find(course.id)), :width => "75", :height => "75",:class=>'searchCourseImage'), course_path(course.id), :alt => "班级图片" %>
</li>
<li class="fl searchContentDes">
<ul class="fl">
<li class="f16 mb5">
<a href="<%= course_path(course.id)%>" class="fontGrey3 fl"><%= course.try(:highlight).try(:name) ? course.highlight.name[0].html_safe : course.name %></a>
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag">课程</span></div>
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag">班级</span></div>
<div class="cl"></div>
</li>
<li class="fontGrey3 mb5"><%= course.try(:highlight).try(:description) ? course.highlight.description[0].html_safe : (course.description.present? ? course.description : '暂时没有该课程描述') %></li>
<li class="fontGrey3 mb5"><%= course.try(:highlight).try(:description) ? course.highlight.description[0].html_safe : (course.description.present? ? course.description : '暂时没有该班级描述') %></li>
<li class="f12 fontGrey2">
<span class="mr30">教师:<%= User.find(course.tea_id).realname %></span>
<span class="mr30">授课时间:<%= course.time.to_s + course.term%></span>

View File

@ -79,7 +79,7 @@
<ul id="searchBanner">
<li id="searchBaner_1" class="searchBannerActive" onclick="HoverLi(1);on_click_search(1);"><a href="javascript:void(0);" id="searchType_1" class="fontGrey3 f14">全部<span style="font-weight:normal;"><font id="searchNum_1" class="c_red">(<%= @total_count%>)</font></span></a></li>
<li id="searchBaner_2" onclick="HoverLi(2);on_click_search(2);"><a href="javascript:void(0);" id="searchType_2" class="fontGrey2 f14">用户<span class="numRed" style="font-weight:normal;"><font id="searchNum_2" class="numRed">(<%= @users_count%>)</font></span></a></li>
<li id="searchBaner_3" onclick="HoverLi(3);on_click_search(3);"><a href="javascript:void(0);" id="searchType_3" class="fontGrey2 f14">课程<span style="font-weight:normal;"><font id="searchNum_3" class="numRed">(<%=@course_count%>)</font></span></a></li>
<li id="searchBaner_3" onclick="HoverLi(3);on_click_search(3);"><a href="javascript:void(0);" id="searchType_3" class="fontGrey2 f14">班级<span style="font-weight:normal;"><font id="searchNum_3" class="numRed">(<%=@course_count%>)</font></span></a></li>
<li id="searchBaner_4" onclick="HoverLi(4);on_click_search(4);"><a href="javascript:void(0);" id="searchType_4" class="fontGrey2 f14">资源<span class="numRed" style="font-weight:normal;"><font id="searchNum_4" class="numRed">(<%= @attach_count%>)</font></span></a></li>
<li id="searchBaner_5" onclick="HoverLi(5);on_click_search(5);"><a href="javascript:void(0);" id="searchType_5" class="fontGrey2 f14">项目<span class="numRed" style="font-weight:normal;"><font id="searchNum_5" class="numRed">(<%= @project_count%>)</font></span></a></li>
<li id="searchBaner_6" onclick="HoverLi(6);on_click_search(6);"><a href="javascript:void(0);" id="searchType_6" class="fontGrey2 f14">帖子<span class="numRed" style="font-weight:normal;"><font id="searchNum_6" class="numRed">(<%= @memo_count%>)</font></span></a></li>

View File

@ -13,7 +13,7 @@ en:
label_homework: Task
label_course_news: 课程通知
label_course_news: 班级通知
label_main_teacher: 主讲教师
label_course_term: 开始学期

View File

@ -16,8 +16,8 @@ zh:
label_course_name: 课程名称
label_homework: 作业
label_course_news: 课程通知
label_course_mail_news_reply: 课程通知回复
label_course_news: 班级通知
label_course_mail_news_reply: 班级通知回复
label_main_teacher: 主讲教师
label_course_term: 开始学期
label_isuue_mail_status: 更新了issue状态
@ -27,7 +27,7 @@ zh:
# 资源库 (课程、项目按类型分)
label_course_file: 资源库
label_upload_files: 上传资源
label_apply_join_course: 申请加入课程
label_apply_join_course: 申请加入班级
label_apply_for_homework: 申请引用作业
#
# 课程托管平台主页

View File

@ -354,12 +354,12 @@ zh:
permission_as_student: 作为学生
permission_paret_in_homework: 加入作业
permission_view_homework_attaches: 查看作品附件
permission_view_course_journals_for_messages: 查看课程留言
view_course_journals_for_messages: 课程留言
permission_view_course_journals_for_messages: 查看班级留言
view_course_journals_for_messages: 班级留言
label_send_course_journals_for_messages: 发布了留言
label_send_course_messages: 发布了讨论
permission_select_course_modules: 选择课程模块
permission_view_course_files: 查看课程资源
permission_view_course_files: 查看班级资源
permission_add_course: 新建课程
permission_edit_course: 编辑课程
permission_select_contest_modules: 选择竞赛模块
@ -485,7 +485,7 @@ zh:
label_new_course: 课程列表
label_course_all: 课程列表
label_excellent_courses_list: 精品课程列表
label_course_resource_list: 课程资源列表
label_course_resource_list: 班级资源列表
label_project_resource_list: 項目资源列表
label_teacher_all: 所有教师
label_requirement_enterprise_list: 众包列表
@ -1538,7 +1538,7 @@ zh:
label_my_brief_introduction: 今天的心情如何?留下你的脚印吧~
label_time: 年度
label_main_term: 课程学期
label_main_term: 班级学期
label_teacher_work_unit: 教师单位
label_course_time: 课程年度
label_i_new_activity: 有了新活动在
@ -1719,7 +1719,7 @@ zh:
label_assign_homework: 中布置了作业
label_noawards: 未评奖
label_course_modify_settings: 配置课程
label_course_modify_settings: 配置班级
label_homework_prompt: 贴心小提示:
label_homework_prompt_content: 亲,在这里我们的作业将以项目的形式提交,如果小伙伴们还没有创建项目,请先创建一个项目。项目创建成功后,就可以
label_create_homework: 布置了作业:
@ -1734,13 +1734,13 @@ zh:
label_search_by_student_id: 按学号过滤
label_institution_name: 单位名称
label_duration_time: 授课时间
label_course_brief_introduction: 课程简介
label_course_brief_introduction: 班级简介
field_teacher_name: 教 师
label_newbie_faq: '新手指引 & 问答'
label_hot_project: '热门项目'
label_borad_project: 项目讨论区
label_borad_course: 课程问答区
label_borad_course: 班级问答区
label_borad_org_subfield: 资源栏目讨论区
view_borad_course: 课程讨论
label_memo_create_succ: 发布成功
@ -1850,7 +1850,7 @@ zh:
label_contest_notification: 竞赛通知
label_company_name: 组织名
label_coursefile_sharingarea: 课程资源共享区
label_coursefile_sharingarea: 班级资源共享区
label_x_activity:
@ -1919,7 +1919,7 @@ zh:
label_attendingcontestwork_adaptive_system: 系统支持
label_attendingcontestwork_download: 作品下载
label_course_attendingcontestwork_download: 课件下载
label_course_mail_files: 课程资源
label_course_mail_files: 班级资源
label_attendingcontestwork_developers: 开发人员
label_attendingcontestwork_average_scores: 平均评分
label_attendingcontestwork_release_time: 发布时间
@ -1939,7 +1939,7 @@ zh:
label_notification: 通知公告
label_course_ad_description: 课程模块正在优化中,使用过程中如有问题请您与我们联系,感谢大家的支持!
label_course_adcolick: 请点击:
label_coursejoin_tip: 提示:加入课程才有权限查看或提交作业,“加入”按钮见课程图标右侧!
label_coursejoin_tip: 提示:加入班级才有权限查看或提交作业,“加入”按钮见班级图标右侧!
# ajax异步验证
modal_valid_passing: 可以使用
@ -2047,7 +2047,7 @@ zh:
label_recently_updated_homework: 最近更新了作业
label_recently_updated_message: 最近更新了留言
label_recently_updated_courseware: 最近更新了课件
label_no_courses: 您没有参与任何课程,请搜索课程、加入课程,或者创建课程吧!
label_no_courses: 您没有参与任何班级,请搜索班级、加入班级,或者创建班级吧!
label_commit_failed: 提交失败
label_recently: 最近被
label_creat: 创建
@ -2124,7 +2124,7 @@ zh:
# 课程推荐
label_homework_commont: 作业
label_homework_recommendation: 课程推荐
label_homework_recommendation: 班级推荐
#资源
label_resource_name: 资源名称

View File

@ -1076,6 +1076,8 @@ RedmineApp::Application.routes.draw do
resources :syllabuses do
member do
match 'syllabus_courselist', :to => 'syllabuses#syllabus_courselist', :via => :get, :as => 'syllabus_courselist'
get 'edit_syllabus_eng_name'
post 'update_base_info'
end
collection do

View File

@ -0,0 +1,8 @@
class RenameSyllabusColumn < ActiveRecord::Migration
def up
rename_column :syllabuses, :type, :syllabus_type
end
def down
end
end

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程问答区</td>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;班级问答区</td>
</tr></table>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
<div class="cl"></div>

View File

@ -12,7 +12,7 @@
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{news.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程通知</td>
<td>{{news.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;班级通知</td>
</tr></table>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="news.description|safeHtml"></div>
<div class="cl"></div>

View File

@ -1545,17 +1545,6 @@ function show_edit_file_description(id) {
$("#file_description_edit_"+id).focus();
}
//编辑资源描述之后提交
function edit_file_description(url,id){
$.get(
url,
{id: id ,description: $("#file_description_edit_"+id).val() },
function (data) {
}
);
}
//展开课程大纲列表中的班级
function expand_course_list(id, target, btnid, count) {
var target = $(target);

View File

@ -184,13 +184,17 @@ function regex_course_password(str)
}
//验证课程大纲
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();
if(document.getElementById(str + "_syllabus_id")) {
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;
}
} else {
return true;
}
}

View File

@ -28,4 +28,84 @@ 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;
}
}