commit
6ae4cd0767
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
|||||||
class CourseContributorScore < ActiveRecord::Base
|
class CourseContributorScore < ActiveRecord::Base
|
||||||
attr_accessible :course_id, :journal_num, :journal_reply_num, :message_num, :message_reply_num, :news_reply_num, :resource_num, :user_id, :total_score
|
attr_accessible :course_id, :journal_num, :journal_reply_num, :message_num, :message_reply_num, :news_reply_num,
|
||||||
|
:resource_num, :user_id, :total_score, :homework_journal_num, :news_num
|
||||||
belongs_to :course
|
belongs_to :course
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
end
|
end
|
||||||
|
@ -1,185 +1,185 @@
|
|||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
class Member < ActiveRecord::Base
|
class Member < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :principal, :foreign_key => 'user_id'
|
belongs_to :principal, :foreign_key => 'user_id'
|
||||||
has_many :member_roles, :dependent => :destroy
|
has_many :member_roles, :dependent => :destroy
|
||||||
has_many :roles, :through => :member_roles
|
has_many :roles, :through => :member_roles
|
||||||
|
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
belongs_to :course
|
belongs_to :course
|
||||||
|
|
||||||
belongs_to :course_group
|
belongs_to :course_group
|
||||||
validates_presence_of :principal
|
validates_presence_of :principal
|
||||||
validates_uniqueness_of :user_id, :scope => [:project_id,:course_id]
|
validates_uniqueness_of :user_id, :scope => [:project_id,:course_id]
|
||||||
validate :validate_role
|
validate :validate_role
|
||||||
|
|
||||||
before_destroy :set_issue_category_nil
|
before_destroy :set_issue_category_nil
|
||||||
# 删除项目成员一并删除该成员的邀请记录
|
# 删除项目成员一并删除该成员的邀请记录
|
||||||
after_destroy :delete_ivite_list
|
after_destroy :delete_ivite_list
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def role
|
def role
|
||||||
end
|
end
|
||||||
|
|
||||||
def role=
|
def role=
|
||||||
end
|
end
|
||||||
|
|
||||||
def name
|
def name
|
||||||
self.user.name
|
self.user.name
|
||||||
end
|
end
|
||||||
|
|
||||||
alias :base_role_ids= :role_ids=
|
alias :base_role_ids= :role_ids=
|
||||||
def role_ids=(arg)
|
def role_ids=(arg)
|
||||||
ids = (arg || []).collect(&:to_i) - [0]
|
ids = (arg || []).collect(&:to_i) - [0]
|
||||||
# Keep inherited roles
|
# Keep inherited roles
|
||||||
ids += member_roles.select {|mr| !mr.inherited_from.nil?}.collect(&:role_id)
|
ids += member_roles.select {|mr| !mr.inherited_from.nil?}.collect(&:role_id)
|
||||||
|
|
||||||
new_role_ids = ids - role_ids
|
new_role_ids = ids - role_ids
|
||||||
# Add new roles
|
# Add new roles
|
||||||
new_role_ids.each {|id| member_roles << MemberRole.new(:role_id => id) }
|
new_role_ids.each {|id| member_roles << MemberRole.new(:role_id => id) }
|
||||||
# Remove roles (Rails' #role_ids= will not trigger MemberRole#on_destroy)
|
# Remove roles (Rails' #role_ids= will not trigger MemberRole#on_destroy)
|
||||||
member_roles_to_destroy = member_roles.select {|mr| !ids.include?(mr.role_id)}
|
member_roles_to_destroy = member_roles.select {|mr| !ids.include?(mr.role_id)}
|
||||||
if member_roles_to_destroy.any?
|
if member_roles_to_destroy.any?
|
||||||
member_roles_to_destroy.each(&:destroy)
|
member_roles_to_destroy.each(&:destroy)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def <=>(member)
|
def <=>(member)
|
||||||
a, b = roles.sort.first, member.roles.sort.first
|
a, b = roles.sort.first, member.roles.sort.first
|
||||||
if a == b
|
if a == b
|
||||||
if principal
|
if principal
|
||||||
principal <=> member.principal
|
principal <=> member.principal
|
||||||
else
|
else
|
||||||
1
|
1
|
||||||
end
|
end
|
||||||
elsif a
|
elsif a
|
||||||
a <=> b
|
a <=> b
|
||||||
else
|
else
|
||||||
1
|
1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def deletable?
|
def deletable?
|
||||||
member_roles.detect {|mr| mr.inherited_from}.nil?
|
member_roles.detect {|mr| mr.inherited_from}.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
def include?(user)
|
def include?(user)
|
||||||
if principal.is_a?(Group)
|
if principal.is_a?(Group)
|
||||||
!user.nil? && user.groups.include?(principal)
|
!user.nil? && user.groups.include?(principal)
|
||||||
else
|
else
|
||||||
self.user == user
|
self.user == user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_issue_category_nil
|
def set_issue_category_nil
|
||||||
if user
|
if user
|
||||||
# remove category based auto assignments for this member
|
# remove category based auto assignments for this member
|
||||||
#modify by nwb
|
#modify by nwb
|
||||||
if project
|
if project
|
||||||
IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id]
|
IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id]
|
||||||
elsif course
|
elsif course
|
||||||
#IssueCategory.update_all "assigned_to_id = NULL", ["course_id = ? AND assigned_to_id = ?", course.id, user.id]
|
#IssueCategory.update_all "assigned_to_id = NULL", ["course_id = ? AND assigned_to_id = ?", course.id, user.id]
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# 删除成员一并删除该成员的邀请信息
|
# 删除成员一并删除该成员的邀请信息
|
||||||
def delete_ivite_list
|
def delete_ivite_list
|
||||||
member_invite_lists = InviteList.where("user_id =? and project_id =?", self.user_id, self.project_id)
|
member_invite_lists = InviteList.where("user_id =? and project_id =?", self.user_id, self.project_id)
|
||||||
unless member_invite_lists.nil?
|
unless member_invite_lists.nil?
|
||||||
member_invite_lists.each do |member_invite_list|
|
member_invite_lists.each do |member_invite_list|
|
||||||
member_invite_list.destroy
|
member_invite_list.destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find or initilize a Member with an id, attributes, and for a Principal
|
# Find or initilize a Member with an id, attributes, and for a Principal
|
||||||
def self.edit_membership(id, new_attributes, principal=nil)
|
def self.edit_membership(id, new_attributes, principal=nil)
|
||||||
@membership = id.present? ? Member.find(id) : Member.new(:principal => principal)
|
@membership = id.present? ? Member.find(id) : Member.new(:principal => principal)
|
||||||
@membership.attributes = new_attributes
|
@membership.attributes = new_attributes
|
||||||
@membership
|
@membership
|
||||||
end
|
end
|
||||||
|
|
||||||
# Finds or initilizes a Member for the given project and principal
|
# Finds or initilizes a Member for the given project and principal
|
||||||
def self.find_or_new(project, principal)
|
def self.find_or_new(project, principal)
|
||||||
project_id = project.is_a?(Project) ? project.id : project
|
project_id = project.is_a?(Project) ? project.id : project
|
||||||
principal_id = principal.is_a?(Principal) ? principal.id : principal
|
principal_id = principal.is_a?(Principal) ? principal.id : principal
|
||||||
|
|
||||||
member = Member.find_by_project_id_and_user_id(project_id, principal_id)
|
member = Member.find_by_project_id_and_user_id(project_id, principal_id)
|
||||||
member ||= Member.new(:project_id => project_id, :user_id => principal_id)
|
member ||= Member.new(:project_id => project_id, :user_id => principal_id)
|
||||||
member
|
member
|
||||||
end
|
end
|
||||||
|
|
||||||
# 查找每个学生每个作业的评分
|
# 查找每个学生每个作业的评分
|
||||||
def student_homework_score
|
def student_homework_score
|
||||||
homework_score = StudentWork.find_by_sql("SELECT homework_commons.name,student_works.final_score as score
|
homework_score = StudentWork.find_by_sql("SELECT homework_commons.name,student_works.final_score as score
|
||||||
FROM student_works,homework_commons
|
FROM student_works,homework_commons
|
||||||
WHERE student_works.homework_common_id = homework_commons.id
|
WHERE student_works.homework_common_id = homework_commons.id
|
||||||
AND homework_commons.course_id = #{self.course_id}
|
AND homework_commons.course_id = #{self.course_id}
|
||||||
AND student_works.user_id = #{self.user_id}")
|
AND student_works.user_id = #{self.user_id}")
|
||||||
score_count = StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
|
score_count = StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
|
||||||
[homework_score, format("%0.2f", score_count)]
|
[homework_score, format("%0.2f", score_count)]
|
||||||
end
|
end
|
||||||
|
|
||||||
def student_work_score
|
def student_work_score
|
||||||
StudentWork.select("homework_commons.name, student_works.final_score").joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}")
|
StudentWork.select("homework_commons.name, student_works.final_score").joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}")
|
||||||
end
|
end
|
||||||
|
|
||||||
#当前课程的作业列表
|
#当前课程的作业列表
|
||||||
def homework_common_list
|
def homework_common_list
|
||||||
HomeworkCommon.where(:course_id => self.course_id)
|
HomeworkCommon.where(:course_id => self.course_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
#当前学生在指定作业内的得分
|
#当前学生在指定作业内的得分
|
||||||
def homework_common_score homework_common
|
def homework_common_score homework_common
|
||||||
StudentWork.select("IF(final_score is null,null,final_score - absence_penalty - late_penalty) as final_score").where(:homework_common_id => homework_common.id,:user_id => self.user_id)
|
StudentWork.select("IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as final_score").where(:homework_common_id => homework_common.id,:user_id => self.user_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def student_work_score_avg
|
def student_work_score_avg
|
||||||
StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
|
StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
|
||||||
end
|
end
|
||||||
|
|
||||||
def student_work_score_sum
|
def student_work_score_sum
|
||||||
sql_select = "SELECT (SUM(IF(student_works.final_score is null,null,student_works.final_score - student_works.absence_penalty - student_works.late_penalty))) as score
|
sql_select = "SELECT (SUM(IF(student_works.final_score IS NULL,NULL,IF(student_works.final_score =0,0,student_works.final_score - student_works.absence_penalty - student_works.late_penalty)))) as score
|
||||||
FROM student_works,homework_commons
|
FROM student_works,homework_commons
|
||||||
WHERE student_works.homework_common_id = homework_commons.id
|
WHERE student_works.homework_common_id = homework_commons.id
|
||||||
AND homework_commons.course_id = #{self.course_id}
|
AND homework_commons.course_id = #{self.course_id}
|
||||||
AND student_works.user_id = #{self.user_id}"
|
AND student_works.user_id = #{self.user_id}"
|
||||||
score = StudentWork.find_by_sql(sql_select)
|
score = StudentWork.find_by_sql(sql_select)
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def validate_role
|
def validate_role
|
||||||
errors.add_on_empty :role if member_roles.empty? && roles.empty?
|
errors.add_on_empty :role if member_roles.empty? && roles.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def searchTeacherAndAssistant project
|
def searchTeacherAndAssistant project
|
||||||
#searchPeopleByRoles(project, TeacherRoles)
|
#searchPeopleByRoles(project, TeacherRoles)
|
||||||
members = []
|
members = []
|
||||||
project.members.each do |m|
|
project.members.each do |m|
|
||||||
members << m if m && m.user && m.user.allowed_to?(:as_teacher,project)
|
members << m if m && m.user && m.user.allowed_to?(:as_teacher,project)
|
||||||
end
|
end
|
||||||
members
|
members
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
class UserActions < ActiveRecord::Base
|
||||||
|
attr_accessible :action_id, :action_type, :user_id
|
||||||
|
has_many :users
|
||||||
|
end
|
@ -0,0 +1,64 @@
|
|||||||
|
<h3><%=l(:label_course_resource_list)%></h3>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="autoscroll">
|
||||||
|
<table class="list" style="width: 100%;table-layout: fixed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th style="width: 60px;">
|
||||||
|
资源名称
|
||||||
|
</th>
|
||||||
|
<th style="width: 30px;">
|
||||||
|
资源大小
|
||||||
|
</th>
|
||||||
|
<th style="width: 25px;">
|
||||||
|
资源类型
|
||||||
|
</th>
|
||||||
|
<th style="width: 23px;">
|
||||||
|
上传时间
|
||||||
|
</th>
|
||||||
|
<th style="width: 15px;">
|
||||||
|
下载次数
|
||||||
|
</th>
|
||||||
|
<th style="width: 20px;">
|
||||||
|
上传者
|
||||||
|
</th>
|
||||||
|
<th style="width: 35px;">
|
||||||
|
所属课程
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @resource.each do |resource| %>
|
||||||
|
<tr class="<%= cycle("odd", "even") %>">
|
||||||
|
<td style="text-align: left;">
|
||||||
|
<%= link_to truncate(resource.filename, :length => 18), download_named_attachment_path(resource.id, resource.filename ), :title => resource.filename,:class=>'resourcesBlack'%>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%= number_to_human_size(resource.filesize)%>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
课程资源
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%= format_date(resource.created_on)%>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%= resource.downloads %>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%= link_to(User.find(resource.author_id).realname, user_path(User.find(resource.author_id)) ) %>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%=link_to truncate(Course.find(resource.container_id).name, :length => 10), course_path(Course.find(resource.container_id)), :title => Course.find(resource.container_id).name, :class => "hidden fl w170" %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pagination">
|
||||||
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||||
|
</div>
|
@ -0,0 +1,75 @@
|
|||||||
|
<h3>
|
||||||
|
<%=l(:label_excellent_courses_list)%>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="autoscroll">
|
||||||
|
<table class="list" style="width: 100%;table-layout: fixed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 25px;">
|
||||||
|
序号
|
||||||
|
</th>
|
||||||
|
<th style="width: 120px;">
|
||||||
|
课程名
|
||||||
|
</th>
|
||||||
|
<th style="width: 50px;">
|
||||||
|
主讲老师
|
||||||
|
</th>
|
||||||
|
<th style="width: 30px;">
|
||||||
|
学生数
|
||||||
|
</th>
|
||||||
|
<th style="width: 25px;">
|
||||||
|
作业数
|
||||||
|
</th>
|
||||||
|
<th style="width: 25px;">
|
||||||
|
作品数
|
||||||
|
</th>
|
||||||
|
<th style="width: 25px;">
|
||||||
|
资源数
|
||||||
|
</th>
|
||||||
|
<th style="width: 70px;">
|
||||||
|
帖子数
|
||||||
|
</th>
|
||||||
|
<th style="width: 70px;">
|
||||||
|
动态数
|
||||||
|
</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">
|
||||||
|
<%= studentCount(course) %>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<%= course.homework_commons.count%>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<%= student_works_num(course) %>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<%= 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 %>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<%= course.course_activities.count%>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
@ -1,84 +1,84 @@
|
|||||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', :media => 'all' %>
|
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', :media => 'all' %>
|
||||||
<h3>
|
<h3>
|
||||||
<%=l(:label_latest_login_user_list)%>
|
<%=l(:label_latest_login_user_list)%>
|
||||||
</h3>
|
</h3>
|
||||||
<%= render 'tab_users' %>
|
<%= render 'tab_users' %>
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
最近登录老师列表
|
最近登录老师列表
|
||||||
</h3>
|
</h3>
|
||||||
<%= form_tag({}, :method => :get) do %>
|
<%= form_tag({}, :method => :get) do %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>
|
<legend>
|
||||||
<%= l(:label_filter_plural) %>
|
<%= l(:label_filter_plural) %>
|
||||||
</legend>
|
</legend>
|
||||||
<label style="float:left">开始日期:</label>
|
<label style="float:left">开始日期:</label>
|
||||||
<%= text_field_tag 'startdate', params[:startdate], :size => 15, :onchange=>"$('#ui-datepicker-div').hide()", :style=>"float:left"%>
|
<%= text_field_tag 'startdate', params[:startdate], :size => 15, :onchange=>"$('#ui-datepicker-div').hide()", :style=>"float:left"%>
|
||||||
<%= calendar_for('startdate')%><span style="float: left "> </span>
|
<%= calendar_for('startdate')%><span style="float: left "> </span>
|
||||||
<label style="float:left">结束日期:</label>
|
<label style="float:left">结束日期:</label>
|
||||||
<%= text_field_tag 'enddate', params[:enddate], :size => 15, :onchange =>"$('#ui-datepicker-div').hide()", :style=>"float:left"%>
|
<%= text_field_tag 'enddate', params[:enddate], :size => 15, :onchange =>"$('#ui-datepicker-div').hide()", :style=>"float:left"%>
|
||||||
<%= calendar_for('enddate')%>
|
<%= calendar_for('enddate')%>
|
||||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'latest_login_teachers'}, :class => 'icon icon-reload' %>
|
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'latest_login_teachers'}, :class => 'icon icon-reload' %>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="autoscroll">
|
<div class="autoscroll">
|
||||||
<table class="list" style="width: 100%;table-layout: fixed">
|
<table class="list" style="width: 100%;table-layout: fixed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 30px;">
|
<th style="width: 30px;">
|
||||||
序号
|
序号
|
||||||
</th>
|
</th>
|
||||||
<th style="width: 70px;">
|
<th style="width: 70px;">
|
||||||
登录时间
|
登录时间
|
||||||
</th>
|
</th>
|
||||||
<th style="width: 30px;">
|
<th style="width: 30px;">
|
||||||
用户id
|
用户id
|
||||||
</th>
|
</th>
|
||||||
<th style="width: 50px;">
|
<th style="width: 50px;">
|
||||||
用户姓名
|
用户姓名
|
||||||
</th>
|
</th>
|
||||||
<th style="width: 50px;">
|
<th style="width: 50px;">
|
||||||
用户登录名
|
用户登录名
|
||||||
</th>
|
</th>
|
||||||
<th style="width: 50px;">
|
<th style="width: 50px;">
|
||||||
用户身份
|
用户身份
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @count=@page * 30 %>
|
<% @count=@page * 30 %>
|
||||||
<% for teacher in @teachers do %>
|
<% for teacher in @teachers do %>
|
||||||
<tr>
|
<tr>
|
||||||
<% @count +=1 %>
|
<% @count +=1 %>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<%=@count %>
|
<%=@count %>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<%=format_time(teacher.last_login_on) %>
|
<%=format_time(teacher.last_login_on) %>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<%=teacher.id %>
|
<%=teacher.user_id %>
|
||||||
</td>
|
</td>
|
||||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if teacher.try(:realname) == ' '%><%= teacher.login%><% else %><%=teacher.try(:realname) %><% end %>'>
|
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if teacher.try(:realname) == ' '%><%= teacher.login%><% else %><%=teacher.try(:realname) %><% end %>'>
|
||||||
<% if teacher.try(:realname) == ' '%>
|
<% if teacher.try(:realname) == ' '%>
|
||||||
<%= link_to(teacher.login, user_path(teacher)) %>
|
<%= link_to(teacher.login, user_path(teacher.user_id)) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to(teacher.try(:realname), user_path(teacher)) %>
|
<%= link_to(teacher.try(:realname), user_path(teacher.user_id)) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<%=link_to(teacher.login, user_path(teacher)) %>
|
<%=link_to(teacher.login, user_path(teacher.user_id)) %>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
老师
|
老师
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
<h3><%=l(:label_project_resource_list)%></h3>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="autoscroll">
|
||||||
|
<table class="list" style="width: 100%;table-layout: fixed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th style="width: 60px;">
|
||||||
|
资源名称
|
||||||
|
</th>
|
||||||
|
<th style="width: 30px;">
|
||||||
|
资源大小
|
||||||
|
</th>
|
||||||
|
<th style="width: 25px;">
|
||||||
|
资源类型
|
||||||
|
</th>
|
||||||
|
<th style="width: 23px;">
|
||||||
|
上传时间
|
||||||
|
</th>
|
||||||
|
<th style="width: 15px;">
|
||||||
|
下载次数
|
||||||
|
</th>
|
||||||
|
<th style="width: 20px;">
|
||||||
|
上传者
|
||||||
|
</th>
|
||||||
|
<th style="width: 35px;">
|
||||||
|
所属项目
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @pro_resource.each do |pro_resource| %>
|
||||||
|
<tr class="<%= cycle("odd", "even") %>">
|
||||||
|
<td style="text-align: left;">
|
||||||
|
<%= link_to truncate(pro_resource.filename, :length => 18), download_named_attachment_path(pro_resource.id, pro_resource.filename ), :title => pro_resource.filename,:class=>'resourcesBlack'%>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%= number_to_human_size(pro_resource.filesize)%>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
项目资源
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%= format_date(pro_resource.created_on)%>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%= pro_resource.downloads %>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%= link_to(User.find(pro_resource.author_id).realname, user_path(User.find(pro_resource.author_id)) ) %>
|
||||||
|
</td>
|
||||||
|
<td style=" text-align: center;">
|
||||||
|
<%=link_to truncate(Project.find(pro_resource.container_id).name, :length => 10), project_path(Project.find(pro_resource.container_id)), :title => Project.find(pro_resource.container_id).name, :class => "hidden fl w170" %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pagination">
|
||||||
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||||
|
</div>
|
@ -1,6 +1,11 @@
|
|||||||
[
|
[
|
||||||
<% @users && @users.each_with_index do |person,index| %>
|
<% @users && @users.each_with_index do |person,index| %>
|
||||||
|
<% if index == 0 %>
|
||||||
|
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
|
||||||
|
<%= index != @users.size-1 ? ',' : '' %>
|
||||||
|
<% else %>
|
||||||
{"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
|
{"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
|
||||||
<%= index != @users.size-1 ? ',' : '' %>
|
<%= index != @users.size-1 ? ',' : '' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
]
|
]
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(".popupClose").click(function(){
|
||||||
|
$(".popupWrap").css("display","none");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<span class="f16 fontBlue fb">选择版本 </span>
|
||||||
|
<p class="c_red">注:该文件有历史版本,请选择您需要的文件,点击文件名下载。</p>
|
||||||
|
<p class="fontGrey3 mb4 fb">版本及序号</p>
|
||||||
|
|
||||||
|
<div style="max-height:165px; overflow-y:auto; background-color: #e3e3e3; line-height:33px;" class="p10">
|
||||||
|
<span class="attachment">
|
||||||
|
<%= link_to truncate(@attachment.filename,length: 35, omission: '...'),
|
||||||
|
download_named_attachment_path(@attachment.id, @attachment.filename),
|
||||||
|
:title => @attachment.filename+"\n"+@attachment.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f14 fb link_file_a2 fl" %>
|
||||||
|
</span>
|
||||||
|
<span class="fr">版本号:当前</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% @attachment_histories.each do |history| %>
|
||||||
|
<span class="attachment">
|
||||||
|
<%= link_to truncate(history.filename,length: 35, omission: '...'),
|
||||||
|
download_history_attachment_path(history.id, history.filename),
|
||||||
|
:title => history.filename+"\n"+history.description.to_s,
|
||||||
|
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f14 fb link_file_a2 fl" %>
|
||||||
|
</span>
|
||||||
|
<span class="fr">版本号:<%= history.version %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
@ -0,0 +1,7 @@
|
|||||||
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'attachments/attachment_history_download' )%>');
|
||||||
|
showModal('ajax-modal', '452px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","40%").css("left","50%");
|
||||||
|
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||||
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
@ -1,21 +1,21 @@
|
|||||||
<div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>">
|
<div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>">
|
||||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||||
<div class="ReplyToMessageInputContainer mb10">
|
<div class="ReplyToMessageInputContainer mb10">
|
||||||
<div nhname='new_message_<%= reply.id%>'>
|
<div nhname='new_message_<%= reply.id%>'>
|
||||||
<%= form_for @blog_comment, :as => :reply, :url => {:controller => 'blog_comments',:action => 'reply', :id => @blogComment.id}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
<%= form_for @blog_comment, :as => :reply, :url => {:controller => 'blog_comments',:action => 'reply', :id => @blogComment.id}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||||
<input type="hidden" name="quote[quote]" id="quote_quote">
|
<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||||
<% if course_id%>
|
<% if course_id%>
|
||||||
<input type="hidden" name="course_id" id="" value="<%= course_id%>">
|
<input type="hidden" name="course_id" id="" value="<%= course_id%>">
|
||||||
<% end %>
|
<% end %>
|
||||||
<input type="hidden" name="blog_comment[title]" id="reply_subject">
|
<input type="hidden" name="blog_comment[title]" id="reply_subject">
|
||||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="blog_comment[content]"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="blog_comment[content]"></textarea>
|
||||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
|
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||||
<% end%>
|
<% end%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
@ -1,6 +1,5 @@
|
|||||||
<% if User.current.logged? && User.current.id == @user.id %>
|
|
||||||
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
|
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
|
||||||
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||||
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
|
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
|
@ -0,0 +1,15 @@
|
|||||||
|
<% if @order == "asc" %>
|
||||||
|
按 <%= link_to "时间", search_tag_attachment_course_files_path(@course, :sort => "created_on:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey", :remote => true %>
|
||||||
|
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
||||||
|
<%= link_to "下载次数", search_tag_attachment_course_files_path(@course, :sort => "downloads:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey",:remote => true %>
|
||||||
|
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
||||||
|
<%= link_to "引用次数", search_tag_attachment_course_files_path(@course, :sort => "quotes:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey", :remote => true %>
|
||||||
|
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
||||||
|
<% else %>
|
||||||
|
按 <%= link_to "时间", search_tag_attachment_course_files_path(@course, :sort => "created_on:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q), :class => "f_b c_grey" , :remote => true %>
|
||||||
|
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
||||||
|
<%= link_to "下载次数", search_tag_attachment_course_files_path(@course, :sort => "downloads:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q), :class => "f_b c_grey", :remote => true %>
|
||||||
|
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
||||||
|
<%= link_to "引用次数", search_tag_attachment_course_files_path(@course, :sort =>"quotes:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q),:class => "f_b c_grey", :remote => true %>
|
||||||
|
<%= render partial:'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
||||||
|
<% end %>
|
@ -0,0 +1,138 @@
|
|||||||
|
<%#= render :partial => 'users/user_resource_info' %>
|
||||||
|
<div class="f16 fb fontBlue mb10">选用资源库中的资源</div>
|
||||||
|
<div class="subjectList fl mr10"> <a href="javascript:void(0);" class="subjectChoose chooseActive fl">公共资源</a> <a href="javascript:void(0);" class="subjectChoose fl">我的资源</a>
|
||||||
|
<input type="text" name="serach" placeholder="输入关键词进行搜索" class="subjectSearch fr" />
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div style="height:441px; min-height:441px; max-height:441px;">
|
||||||
|
<ul class="subjectBanner mt10">
|
||||||
|
<li class="subjectName fl hidden"><span style="padding-left:15px;">资源名称</span></li>
|
||||||
|
<li class="subjectType fl">类别</li>
|
||||||
|
<li class="subjectCount fl">大小</li>
|
||||||
|
<li class="subjectPublisher fl">上传者</li>
|
||||||
|
<li class="fl subjectDate">上传时间</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">课程资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">项目资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">附件</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">课程资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">课程资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">课程资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">课程资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">课程资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">课程资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="subjectRow">
|
||||||
|
<li class="subjectName fl hidden">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
|
<span>123456.jpg</span></label>
|
||||||
|
</li>
|
||||||
|
<li class="subjectType fl">课程资源</li>
|
||||||
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText">选用</a></div>
|
||||||
|
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText">取消</a></div>
|
||||||
|
<div class="pageRoll mt0">
|
||||||
|
<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">上一页</a></div>
|
||||||
|
<div class="pageCell pageCellActive"><a href="javascript:void(0);" class="c_white">1</a></div>
|
||||||
|
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">2</a></div>
|
||||||
|
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">3</a></div>
|
||||||
|
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">...</a></div>
|
||||||
|
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">14</a></div>
|
||||||
|
<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">下一页</a></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
@ -1,78 +1,90 @@
|
|||||||
<% delete_allowed = User.current.admin? %>
|
<% delete_allowed = User.current.admin? %>
|
||||||
|
|
||||||
<% org_subfield_attachments.each do |file| %>
|
<% org_subfield_attachments.each do |file| %>
|
||||||
<div class="resources mt10" id="container_files_<%= file.id %>">
|
<% if file.is_public == 1 or User.current.member_of_org?(file.container.organization) %>
|
||||||
<div class="homepagePostBrief">
|
<div class="resources mt10" id="container_files_<%= file.id %>">
|
||||||
<div class="homepagePostPortrait">
|
<div class="homepagePostBrief">
|
||||||
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
<div class="homepagePostPortrait">
|
||||||
</div>
|
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||||
<div class="homepagePostDes">
|
</div>
|
||||||
<div class="homepagePostTitle break_word mt-4">
|
<div class="homepagePostDes">
|
||||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
<div class="homepagePostTitle break_word mt-4">
|
||||||
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 => "c_dblue f_14 f_b f_l" %>
|
<% if file.attachment_histories.count == 0 %>
|
||||||
<%= file_preview_eye(file, class: 'preview') %>
|
<%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
|
||||||
<span id="image_private_<%= file.id%>">
|
download_named_attachment_path(file.id, file.filename),
|
||||||
<% if file.is_public? == false%>
|
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
|
||||||
<span class="img_private ml5">私有</span>
|
<% else %>
|
||||||
<%end %>
|
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
|
||||||
</span>
|
:title => file.filename+"\n"+file.description.to_s,
|
||||||
<br/>
|
:class => "linkGrey3 f_14",
|
||||||
</div>
|
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||||
<div class="mt5">
|
<% end %>
|
||||||
<span class="fontGrey2 mr15 fl">上传时间:<%= format_date(file.created_on)%></span>
|
<%= file_preview_eye(file, class: 'preview') %>
|
||||||
<% if file.tag_list.length > 0%>
|
<span id="image_private_<%= file.id%>">
|
||||||
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
<% if file.is_public? == false%>
|
||||||
<% end %>
|
<span class="img_private ml5">私有</span>
|
||||||
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
<%end %>
|
||||||
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
</span>
|
||||||
</div>
|
<br/>
|
||||||
<div class="cl"></div>
|
</div>
|
||||||
<div class="tag_h">
|
<div class="mt5">
|
||||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
|
<span class="fontGrey2 mr15 fl">上传时间:<%= format_date(file.created_on)%></span>
|
||||||
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
|
<% if file.tag_list.length > 0%>
|
||||||
</div>
|
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
||||||
<div class="homepagePostSetting">
|
<% end %>
|
||||||
<ul>
|
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||||
<li class="homepagePostSettingIcon">
|
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<span id="reference_number_<%= file.id %>"><%= file.quotes.nil? ? 0:file.quotes %></span></p>
|
||||||
<% if User.current.logged? %>
|
</div>
|
||||||
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
|
<div class="cl"></div>
|
||||||
<ul class="homepagePostSettiongText">
|
<div class="tag_h">
|
||||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
|
||||||
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
|
||||||
<li>
|
</div>
|
||||||
<span id="is_public_<%= file.id %>">
|
<div class="homepagePostSetting">
|
||||||
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
|
<ul>
|
||||||
</span>
|
<li class="homepagePostSettingIcon">
|
||||||
</li>
|
<% if User.current.logged? %>
|
||||||
<li>
|
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
|
||||||
<%= link_to( '删除资源', attachment_path(file),
|
<ul class="homepagePostSettiongText">
|
||||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" && file.destroyable %>
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||||
</li>
|
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
||||||
</ul>
|
<% if file.container.try(:organization).try(:is_public?) %>
|
||||||
<%else%>
|
<li>
|
||||||
<ul class="resourceSendO">
|
<span id="is_public_<%= file.id %>">
|
||||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
|
||||||
</ul>
|
</span>
|
||||||
<% end %>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
<li>
|
||||||
</ul>
|
<%= link_to( '删除资源', attachment_path(file),
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" && file.destroyable %>
|
||||||
</div>
|
</li>
|
||||||
</div>
|
</ul>
|
||||||
<div class="cl"></div>
|
<%else%>
|
||||||
</div>
|
<ul class="resourceSendO">
|
||||||
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||||
</div><!---re_con_box end-->
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<% if org_subfield_attachments.count == 10 %>
|
</li>
|
||||||
<% if params[:action] == 'search_files_in_subfield' %>
|
</ul>
|
||||||
<%=link_to "点击展开更多", search_files_in_subfield_org_subfield_files_path(:org_subfield_id => org_subfield.id,:page => @page.to_i + 1, :name => params[:name],:insite => params[:insite]),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
|
||||||
<% else %>
|
</div>
|
||||||
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
|
</div>
|
||||||
<%=link_to "点击展开更多", org_subfield_files_path(:org_subfield_id => org_subfield.id, :page => @page.nil? ? 2 :(@page.to_i + 1)), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
<div class="cl"></div>
|
||||||
<%end%>
|
</div>
|
||||||
<% end%>
|
|
||||||
|
</div><!---re_con_box end-->
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if org_subfield_attachments.count == 10 %>
|
||||||
|
<% if params[:action] == 'search_files_in_subfield' %>
|
||||||
|
<%=link_to "点击展开更多", search_files_in_subfield_org_subfield_files_path(:org_subfield_id => org_subfield.id,:page => @page.to_i + 1, :name => params[:name],:insite => params[:insite]),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||||
|
<% else %>
|
||||||
|
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
|
||||||
|
<%=link_to "点击展开更多", org_subfield_files_path(:org_subfield_id => org_subfield.id, :page => @page.nil? ? 2 :(@page.to_i + 1)), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||||
|
<%end%>
|
||||||
|
<% end%>
|
||||||
|
|
||||||
|
@ -1,61 +1,69 @@
|
|||||||
<% delete_allowed = User.current.allowed_to?(:manage_files, project) %>
|
<% delete_allowed = User.current.allowed_to?(:manage_files, project) %>
|
||||||
<% project_attachments.each do |file| %>
|
<% project_attachments.each do |file| %>
|
||||||
<% if file.is_public? || User.current.member_of?(project) || User.current.admin? %>
|
<% if file.is_public? || User.current.member_of?(project) || User.current.admin? %>
|
||||||
<div class="resources mt10"><!--资源库内容开始--->
|
<div class="resources mt10"><!--资源库内容开始--->
|
||||||
<div class="homepagePostBrief">
|
<div class="homepagePostBrief">
|
||||||
<div class="homepagePostPortrait">
|
<div class="homepagePostPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTitle break_word mt-4">
|
<div class="homepagePostTitle break_word mt-4">
|
||||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
<%# 如果有历史版本则提供历史版本下载 %>
|
||||||
download_named_attachment_path(file.id, file.filename),
|
<% if file.attachment_histories.count == 0 %>
|
||||||
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkBlue f_14 f_b" %>
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||||
<%= file_preview_eye(file, class: 'preview') %>
|
download_named_attachment_path(file.id, file.filename),
|
||||||
<span id="image_private_<%= file.id%>">
|
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
|
||||||
<% if file.is_public? == false%>
|
<% else %>
|
||||||
<span class="img_private ml5">私有</span>
|
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
|
||||||
<%end %>
|
:title => file.filename+"\n"+file.description.to_s,
|
||||||
</span>
|
:class => "linkGrey3 f_14",
|
||||||
</div>
|
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||||
<div class="mt5">
|
<% end %>
|
||||||
<span class="fontGrey2 mr15 fl">上传时间:<%= format_time(file.created_on)%></span>
|
<%= file_preview_eye(file, class: 'preview') %>
|
||||||
<% if file.tag_list.length > 0%>
|
<span id="image_private_<%= file.id%>">
|
||||||
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
<% if file.is_public? == false%>
|
||||||
<% end %>
|
<span class="img_private ml5">私有</span>
|
||||||
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
<%end %>
|
||||||
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="mt5">
|
||||||
<div class="tag_h">
|
<span class="fontGrey2 mr15 fl">上传时间:<%= format_time(file.created_on)%></span>
|
||||||
<!-- container_type = 1 代表是课程里的资源 -->
|
<% if file.tag_list.length > 0%>
|
||||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
||||||
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
<% end %>
|
||||||
</div>
|
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||||
<div class="homepagePostSetting">
|
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||||
<%= render :partial => 'files/tool_settings', :locals => {:project => @project, :delete_allowed => delete_allowed, :file => file} %>
|
</div>
|
||||||
</div>
|
<div class="cl"></div>
|
||||||
</div>
|
<div class="tag_h">
|
||||||
<div class="cl"></div>
|
<!-- container_type = 1 代表是课程里的资源 -->
|
||||||
</div>
|
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||||
<div class="cl"></div>
|
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<div class="homepagePostSetting">
|
||||||
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
|
<%= render :partial => 'files/tool_settings', :locals => {:project => @project, :delete_allowed => delete_allowed, :file => file} %>
|
||||||
<% end %>
|
</div>
|
||||||
<% end %>
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<% if project_attachments.count == 10%>
|
</div>
|
||||||
<% if params[:action] == 'search_project' %>
|
<div class="cl"></div>
|
||||||
<!--<ul class="wlist">-->
|
</div>
|
||||||
<!--<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>-->
|
<% else %>
|
||||||
<!--</ul>-->
|
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
|
||||||
<%=link_to "点击展开更多", search_project_project_files_path({:project_id => project.id, :page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
<% end %>
|
||||||
<%else%>
|
<% end %>
|
||||||
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
|
|
||||||
<%=link_to "点击展开更多", project_files_path(:project_id => project.id,:page => @page),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
<% if project_attachments.count == 10%>
|
||||||
<%end%>
|
<% if params[:action] == 'search_project' %>
|
||||||
<% end%>
|
<!--<ul class="wlist">-->
|
||||||
|
<!--<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>-->
|
||||||
|
<!--</ul>-->
|
||||||
|
<%=link_to "点击展开更多", search_project_project_files_path({:project_id => project.id, :page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||||
|
<%else%>
|
||||||
|
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
|
||||||
|
<%=link_to "点击展开更多", project_files_path(:project_id => project.id,:page => @page),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||||
|
<%end%>
|
||||||
|
<% end%>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,77 +1,86 @@
|
|||||||
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
|
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
|
||||||
<div class="resources mt10"><!--资源库内容开始--->
|
<div class="resources mt10"><!--资源库内容开始--->
|
||||||
<div class="homepagePostBrief">
|
<div class="homepagePostBrief">
|
||||||
<div class="homepagePostPortrait">
|
<div class="homepagePostPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTitle break_word mt-4">
|
<div class="homepagePostTitle break_word mt-4">
|
||||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
<%# 如果有历史版本则提供历史版本下载 %>
|
||||||
download_named_attachment_path(file.id, file.filename),
|
<% if file.attachment_histories.count == 0 %>
|
||||||
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkBlue f_14 f_b" %>
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||||
<%= file_preview_eye(file, class: 'preview') %>
|
download_named_attachment_path(file.id, file.filename),
|
||||||
<span id="image_private_<%= file.id%>">
|
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
|
||||||
<% if file.is_public? == false%>
|
<% else %>
|
||||||
<span class="img_private ml5">私有</span>
|
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
|
||||||
<%end %>
|
:title => file.filename+"\n"+file.description.to_s,
|
||||||
</span>
|
:class => "linkGrey3 f_14",
|
||||||
<% if file.is_publish == 0 %>
|
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||||
<span class="grey_homework_btn_cir ml5"><%=file.publish_time %> 0点发布</span>
|
<% end %>
|
||||||
<% end %>
|
<%= file_preview_eye(file, class: 'preview') %>
|
||||||
</div>
|
<span id="image_private_<%= file.id%>">
|
||||||
<div class="mt5">
|
<% if file.is_public? == false%>
|
||||||
<span class="fontGrey2 mr15 fl">上传时间:<%= format_time(file.created_on)%></span>
|
<span class="img_private ml5">私有</span>
|
||||||
<% if file.tag_list.length > 0%>
|
<%end %>
|
||||||
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
</span>
|
||||||
<% end %>
|
<% if file.is_publish == 0 %>
|
||||||
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
<span class="grey_homework_btn_cir ml5"><%=file.publish_time %> 0点发布</span>
|
||||||
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="mt5">
|
||||||
<div class="tag_h">
|
<span class="fontGrey2 mr15 fl">上传时间:<%= format_time(file.created_on)%></span>
|
||||||
<!-- container_type = 1 代表是课程里的资源 -->
|
<% if file.tag_list.length > 0%>
|
||||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
||||||
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
<% end %>
|
||||||
</div>
|
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||||
<div class="homepagePostSetting">
|
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||||
|
</div>
|
||||||
<ul>
|
<% unless file.description.blank? %>
|
||||||
<li class="homepagePostSettingIcon">
|
<div class="cl"></div>
|
||||||
<% if User.current.logged? %>
|
<div class="fontGrey2 mb4">资源描述:<%= file.description %></div>
|
||||||
|
<% end %>
|
||||||
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
<div class="cl"></div>
|
||||||
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
<div class="tag_h">
|
||||||
<ul class="homepagePostSettiongText">
|
<!-- container_type = 1 代表是课程里的资源 -->
|
||||||
|
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||||
<li><%= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %></li>
|
</div>
|
||||||
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
<div class="homepagePostSetting">
|
||||||
<% if @course.is_public? %>
|
<ul>
|
||||||
<li>
|
<li class="homepagePostSettingIcon">
|
||||||
<span id="is_public_<%= file.id %>">
|
<% if User.current.logged? %>
|
||||||
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
|
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||||
</span>
|
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
||||||
</li>
|
<ul class="homepagePostSettiongText">
|
||||||
<%end%>
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||||
<li>
|
<li><%= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %></li>
|
||||||
<%= link_to( '删除资源', attachment_path(file),
|
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
||||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
|
<% if @course.is_public? %>
|
||||||
</li>
|
<li>
|
||||||
</ul>
|
<span id="is_public_<%= file.id %>">
|
||||||
|
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
|
||||||
<% end %>
|
</span>
|
||||||
<%else%>
|
</li>
|
||||||
<ul class="resourceSendO">
|
<%end%>
|
||||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
<li>
|
||||||
</ul>
|
<%= link_to( '删除资源', attachment_path(file),
|
||||||
<% end %>
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
<% end %>
|
:method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<% end %>
|
||||||
</div>
|
<%else%>
|
||||||
<div class="cl"></div>
|
<ul class="resourceSendO">
|
||||||
</div>
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||||
<div class="cl"></div>
|
</ul>
|
||||||
</div>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,85 +1,87 @@
|
|||||||
<%= stylesheet_link_tag 'courses'%>
|
<%= stylesheet_link_tag 'courses'%>
|
||||||
<script>
|
<script>
|
||||||
function searchone4reload(fileid){
|
function searchone4reload(fileid){
|
||||||
var url = "<%= searchone4reload_org_subfield_files_path(@org_subfield)%>";
|
var url = "<%= searchone4reload_org_subfield_files_path(@org_subfield)%>";
|
||||||
var data = {};data.fileid=fileid;
|
var data = {};data.fileid=fileid;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:url,dataType:'text',data:data,success:function(text){
|
url:url,dataType:'text',data:data,success:function(text){
|
||||||
var container_file_div = $("#container_files_"+fileid);
|
var container_file_div = $("#container_files_"+fileid);
|
||||||
container_file_div.after(text);
|
container_file_div.after(text);
|
||||||
container_file_div.remove();
|
container_file_div.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeModal()
|
function closeModal()
|
||||||
{
|
{
|
||||||
hideModal($("#popbox_upload"));
|
hideModal($("#popbox_upload"));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="homepageRight mt0 ml0">
|
<div class="homepageRight mt0 ml0">
|
||||||
<div class="homepageRightBanner" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>">
|
<div class="homepageRightBanner" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>">
|
||||||
<div class="NewsBannerName"><%= org_subfield.name %></div>
|
<div class="NewsBannerName"><%= org_subfield.name %></div>
|
||||||
<ul class="resourcesSelect">
|
<ul class="resourcesSelect">
|
||||||
<ul class="resourcesSelect">
|
<ul class="resourcesSelect">
|
||||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||||
<ul class="resourcesType">
|
<ul class="resourcesType">
|
||||||
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','','<%= @q%>','<%= org_subfield.id%>');" class="resourcesTypeAll resourcesGrey">全部</a></li>
|
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','','<%= @q%>','<%= org_subfield.id%>');" class="resourcesTypeAll resourcesGrey">全部</a></li>
|
||||||
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','软件','<%= @q%>','<%= org_subfield.id%>');" class="softwareIcon postTypeGrey">软件</a></li>
|
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','软件','<%= @q%>','<%= org_subfield.id%>');" class="softwareIcon postTypeGrey">软件</a></li>
|
||||||
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','媒体','<%= @q%>','<%= org_subfield.id%>');" class="mediaIcon resourcesGrey">媒体</a></li>
|
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','媒体','<%= @q%>','<%= org_subfield.id%>');" class="mediaIcon resourcesGrey">媒体</a></li>
|
||||||
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','代码','<%= @q%>','<%= org_subfield.id%>');" class="codeIcon resourcesGrey">代码</a></li>
|
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','代码','<%= @q%>','<%= org_subfield.id%>');" class="codeIcon resourcesGrey">代码</a></li>
|
||||||
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield,:other=>true)%>','其他','<%= @q%>','<%= org_subfield.id%>');" class="othersIcon resourcesGrey">其它</a></li>
|
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield,:other=>true)%>','其他','<%= @q%>','<%= org_subfield.id%>');" class="othersIcon resourcesGrey">其它</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="resources mt10" style="padding-bottom:5px;">
|
<div class="resources mt10" style="padding-bottom:5px;">
|
||||||
<div class="reTop mb5">
|
<div class="reTop mb5">
|
||||||
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search",:remote=>true) do %>
|
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search",:remote=>true) do %>
|
||||||
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
|
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
|
||||||
<%= submit_tag "栏目内搜索", :class => "blueBtn mr5 fl",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
|
<%= submit_tag "栏目内搜索", :class => "blueBtn mr5 fl",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
|
||||||
<%= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
<%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||||
<input class="blueBtn fr mr5" value="上传资源" onclick="org_upload_files(<%= org_subfield.id %>);">
|
<% if User.current.member_of_org?(org_subfield.organization) %>
|
||||||
<%#= link_to "上传资源",subfield_upload_file_org_subfield_files_path(@org_subfield.id, :in_org => 1),:method => "post",:class=>"blueBtn fr mr5",:remote => true %>
|
<input class="blueBtn fr mr5" value="上传资源" onclick="org_upload_files(<%= org_subfield.id %>);">
|
||||||
<% end %>
|
<%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :subfield_file_id => @org_subfield.id), :class => "blue-btn fr mr5", :remote => true) %>
|
||||||
</div><!---re_top end-->
|
<% end %>
|
||||||
<div class="cl"></div>
|
<% end %>
|
||||||
|
</div><!---re_top end-->
|
||||||
<div>
|
<div class="cl"></div>
|
||||||
<div class="re_con_top">
|
|
||||||
<div class="files_tag" id="files_tag">
|
<div>
|
||||||
<%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
|
<div class="re_con_top">
|
||||||
</div>
|
<div class="files_tag" id="files_tag">
|
||||||
<div class="cl"></div>
|
<%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
|
||||||
<p class="f_l fontBlue f_b f_14">共有 <span id="attachment_count"><%= @all_attachments.count %></span> 个资源</p>
|
</div>
|
||||||
<p class="f_r" style="color: #808080">
|
<div class="cl"></div>
|
||||||
<% if @order == "asc" %>
|
<p class="f_l fontBlue f_b f_14">共有 <span id="attachment_count"><%= User.current.member_of_org?(@org_subfield.organization) ? @all_attachments.count : @all_attachments.select{|attach| attach.is_public == 1 }.count %></span> 个资源</p>
|
||||||
按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
<p class="f_r" style="color: #808080">
|
||||||
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
<% if @order == "asc" %>
|
||||||
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
||||||
<% else %>
|
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
||||||
按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
||||||
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
<% else %>
|
||||||
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /
|
||||||
<% end %>
|
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /
|
||||||
</p>
|
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序
|
||||||
</div>
|
<% end %>
|
||||||
<div class="cl"></div>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="cl"></div>
|
||||||
<div id="org_subfield_list">
|
</div>
|
||||||
<%= render :partial => 'files/org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
|
</div>
|
||||||
</div><!---re_con end-->
|
<div id="org_subfield_list">
|
||||||
|
<%= render :partial => 'files/org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
|
||||||
</div>
|
</div><!---re_con end-->
|
||||||
<%# html_title(l(:label_attachment_plural)) -%>
|
|
||||||
<script>
|
</div>
|
||||||
function org_upload_files(org_subfield_id){
|
<%# html_title(l(:label_attachment_plural)) -%>
|
||||||
$.ajax({
|
<script>
|
||||||
url :"/org_subfields/" + org_subfield_id + "/files/subfield_upload_file",
|
function org_upload_files(org_subfield_id){
|
||||||
type :'post'
|
$.ajax({
|
||||||
});
|
url :"/org_subfields/" + org_subfield_id + "/files/subfield_upload_file",
|
||||||
}
|
type :'post'
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
@ -1,84 +1,92 @@
|
|||||||
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
|
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
|
||||||
<div id="popbox_upload" class="mb10" style="margin-top: -30px;color:#15bccf; font-size:16px;">
|
<div id="popbox_upload" class="mb10" style="margin-top: -30px;color:#15bccf; font-size:16px;">
|
||||||
<div class="upload_con">
|
<div class="upload_con">
|
||||||
<h2 style="text-align: center"><%= l(:label_upload_files)%></h2>
|
<h2 style="text-align: center"><%= l(:label_upload_files)%></h2>
|
||||||
<div class="upload_box">
|
<div class="upload_box">
|
||||||
<%= error_messages_for 'attachment' %>
|
<%= error_messages_for 'attachment' %>
|
||||||
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
|
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
|
||||||
|
|
||||||
<%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
|
<%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
|
||||||
<input type="hidden" name="in_course_toolbar" value="Y">
|
<input type="hidden" name="in_course_toolbar" value="Y">
|
||||||
<!--<p class="c_grey fr mt10 mr5">-->
|
<!--<p class="c_grey fr mt10 mr5">-->
|
||||||
<div class="c_dark">
|
<div class="c_dark">
|
||||||
<input name="course_attachment_type[]" type="checkbox" value="1" checked class="c_dark" >课件</input> <span class="c_grey">|</span>
|
<input name="course_attachment_type[]" type="checkbox" value="1" checked class="c_dark" >课件</input> <span class="c_grey">|</span>
|
||||||
<input name="course_attachment_type[]" type="checkbox" value="2" class="c_dblue">软件</input> <span class="c_grey">|</span>
|
<input name="course_attachment_type[]" type="checkbox" value="2" class="c_dblue">软件</input> <span class="c_grey">|</span>
|
||||||
<input name="course_attachment_type[]" type="checkbox" value="3" class="c_dblue">媒体</input> <span class="c_grey">|</span>
|
<input name="course_attachment_type[]" type="checkbox" value="3" class="c_dblue">媒体</input> <span class="c_grey">|</span>
|
||||||
<input name="course_attachment_type[]" type="checkbox" value="4" class="c_dblue">代码</input> <span class="c_grey">|</span>
|
<input name="course_attachment_type[]" type="checkbox" value="4" class="c_dblue">代码</input> <span class="c_grey">|</span>
|
||||||
<input name="course_attachment_type[]" type="checkbox" value="6" class="c_dblue">论文</input> <span class="c_grey">|</span>
|
<input name="course_attachment_type[]" type="checkbox" value="6" class="c_dblue">论文</input> <span class="c_grey">|</span>
|
||||||
<input name="course_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>
|
<input name="course_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div>
|
<div>
|
||||||
<%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
|
<%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if User.current.allowed_to?(:as_teacher,course) %>
|
<div class="mb5">
|
||||||
<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="fl">
|
||||||
<div class="calendar_div fl">
|
<input type="text" name="description" placeholder="文件描述" class="InputBox fl W160">
|
||||||
<input type="text" name="publish_time" id="attachment_publish_time" placeholder="发布日期(可选)" class="InputBox fl W120 calendar_input" readonly="readonly">
|
</div>
|
||||||
<%#= calendar_for('attachment_publish_time')%>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="fl c_red f12" style="margin-top: 4px;" id="publish_time_notice"></span>
|
|
||||||
<div class="cl"></div>
|
<% if User.current.allowed_to?(:as_teacher,course) %>
|
||||||
</div>
|
<div class="mb5">
|
||||||
<% end %>
|
<label class="fl c_dark f14" style="margin-top: 4px;">延迟发布:</label>
|
||||||
<a href="javascript:void(0);" class=" fr courseSendCancel mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
<div class="calendar_div fl">
|
||||||
<a id="submit_resource" href="javascript:void(0);" class="c_white courseSendSubmit fr" onclick="submit_course_resource();"><%= l(:button_confirm)%></a>
|
<input type="text" name="publish_time" id="attachment_publish_time" placeholder="发布日期(可选)" class="InputBox fl W120 calendar_input" readonly="readonly">
|
||||||
<%#= submit_tag '确定',:onclick=>'submit_course_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
|
<%#= calendar_for('attachment_publish_time')%>
|
||||||
<% end %>
|
</div>
|
||||||
</div>
|
<span class="fl c_red f12" style="margin-top: 4px;" id="publish_time_notice"></span>
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% content_for :header_tags do %>
|
<% end %>
|
||||||
<%= javascript_include_tag 'attachments' %>
|
<a href="javascript:void(0);" class=" fr courseSendCancel mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||||
<% end %>
|
<a id="submit_resource" href="javascript:void(0);" class="c_white courseSendSubmit fr" onclick="submit_course_resource();"><%= l(:button_confirm)%></a>
|
||||||
</div>
|
<%#= submit_tag '确定',:onclick=>'submit_course_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
|
||||||
|
<% end %>
|
||||||
<script>
|
</div>
|
||||||
function regex_publish_time()
|
|
||||||
{
|
</div>
|
||||||
var myDate = new Date();
|
<% content_for :header_tags do %>
|
||||||
if($.trim($("#attachment_publish_time").val()) == "")
|
<%= javascript_include_tag 'attachments' %>
|
||||||
{
|
<% end %>
|
||||||
return true;
|
</div>
|
||||||
} else{
|
|
||||||
var publish_time = Date.parse($("#attachment_publish_time").val());
|
<script>
|
||||||
if(Date.parse(formate_date(myDate)) > publish_time)
|
function regex_publish_time()
|
||||||
{
|
{
|
||||||
$("#publish_time_notice").text("发布日期不能小于当前日期");
|
var myDate = new Date();
|
||||||
return false;
|
if($.trim($("#attachment_publish_time").val()) == "")
|
||||||
|
{
|
||||||
}
|
return true;
|
||||||
else
|
} else{
|
||||||
{
|
var publish_time = Date.parse($("#attachment_publish_time").val());
|
||||||
$("#publish_time_notice").text("");
|
if(Date.parse(formate_date(myDate)) > publish_time)
|
||||||
return true;
|
{
|
||||||
}
|
$("#publish_time_notice").text("发布日期不能小于当前日期");
|
||||||
}
|
return false;
|
||||||
}
|
|
||||||
function submit_course_resource()
|
}
|
||||||
{
|
else
|
||||||
<% if User.current.allowed_to?(:as_teacher,course) %>
|
{
|
||||||
if(regex_publish_time()) {
|
$("#publish_time_notice").text("");
|
||||||
$('#submit_resource').parent().submit();
|
return true;
|
||||||
}
|
}
|
||||||
<% else %>
|
}
|
||||||
$('#submit_resource').parent().submit();
|
}
|
||||||
<% end %>
|
function submit_course_resource()
|
||||||
}
|
{
|
||||||
$(function(){
|
<% if User.current.allowed_to?(:as_teacher,course) %>
|
||||||
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
|
if(regex_publish_time()) {
|
||||||
$('#attachment_publish_time').datepicker(datepickerOptions);
|
$('#submit_resource').parent().submit();
|
||||||
});
|
}
|
||||||
|
<% else %>
|
||||||
|
$('#submit_resource').parent().submit();
|
||||||
|
<% end %>
|
||||||
|
}
|
||||||
|
$(function(){
|
||||||
|
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
|
||||||
|
$('#attachment_publish_time').datepicker(datepickerOptions);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
@ -1,86 +1,86 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<% issue.journals.reorder("created_on desc").each do |reply| %>
|
<% issue.journals.reorder("created_on desc").each do |reply| %>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i + 1 %>
|
<% replies_all_i=replies_all_i + 1 %>
|
||||||
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();" >
|
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();" >
|
||||||
<div class="homepagePostReplyPortrait" >
|
<div class="homepagePostReplyPortrait" >
|
||||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher mt-4">
|
||||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%#= format_time(reply.created_on) %>
|
<%#= format_time(reply.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||||
<% if reply.details.any? %>
|
<% if reply.details.any? %>
|
||||||
<% details_to_strings(reply.details).each do |string| %>
|
<% details_to_strings(reply.details).each do |string| %>
|
||||||
<p><%= string %></p>
|
<p><%= string %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<P><%= reply.notes.html_safe %></P>
|
<P><%= reply.notes.html_safe %></P>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 7px">
|
<div style="margin-top: 7px">
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_reply),
|
l(:button_reply),
|
||||||
{:controller => 'issues', :action => 'reply', :user_id => reply.user_id, :id => issue.id, :journal_id => reply.id},
|
{:controller => 'issues', :action => 'reply', :user_id => reply.user_id, :id => issue.id, :journal_id => reply.id},
|
||||||
:remote => true,
|
:remote => true,
|
||||||
:method => 'get',
|
:method => 'get',
|
||||||
:class => 'fr newsBlue',
|
:class => 'fr newsBlue',
|
||||||
:title => l(:button_reply)) if User.current.logged? %>
|
:title => l(:button_reply)) if User.current.logged? %>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_delete),
|
l(:button_delete),
|
||||||
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>reply.id},
|
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>reply.id},
|
||||||
:method => :get,
|
:method => :get,
|
||||||
:remote=>true,
|
:remote=>true,
|
||||||
:class => 'fr newsGrey mr10',
|
:class => 'fr newsGrey mr10',
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:title => l(:button_delete)
|
:title => l(:button_delete)
|
||||||
) if reply.user_id == User.current.id %>
|
) if reply.user_id == User.current.id %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p id="reply_message_<%= reply.id%>"></p>
|
<p id="reply_message_<%= reply.id%>"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||||
|
|
||||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
|
||||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="homepagePostReplyInputContainer mb10">
|
<div class="homepagePostReplyInputContainer mb10">
|
||||||
<div nhname='new_message_<%= @issue.id %>' style="display:none;">
|
<div nhname='new_message_<%= @issue.id %>' style="display:none;">
|
||||||
<%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f| %>
|
<%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f| %>
|
||||||
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
||||||
<!--<div class="cl"></div>-->
|
<!--<div class="cl"></div>-->
|
||||||
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
|
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
|
||||||
<div nhname='toolbar_container_<%= @issue.id %>' ></div>
|
<div nhname='toolbar_container_<%= @issue.id %>' ></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id %>' name="notes"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id %>' name="notes"></textarea>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="mt5 fl">
|
<div class="mt5 fl">
|
||||||
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %>
|
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %>
|
||||||
</div>
|
</div>
|
||||||
<span nhname='contentmsg_<%= @issue.id %>' class="fl"></span>
|
<span nhname='contentmsg_<%= @issue.id %>' class="fl"></span>
|
||||||
<a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" class="blue_n_btn fr mt5" style="display:none;">发送</a>
|
<a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr mt5" style="display:none;">发送</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
|
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
@ -1,27 +1,27 @@
|
|||||||
<div class="ReplyToMessageContainer borderBottomNone " id="reply_to_message_<%= @issue.id%>">
|
<div class="ReplyToMessageContainer borderBottomNone " id="reply_to_message_<%= @issue.id%>">
|
||||||
|
|
||||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
|
||||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ReplyToMessageInputContainer mb10">
|
<div class="ReplyToMessageInputContainer mb10">
|
||||||
<div nhname='new_message_<%= @issue.id%>' style="display:none;">
|
<div nhname='new_message_<%= @issue.id%>' style="display:none;">
|
||||||
<%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post", :remote => true) do |f|%>
|
<%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post", :remote => true) do |f|%>
|
||||||
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
||||||
<!--<div class="cl"></div>-->
|
<!--<div class="cl"></div>-->
|
||||||
<input type="hidden" name="quote" value=""/>
|
<input type="hidden" name="quote" value=""/>
|
||||||
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
|
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
|
||||||
<div nhname='toolbar_container_<%= @issue.id%>' ></div>
|
<div nhname='toolbar_container_<%= @issue.id%>' ></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<span nhname='contentmsg_<%= @issue.id%>' class="fl"></span>
|
<span nhname='contentmsg_<%= @issue.id%>' class="fl"></span>
|
||||||
<a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
<a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
|
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,136 +1,142 @@
|
|||||||
<div class="navHomepage">
|
<div class="navHomepage">
|
||||||
<div class="navHomepageLogo fl">
|
<div class="navHomepageLogo fl">
|
||||||
<%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), user_activities_path(User.current.id)%>
|
<%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), user_activities_path(User.current.id)%>
|
||||||
</div>
|
</div>
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="navHomepageMenu fl">
|
<li class="navHomepageMenu fl">
|
||||||
<%= link_to "首页",user_activities_path(User.current.id), :class => "c_white f16 db p10", :title => "回到个人首页"%>
|
<%= link_to "首页",user_activities_path(User.current.id), :class => "c_white f16 db p10", :title => "回到个人首页"%>
|
||||||
</li>
|
</li>
|
||||||
<li class="navHomepageMenu fl">
|
<li class="navHomepageMenu fl">
|
||||||
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>User.current.id,:type=>1)%>" class="c_white f16 db p10">资源库</a></li>
|
<a href="<%=url_for(:controller => 'users', :action => 'user_resource', :id => User.current.id, :type => 6) %>" class="c_white f16 db p10">资源库</a></li>
|
||||||
<li class="navHomepageMenu fl">
|
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||||
<%= link_to "作业", user_homeworks_user_path(User.current.id), :class => "c_white f16 db p10"%>
|
<li class="navHomepageMenu fl">
|
||||||
</li>
|
<%= link_to "题库", user_homeworks_user_path(User.current.id), :class => "c_white f16 db p10"%>
|
||||||
<li class="navHomepageMenu fl mr30">
|
</li>
|
||||||
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
|
<% else %>
|
||||||
</li>
|
<li class="navHomepageMenu fl">
|
||||||
</ul>
|
<%= link_to "我的作业", student_homeworks_user_path(User.current.id), :class => "c_white f16 db p10"%>
|
||||||
</div>
|
</li>
|
||||||
<script>
|
<% end %>
|
||||||
<%# type = type%>
|
<li class="navHomepageMenu fl mr30">
|
||||||
// $(function (){
|
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
|
||||||
// if('<%#= type %>' != null && '<%#= type %>' == 'courses' ){
|
</li>
|
||||||
// $('input:radio[value="courses"]').attr('checked','checked');
|
</ul>
|
||||||
// }
|
</div>
|
||||||
// if('<%#= type %>' != null && '<%#= type %>' == 'projects' ){
|
<script>
|
||||||
// $('input:radio[value="projects"]').attr('checked','checked');
|
<%# type = type%>
|
||||||
// }
|
// $(function (){
|
||||||
// if('<%#= type %>' != null && '<%#= type %>' == 'users' ){
|
// if('<%#= type %>' != null && '<%#= type %>' == 'courses' ){
|
||||||
// $('input:radio[value="users"]').attr('checked','checked');
|
// $('input:radio[value="courses"]').attr('checked','checked');
|
||||||
// }
|
// }
|
||||||
// });
|
// if('<%#= type %>' != null && '<%#= type %>' == 'projects' ){
|
||||||
|
// $('input:radio[value="projects"]').attr('checked','checked');
|
||||||
$(function(){
|
// }
|
||||||
$("#navHomepageSearchInput").keypress(function(e){
|
// if('<%#= type %>' != null && '<%#= type %>' == 'users' ){
|
||||||
var name = $.trim($('#navHomepageSearchInput').val());
|
// $('input:radio[value="users"]').attr('checked','checked');
|
||||||
if (e.keyCode == '13' && name != "" && name.length != 0) {
|
// }
|
||||||
//$('#type').val($('input[type=radio]:checked').val());
|
// });
|
||||||
$(this).parent().submit();
|
|
||||||
}
|
$(function(){
|
||||||
})
|
$("#navHomepageSearchInput").keypress(function(e){
|
||||||
});
|
var name = $.trim($('#navHomepageSearchInput').val());
|
||||||
|
if (e.keyCode == '13' && name != "" && name.length != 0) {
|
||||||
function search_in_header(obj){
|
//$('#type').val($('input[type=radio]:checked').val());
|
||||||
var name = $.trim($('#navHomepageSearchInput').val());
|
$(this).parent().submit();
|
||||||
if (name != "" && name.length != 0) {
|
}
|
||||||
//$('#type').val($('input[type=radio]:checked').val());
|
})
|
||||||
obj.parent().submit();
|
});
|
||||||
}
|
|
||||||
}
|
function search_in_header(obj){
|
||||||
</script>
|
var name = $.trim($('#navHomepageSearchInput').val());
|
||||||
<div class="fl" id="navHomepageSearch">
|
if (name != "" && name.length != 0) {
|
||||||
<!--<form class="navHomepageSearchBox">-->
|
//$('#type').val($('input[type=radio]:checked').val());
|
||||||
<% name = name%>
|
obj.parent().submit();
|
||||||
|
}
|
||||||
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
}
|
||||||
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子"/>
|
</script>
|
||||||
<input type="hidden" name="search_type" id="type" value="all"/>
|
<div class="fl" id="navHomepageSearch">
|
||||||
<input type="text" style="display: none;"/>
|
<!--<form class="navHomepageSearchBox">-->
|
||||||
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
|
<% name = name%>
|
||||||
<% end %>
|
|
||||||
<!--<div class="navSearchTypeBox" id="navHomepageSearchType">-->
|
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
||||||
<!--<div class="fl mr15 mt8">-->
|
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子"/>
|
||||||
<!--<input type="radio" value="courses" name="search_type" checked/>-->
|
<input type="hidden" name="search_type" id="type" value="all"/>
|
||||||
<!--课程-->
|
<input type="text" style="display: none;"/>
|
||||||
<!--</div>-->
|
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
|
||||||
<!--<div class="fl mr15 mt8">-->
|
<% end %>
|
||||||
<!--<input type="radio" value="projects" name="search_type" />-->
|
<!--<div class="navSearchTypeBox" id="navHomepageSearchType">-->
|
||||||
<!--项目-->
|
<!--<div class="fl mr15 mt8">-->
|
||||||
<!--</div>-->
|
<!--<input type="radio" value="courses" name="search_type" checked/>-->
|
||||||
<!--<div class="fl mr15 mt8">-->
|
<!--课程-->
|
||||||
<!--<input type="radio" value="users" name="search_type" />-->
|
<!--</div>-->
|
||||||
<!--用户-->
|
<!--<div class="fl mr15 mt8">-->
|
||||||
<!--</div>-->
|
<!--<input type="radio" value="projects" name="search_type" />-->
|
||||||
<!--<div id="navSearchAlert" class="fr mr10">-->
|
<!--项目-->
|
||||||
<!--<span class="c_red">请选择搜索类型</span>-->
|
<!--</div>-->
|
||||||
<!--</div>-->
|
<!--<div class="fl mr15 mt8">-->
|
||||||
<!--</div>-->
|
<!--<input type="radio" value="users" name="search_type" />-->
|
||||||
</div>
|
<!--用户-->
|
||||||
|
<!--</div>-->
|
||||||
<div class="navHomepageProfile" id="navHomepageProfile">
|
<!--<div id="navSearchAlert" class="fr mr10">-->
|
||||||
<ul>
|
<!--<span class="c_red">请选择搜索类型</span>-->
|
||||||
<li class="homepageProfileMenuIcon" id="homepageProfileMenuIcon">
|
<!--</div>-->
|
||||||
<%= link_to "<div class='mt5 mb8' id='user_avatar'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
|
<!--</div>-->
|
||||||
<ul class="topnav_login_list none" id="topnav_login_list">
|
</div>
|
||||||
<li>
|
|
||||||
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
<div class="navHomepageProfile" id="navHomepageProfile">
|
||||||
</li>
|
<ul>
|
||||||
<li>
|
<li class="homepageProfileMenuIcon" id="homepageProfileMenuIcon">
|
||||||
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
<%= link_to "<div class='mt5 mb8' id='user_avatar'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
|
||||||
</li>
|
<ul class="topnav_login_list none" id="topnav_login_list">
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
||||||
</li>
|
</li>
|
||||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
<li>
|
||||||
<li>
|
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
||||||
<%= link_to "退出",signout_path,:class => "menuGrey",:method => "post"%>
|
</li>
|
||||||
</li>
|
<li>
|
||||||
</ul>
|
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||||
</div>
|
<li>
|
||||||
|
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%>
|
||||||
<div class="navHomepageNews">
|
</li>
|
||||||
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
|
</ul>
|
||||||
<% if User.current.count_new_message >0 %>
|
</li>
|
||||||
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
|
</ul>
|
||||||
<% end %>
|
</div>
|
||||||
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
|
|
||||||
</div>
|
<div class="navHomepageNews">
|
||||||
</div>
|
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
|
||||||
|
<% if User.current.count_new_message.to_i >0 %>
|
||||||
<script type="text/javascript">
|
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
|
||||||
//搜索相关
|
<% end %>
|
||||||
$("#navHomepageSearch").mouseover(function(){
|
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
|
||||||
$("#navHomepageSearchType").show();
|
</div>
|
||||||
}).mouseout(function(){
|
</div>
|
||||||
$("#navHomepageSearchType").hide();
|
|
||||||
});
|
<script type="text/javascript">
|
||||||
|
//搜索相关
|
||||||
$("#navHomepageProfile").mouseenter(function(){
|
$("#navHomepageSearch").mouseover(function(){
|
||||||
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
$("#navHomepageSearchType").show();
|
||||||
$("#topnav_login_list").show();
|
}).mouseout(function(){
|
||||||
});
|
$("#navHomepageSearchType").hide();
|
||||||
$("#navHomepageProfile").mouseleave(function(){
|
});
|
||||||
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
|
||||||
$("#topnav_login_list").hide();
|
$("#navHomepageProfile").mouseenter(function(){
|
||||||
});
|
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
||||||
|
$("#topnav_login_list").show();
|
||||||
function signout(){
|
});
|
||||||
$.post(
|
$("#navHomepageProfile").mouseleave(function(){
|
||||||
'<%= signout_path%>',
|
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
||||||
{}
|
$("#topnav_login_list").hide();
|
||||||
);
|
});
|
||||||
}
|
|
||||||
</script>
|
function signout(){
|
||||||
|
$.post(
|
||||||
|
'<%= signout_path%>',
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue