课程大纲的显示和编辑
This commit is contained in:
parent
383483de26
commit
e066445036
|
@ -1,7 +1,7 @@
|
|||
class SyllabusesController < ApplicationController
|
||||
|
||||
before_filter :is_logged, :only => [:index, :show]
|
||||
before_filter :find_syllabus, :only => [:show]
|
||||
before_filter :is_logged, :only => [:index, :show, :edit, :new, :update]
|
||||
before_filter :find_syllabus, :only => [:show, :edit, :update]
|
||||
def index
|
||||
user = User.current
|
||||
@syllabuses = user.syllabuses
|
||||
|
@ -17,12 +17,8 @@ class SyllabusesController < ApplicationController
|
|||
end
|
||||
|
||||
def new
|
||||
if User.current.login?
|
||||
@syllabus = Syllabus.new
|
||||
render :layout => 'new_base'
|
||||
else
|
||||
redirect_to signin_url
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
@ -47,6 +43,22 @@ class SyllabusesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_syllabus'}
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@syllabus.description = params[:syllabus][:description]
|
||||
@syllabus.save_attachments(params[:attachments])
|
||||
if @syllabus.save
|
||||
redirect_to syllabus_path(@syllabus)
|
||||
else
|
||||
redirect_to syllabus_path(@syllabus)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def find_syllabus
|
||||
@syllabus = Syllabus.find params[:id]
|
||||
|
|
|
@ -1367,7 +1367,15 @@ class UsersController < ApplicationController
|
|||
#显示更多用户课程
|
||||
def user_courses4show
|
||||
@page = params[:page].to_i + 1
|
||||
@type = params[:type]
|
||||
if @type == 'User'
|
||||
@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
|
||||
@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
|
||||
end
|
||||
|
||||
#显示更多用户项目
|
||||
|
|
|
@ -8,4 +8,5 @@ module OwnerTypeHelper
|
|||
JOURNALSFORMESSAGE = 7
|
||||
HOMEWORKCOMMON = 8
|
||||
BLOGCOMMENT = 9
|
||||
SYLLABUS = 10
|
||||
end
|
|
@ -24,6 +24,7 @@ class Attachment < ActiveRecord::Base
|
|||
belongs_to :course, foreign_key: 'container_id', conditions: "attachments.container_type = 'Course'"
|
||||
belongs_to :org_subfield, foreign_key: 'container_id', conditions: "attachements.container_type = 'OrgSubfield'"
|
||||
belongs_to :organization, foreign_key: 'container_id', conditions: "attachements.container_type = 'Organization'"
|
||||
belongs_to :syllabus, foreign_key: 'container_id', conditions: "attachements.container_type = 'Syllabus'"
|
||||
belongs_to :softapplication, foreign_key: 'container_id', conditions: "attachments.container_type = 'Softapplication'"
|
||||
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
|
||||
belongs_to :attachmentstype, :foreign_key => "attachtype",:primary_key => "id"
|
||||
|
|
|
@ -90,7 +90,8 @@ class Course < ActiveRecord::Base
|
|||
'description',
|
||||
'class_period',
|
||||
'open_student',
|
||||
'is_delete'
|
||||
'is_delete',
|
||||
'syllabus_id'
|
||||
|
||||
acts_as_customizable
|
||||
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
class Syllabus < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
include ApplicationHelper
|
||||
acts_as_taggable
|
||||
acts_as_attachable
|
||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
|
||||
belongs_to :user
|
||||
has_many :courses
|
||||
attr_accessible :description, :title, :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'
|
||||
|
||||
def delete_kindeditor_assets
|
||||
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::SYLLABUS
|
||||
end
|
||||
end
|
||||
|
|
|
@ -260,6 +260,7 @@ class CoursesService
|
|||
course.send(:safe_attributes=, params[:course], current_user)
|
||||
#course.safe_attributes = params[:course]
|
||||
#course.password = params[:course][:password]
|
||||
course.syllabus_id = params[:syllabus_id].to_i
|
||||
course.time = params[:time]
|
||||
course.term = params[:term]
|
||||
course.end_time = params[:end_time]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script type="text/javascript">
|
||||
function submit_copy_course() {
|
||||
if(regex_course_name('new')&®ex_course_class_period('new')&®ex_time_term('new'))
|
||||
if(regex_syllabus_option('new')&®ex_course_name('new')&®ex_course_class_period('new')&®ex_time_term('new'))
|
||||
{
|
||||
$("#new_course").submit();
|
||||
document.getElementById("submit_copy_course").onclick = "";
|
||||
|
@ -51,13 +51,15 @@
|
|||
<!--</span>-->
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
<%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<span class="c_red" id="new_syllabus_notice" style="display: none;">请选择课程大纲</span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="new_course_name" class="courses_input grey_border" maxlength="100" onkeyup="regex_course_name('new');" value="<%=@course.name %>">
|
||||
<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>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_class_period)%> :</label>
|
||||
|
@ -96,7 +98,7 @@
|
|||
<li class=" mb5 ml85">
|
||||
<label >公开 :</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">
|
||||
|
@ -106,13 +108,13 @@
|
|||
<label class="fl">
|
||||
<input name="course_content_type[]" type="checkbox" value="0" class="resourceCopy"/>
|
||||
作业</label>
|
||||
<span class="c_red ml5 fl mb10 w490">复制到新课中的作业将在1个月后发布、2个月后提交截止,请您调整作业的发布时间、截止时间等时间节点。</span>
|
||||
<span class="c_red ml5 fl mb10 w490">复制到新班级中的作业将在1个月后发布、2个月后提交截止,请您调整作业的发布时间、截止时间等时间节点。</span>
|
||||
</li>
|
||||
<li class="sendCourseName fl ml5">
|
||||
<label class="fl">
|
||||
<input name="course_content_type[]" type="checkbox" value="1" class="resourceCopy"/>
|
||||
资源</label>
|
||||
<span class="c_red ml5 fl mb10">复制到新课的资源将在1个月后发布,请您调整资源的发布时间,否则学生可能看不到资源。</span>
|
||||
<span class="c_red ml5 fl mb10">复制到新班级的资源将在1个月后发布,请您调整资源的发布时间,否则学生可能看不到资源。</span>
|
||||
</li>
|
||||
</ul>
|
||||
<!--<ul class="fl" id="copyResource2">
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
<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>
|
||||
|
|
|
@ -29,12 +29,15 @@
|
|||
<%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
<%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<span class="c_red" id="edit_syllabus_notice" style="display: none;">请选择课程大纲</span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="edit_course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name('edit');" value="<%= @course.name%>">
|
||||
<span class="c_red" id="edit_course_name_notice" style="display: none;">课程名称不能为空</span>
|
||||
<span class="c_red" id="edit_course_name_notice" style="display: none;">班级名称不能为空</span>
|
||||
<input type="password" style="top: -100000px;position: fixed;">
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
@ -73,19 +76,19 @@
|
|||
<li class=" mb5 ml80">
|
||||
<label >公开 :</label>
|
||||
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox">
|
||||
<span class="c_grey">(选中后课外用户可见该课程,否则仅对课内成员可见)</span>
|
||||
<span class="c_grey">(选中后班级外用户可见该班级,否则仅对班级内成员可见)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml30">
|
||||
<label >学生列表公开 :</label>
|
||||
<input <%= @course.open_student == 1 ? 'checked' : ''%> id="course_open_student" name="course[open_student]" type="checkbox" style="margin-left: 1px;"/>
|
||||
<span class="c_grey">(选中后课外用户可见学生列表,否则仅对课内成员可见)</span>
|
||||
<span class="c_grey">(选中后班级外用户可见学生列表,否则仅对班级内成员可见)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml30">
|
||||
<label >学生上传资源 :</label>
|
||||
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" style="margin-left: 1px;"/>
|
||||
<span class="c_grey">(选中后允许学生上传课程资源,否则不允许)</span>
|
||||
<span class="c_grey">(选中后允许学生上传班级资源,否则不允许)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
|
@ -96,11 +99,11 @@
|
|||
<% end %>
|
||||
</ul>
|
||||
<% if @course.is_delete == 1 %>
|
||||
<div class="mt30"><%=link_to "恢复该课程", renew_course_path(@course) %></div>
|
||||
<div class="mt30"><%=link_to "恢复该班级", renew_course_path(@course) %></div>
|
||||
<% else %>
|
||||
<div class="mt30">
|
||||
<img src="/images/pic_del.gif" class="mr5"><%=link_to "删除该课程", course_path(@course), :method => :delete, :confirm=>"确认要删除该课程吗?" %>
|
||||
<span>(友情提示:删除该课程后如果您想恢复该课程,请联系系统管理员!)</span>
|
||||
<img src="/images/pic_del.gif" class="mr5"><%=link_to "删除该班级", course_path(@course), :method => :delete, :confirm=>"确认要删除该班级吗?" %>
|
||||
<span>(友情提示:删除该班级后如果您想恢复该班级,请联系系统管理员!)</span>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -8,36 +8,26 @@
|
|||
<% end %>
|
||||
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
|
||||
</div>
|
||||
<div class="pr_info_id fl mb5 f14">ID:<%= @course.id %><%= @course.is_public == 0 ? "(私有)" : "(公开)" %>
|
||||
<div class="pr_info_id fl f14">
|
||||
<%= @course.name %></br>
|
||||
<% if @course.syllabus%>
|
||||
<a class="pr_info_name fb c_dark fl" href="<%= Setting.protocol%>://<%= Setting.host_name%>/syllabuses/<%= @course.syllabus_id%>" target="_blank">
|
||||
<%=@course.syllabus.title %>
|
||||
</a>
|
||||
<% end %>
|
||||
<% if is_excellent_course(@course) %>
|
||||
<img src="/images/course/medal.png" alt="精品课程" style="vertical-align:bottom;" class="ml5" />
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pr_info_id fl f14">
|
||||
<div class="pr_info_id fl f14" style="margin-top: 0px;">
|
||||
<% unless is_teacher %>
|
||||
<div id="join_in_course_header"><%= join_in_course_header(@course, User.current) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<a class="pr_info_name fl c_dark fb" href="http://<%= Setting.host_course%>/courses/<%= @course.id%>" target="_blank"></a>
|
||||
<div>
|
||||
<a class="pr_info_name c_dark fb fl" href="http://<%= Setting.host_course%>/courses/<%= @course.id%>" target="_blank">
|
||||
<%= @course.name %>
|
||||
</a>
|
||||
<span id="course_outline_bar">
|
||||
<% if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %>
|
||||
<a href="javascript:void(0);" title="设置课程大纲" onclick="course_outline('<%= @course.id%>')" class="mr5 syllabusSetting fl"> </a>
|
||||
<% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0 %>
|
||||
<a href="<%=syllabus_course_path(@course) %>" title="课程大纲" class="mr5 syllabusIcon fl"> </a>
|
||||
<% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0 %>
|
||||
<a href="<%=syllabus_course_path(@course) %>" title="课程大纲" class="mr5 syllabusIcon fl"> </a>
|
||||
<% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0 %>
|
||||
<a href="<%=syllabus_course_path(@course) %>" title="课程大纲" class="mr5 syllabusIcon fl"> </a>
|
||||
<%else %>
|
||||
<%end %>
|
||||
</span>
|
||||
</div>
|
||||
<span class="f14">邀请码:</span>
|
||||
<span class="f14 fontBlue2"><%=@course.generate_invite_code %></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="pr_info_foot ">
|
||||
|
@ -52,7 +42,7 @@
|
|||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText boxShadow">
|
||||
<li><%= link_to "课程配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %></li>
|
||||
<li><%= link_to "班级配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %></li>
|
||||
<li><%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %></li>
|
||||
<li><%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %></li>
|
||||
</ul>
|
||||
|
|
|
@ -79,12 +79,12 @@
|
|||
<% if courses.size == 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('<%= user_courses4show_user_path(user.id)%>');"></a>
|
||||
<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>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var coursecount = <%= user.courses.visible.where("is_delete =?", 0).count %>;
|
||||
var coursecount = <%= all_count %>;
|
||||
var courseshowcount = document.getElementsByClassName("coursesLineGrey").length;
|
||||
|
||||
if((coursecount <= courseshowcount)&&(coursecount > 5) ){
|
||||
|
|
|
@ -57,12 +57,7 @@
|
|||
<div class="project_info" style="position: relative" id="project_info_<%=@course.id %>">
|
||||
<%=render :partial=>'layouts/project_info' %>
|
||||
</div><!--课程信息 end-->
|
||||
<% if (User.current.logged? && User.current.member_of_course?(@course)) || is_teacher %>
|
||||
<div class="info_box mb10">
|
||||
<p class="f14">邀请码</p>
|
||||
<p class="f14 fontBlue2"><%=@course.generate_invite_code %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="info_box">
|
||||
<ul>
|
||||
<li><%= l(:label_main_teacher)%> : <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %></li>
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
<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 'jquery/jquery-ui-1.9.2', 'syllabus','new_user','prettify','share',:media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify'%>
|
||||
<%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify','syllabus'%>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
|
@ -30,7 +30,7 @@
|
|||
</head>
|
||||
|
||||
<body onload="prettyPrint();">
|
||||
<% is_current_user = User.current.logged? && User.current == @user%>
|
||||
<% is_current_user = User.current.logged?%>
|
||||
<div class="navContainer">
|
||||
<% if User.current.logged? %>
|
||||
<%= render :partial => 'layouts/logined_header' %>
|
||||
|
@ -74,6 +74,8 @@
|
|||
<div class="homepageLeftMenuContainer">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" >班级</a>
|
||||
<% if is_current_user%>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<div class="courseMenu" id="courseMenu">
|
||||
<ul>
|
||||
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
|
||||
|
@ -81,7 +83,6 @@
|
|||
<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>
|
||||
|
@ -89,13 +90,17 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% else%>
|
||||
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入班级"%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
</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) %>
|
||||
<% all_count = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).count%>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>">
|
||||
<div id="homepageLeftMenuCourses">
|
||||
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => User.current, :page => 0} %>
|
||||
<%= 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>
|
||||
|
|
|
@ -230,10 +230,11 @@
|
|||
end
|
||||
%>
|
||||
<% 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) %>
|
||||
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" >
|
||||
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:type =>'User',:page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !courses.empty? %>
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
<% end %>
|
||||
<div class="RightBanner" >
|
||||
<p >课程信息</p>
|
||||
</div>
|
||||
<div class="HomeWork">
|
||||
<p class="f16 mb10">课程信息</p>
|
||||
<div class="HomeWorkCon">
|
||||
<!--<div class="">
|
||||
<textarea class="InputBox W700 h400" >
|
||||
<h2 class="syllabuscon_title">《设计管理》课程大纲</h2>
|
||||
<div class="syllabuscon_txt">
|
||||
<p class="syllabuscon_txt_title">一 . 课程目的</p>
|
||||
<p >1. 综合各门专业基础课程知识,运用前修课程获得的技术技能进行项目策划、设计、实施、运作方法研究;<br/>
|
||||
2. 初步学会运用现代科学的设计理念;实施规范;系统管理观念运作;<br/>
|
||||
3. 确立现代设计管理意识及培育实施务实思想。
|
||||
</p>
|
||||
<p class="syllabuscon_txt_title">二 . 主要目标</p>
|
||||
<p >1. 培养学生具备设计管理的理念;<br/>
|
||||
2. 培养学生了解和掌握项目策划、设计、实事、运作方法;<br/>
|
||||
3. 培养学生运用现代科学的设计理念;实施规范;系统管理观念。确立现代设计管理意识及培育实施务实思想。
|
||||
</p>
|
||||
<p class="syllabuscon_txt_title">三 . 详细内容与学时安排</p>
|
||||
<p >1. 详细内容<br/>
|
||||
第一章 概论<br/>
|
||||
(1) 设计管理基本概念<br/>
|
||||
(2) 设计管理构成内容<br/>
|
||||
(3) 设计管理社会意义理论<br/>
|
||||
第二章 设计管理的文化内涵<br/>
|
||||
(1) 人类文化与设计文化<br/>
|
||||
(2) 设计文化与文化设计基本概念<br/>
|
||||
2. 安排学时<br/>
|
||||
第一章 理论学时:6 实践学时:2 上级学时:0<br/>
|
||||
第二章 理论学时:6 实践学时:2 上级学时:0<br/>
|
||||
</p>
|
||||
<p class="syllabuscon_txt_title">四 . 讲授方法</p>
|
||||
<p >1. 理论讲授;<br/>
|
||||
2. 案例分析;<br/>
|
||||
3. 作业项目;<br/>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</textarea>
|
||||
</div>-->
|
||||
<%= labelled_form_for @syllabus, :url =>syllabus_path(@syllabus),
|
||||
:html => {:nhname=>'form',:multipart => true, :id => 'syllabus-form'} do |f| %>
|
||||
<div>
|
||||
<div id="syllabus_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
|
||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
|
||||
<%= f.kindeditor :description, :editor_id => 'syllabus_description_editor',
|
||||
:owner_id => @syllabus.nil? ? 0: @syllabus.id,
|
||||
:owner_type => OwnerTypeHelper::SYLLABUS,
|
||||
:width => '100%',
|
||||
:height => 300,
|
||||
:minHeight=>300,
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'syllabus_content',
|
||||
:class => 'talk_text fl',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<div class="cl"></div>
|
||||
<p id="description_notice_span"></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mt5">
|
||||
<div class="fl" id="syllabus_attachments">
|
||||
<%= render :partial => 'attachments/form_course', :locals => {:container => @syllabus, :isReply => false} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_syllabus();">发送</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="window.location.href = '<%=syllabus_path(@syllabus)%>';">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
</div>
|
||||
</div><!--HomeWork end-->
|
|
@ -0,0 +1,44 @@
|
|||
<div class="RightBanner" >
|
||||
<p >课程信息</p>
|
||||
</div>
|
||||
<div class="<%=@syllabus.description.nil? ? 'HomeWork' : 'syllabusbox'%>">
|
||||
<% if @syllabus.description.nil?%>
|
||||
<% if User.current == @syllabus.user %>
|
||||
<p class="syllabus_info_tishi">您建立的课程尚未填写课程大纲,请完善您的<%=link_to '课程大纲', edit_syllabus_path(@syllabus) %>!</p>
|
||||
<% else %>
|
||||
<p class="syllabus_info_tishi"><%=@syllabus.user.show_name %>老师尚未完成课程大纲的编写,敬请期待。</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="syllabuscon">
|
||||
<%=@syllabus.description %>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @syllabus} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostSetting" style="margin:10px;">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%=link_to '编辑', edit_syllabus_path(@syllabus),:class=>'postOptionLink' %></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount"><a href="javascript:void(0);" class="mr5">回复(2)</a>▪<a href="javascript:void(0);" class="ml5"> 赞(10)</a></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer">
|
||||
<div class="homepagePostReplyPortrait mr15"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="33" height="33" alt="用户头像" /></a></div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<input class="homepagePostReplyInput fl mr15" placeholder="请输入回复">
|
||||
<a href="javascript:void(0);" class="homepagePostReplyEmotion mt5"></a> <a href="javascript:void(0);" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a> </div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--回复框 用正式版样式-->
|
||||
</div><!--HomeWork end-->
|
|
@ -1 +1 @@
|
|||
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user, :page => @page} )%>");
|
||||
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user,:type=>@type,:page => @page, :all_count => @all_count} )%>");
|
||||
|
|
|
@ -10,8 +10,8 @@ zh:
|
|||
#
|
||||
# 课程公共标签
|
||||
#
|
||||
label_course_join_student: 加入课程
|
||||
label_course_exit_student: 退出课程
|
||||
label_course_join_student: 加入班级
|
||||
label_course_exit_student: 退出班级
|
||||
label_course_new: 新建课程
|
||||
label_course_name: 课程名称
|
||||
|
||||
|
|
|
@ -7,3 +7,25 @@ function show_more_course(url){
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
function regex_sylla_description() {
|
||||
syllabus_description_editor.sync();
|
||||
var name = syllabus_description_editor.html();
|
||||
if (name.length == 0) {
|
||||
$("#description_notice_span").text("描述不能为空");
|
||||
$("#description_notice_span").css('color', '#ff0000');
|
||||
$("#description_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$("#description_notice_span").text("填写正确");
|
||||
$("#description_notice_span").css('color', '#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submit_syllabus() {
|
||||
if (regex_sylla_description()) {
|
||||
$("#syllabus-form").submit();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue