Merge branch 'cxt_course' into develop
Conflicts: db/schema.rb public/javascripts/application.js
This commit is contained in:
commit
ef8b127225
|
@ -45,9 +45,62 @@ class AdminController < ApplicationController
|
|||
render :action => "projects", :layout => false if request.xhr?
|
||||
end
|
||||
|
||||
def courses
|
||||
def syllabuses
|
||||
@name = params[:name]
|
||||
@courses = Course.like(@name).order('created_at desc')
|
||||
@syllabuses = Syllabus.like(@name).order('created_at desc')
|
||||
@syllabuses = paginateHelper @syllabuses,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#为班级选择课程
|
||||
def select_course_syllabus
|
||||
@flag = false
|
||||
if params[:syllabus_id] && params[:course_id]
|
||||
course = Course.where("id = #{params[:course_id].to_i}").first
|
||||
unless course.nil?
|
||||
course.update_attribute('syllabus_id', params[:syllabus_id].to_i)
|
||||
@flag = true
|
||||
end
|
||||
end
|
||||
if @flag
|
||||
render :text=> "succ"
|
||||
else
|
||||
render :text=>'fail'
|
||||
end
|
||||
end
|
||||
|
||||
#新建课程
|
||||
def create_syllabus
|
||||
if params[:course_id]
|
||||
course = Course.where("id = #{params[:course_id]}").first
|
||||
if course
|
||||
@user = course.teacher
|
||||
syllabus = Syllabus.new
|
||||
syllabus.update_attributes(:title => params[:title], :eng_name => params[:eng_name], :user_id => @user.id)
|
||||
syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content
|
||||
if syllabus.save
|
||||
course.update_attribute('syllabus_id', syllabus.id)
|
||||
@flag = params[:flag].to_i
|
||||
@course = course
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def courses
|
||||
@name = params[:name].to_s.strip.downcase
|
||||
if @name && @name != ""
|
||||
@courses = Course.select{ |course| (course.teacher[:lastname].to_s.downcase + course.teacher[:firstname].to_s.downcase).include?(@name) || course.name.include?(@name)}
|
||||
@courses = @courses.sort{|x, y| y.created_at <=> x.created_at}
|
||||
else
|
||||
@courses = Course.order('created_at desc')
|
||||
end
|
||||
@courses = paginateHelper @courses,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
|
@ -55,6 +108,33 @@ class AdminController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#未配置班级列表
|
||||
def non_syllabus_courses
|
||||
@name = params[:name].to_s.strip.downcase
|
||||
if @name && @name != ""
|
||||
@courses = Course.where("syllabus_id is null").select{ |course| (course.teacher[:lastname].to_s.downcase + course.teacher[:firstname].to_s.downcase).include?(@name) || course.name.include?(@name)}
|
||||
@courses = @courses.sort{|x, y| y.created_at <=> x.created_at}
|
||||
else
|
||||
@courses = Course.where("syllabus_id is null").order('created_at desc')
|
||||
end
|
||||
@courses = paginateHelper @courses,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#修改课程名称
|
||||
def update_course_name
|
||||
@course = Course.where("id = #{params[:course_id].to_i}").first
|
||||
unless @course.nil?
|
||||
@course.update_attribute("name", params[:name])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#管理员界面精品课程列表
|
||||
def excellent_courses
|
||||
@courses = Course.where("is_excellent =? or excellent_option =?", 1, 1 )
|
||||
|
@ -72,10 +152,42 @@ class AdminController < ApplicationController
|
|||
courses = Course.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) #{params[:sort]}, c.id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'time')
|
||||
courses = Course.find_by_sql("SELECT * FROM courses WHERE name like '%#{name}%' ORDER BY time #{params[:sort]},id desc")
|
||||
courses = Course.find_by_sql("SELECT * FROM courses WHERE name like '%#{name}%' ORDER BY time #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'post')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(m.id) count FROM boards b, courses c, messages m WHERE m.board_id = b.id AND b.course_id = c.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count #{params[:sort]}, c.id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'res')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(at.container_id) cat FROM attachments at, courses c WHERE at.container_type = 'Course' AND at.container_id = c.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY cat #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'works')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(hc.id) chc FROM courses c, homework_commons hc,student_works sw WHERE c.id = hc.course_id AND sw.homework_common_id = hc.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY chc #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'homework')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(sw.id) csw FROM student_works sw, courses c, homework_commons hc WHERE c.id = hc.course_id AND sw.id = c.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY csw #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'std')
|
||||
courses = Course.find_by_sql("SELECT c.*, count(sfc.id) sfc FROM courses c, students_for_courses sfc WHERE sfc.course_id = c.id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY sfc #{params[:sort]}, id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
elsif params[:sort] && (params[:order] == 'open')
|
||||
courses = Course.find_by_sql("SELECT * FROM courses WHERE name like '%#{name}%' ORDER BY is_public #{params[:sort]},id desc")
|
||||
@order = params[:order]
|
||||
@sort = params[:sort]
|
||||
|
||||
else
|
||||
courses = Course.like(name).order('created_at desc')
|
||||
end
|
||||
|
|
|
@ -511,7 +511,7 @@ class ExerciseController < ApplicationController
|
|||
def commit_exercise
|
||||
# 老师不需要提交
|
||||
if User.current.allowed_to?(:as_teacher,@course)
|
||||
if @exercise.publish_time.nil?
|
||||
if @exercise.publish_time.nil? || @exercise.publish_time <= Time.now
|
||||
@exercise.update_attributes(:show_result => params[:show_result])
|
||||
@exercise.update_attributes(:exercise_status => 2)
|
||||
@exercise.update_attributes(:publish_time => Time.now)
|
||||
|
|
|
@ -6,7 +6,7 @@ class SyllabusesController < ApplicationController
|
|||
include CoursesHelper
|
||||
|
||||
before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy, :delete_syllabus]
|
||||
before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :update_base_info, :delete_syllabus, :delete_des]
|
||||
before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des]
|
||||
def index
|
||||
user = User.current
|
||||
@syllabuses = user.syllabuses
|
||||
|
@ -140,6 +140,16 @@ class SyllabusesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#修改课程名称
|
||||
def edit_syllabus_title
|
||||
if @syllabus && params[:title] != ""
|
||||
@syllabus.update_column("title",params[:title])
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#修改英文名称
|
||||
def edit_syllabus_eng_name
|
||||
if @syllabus
|
||||
|
|
|
@ -2782,8 +2782,8 @@ class UsersController < ApplicationController
|
|||
|
||||
# 获取我的课程资源
|
||||
def get_course_resources author_id, user_course_ids, order, score
|
||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
|
||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and container_type = 'Course')"+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
|
||||
and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
end
|
||||
|
||||
|
|
|
@ -3322,3 +3322,21 @@ def get_group_member_names work
|
|||
end
|
||||
result
|
||||
end
|
||||
|
||||
def course_syllabus_option user = User.current
|
||||
syllabuses = user.syllabuses
|
||||
type = []
|
||||
option1 = []
|
||||
option1 << "请选择课程"
|
||||
option1 << 0
|
||||
type << option1
|
||||
unless syllabuses.empty?
|
||||
syllabuses.each do |syllabus|
|
||||
option = []
|
||||
option << syllabus.title
|
||||
option << syllabus.id
|
||||
type << option
|
||||
end
|
||||
end
|
||||
type
|
||||
end
|
||||
|
|
|
@ -772,12 +772,12 @@ module CoursesHelper
|
|||
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
|
||||
method = joined ? 'delete' : 'post'
|
||||
if joined
|
||||
link = link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
|
||||
link = link_to(text, url, :remote => true, :method => method, :class => "Blue-btn", :style => "margin_left: 0px;", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
|
||||
else
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "pr_join_a")
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "Blue-btn", :style => "margin_left: 0px;")
|
||||
end
|
||||
else
|
||||
link = "<span class='pr_join_span mr5' >#{l(:label_course_join_student)}</span>"
|
||||
link = "<span class='pr_join_span mr5' >#{l(:label_course_join_student)}</span>"
|
||||
end
|
||||
link.html_safe
|
||||
end
|
||||
|
|
|
@ -9,9 +9,18 @@ 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, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
|
||||
attr_accessible :user_id, :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'
|
||||
|
||||
scope :like, lambda {|arg|
|
||||
if arg.blank?
|
||||
where(nil)
|
||||
else
|
||||
pattern = "%#{arg.to_s.strip.downcase}%"
|
||||
where(" LOWER(title) LIKE :p ", :p => pattern)
|
||||
end
|
||||
}
|
||||
|
||||
def delete_kindeditor_assets
|
||||
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::SYLLABUS
|
||||
end
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
|
@ -22,7 +25,7 @@
|
|||
<%= visable_attachemnts_incourse(course).count%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", course.boards.first.id, nil).count %>
|
||||
<%= Message.where("board_id =?", course.boards.first.id).count %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.course_activities.count%>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= course.class_period %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.updated_at.strftime('%Y-%m-%d %H:%M:%S') %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option(course.teacher),course.syllabus_id), {:id=>"new_syllabus_id_#{course.id}", :class=>"course_syllabus_input", :onchange=>"select_syllabus(#{course.id});"}%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="javascript:void(0)" onclick="alert_new_syllabus(<%=course.id %>, 0)">新建课程</a>
|
||||
<%#= link_to "新建课程", admin_create_syllabus_path%>
|
||||
</td>
|
|
@ -0,0 +1,7 @@
|
|||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to '课程列表', {:action => 'syllabuses'}, class: "#{current_page?(all_syllabuses_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to '全部班级列表', {:action => 'courses'}, class: "#{current_page?(all_courses_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to '未配置班级列表', {:action => 'non_syllabus_courses'}, class: "#{current_page?(non_syllabus_courses_path)? 'selected' : nil }" %></li>
|
||||
</ul>
|
||||
</div>
|
|
@ -5,15 +5,20 @@
|
|||
<h3>
|
||||
<%=l(:label_course_all)%>
|
||||
</h3>
|
||||
<%= render 'tab_syllabuses_courses' %>
|
||||
|
||||
<h3>
|
||||
班级列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
课程:
|
||||
班级:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '班级、老师名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'courses'},:remote => true, :class => 'icon icon-reload' %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'courses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
@ -25,46 +30,36 @@
|
|||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程
|
||||
<th style="width: 85px;">
|
||||
班级
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
<th style="width: 35px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
<th style="width: 20px;">
|
||||
学时
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
<th style="width: 15px;">
|
||||
<%=l(:field_is_public)%>
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
<th style="width: 45px;">
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
<th style="width: 45px;">
|
||||
动态时间
|
||||
</th>
|
||||
<th style="width:75px">
|
||||
课程
|
||||
</th>
|
||||
<th style="width:35px">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= course.class_period %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
<tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>">
|
||||
<%=render :partial => 'courselist_detail_tr', :locals => {:course => course} %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
@ -75,4 +70,19 @@
|
|||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function select_syllabus(id){
|
||||
val = $("#new_syllabus_id_"+id).children('option:selected').val();
|
||||
if(val != "0") {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/select_course_syllabus",
|
||||
data: {syllabus_id: val,
|
||||
course_id: id},
|
||||
success: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<% html_title(l(:label_course_all)) -%>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
hideModal();
|
||||
<%courses = Course.where("tea_id = #{@user.id}") %>
|
||||
<% unless courses.empty? %>
|
||||
<% courses.each do |course|%>
|
||||
$("#course_<%=course.id %>").html("<%=escape_javascript(render :partial => 'courselist_detail_tr', :locals => {:course => course}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @flag == 1 %>
|
||||
$("#course_<%=@course.id %>").html("");
|
||||
<% end %>
|
|
@ -27,32 +27,35 @@
|
|||
<th style="width: 25px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
<th style="width: 105px;">
|
||||
课程名
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
<th style="width: 35px;" class = "<%= @order == 'open' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '公开', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'open') %>
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
学生数
|
||||
<th style="width: 30px;" class = "<%= @order == 'std' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '学生数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'std') %>
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
作业数
|
||||
<th style="width: 30px;" class = "<%= @order == 'homework' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '作业数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'homework') %>
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
作品数
|
||||
<th style="width: 30px;" class = "<%= @order == 'works' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '作品数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'works') %>
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
资源数
|
||||
<th style="width: 30px;" class = "<%= @order == 'res' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '资源数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'res') %>
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
帖子数
|
||||
<th style="width: 30px;" class = "<%= @order == 'post' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '帖子数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'post') %>
|
||||
</th>
|
||||
<th style="width: 30px;" class = "<%= @order == 'act' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%=link_to '动态数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'act') %>
|
||||
<th style="width: 40px;" class = "<%= @order == 'act' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%= link_to '动态数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'act') %>
|
||||
</th>
|
||||
<th style="width: 40px;" class = "<%= @order == 'time' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
|
||||
<%=link_to '开课学期', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'time') %>
|
||||
<%= link_to '开课学期', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'time') %>
|
||||
</th>
|
||||
<th style="width: 40px;">
|
||||
</tr>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程名
|
||||
班级名
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
主讲老师
|
||||
|
|
|
@ -0,0 +1,164 @@
|
|||
<div class="contextual">
|
||||
<%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<h3>
|
||||
未配置班级列表
|
||||
</h3>
|
||||
<%= render 'tab_syllabuses_courses' %>
|
||||
|
||||
<h3>
|
||||
未配置班级列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
班级:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '班级、老师名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'non_syllabus_courses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
班级
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
学时
|
||||
</th>
|
||||
<th style="width: 15px;">
|
||||
<%=l(:field_is_public)%>
|
||||
</th>
|
||||
<th style="width: 45px;">
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
<th style="width: 45px;">
|
||||
动态时间
|
||||
</th>
|
||||
<th style="width:75px">
|
||||
课程
|
||||
</th>
|
||||
<th style="width:35px">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<a title="<%=course.name %>" id="rename_course_name_<%=course.id %>" ondblclick="rename_course_name($(this),'<%=course.name %>','<%=course.id %>');"><%= course.name%></a>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= course.class_period %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.updated_at.strftime('%Y-%m-%d %H:%M:%S') %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option(course.teacher),course.syllabus_id), {:id=>"new_syllabus_id_#{course.id}", :class=>"course_syllabus_input", :onchange=>"select_syllabus(#{course.id});"}%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="javascript:void(0)" onclick="alert_new_syllabus(<%=course.id %>, 1)">新建课程</a>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
var ele; //当前双击的链接
|
||||
var tagId; //班级的id
|
||||
var tagName; //班级名称
|
||||
|
||||
function rename_course_name(domEle,name,id){
|
||||
isdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html();
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
tagName = name;
|
||||
domEle.html('<input name="" id="renameCourseName" maxlength="120" minlength="1" style="width:125px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameCourseName").focus();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#renameCourseName").live("blur",function(){
|
||||
updateCourseName();
|
||||
}).live("keypress",function(e){
|
||||
if (e.keyCode == '13') {
|
||||
updateCourseName();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//执行修改courseName方法
|
||||
function updateCourseName(){
|
||||
if(isdb){
|
||||
isdb = false;
|
||||
if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_course_name_path %>',
|
||||
{"course_id": tagId, "name": $("#renameCourseName").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
function select_syllabus(id){
|
||||
val = $("#new_syllabus_id_"+id).children('option:selected').val();
|
||||
if(val != "0") {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/select_course_syllabus",
|
||||
data: {syllabus_id: val,
|
||||
course_id: id},
|
||||
success: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<% html_title(l(:label_course_all)) -%>
|
|
@ -0,0 +1,142 @@
|
|||
<h3>
|
||||
课程列表
|
||||
</h3>
|
||||
<%= render 'tab_syllabuses_courses' %>
|
||||
|
||||
<h3>
|
||||
课程列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
课程:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'syllabuses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
课程名称
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
班级名称
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
创建老师
|
||||
</th>
|
||||
<th style="width: 60px;">
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @syllabuses.each do |syllabus| %>
|
||||
<tr class="odd">
|
||||
<td style="text-align: center;">
|
||||
<%= syllabus.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=syllabus.title%>'>
|
||||
<span>
|
||||
<%= link_to(syllabus.title, syllabus_path(syllabus.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td class="center">
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(syllabus.try(:user).try(:realname).truncate(6, omission: '...'), user_path(syllabus.user)) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(syllabus.created_at) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% courses = syllabus.courses %>
|
||||
<% courses.each do |course| %>
|
||||
<tr class="even">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td class="center">
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<a title="<%=course.name %>" id="rename_course_name_<%=course.id %>" ondblclick="rename_course_name($(this),'<%=course.name %>','<%=course.id %>');"><%= course.name%></a>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
var ele; //当前双击的链接
|
||||
var tagId; //班级的id
|
||||
var tagName; //班级名称
|
||||
|
||||
function rename_course_name(domEle,name,id){
|
||||
isdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html();
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
tagName = name;
|
||||
domEle.html('<input name="" id="renameCourseName" maxlength="120" minlength="1" style="width:125px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameCourseName").focus();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#renameCourseName").live("blur",function(){
|
||||
updateCourseName();
|
||||
}).live("keypress",function(e){
|
||||
if (e.keyCode == '13') {
|
||||
updateCourseName();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//执行修改TAGName方法
|
||||
function updateCourseName(){
|
||||
if(isdb){
|
||||
isdb = false;
|
||||
if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_course_name_path %>',
|
||||
{"course_id": tagId, "name": $("#renameCourseName").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
$("#rename_course_name_<%=@course.id %>").html("<%=@course.name %>");
|
|
@ -7,7 +7,7 @@
|
|||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
<% if @syllabus.nil? %>
|
||||
<%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<% else %>
|
||||
<span><%=@syllabus.title %></span>
|
||||
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
|
||||
|
|
|
@ -31,14 +31,13 @@
|
|||
</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", :style=>'width:280px'} %>
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:280px'} %>
|
||||
<span class="c_red" id="edit_syllabus_notice" style="display: none;">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<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%>">
|
||||
<input type="text" name="course[name]" id="edit_course_name" autocomplete="off" 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>
|
||||
<input type="password" style="top: -100000px;position: fixed;">
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
|
|
|
@ -145,11 +145,11 @@
|
|||
alert("测验标题不能为空");
|
||||
} else if($.trim($("#exercise_end_time").val()) =="") {
|
||||
alert("截止时间不能为空");
|
||||
} else if((Date.parse($("#exercise_end_time").val())+(24*60*60-1)*1000) < Date.now()) {
|
||||
} else if((Date.parse($("#exercise_end_time").val())+(24*60*60-1)*1000) <= Date.now()) {
|
||||
alert("截止时间不能小于当前时间");
|
||||
} else if($.trim($("#exercise_time").val()) !="" && !/^[1-9][0-9]*$/.test($.trim($("#exercise_time").val()))) {
|
||||
alert("测验时长必须为非零开头的数字");
|
||||
} else if($.trim($("#exercise_publish_time").val()) !="" && Date.parse($("#exercise_publish_time").val()) < Date.now()) {
|
||||
} else if($.trim($("#exercise_publish_time").val()) !="" && ((Date.parse($("#exercise_publish_time").val())+(24*60*60-1)*1000) < Date.now())) {
|
||||
alert("发布时间不能小于当前时间");
|
||||
} else if($.trim($("#exercise_publish_time").val()) !="" && Date.parse($("#exercise_end_time").val()) < Date.parse($("#exercise_publish_time").val())) {
|
||||
alert("截止时间不能小于发布时间");
|
||||
|
|
|
@ -86,6 +86,14 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% unless User.current.logged? %>
|
||||
<div class="syllabusbox_tishi mt10">
|
||||
<p style="text-align: center;">您尚未登录,<a href='<%= signin_url_without_domain %>' class='syllabusbox_a_blue' target='_Blank' >登录</a>
|
||||
后可浏览更多信息
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="resources mt10" style="padding-bottom:5px;">
|
||||
<div class="reTop mb5">
|
||||
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search",:remote=>true) do %>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>-->
|
||||
<%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
|
||||
<div class="mb10">
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">延迟发布:</label>
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">延期发布:</label>
|
||||
<div class="calendar_div fl">
|
||||
<input type="text" name="publish_time" id="attachment_publish_time" placeholder="发布日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%=@file.publish_time %>">
|
||||
<%#= calendar_for('attachment_publish_time')%>
|
||||
|
@ -11,7 +11,7 @@
|
|||
<span class="fl c_red" style="margin-top: 4px;" id="publish_time_notice"></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--<div class="mt15"> <span class="f14 fontGrey3 mr10">延迟发布:</span>
|
||||
<!--<div class="mt15"> <span class="f14 fontGrey3 mr10">延期发布:</span>
|
||||
<input type="text" name="" placeholder="请输入0-50数值" class="markInput" />
|
||||
</div>-->
|
||||
<div>
|
||||
|
|
|
@ -57,6 +57,14 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% unless User.current.logged? %>
|
||||
<div class="syllabusbox_tishi mt10">
|
||||
<p style="text-align: center;">您尚未登录,<a href='<%= signin_url_without_domain %>' class='syllabusbox_a_blue' target='_Blank' >登录</a>
|
||||
后可浏览更多信息
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="resources mt10" style="padding-bottom:5px;">
|
||||
<div class="reTop mb5">
|
||||
<%= form_tag( search_project_project_files_path(@project), method: 'get',:class => "re_search",:remote=>true) do %>
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
<div class="homepagePostTitle break_word">
|
||||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
<%= link_to truncate(file.filename,length: 40, omission: '...'),
|
||||
download_named_attachment_path(file.id, file.filename),
|
||||
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
|
||||
<% else %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
|
||||
<%= link_to truncate(file.filename,length: 40, omission: '...'), attachment_history_download_path(file.id),
|
||||
:title => file.filename+"\n"+file.description.to_s,
|
||||
:class => "linkGrey3 f_14",
|
||||
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||
|
|
|
@ -35,6 +35,14 @@
|
|||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% unless User.current.logged? %>
|
||||
<div class="syllabusbox_tishi mt10">
|
||||
<p style="text-align: center;">您尚未登录,<a href='<%= signin_url_without_domain %>' class='syllabusbox_a_blue' target='_Blank' >登录</a>
|
||||
后可浏览更多信息
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="resources mt10" style="padding-bottom:5px;">
|
||||
<div class="reTop mb5">
|
||||
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search",:remote=>true) do %>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
<% if User.current.allowed_to?(:as_teacher,course) %>
|
||||
<div class="mb5">
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">延迟发布:</label>
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">延期发布:</label>
|
||||
<div class="calendar_div fl">
|
||||
<input type="text" name="publish_time" id="attachment_publish_time" placeholder="发布日期(可选)" class="InputBox fl W120 calendar_input" readonly="readonly">
|
||||
<%#= calendar_for('attachment_publish_time')%>
|
||||
|
|
|
@ -8,31 +8,29 @@
|
|||
<% end %>
|
||||
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
|
||||
</div>
|
||||
<div class="pr_info_id fl f14">
|
||||
<div class="pr_info_id fl f14 pr_info_name" style="margin-top: 0px;">
|
||||
<!--<span class="pr_info_name hidden">-->
|
||||
<% if @course.syllabus%>
|
||||
<a class="pr_info_name fb c_dark fl hidden" title="<%=@course.syllabus.title %>" style="max-width: 120px;" href="<%= Setting.protocol%>://<%= Setting.host_name%>/syllabuses/<%= @course.syllabus_id%>" target="_blank">
|
||||
<%=@course.syllabus.title %>
|
||||
<a class="c_dark" title="<%=@course.syllabus.title %>" href="<%= Setting.protocol%>://<%= Setting.host_name%>/syllabuses/<%= @course.syllabus_id%>" target="_blank">
|
||||
<%= @course.syllabus.title + " •" %>
|
||||
</a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<span class="hidden fl" style="max-width: 80px;" title="<%= @course.name %><%=@course.is_public == 0 ? '(私有)' : '(公开)' %>"><%= @course.name %></span><span class="fl"><%=@course.is_public == 0 ? '(私有)' : '(公开)' %></span>
|
||||
</br>
|
||||
<div class="cl"></div>
|
||||
<%= @course.name %><%=@course.is_public == 0 ? '(私有)' : '(公开)' %>
|
||||
<% 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" style="margin-top: 0px;">
|
||||
<% unless is_teacher %>
|
||||
<div id="join_in_course_header"><%= join_in_course_header(@course, User.current) %></div>
|
||||
<img src="/images/course/medal.png" alt="精品课程" style="vertical-align:bottom;" />
|
||||
<% end %>
|
||||
<!--</span>-->
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div>
|
||||
<span class="f14">邀请码:</span>
|
||||
<span class="f14 fontBlue2"><%=@course.generate_invite_code %></span>
|
||||
<span class="f14 fl">邀请码:</span>
|
||||
<span class="f14 fontBlue2 fl"><%=@course.generate_invite_code %></span>
|
||||
<% unless is_teacher %>
|
||||
<div id="join_in_course_header" class="fl ml35"><%= join_in_course_header(@course, User.current) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="pr_info_foot ">
|
||||
<%= l(:label_account_identity_teacher)%>(<%= course_teacher_link teacher_num %>)
|
||||
|
@ -46,6 +44,9 @@
|
|||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText boxShadow">
|
||||
<% if @course.syllabus %>
|
||||
<li><%= link_to "查看课程", syllabus_path(@course.syllabus), :class => "postOptionLink", :target => "_blank" %></li>
|
||||
<% end %>
|
||||
<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>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
|
||||
<% 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) %>
|
||||
<% href = board_message_path(ma.course_message.board_id, ma.course_message.parent_id ? ma.course_message.parent_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>
|
||||
<% 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>
|
||||
|
@ -104,7 +104,7 @@
|
|||
<% elsif ma.forge_message_type == "Journal" %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "Message" %>
|
||||
<li><a href="<%=project_boards_path(ma.forge_message.project,:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,:topic_id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>
|
||||
<li><a href="<%=board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "News" %>
|
||||
<li><a href="<%=news_path(ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 发布了新闻:<%= ma.forge_message.title.html_safe%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>发布了新闻:<%= ma.forge_message.title.html_safe%></a></li>
|
||||
<% elsif ma.forge_message_type == "Comment" %>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
||||
<li class="fl"><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<% 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();"%>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :id => 'syllabus_attr_edit', :class => 'undis 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 || syllabus.syllabus_type == '' %>
|
||||
<li><label>课程性质:</label><%=syllabus.syllabus_type_str %></li>
|
||||
<% end %>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
||||
<%= form_for('syllabus',:url => update_base_info_syllabus_path(syllabus.id),:remote => true) do |f|%>
|
||||
<li class="fl"><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<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>
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
<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();"%>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :class => "none", :onclick => "show_edit_eng_name();"%>
|
||||
<% end %>
|
|
@ -1,22 +1,25 @@
|
|||
<% teachers_num = teacher_count @syllabus%>
|
||||
<% students_num = student_count @syllabus%>
|
||||
<% files_num = file_count @syllabus%>
|
||||
<div class="pr_info_logo fl mb5">
|
||||
<%# teachers_num = teacher_count @syllabus%>
|
||||
<%# students_num = student_count @syllabus%>
|
||||
<%# files_num = file_count @syllabus%>
|
||||
<div class="pr_info_logo fl mb5 mr10">
|
||||
<%= image_tag("../images/syllabus.jpg",width:"60px", height: "60px") %>
|
||||
</div>
|
||||
<div class="fl ml15">
|
||||
<p class="homepageSyllabusName mb5" title="<%=@syllabus.title %>"><%=@syllabus.title %></p>
|
||||
<div class="cl"></div>
|
||||
<div class="fl">
|
||||
<div id="syllabus_title_show" class="homepageSyllabusName mb5">
|
||||
<%= render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus}%>
|
||||
</div>
|
||||
<textarea class="syllabusTitleTextarea none" placeholder="请编辑课程名称" id="syllabus_title_edit" onblur="edit_syllabus_title('<%= edit_syllabus_title_syllabus_path(@syllabus.id)%>');"><%= @syllabus.title %></textarea>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="mb5" id="syllabus_eng_name_show">
|
||||
<div class="mb5" id="syllabus_eng_name_show" style="word-break:normal;word-wrap:normal;">
|
||||
<%= 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" 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>
|
||||
教师(<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>-->
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<span style="word-break: normal; word-wrap: normal;"><%=@syllabus.title %></span>
|
||||
|
||||
<% if User.current == syllabus.user %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :onclick => "show_edit_title();"%>
|
||||
<% end %>
|
|
@ -19,6 +19,10 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
</head>
|
||||
<body class="<%= h body_css_classes %>">
|
||||
<div id="wrapper">
|
||||
|
|
|
@ -42,12 +42,12 @@
|
|||
<div class="homepageContentContainer">
|
||||
<div class="homepageContent">
|
||||
<div class="homepageLeft">
|
||||
<div class="homepagePortraitContainer mt15">
|
||||
<div class="homepagePortraitContainer mt15" onmouseover="$('#syllabus_edit_title_png').show();$('#syllabus_edit_ng_name_png').show();" onmouseout="$('#syllabus_edit_title_png').hide();$('#syllabus_edit_ng_name_png').hide();">
|
||||
<%=render :partial => 'layouts/syllabus_info' %>
|
||||
</div>
|
||||
<% update_visiti_count @syllabus %>
|
||||
|
||||
<div class="homepageLeftMenuContainer" id="syllabus_base_info">
|
||||
<div class="homepageLeftMenuContainer" id="syllabus_base_info" onmouseover="$('#syllabus_attr_edit').show();" onmouseout="$('#syllabus_attr_edit').hide();">
|
||||
<%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %>
|
||||
</div>
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
|||
<div class="homepageLeftMenuBlock">
|
||||
<%=link_to '班级', {:controller => "syllabuses", :action => "syllabus_courselist", :id => @syllabus.id}, :class => 'homepageMenuText' %>
|
||||
<% if is_current_user%>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<% if User.current == @syllabus.user && 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">
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<%= user_for_homework_common activity,is_teacher %>
|
||||
</div>
|
||||
<% work = cur_user_works_for_homework activity %>
|
||||
<% if activity.end_time < Date.today && !is_teacher && !work.nil? %>
|
||||
<% if activity.end_time < Date.today && !is_teacher && !work.nil? && work.user == User.current %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<%= link_to "", {:controller => 'syllabuses', :action => 'syllabus_courselist', :id =>@syllabus, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
</div>
|
||||
<p class="fr grayTxt">创建老师:<%=@syllabus.user.show_name %><span class="mr10 "></span> 创建时间:<%=format_date @syllabus.created_at %></p>
|
||||
<!-- <p class="fr grayTxt">创建老师:<%#=@syllabus.user.show_name %><span class="mr10 "></span> 创建时间:<%#=format_date @syllabus.created_at %></p> -->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
$("#syllabus_title_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus} %>");
|
||||
$("#syllabus_title_show").show();
|
||||
$("#syllabus_title_edit").hide();
|
|
@ -9,16 +9,12 @@
|
|||
<div class="RightBanner" >
|
||||
<p >课程信息</p>
|
||||
</div>
|
||||
<% if @syllabus.des_status == 1 && @syllabus.courses.empty? %>
|
||||
<% if @syllabus.des_status == 1 && @syllabus.courses.where("is_delete = 0").empty? %>
|
||||
<div class="syllabusbox_tishi">
|
||||
<% if User.current == @syllabus.user %>
|
||||
<p >您建立的课程还未创建班级,请
|
||||
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%>
|
||||
</p>
|
||||
<% elsif User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<p >本课程下还未创建班级,请
|
||||
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%>
|
||||
</p>
|
||||
<% else %>
|
||||
<p >本课程下还未创建班级,敬请期待。
|
||||
</p>
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<%= user_for_homework_common activity,is_teacher %>
|
||||
</div>
|
||||
<% work = cur_user_works_for_homework activity %>
|
||||
<% if activity.end_time < Date.today && !is_teacher && !work.nil? %>
|
||||
<% if activity.end_time < Date.today && !is_teacher && !work.nil? && work.user == User.current %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
</div>
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<%= user_for_homework_common homework_common,is_teacher %>
|
||||
</div>
|
||||
<% work = cur_user_works_for_homework homework_common %>
|
||||
<% if !is_teacher && !work.nil? && homework_common.end_time < Date.today %>
|
||||
<% if !is_teacher && !work.nil? && homework_common.end_time < Date.today && work.user == User.current %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "追加附件", student_work_index_url_in_org(homework_common.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
|
||||
</div>
|
||||
|
|
|
@ -295,7 +295,7 @@
|
|||
<%= 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),
|
||||
<%= link_to ma.course_message.subject, board_message_path(ma.course_message.board_id, ma.course_message.id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
|
@ -309,7 +309,7 @@
|
|||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.content.html_safe, 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),
|
||||
<%= link_to ma.course_message.content.html_safe, board_message_path(ma.course_message.board_id, ma.course_message.parent_id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
|
|
|
@ -156,9 +156,7 @@
|
|||
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project,
|
||||
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
|
||||
:topic_id => ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<li class="fontGrey3 mb5"><%= User.find(item.id).user_extensions && User.find(item.id).user_extensions.brief_introduction.present? ? User.find(item.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%></li>
|
||||
<li class="f12 fontGrey2">
|
||||
<span class="mr30">加入时间:<%= format_date( User.find(item.id).created_on)%></span><span class="mr30">
|
||||
最后登陆时间:<%= format_date( User.find(item.id).last_login_on)%></span><span class="mr30">
|
||||
最后登录时间:<%= format_date( User.find(item.id).last_login_on)%></span><span class="mr30">
|
||||
<%= User.find(item.id).user_extensions.occupation.present? ? '单位:'+User.find(item.id).user_extensions.occupation : ''%></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</li>
|
||||
<li class="fontGrey3 mb5"><%= User.find(user.id).user_extensions && User.find(user.id).user_extensions.brief_introduction.present? ? User.find(user.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%></li>
|
||||
<li class="f12 fontGrey2"><span class="mr30">加入时间:<%= format_date( User.find(user.id).created_on)%></span><span class="mr30">
|
||||
最后登陆时间:<%= format_date( User.find(user.id).last_login_on)%></span><span class="mr30">
|
||||
最后登录时间:<%= format_date( User.find(user.id).last_login_on)%></span><span class="mr30">
|
||||
<%= User.find(user.id).user_extensions.occupation.present? ? '单位:'+User.find(user.id).user_extensions.occupation : ''%></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -12,7 +12,7 @@ zh:
|
|||
#
|
||||
label_course_join_student: 加入班级
|
||||
label_course_exit_student: 退出班级
|
||||
label_course_new: 新建课程
|
||||
label_course_new: 新建班级
|
||||
label_course_name: 课程名称
|
||||
|
||||
label_homework: 作业
|
||||
|
|
|
@ -482,9 +482,10 @@ zh:
|
|||
label_show_contest: 显示竞赛
|
||||
#by young
|
||||
label_requirement: 需求
|
||||
label_new_course: 课程列表
|
||||
label_course_all: 课程列表
|
||||
label_excellent_courses_list: 精品课程列表
|
||||
label_new_course: 班级列表
|
||||
label_course_all: 班级列表
|
||||
label_syllabus_all: 课程列表
|
||||
label_excellent_courses_list: 精品班级列表
|
||||
label_course_resource_list: 班级资源列表
|
||||
label_project_resource_list: 項目资源列表
|
||||
label_teacher_all: 所有教师
|
||||
|
@ -1139,7 +1140,7 @@ zh:
|
|||
text_account_destroy_confirmation: |-
|
||||
确定继续处理?
|
||||
您的账号一旦删除,将无法再次激活使用。
|
||||
error_session_expired: 您的会话已过期。请重新登陆。
|
||||
error_session_expired: 您的会话已过期。请重新登录。
|
||||
text_session_expiration_settings: "警告: 更改这些设置将会使包括你在内的当前会话失效。"
|
||||
setting_session_lifetime: 会话最大有效时间
|
||||
setting_session_timeout: 会话闲置超时
|
||||
|
@ -1367,7 +1368,7 @@ zh:
|
|||
label_bid_reason_homework: 请输入作业提交说明!
|
||||
label_create_new_projects: 创建项目
|
||||
label_call_for_bids: 发布需求
|
||||
label_create_course: 创建课程
|
||||
label_create_course: 创建班级
|
||||
|
||||
label_milestone: 里程碑
|
||||
label_features: 特性
|
||||
|
@ -1488,7 +1489,7 @@ zh:
|
|||
|
||||
|
||||
label_user_project: 项目
|
||||
label_user_course: 课程
|
||||
label_user_course: 班级
|
||||
label_user_homework: 作业
|
||||
|
||||
label_bid_if_agreement: 如果喜欢我,请点击我
|
||||
|
@ -1542,7 +1543,7 @@ zh:
|
|||
label_teacher_work_unit: 教师单位
|
||||
label_course_time: 课程年度
|
||||
label_i_new_activity: 有了新活动在
|
||||
label_choose_course: 选择课程
|
||||
label_choose_course: 选择班级
|
||||
button_submit_homework: 提交作业
|
||||
button_submit_bid: 参与竞标
|
||||
label_requirement_from: 需求来源
|
||||
|
@ -1596,9 +1597,9 @@ zh:
|
|||
|
||||
#end
|
||||
|
||||
label_joined_course: 参加的课程
|
||||
label_created_course: 创建的课程
|
||||
label_course: 课程
|
||||
label_joined_course: 参加的班级
|
||||
label_created_course: 创建的班级
|
||||
label_course: 班级
|
||||
|
||||
|
||||
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
|
||||
|
|
|
@ -1035,7 +1035,10 @@ RedmineApp::Application.routes.draw do
|
|||
|
||||
match 'admin', :to => 'admin#index', :via => :get
|
||||
match 'admin/projects', :via => :get
|
||||
get 'admin/courses'
|
||||
get 'admin/courses', as: :all_courses
|
||||
get 'admin/syllabuses', as: :all_syllabuses
|
||||
get 'admin/non_syllabus_courses', as: :non_syllabus_courses
|
||||
post 'admin/update_course_name'
|
||||
get 'admin/excellent_courses', as: :excellent_courses
|
||||
get 'admin/excellent_all_courses', as: :excellent_all_courses
|
||||
match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course'
|
||||
|
@ -1068,6 +1071,8 @@ RedmineApp::Application.routes.draw do
|
|||
get 'admin/homework'
|
||||
get 'admin/apply_for_homework'
|
||||
get 'admin/code_work_tests'
|
||||
post 'admin/select_course_syllabus'
|
||||
post 'admin/create_syllabus'
|
||||
|
||||
resources :auth_sources do
|
||||
member do
|
||||
|
@ -1086,6 +1091,7 @@ RedmineApp::Application.routes.draw do
|
|||
member do
|
||||
match 'syllabus_courselist', :to => 'syllabuses#syllabus_courselist', :via => :get, :as => 'syllabus_courselist'
|
||||
get 'edit_syllabus_eng_name'
|
||||
get 'edit_syllabus_title'
|
||||
post 'update_base_info'
|
||||
get 'delete_syllabus'
|
||||
get 'delete_des'
|
||||
|
|
|
@ -367,7 +367,7 @@ end
|
|||
Redmine::MenuManager.map :admin_menu do |menu|
|
||||
menu.push :organization, {:controller => 'admin', :action => 'organization'}, :caption => :label_organization_list
|
||||
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
|
||||
menu.push :courses, {:controller => 'admin', :action => 'courses'}, :caption => :label_course_all
|
||||
menu.push :syllabuses, {:controller => 'admin', :action => 'syllabuses'}, :caption => :label_course_all
|
||||
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
|
||||
menu.push :messages, {:controller => 'admin', :action => 'messages'}, :caption => :label_system_message
|
||||
menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural
|
||||
|
|
|
@ -1810,3 +1810,72 @@ function showcity(province, cityField) {
|
|||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
function regex_syllabus_name() {
|
||||
var name = $.trim($("#new_syllabus_name").val());
|
||||
if(name.length < 2)
|
||||
{
|
||||
$("#new_syllabus_name_notice").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#new_syllabus_name_notice").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function alert_new_syllabus(course_id, flag){
|
||||
htmlvalue = "<div><h2 style='text-align: center'>新建课程</h2><ul>" +
|
||||
"<li class='ml45'>" +
|
||||
"<label><span class='c_red'>*</span> 课程名称 :</label>" +
|
||||
"<input type='text' name='title' id='new_syllabus_name' class='name_input' placeholder='例如:设计管理' maxlength='100' onkeyup='regex_syllabus_name();'><br>" +
|
||||
"<span class='c_red' id='new_syllabus_name_notice' style='display: none; font-size: 12px;'>课程名称不能为空且至少有两个字符</span>" +
|
||||
"</li>" +
|
||||
"<div class='cl'></div>" +
|
||||
"<li class='ml45'>" +
|
||||
"<label><span class='c_white'>*</span> 英文名称 :</label>" +
|
||||
"<input type='text' name='eng_name' id='new_syllabus_eng_name' placeholder='例如:Management of design' class='name_input' maxlength='100'>" +
|
||||
"</li>" +
|
||||
"<div class='cl'></div>" +
|
||||
"<li class='ml90' >" +
|
||||
"<a href='javascript:void(0)' style='margin-left: 145px;' class='Blue-btn fl' onclick='admin_new_syllabus("+course_id+","+flag+");' >提交</a>" +
|
||||
"<a href='javascript:void(0)' style='margin-left: 50px;' class='Blue-btn fl' onclick='hideModal();' >取消</a>" +
|
||||
"<div class='cl'></div>" +
|
||||
"</li>" +
|
||||
"</ul></div>";
|
||||
pop_up_box(htmlvalue,600,30,50);
|
||||
}
|
||||
|
||||
function admin_new_syllabus(course_id, flag){
|
||||
if(regex_syllabus_name()) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/create_syllabus",
|
||||
data: {course_id: course_id,
|
||||
title: $("#new_syllabus_name").val(),
|
||||
eng_name: $("#new_syllabus_eng_name").val(),
|
||||
flag: flag},
|
||||
success: function (data) {
|
||||
}
|
||||
});
|
||||
hideModal();
|
||||
}
|
||||
}
|
||||
|
||||
//执行修改courseName方法
|
||||
function updateCourseName(){
|
||||
if(isdb){
|
||||
isdb = false;
|
||||
if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_course_name_path %>',
|
||||
{"course_id": tagId, "name": $("#renameCourseName").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,20 +224,6 @@ function submit_new_syllabus()
|
|||
}
|
||||
}
|
||||
|
||||
function regex_syllabus_name() {
|
||||
var name = $.trim($("#new_syllabus_name").val());
|
||||
if(name.length < 2)
|
||||
{
|
||||
$("#new_syllabus_name_notice").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#new_syllabus_name_notice").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//课程讨论区
|
||||
function regexTopicSubject() {
|
||||
var name = $("#message_subject").val();
|
||||
|
|
|
@ -48,6 +48,24 @@ function edit_syllabus_eng_name(url){
|
|||
);
|
||||
}
|
||||
|
||||
//编辑课程名称
|
||||
function show_edit_title() {
|
||||
$("#syllabus_title_show").hide();
|
||||
$("#syllabus_title_edit").show();
|
||||
$("#syllabus_title_edit").focus();
|
||||
}
|
||||
|
||||
//编辑课程名称之后提交
|
||||
function edit_syllabus_title(url){
|
||||
$.get(
|
||||
url,
|
||||
{ title: $("#syllabus_title_edit").val().trim() },
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//展开所有属性
|
||||
function toggle_all_syllabus_attr(){
|
||||
var btn = $("#show_all_syllabus_attr");
|
||||
|
|
|
@ -1409,6 +1409,7 @@ table td {padding:2px;}
|
|||
table p {margin:0;}
|
||||
.odd {background-color:#f6f7f8;}
|
||||
.even {background-color: #fff;}
|
||||
.odd_grey {background-color: #b4b4b4}
|
||||
|
||||
a.sort { padding-right: 16px; background-position: 100% 50%; background-repeat: no-repeat; }
|
||||
a.sort.asc { background-image: url(../images/sort_asc.png); }
|
||||
|
@ -2847,4 +2848,10 @@ img.school_avatar {
|
|||
}
|
||||
|
||||
.admin_message_warn{font-size: 12px;color: red;}
|
||||
a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;margin-left: 58px;}
|
||||
a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;margin-left: 58px;}
|
||||
|
||||
.course_syllabus_input{width:120px;}
|
||||
.name_input{ border:1px solid #64bdd9; height:16px; width:310px; background:#fff; margin-bottom:10px; padding:5px;}
|
||||
a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
|
||||
a:hover.Blue-btn{ background:#3598db; color:#fff;}
|
||||
.c_white {color:#fff;}
|
|
@ -33,7 +33,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
|
|||
.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
|
||||
.homepageImageSexMan {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
|
||||
.homepageImageSexWomen {width: 20px;height: 20px;background: url(../images/homepage_icon.png) -10px -149px no-repeat;float: left;}
|
||||
.homepageSignatureTextarea {width:207px; height:80px; max-width:207px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 15px;;}
|
||||
.homepageSignatureTextarea {resize:none; width:207px; height:80px; max-width:207px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 15px;;}
|
||||
.homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;}
|
||||
.homepageImageBlock {margin:0 auto; width:78px; float:left; text-align:center; display:inline-block;}
|
||||
.homepageImageNumber {font-size:12px; color:#484848;}
|
||||
|
@ -292,4 +292,4 @@ div.modal {
|
|||
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
|
||||
a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
|
||||
a:hover.Blue-btn{ background:#3598db; color:#fff;}
|
||||
/***** end Ajax indicator ******/
|
||||
/***** end Ajax indicator ******/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
.search{ margin-top:8px; margin-left:71px;}
|
||||
/*信息*/
|
||||
.project_info{ background:#fff; padding:10px; padding-right:0px;width:222px; padding-right:8px; margin-bottom:10px;}
|
||||
.pr_info_id{ width:137px; color:#5a5a5a; font-size:14px; margin-top:5px;}
|
||||
.pr_info_id{ width:130px; color:#5a5a5a; font-size:14px; margin-top:5px;}
|
||||
.pr_info_logo{ border:1px solid #eaeaea; width:60px; height:60px; padding:1px;}
|
||||
.pr_info_logo:hover{ border:1px solid #64bdd9; }
|
||||
.pr_info_join{}
|
||||
|
|
|
@ -578,7 +578,7 @@ a.UsersAttBtn{ display:block; width:55px; height:20px; border:1px solid #d3d3d3;
|
|||
a:hover.UsersAttBtn{border:1px solid #888888; }
|
||||
a.UsersApBtn{ display:block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -177px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
|
||||
a:hover.UsersApBtn{border:1px solid #888888; }
|
||||
.homepageSignatureTextarea {width:207px; height:80px; max-width:207px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 0px;}
|
||||
.homepageSignatureTextarea {resize:none; width:207px; height:80px; max-width:207px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 0px;}
|
||||
.homepageSignature {font-size:12px; color:#888888; margin:10px 0; width:208px;}
|
||||
.homepageImageBlock {margin:0 auto; width:68px; float:left; text-align:center; display:inline-block;}
|
||||
a.homepageImageNumber {font-size:12px; font-weight: bold;} /*color:#484848;*/
|
||||
|
|
|
@ -181,3 +181,17 @@ a.follow-button:hover {background-color:#c1c1c1;}
|
|||
|
||||
/*组织未登录提示*/
|
||||
.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;}
|
||||
|
||||
/* 未登录的提示信息 */
|
||||
.syllabusbox_tishi{
|
||||
font-size:14px;
|
||||
width:733px;
|
||||
color:#cb7c01;
|
||||
padding:10px 0 0 15px;
|
||||
background:#fff7d1;
|
||||
border:1px solid #fcd9b4;
|
||||
height:34px;
|
||||
}
|
||||
a.syllabusbox_a_blue{
|
||||
color:#3b94d6 !important;
|
||||
}
|
||||
|
|
|
@ -1226,3 +1226,17 @@ a:hover.comment_ding_link{ color:#269ac9;}
|
|||
.orig_sub:hover{ background:#297fb8;}
|
||||
.orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:8px 0;}
|
||||
.orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;}
|
||||
|
||||
/* 未登录的提示信息 */
|
||||
.syllabusbox_tishi{
|
||||
font-size:14px;
|
||||
width:733px;
|
||||
color:#cb7c01;
|
||||
padding:10px 0 0 15px;
|
||||
background:#fff7d1;
|
||||
border:1px solid #fcd9b4;
|
||||
height:34px;
|
||||
}
|
||||
a.syllabusbox_a_blue{
|
||||
color:#3b94d6 !important;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
|
|||
.tag_h span,.tag_h a{ margin-bottom:5px;}
|
||||
/*信息*/
|
||||
.project_info{ background:#fff; padding:10px 8px; width:222px; margin-bottom:10px; border:1px solid #dddddd;}
|
||||
.pr_info_id{ width:137px; color:#5a5a5a; font-size:14px; margin-top:5px;}
|
||||
.pr_info_id{ width:130px; color:#5a5a5a; font-size:14px; margin-top:5px;}
|
||||
.pr_info_logo{ border:1px solid #eaeaea; width:60px; height:60px; padding:1px;}
|
||||
.pr_info_logo:hover{ border:1px solid #297fb8; }
|
||||
|
||||
|
@ -113,7 +113,7 @@ a.syllabusbox_a_blue{
|
|||
.syllabus_courses_list:hover{ background:#f6fafd;}
|
||||
.syllabus_courses_title{ font-size:16px; color:#333; width:650px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
.sy_p_grey{ margin-left:25px; color:#888; margin-top:5px; font-size:12px;}
|
||||
.syllabus_class_box{ padding-left:30px; background:#f6f6f6;}
|
||||
.syllabus_class_box{ padding-left:43px; background:#f6f6f6;}
|
||||
.syllabus_class_list{ padding:12px 0 12px 15px; height:44px;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7; position:relative;}
|
||||
.syllabus_class_list:hover{ background:#ececec;}
|
||||
.syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;}
|
||||
|
@ -155,4 +155,6 @@ a:hover.course-title{ color:#269ac9;}
|
|||
/*新建页面*/
|
||||
.name_input{ border:1px solid #64bdd9; height:16px; width:310px; background:#fff; margin-bottom:10px; padding:5px;}
|
||||
|
||||
.homepageSyllabusName {font-size:16px; color:#484848; height:25px; float:left; font-weight: bold; max-width:120px;overflow: hidden; white-space:nowrap; text-overflow:ellipsis;}
|
||||
.homepageSyllabusName {font-size:16px; color:#484848; float:left; max-width:120px;}
|
||||
.syllabusTitleTextarea {resize:none; width:120px; margin-left: 10px; height:80px; max-width:120px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 0px;}
|
||||
|
||||
|
|
Loading…
Reference in New Issue