Merge branch 'develop' into hjq_new_course
Conflicts: app/controllers/files_controller.rb db/schema.rb 处理冲突
This commit is contained in:
commit
165d5f50c8
|
@ -0,0 +1,3 @@
|
|||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
|
@ -0,0 +1,3 @@
|
|||
// Place all the styles related to the shield_activities controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -7,10 +7,14 @@ class AtController < ApplicationController
|
|||
@logger = Logger.new(Rails.root.join('log', 'at.log').to_s)
|
||||
users = find_at_users(params[:type], params[:id])
|
||||
@users = users
|
||||
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id } if users
|
||||
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }.sort{|x,y| to_pinyin(x.show_name) <=> to_pinyin(y.show_name)} if users
|
||||
end
|
||||
|
||||
private
|
||||
def to_pinyin(s)
|
||||
Pinyin.t(s).downcase
|
||||
end
|
||||
|
||||
def find_at_users(type, id)
|
||||
@logger.info("#{type}, #{id}")
|
||||
case type
|
||||
|
|
|
@ -10,7 +10,7 @@ class AvatarController < ApplicationController
|
|||
unless request.content_type == 'application/octet-stream'
|
||||
@source_type = params[:source_type]
|
||||
@source_id = params[:source_id]
|
||||
@temp_file = params[:avatar][:image]
|
||||
@temp_file = params[:avatar][:image]
|
||||
@image_file = @temp_file.original_filename
|
||||
else
|
||||
unless request.raw_post.nil?
|
||||
|
@ -23,7 +23,7 @@ class AvatarController < ApplicationController
|
|||
#image_file.force_encoding("UTF-8") if filename.respond_to?(:force_encoding)
|
||||
else
|
||||
@image_file=params[:filename]
|
||||
end
|
||||
end
|
||||
@temp_file = StringIO.new(@temp_file)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -52,7 +52,11 @@ class BlogCommentsController < ApplicationController
|
|||
render_attachment_warning_if_needed(@article)
|
||||
else
|
||||
end
|
||||
redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
|
||||
if params[:is_homepage]
|
||||
redirect_to user_blogs_path(params[:user_id])
|
||||
else
|
||||
redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
|
||||
end
|
||||
end
|
||||
def destroy
|
||||
@article = BlogComment.find(params[:id])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class BlogsController < ApplicationController
|
||||
before_filter :find_blog,:except => [:index,:create,:new]
|
||||
before_filter :find_blog,:except => [:index,:create,:new,:set_homepage, :cancel_homepage]
|
||||
before_filter :find_user
|
||||
def index
|
||||
@articls = @user.blog.articles
|
||||
|
@ -26,6 +26,18 @@ class BlogsController < ApplicationController
|
|||
def edit
|
||||
|
||||
end
|
||||
|
||||
def set_homepage
|
||||
@blog = Blog.find(params[:id])
|
||||
@blog.update_attribute(:homepage_id, params[:article_id])
|
||||
redirect_to user_blogs_path(params[:user_id])
|
||||
end
|
||||
|
||||
def cancel_homepage
|
||||
@blog = Blog.find(params[:id])
|
||||
@blog.update_attribute(:homepage_id, nil)
|
||||
redirect_to user_blogs_path(params[:user_id])
|
||||
end
|
||||
private
|
||||
def find_blog
|
||||
if params[:blog_id]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#encoding: utf-8
|
||||
class CoursesController < ApplicationController
|
||||
# layout 'base_courses'
|
||||
include CoursesHelper
|
||||
|
@ -38,15 +39,17 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
limit = 15
|
||||
course_org_ids = OrgCourse.find_by_sql("select distinct organization_id from org_courses where course_id = #{params[:id]}").map(&:organization_id)
|
||||
if course_org_ids.empty?
|
||||
@orgs_not_in_course = Organization.where("(is_public or creator_id =?) and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(limit)
|
||||
@org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count
|
||||
else
|
||||
course_org_ids = "(" + course_org_ids.join(',') + ")"
|
||||
@orgs_not_in_course = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(limit)
|
||||
@org_count = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count
|
||||
end
|
||||
# @course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count
|
||||
#@orgs_not_in_course = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).page(params[:page].to_i || 1).per(limit)
|
||||
#@org_count = User.current.organizations.where("organizations.id not in (#{course_org_ids.join(',')}) and organizations.name like ?", condition).count
|
||||
if course_org_ids.empty?
|
||||
@orgs_not_in_course = User.current.organizations.where("name like ?",condition).page((params[:page].to_i || 1)).per(limit)
|
||||
@org_count = @orgs_not_in_course.count
|
||||
else
|
||||
course_org_ids = "(" + course_org_ids.join(',') + ")"
|
||||
@orgs_not_in_course = User.current.organizations.where("organizations.id not in #{course_org_ids} and organizations.name like ?", condition).page((params[:page].to_i || 1)).per(limit)
|
||||
@org_count = @orgs_not_in_course.empty? ? 0 : @orgs_not_in_course.count
|
||||
end
|
||||
@course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count
|
||||
@orgs_page = Paginator.new @org_count, limit,params[:page]
|
||||
@hint_flag = params[:hint_flag]
|
||||
#render :json => {:orgs => @orgs_not_in_course, :count => @org_count}.to_json
|
||||
|
@ -436,6 +439,73 @@ class CoursesController < ApplicationController
|
|||
def create
|
||||
cs = CoursesService.new
|
||||
@course = cs.create_course(params,User.current)[:course]
|
||||
if params[:copy_course]
|
||||
copy_course = Course.find params[:copy_course].to_i
|
||||
@course.update_attributes(:open_student => copy_course.open_student, :publish_resource => copy_course.publish_resource)
|
||||
if params[:checkAll]
|
||||
attachments = copy_course.attachments
|
||||
attachments.each do |attachment|
|
||||
attach_copied_obj = attachment.copy
|
||||
attach_copied_obj.tag_list.add(attachment.tag_list) # tag关联
|
||||
attach_copied_obj.container = @course
|
||||
attach_copied_obj.created_on = Time.now
|
||||
attach_copied_obj.author_id = User.current.id
|
||||
attach_copied_obj.copy_from = attachment.copy_from.nil? ? attachment.id : attachment.copy_from
|
||||
if attach_copied_obj.attachtype == nil
|
||||
attach_copied_obj.attachtype = 4
|
||||
end
|
||||
attach_copied_obj.save
|
||||
update_quotes attach_copied_obj
|
||||
end
|
||||
elsif params[:course_attachment_type]
|
||||
copy_attachments = []
|
||||
params[:course_attachment_type].each do |type|
|
||||
case type
|
||||
when "1"
|
||||
tag_name = l(:label_courseware)
|
||||
when "2"
|
||||
tag_name = l(:label_software)
|
||||
when "3"
|
||||
tag_name = l(:label_media)
|
||||
when "4"
|
||||
tag_name = l(:label_code)
|
||||
when "6"
|
||||
tag_name = "论文"
|
||||
else
|
||||
tag_name = ""
|
||||
end
|
||||
if tag_name == ""
|
||||
tag_attachments = copy_course.attachments.select{|attachment|
|
||||
!attachment.tag_list.include?('课件') &&
|
||||
!attachment.tag_list.include?('软件') &&
|
||||
!attachment.tag_list.include?('媒体') &&
|
||||
!attachment.tag_list.include?('代码') &&
|
||||
!attachment.tag_list.include?('论文') }
|
||||
else
|
||||
tag_attachments = copy_course.attachments.select{|attachment| attachment.tag_list.include?(tag_name)}
|
||||
end
|
||||
tag_attachments.each do |attach|
|
||||
next if copy_attachments.include?(attach)
|
||||
copy_attachments << attach
|
||||
end
|
||||
end
|
||||
unless copy_attachments.blank?
|
||||
copy_attachments.each do |c_attach|
|
||||
attach_copied_obj = c_attach.copy
|
||||
attach_copied_obj.tag_list.add(c_attach.tag_list) # tag关联
|
||||
attach_copied_obj.container = @course
|
||||
attach_copied_obj.created_on = Time.now
|
||||
attach_copied_obj.author_id = User.current.id
|
||||
attach_copied_obj.copy_from = c_attach.copy_from.nil? ? c_attach.id : c_attach.copy_from
|
||||
if attach_copied_obj.attachtype == nil
|
||||
attach_copied_obj.attachtype = 4
|
||||
end
|
||||
attach_copied_obj.save
|
||||
update_quotes attach_copied_obj
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if @course
|
||||
respond_to do |format|
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
|
@ -751,6 +821,11 @@ class CoursesController < ApplicationController
|
|||
#param id:已有课程ID
|
||||
def copy_course
|
||||
if @course
|
||||
@new_course = Course.new
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
=begin
|
||||
@new_course = Course.new @course.attributes
|
||||
@new_course.tea_id = User.current.id
|
||||
@new_course.created_at = DateTime.now
|
||||
|
@ -769,6 +844,7 @@ class CoursesController < ApplicationController
|
|||
@new_course.course_infos << course
|
||||
redirect_to settings_course_url @new_course
|
||||
end
|
||||
=end
|
||||
else
|
||||
render_404
|
||||
end
|
||||
|
@ -829,6 +905,33 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
private
|
||||
def update_quotes attachment
|
||||
if attachment.copy_from
|
||||
attachments = Attachment.find_by_sql("select * from attachments where copy_from = #{attachment.copy_from} or id = #{attachment.copy_from}")
|
||||
else
|
||||
attachments = Attachment.find_by_sql("select * from attachments where copy_from = #{attachment.id} or id = #{attachment.copy_from}")
|
||||
end
|
||||
attachment.quotes = get_qute_number attachment
|
||||
attachment.save
|
||||
attachments.each do |att|
|
||||
att.quotes = attachment.quotes
|
||||
att.save
|
||||
end
|
||||
end
|
||||
|
||||
def get_qute_number attachment
|
||||
if attachment.copy_from
|
||||
result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.copy_from}")
|
||||
else
|
||||
result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.id}")
|
||||
end
|
||||
if result.nil? || result.count <= 0
|
||||
return 0
|
||||
else
|
||||
return result[0].number
|
||||
end
|
||||
end
|
||||
|
||||
def allow_join course
|
||||
if course_endTime_timeout? course
|
||||
respond_to do |format|
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -23,8 +23,10 @@ class FilesController < ApplicationController
|
|||
before_filter :auth_login1, :only => [:index]
|
||||
before_filter :logged_user_by_apptoken,:only => [:index]
|
||||
before_filter :find_project_by_project_id#, :except => [:getattachtype]
|
||||
before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment,:subfield_upload_file,
|
||||
:search_org_subfield_tag_attachment,:search_tag_attachment,:quote_resource_show_org_subfield,:find_org_subfield_attache,:search_files_in_subfield]
|
||||
before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,
|
||||
:search_tag_attachment,:subfield_upload_file,:search_org_subfield_tag_attachment,
|
||||
:search_tag_attachment,:quote_resource_show_org_subfield,:find_org_subfield_attache,
|
||||
:search_files_in_subfield,:upload_files_menu]
|
||||
|
||||
helper :sort
|
||||
include SortHelper
|
||||
|
@ -227,6 +229,7 @@ class FilesController < ApplicationController
|
|||
@order = ""
|
||||
@is_remote = false
|
||||
if params[:project_id]
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 2
|
||||
@container_type = 0
|
||||
if params[:sort]
|
||||
params[:sort].split(",").each do |sort_type|
|
||||
|
@ -822,4 +825,8 @@ class FilesController < ApplicationController
|
|||
def subfield_upload_file
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
end
|
||||
|
||||
def upload_files_menu
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -412,6 +412,7 @@ class IssuesController < ApplicationController
|
|||
if params[:issue_id]
|
||||
@issue_id = params[:issue_id]
|
||||
end
|
||||
@priorities = IssuePriority.active
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -1,303 +1,319 @@
|
|||
# encoding: utf-8
|
||||
class OrganizationsController < ApplicationController
|
||||
|
||||
|
||||
helper :sort
|
||||
include SortHelper
|
||||
helper :custom_fields
|
||||
include CustomFieldsHelper
|
||||
include AvatarHelper
|
||||
include WordsHelper
|
||||
include GitlabHelper
|
||||
include UserScoreHelper
|
||||
|
||||
include PollHelper
|
||||
helper :user_score
|
||||
helper :journals
|
||||
helper :attachments
|
||||
# added by liuping 关注
|
||||
|
||||
helper :watchers
|
||||
helper :activities
|
||||
|
||||
### added by william
|
||||
include ActsAsTaggableOn::TagsHelper
|
||||
|
||||
# fq
|
||||
helper :words
|
||||
helper :project_score
|
||||
helper :issues
|
||||
include UsersHelper
|
||||
before_filter :find_organization, :only => [:show, :members]
|
||||
layout 'base_org'
|
||||
def index
|
||||
|
||||
end
|
||||
def new
|
||||
@organization = Organization.new
|
||||
render :layout => 'new_base'
|
||||
end
|
||||
|
||||
def edit
|
||||
@organization = Organization.find(params[:id])
|
||||
end
|
||||
|
||||
def destroy
|
||||
@organization = Organization.find(params[:id])
|
||||
@organization.destroy
|
||||
respond_to do |format|
|
||||
format.html{ redirect_to admin_organization_path }
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@organization = Organization.new
|
||||
@organization.name = params[:organization][:name]
|
||||
@organization.description = params[:organization][:description]
|
||||
@organization.is_public = params[:organization][:is_public]
|
||||
@organization.creator_id = User.current.id
|
||||
member = OrgMember.new(:user_id => User.current.id)
|
||||
|
||||
@organization.org_members << member
|
||||
if @organization.save
|
||||
OrgMemberRole.create(:org_member_id => member.id, :role_id => 11)
|
||||
redirect_to organization_path(@organization)
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@organization = Organization.find(params[:id])
|
||||
if params[:org_subfield_id]
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
@org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
else
|
||||
project_ids = @organization.projects.map(&:id) << 0
|
||||
course_ids = @organization.courses.map(&:id) << 0
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
case params[:type]
|
||||
when nil
|
||||
@org_activities = OrgActivity.where("(container_id =? and container_type =?) " +
|
||||
"or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')})) "+
|
||||
"or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))",
|
||||
@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'project_issue'
|
||||
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Issue' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'project_message'
|
||||
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Message' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'org'
|
||||
@org_activities = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_homework'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'HomeworkCommon' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_news'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'News' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_message'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Message' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_poll'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
end
|
||||
end
|
||||
@page = params[:page]
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@organization = Organization.find(params[:id])
|
||||
@organization.name = params[:organization][:name]
|
||||
@organization.description = params[:organization][:description]
|
||||
@organization.domain = params[:organization][:domain]
|
||||
@organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0
|
||||
#@organization.name = params[:organization][:name]
|
||||
@organization.save
|
||||
respond_to do |format|
|
||||
format.html { redirect_to setting_organization_path(@organization)}
|
||||
end
|
||||
end
|
||||
|
||||
def check_uniq
|
||||
@check = false;
|
||||
@org_name = params[:org_name].strip
|
||||
@config_page = params[:config_page]
|
||||
sameName = @config_page ? Organization.where('name = ? and id != ?',params[:org_name],params[:org_id].to_i).count == 0 : Organization.where('name = ?',params[:org_name]).count == 0
|
||||
if sameName == true
|
||||
@check = true
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def find_organization
|
||||
@organization = Organization.find(params[:id])
|
||||
end
|
||||
|
||||
def setting
|
||||
@organization = Organization.find(params[:id])
|
||||
|
||||
if User.current.admin? || User.current.admin_of_org?(@organization)
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def clear_org_avatar_temp
|
||||
|
||||
end
|
||||
|
||||
def set_homepage
|
||||
@org = Organization.find(params[:id])
|
||||
@org.home_id = params[:home_id]
|
||||
@org.save
|
||||
# respond_to do |format|
|
||||
# format.html {redirect_to organization_path(org)}
|
||||
# end
|
||||
end
|
||||
|
||||
def cancel_homepage
|
||||
@org = Organization.find(params[:id])
|
||||
@org.home_id = nil
|
||||
@org.save
|
||||
end
|
||||
|
||||
def autocomplete_search
|
||||
@project = Project.find(params[:project_id])
|
||||
#@flag = params[:flag] || false
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def members
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@members = OrgMember.where("organization_id =?", @organization.id)
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
def more_org_projects
|
||||
@organization = Organization.find params[:id]
|
||||
@page = params[:page]
|
||||
@org_projects = @organization.projects.reorder('created_at').uniq.page((params[:page].to_i || 1) +1).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def more_org_courses
|
||||
@organization = Organization.find(params[:id])
|
||||
@page = params[:page]
|
||||
@org_courses = @organization.courses.reorder('created_at').uniq.page((params[:page].to_i || 1) + 1 ).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def join_course_menu
|
||||
@organization = Organization.find(params[:id])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def search_courses
|
||||
@organization = Organization.find(params[:id])
|
||||
condition = '%%'
|
||||
if !params[:name].nil?
|
||||
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||
end
|
||||
sql = "select courses.* from courses inner join members on courses.id = members.course_id where members.user_id = #{User.current.id} and courses.name like '#{condition}'"+
|
||||
"and courses.id not in (select distinct org_courses.course_id from org_courses where org_courses.organization_id = #{@organization.id})"
|
||||
#user_courses = Course.find_by_sql(sql)
|
||||
@courses = Course.find_by_sql(sql)
|
||||
# @added_course_ids = @organization.courses.map(&:id)
|
||||
# @courses = []
|
||||
# user_courses.each do |course|
|
||||
# if !@added_course_ids.include?(course.id)
|
||||
# @courses << course
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
def join_courses
|
||||
@organization = Organization.find(params[:id])
|
||||
course_ids = params[:courseNames]
|
||||
course_ids.each do |id|
|
||||
OrgCourse.create(:organization_id => @organization.id, :course_id => id.to_i, :created_at => Time.now)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def join_project_menu
|
||||
@organization = Organization.find(params[:id])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def logout
|
||||
logout_user
|
||||
respond_to do |format|
|
||||
format.html {redirect_to organization_path(params[:id])}
|
||||
end
|
||||
end
|
||||
|
||||
def search_projects
|
||||
@organization = Organization.find(params[:id])
|
||||
condition = '%%'
|
||||
if !params[:name].nil?
|
||||
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||
end
|
||||
sql = "select projects.* from projects inner join members on projects.id = members.project_id where members.user_id = #{User.current.id} and projects.status != 9 and projects.name like '#{condition}'" +
|
||||
" and projects.id not in (select org_projects.project_id from org_projects where organization_id = #{@organization.id})"
|
||||
#user_projects = Course.find_by_sql(sql)
|
||||
@projects = Course.find_by_sql(sql)
|
||||
# @added_course_ids = @organization.projects.map(&:id)
|
||||
# @projects = []
|
||||
# user_projects.each do |project|
|
||||
# if !@added_course_ids.include?(project.id)
|
||||
# @projects << project
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
def join_projects
|
||||
@organization = Organization.find(params[:id])
|
||||
project_ids = params[:projectNames]
|
||||
project_ids.each do |id|
|
||||
OrgProject.create(:organization_id => @organization.id, :project_id => id.to_i, :created_at => Time.now)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def hide_org_subfield
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield.update_attribute(:hide, 1)
|
||||
end
|
||||
|
||||
def show_org_subfield
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield.update_attribute(:hide, 0)
|
||||
end
|
||||
|
||||
def org_resources_subfield
|
||||
@org = Organization.find(params[:id])
|
||||
@subfield = @org.org_subfields.where('field_type = "Resource" ')
|
||||
respond_to do | format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
# encoding: utf-8
|
||||
class OrganizationsController < ApplicationController
|
||||
|
||||
|
||||
helper :sort
|
||||
include SortHelper
|
||||
helper :custom_fields
|
||||
include CustomFieldsHelper
|
||||
include AvatarHelper
|
||||
include WordsHelper
|
||||
include GitlabHelper
|
||||
include UserScoreHelper
|
||||
|
||||
include PollHelper
|
||||
helper :user_score
|
||||
helper :journals
|
||||
helper :attachments
|
||||
# added by liuping 关注
|
||||
|
||||
helper :watchers
|
||||
helper :activities
|
||||
|
||||
### added by william
|
||||
include ActsAsTaggableOn::TagsHelper
|
||||
|
||||
# fq
|
||||
helper :words
|
||||
helper :project_score
|
||||
helper :issues
|
||||
include UsersHelper
|
||||
before_filter :find_organization, :only => [:show, :members, :apply_subdomain]
|
||||
layout 'base_org'
|
||||
def index
|
||||
|
||||
end
|
||||
def new
|
||||
@organization = Organization.new
|
||||
render :layout => 'new_base'
|
||||
end
|
||||
|
||||
def edit
|
||||
@organization = Organization.find(params[:id])
|
||||
end
|
||||
|
||||
def destroy
|
||||
@organization = Organization.find(params[:id])
|
||||
@organization.destroy
|
||||
respond_to do |format|
|
||||
format.html{ redirect_to admin_organization_path }
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@organization = Organization.new
|
||||
@organization.name = params[:organization][:name]
|
||||
@organization.description = params[:organization][:description]
|
||||
@organization.is_public = params[:organization][:is_public]
|
||||
@organization.creator_id = User.current.id
|
||||
member = OrgMember.new(:user_id => User.current.id)
|
||||
|
||||
@organization.org_members << member
|
||||
if @organization.save
|
||||
OrgMemberRole.create(:org_member_id => member.id, :role_id => 11)
|
||||
redirect_to organization_path(@organization)
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@organization = Organization.find(params[:id])
|
||||
if params[:org_subfield_id]
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
@org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
else
|
||||
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
|
||||
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
|
||||
project_ids = (@organization.projects.map(&:id)-shield_project_ids) << 0
|
||||
course_ids = (@organization.courses.map(&:id)-shield_course_ids) << 0
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
case params[:type]
|
||||
when nil
|
||||
@org_activities = OrgActivity.where("(container_id =? and container_type =?) " +
|
||||
"or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')})) "+
|
||||
"or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))",
|
||||
@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'project_issue'
|
||||
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Issue' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'project_message'
|
||||
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Message' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'org'
|
||||
@org_activities = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_homework'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'HomeworkCommon' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_news'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'News' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_message'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Message' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_poll'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
end
|
||||
end
|
||||
@page = params[:page] ? params[:page].to_i : 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@organization = Organization.find(params[:id])
|
||||
@organization.name = params[:organization][:name]
|
||||
@organization.description = params[:organization][:description]
|
||||
@organization.domain = params[:organization][:domain]
|
||||
@organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0
|
||||
#@organization.name = params[:organization][:name]
|
||||
@organization.save
|
||||
respond_to do |format|
|
||||
format.html { redirect_to setting_organization_path(@organization)}
|
||||
end
|
||||
end
|
||||
|
||||
def check_uniq
|
||||
@check = false;
|
||||
@org_name = params[:org_name].strip
|
||||
@config_page = params[:config_page]
|
||||
sameName = @config_page ? Organization.where('name = ? and id != ?',params[:org_name],params[:org_id].to_i).count == 0 : Organization.where('name = ?',params[:org_name]).count == 0
|
||||
if sameName == true
|
||||
@check = true
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def find_organization
|
||||
@organization = Organization.find(params[:id])
|
||||
end
|
||||
|
||||
def setting
|
||||
@organization = Organization.find(params[:id])
|
||||
|
||||
if User.current.admin? || User.current.admin_of_org?(@organization)
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def clear_org_avatar_temp
|
||||
|
||||
end
|
||||
|
||||
def set_homepage
|
||||
@org = Organization.find(params[:id])
|
||||
@org.home_id = params[:home_id]
|
||||
@org.save
|
||||
# respond_to do |format|
|
||||
# format.html {redirect_to organization_path(org)}
|
||||
# end
|
||||
end
|
||||
|
||||
def cancel_homepage
|
||||
@org = Organization.find(params[:id])
|
||||
@org.home_id = nil
|
||||
@org.save
|
||||
end
|
||||
|
||||
def autocomplete_search
|
||||
@project = Project.find(params[:project_id])
|
||||
#@flag = params[:flag] || false
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def members
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@members = OrgMember.where("organization_id =?", @organization.id)
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
def more_org_projects
|
||||
@organization = Organization.find params[:id]
|
||||
@page = params[:page]
|
||||
@org_projects = @organization.projects.reorder('created_at').uniq.page((params[:page].to_i || 1) +1).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def more_org_courses
|
||||
@organization = Organization.find(params[:id])
|
||||
@page = params[:page]
|
||||
@org_courses = @organization.courses.reorder('created_at').uniq.page((params[:page].to_i || 1) + 1 ).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def join_course_menu
|
||||
@organization = Organization.find(params[:id])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def search_courses
|
||||
@organization = Organization.find(params[:id])
|
||||
condition = '%%'
|
||||
if !params[:name].nil?
|
||||
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||
end
|
||||
sql = "select courses.* from courses inner join members on courses.id = members.course_id where members.user_id = #{User.current.id} and courses.name like '#{condition}'"+
|
||||
"and courses.id not in (select distinct org_courses.course_id from org_courses where org_courses.organization_id = #{@organization.id})"
|
||||
#user_courses = Course.find_by_sql(sql)
|
||||
@courses = Course.find_by_sql(sql)
|
||||
# @added_course_ids = @organization.courses.map(&:id)
|
||||
# @courses = []
|
||||
# user_courses.each do |course|
|
||||
# if !@added_course_ids.include?(course.id)
|
||||
# @courses << course
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
def join_courses
|
||||
@organization = Organization.find(params[:id])
|
||||
course_ids = params[:courseNames]
|
||||
course_ids.each do |id|
|
||||
OrgCourse.create(:organization_id => @organization.id, :course_id => id.to_i, :created_at => Time.now)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def join_project_menu
|
||||
@organization = Organization.find(params[:id])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def logout
|
||||
logout_user
|
||||
respond_to do |format|
|
||||
format.html {redirect_to organization_path(params[:id])}
|
||||
end
|
||||
end
|
||||
|
||||
def search_projects
|
||||
@organization = Organization.find(params[:id])
|
||||
condition = '%%'
|
||||
if !params[:name].nil?
|
||||
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||
end
|
||||
sql = "select projects.* from projects inner join members on projects.id = members.project_id where members.user_id = #{User.current.id} and projects.status != 9 and projects.name like '#{condition}'" +
|
||||
" and projects.id not in (select org_projects.project_id from org_projects where organization_id = #{@organization.id})"
|
||||
#user_projects = Course.find_by_sql(sql)
|
||||
@projects = Course.find_by_sql(sql)
|
||||
# @added_course_ids = @organization.projects.map(&:id)
|
||||
# @projects = []
|
||||
# user_projects.each do |project|
|
||||
# if !@added_course_ids.include?(project.id)
|
||||
# @projects << project
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
def join_projects
|
||||
@organization = Organization.find(params[:id])
|
||||
project_ids = params[:projectNames]
|
||||
project_ids.each do |id|
|
||||
OrgProject.create(:organization_id => @organization.id, :project_id => id.to_i, :created_at => Time.now)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def hide_org_subfield
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield.update_attribute(:hide, 1)
|
||||
end
|
||||
|
||||
def show_org_subfield
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield.update_attribute(:hide, 0)
|
||||
end
|
||||
|
||||
def org_resources_subfield
|
||||
@org = Organization.find(params[:id])
|
||||
@subfield = @org.org_subfields.where('field_type = "Resource" ')
|
||||
respond_to do | format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
def apply_subdomain
|
||||
@organization = Organization.find(params[:id])
|
||||
admins = User.where("admin=1")
|
||||
admins.each do |admin|
|
||||
OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain])
|
||||
end
|
||||
end
|
||||
|
||||
def agree_apply_subdomain
|
||||
@organization = Organization.find(params[:organization_id])
|
||||
@organization.update_attribute(:domain, params[:org_domain])
|
||||
if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=?",params[:org_domain]).count == 0
|
||||
OrgMessage.create(:user_id => params[:user_id], :organization_id => @organization.id, :message_type => 'AgreeApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -76,16 +76,17 @@ class ProjectsController < ApplicationController
|
|||
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||
end
|
||||
limit = 15
|
||||
project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[:id]}").map(&:organization_id)
|
||||
if project_org_ids.empty?
|
||||
@orgs_not_in_project = Organization.where("(is_public or creator_id =?) = 1 and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(limit)
|
||||
@org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count
|
||||
else
|
||||
project_org_ids = "(" + project_org_ids.join(',') + ")"
|
||||
@orgs_not_in_project = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(limit)
|
||||
@org_count = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count
|
||||
end
|
||||
# @project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count
|
||||
project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[:id]}").map(&:organization_id) << 0
|
||||
@orgs_not_in_project = User.current.organizations.where("organizations.id not in (#{project_org_ids.join(',')}) and organizations.name like ?", condition).page(params[:page].to_i || 1).per(limit)
|
||||
@org_count = User.current.organizations.where("organizations.id not in (#{project_org_ids.join(',')}) and organizations.name like '#{condition}'").count
|
||||
# if project_org_ids.empty?
|
||||
# @orgs_not_in_project = Organization.where("(is_public or creator_id =?) = 1 and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(limit)
|
||||
# @org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count
|
||||
# else
|
||||
# project_org_ids = "(" + project_org_ids.join(',') + ")"
|
||||
# @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(limit)
|
||||
# @org_count = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count
|
||||
# end
|
||||
@orgs_page = Paginator.new @org_count, limit,params[:page]
|
||||
@no_roll_hint = params[:hint_flag]
|
||||
#render :json => {:orgs => @orgs_not_in_project, :count => @org_count}.to_json
|
||||
|
|
|
@ -357,7 +357,7 @@ update
|
|||
@changesets = g.commits(@project.gpid, :ref_name => @rev)
|
||||
# @changesets = @repository.latest_changesets(@path, @rev)
|
||||
# @changesets_count = @repository.latest_changesets(@path, @rev).count
|
||||
@changesets_all_count = @project.gpid.nil? ? 0 : g.commits_total_count(@project.gpid).count
|
||||
@changesets_all_count = @project.gpid.nil? ? 0 : g.project(@project.gpid).commit_count
|
||||
@changesets_latest_coimmit = @changesets[0]
|
||||
@properties = @repository.properties(@path, @rev)
|
||||
@repositories = @project.repositories
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
class ShieldActivitiesController < ApplicationController
|
||||
def create
|
||||
if params[:org_id]
|
||||
if params[:project_id]
|
||||
ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||
elsif params[:course_id]
|
||||
ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Course', :shield_id => params[:course_id].to_i)
|
||||
end
|
||||
elsif params[:user_id]
|
||||
if params[:project_id]
|
||||
ShieldActivity.create(:container_type => 'User', :container_id => params[:user_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||
elsif params[:course_id]
|
||||
ShieldActivity.create(:container_type => 'User', :container_id => params[:user_id].to_i, :shield_type => 'Course', :shield_id => params[:course_id].to_i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show_acts
|
||||
if params[:org_id]
|
||||
if params[:project_id]
|
||||
ShieldActivity.where("container_type='Organization' and container_id=#{params[:org_id].to_i} and shield_type='Project' and shield_id=#{params[:project_id]}").each do |act|
|
||||
act.destroy
|
||||
end
|
||||
# ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||
elsif params[:course_id]
|
||||
ShieldActivity.where("container_type='Organization' and container_id=#{params[:org_id].to_i} and shield_type='Course' and shield_id=#{params[:course_id]}").each do |act|
|
||||
act.destroy
|
||||
end
|
||||
end
|
||||
elsif params[:user_id]
|
||||
if params[:project_id]
|
||||
ShieldActivity.where("container_type='User' and container_id=#{params[:user_id].to_i} and shield_type='Project' and shield_id=#{params[:project_id]}").each do |act|
|
||||
act.destroy
|
||||
end
|
||||
# ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||
elsif params[:course_id]
|
||||
ShieldActivity.where("container_type='User' and container_id=#{params[:user_id].to_i} and shield_type='Course' and shield_id=#{params[:course_id]}").each do |act|
|
||||
act.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -967,9 +967,11 @@ class UsersController < ApplicationController
|
|||
params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false)
|
||||
join_course_messages.update_all(:viewed => true)
|
||||
end
|
||||
shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
|
||||
shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
|
||||
user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
||||
user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
||||
user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")"
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
project_types = "('Message','Issue','ProjectCreateInfo')"
|
||||
principal_types = "JournalsForMessage"
|
||||
|
|
|
@ -236,7 +236,11 @@ class WordsController < ApplicationController
|
|||
if User.current.logged?
|
||||
@user = User.find(params[:id])
|
||||
if params[:new_form][:user_message].size>0 && User.current.logged? && @user
|
||||
@user.add_jour(User.current, params[:new_form][:user_message])
|
||||
if params[:private] && params[:private] == '1'
|
||||
@user.journals_for_messages << JournalsForMessage.new(:user_id => User.current.id, :notes => params[:new_form][:user_message], :reply_id => 0, :status => true, :is_readed => false, :private => 1)
|
||||
else
|
||||
@user.add_jour(User.current, params[:new_form][:user_message])
|
||||
end
|
||||
end
|
||||
redirect_to feedback_path(@user)
|
||||
else
|
||||
|
|
|
@ -59,6 +59,19 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
# 判断组织左侧展开或者隐藏
|
||||
def is_hide_org_left obj
|
||||
if obj.nil?
|
||||
return true
|
||||
else
|
||||
if obj.hide == 0
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Time 2015-03-24 16:38:05
|
||||
# Author lizanle
|
||||
# Description after save后需要进行资源记录的更新
|
||||
|
@ -2768,4 +2781,10 @@ int main(int argc, char** argv){
|
|||
ss.html_safe
|
||||
end
|
||||
|
||||
#代码提交数量
|
||||
def changesets_num project
|
||||
g = Gitlab.client
|
||||
project.gpid.nil? ? 0 : g.project(project.gpid).commit_count
|
||||
# project.changesets.count
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,14 +20,6 @@ module ProjectScoreHelper
|
|||
project.documents.count
|
||||
end
|
||||
|
||||
#代码提交数量
|
||||
def changesets_num project
|
||||
g = Gitlab.client
|
||||
project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count
|
||||
# # commits_total_count(project.gpid)
|
||||
# project.changesets.count
|
||||
end
|
||||
|
||||
#讨论区帖子数量
|
||||
def board_message_num project
|
||||
board_message_count = 0
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
module ShieldActivitiesHelper
|
||||
end
|
|
@ -591,7 +591,7 @@ module UsersHelper
|
|||
option << "请选择发布作业的课程"
|
||||
option << -1
|
||||
type << option
|
||||
user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
|
||||
user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
|
||||
option = []
|
||||
option << course.name+"("+course.time.to_s+course.term+")"
|
||||
option << course.id
|
||||
|
|
|
@ -15,8 +15,9 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
"m_parent_id", # 留言信息的父留言id
|
||||
"is_readed", # 留言是否已读
|
||||
"m_reply_count", # 留言的回复数量
|
||||
"m_reply_id" # 回复某留言的留言id(a留言回复了b留言,这是b留言的id)
|
||||
"is_comprehensive_evaluation" # 1 教师评论、2 匿评、3 留言
|
||||
"m_reply_id" , # 回复某留言的留言id(a留言回复了b留言,这是b留言的id)
|
||||
"is_comprehensive_evaluation", # 1 教师评论、2 匿评、3 留言
|
||||
"private"
|
||||
acts_as_tree :foreign_key => 'm_parent_id', :counter_cache => :m_reply_count, :order => "#{JournalsForMessage.table_name}.created_on ASC"
|
||||
after_destroy :delete_kindeditor_assets
|
||||
belongs_to :project,
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
class OrgMessage < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
belongs_to :organization
|
||||
has_many :message_alls, :as => :message, :dependent => :destroy
|
||||
validates :message_type, :presence => true
|
||||
validates :message_id, :presence => true
|
||||
validates :organization_id, :presence => true
|
||||
after_create :add_user_message
|
||||
|
||||
def add_user_message
|
||||
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
|
||||
self.message_alls << MessageAll.new(:user_id => self.user_id)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
class ShieldActivity < ActiveRecord::Base
|
||||
|
||||
end
|
|
@ -193,6 +193,7 @@ class CoursesService
|
|||
@course.extra = 'course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s
|
||||
@course.send(:safe_attributes=, params[:course], current_user)
|
||||
#@course.safe_attributes(current_user,params[:course])
|
||||
@course.password = params[:course][:password]
|
||||
@course.tea_id = current_user.id
|
||||
@course.term = params[:term]
|
||||
@course.time = params[:time]
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<% if activity.attachments.any? %>
|
||||
<% activity.attachments.each do |attachment| %>
|
||||
<div class="break_word">
|
||||
<span class="fl">
|
||||
<span title="<%= attachment.filename %>" id="attachment_<%=attachment.id %>">
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'mw400 hidden link_file_a fl newsBlue', :download => true -%>
|
||||
</span>
|
||||
</span>
|
||||
<span class="postAttSize">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,5 +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},:method=>'PUT',
|
||||
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage]},:method=>'PUT',
|
||||
: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} %>
|
||||
<% end %>
|
||||
|
|
|
@ -5,20 +5,4 @@
|
|||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
//init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% end %>
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
showNormalImage('activity_description_<%= @user_activity_id %>');
|
||||
if($("#intro_content_<%= @user_activity_id %>").height() > 810) {
|
||||
$("#intro_content_show_<%= @user_activity_id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= @user_activity_id %>").click(function(){
|
||||
$("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= @user_activity_id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= @user_activity_id %>").hide();
|
||||
$("#intro_content_hide_<%= @user_activity_id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= @user_activity_id %>").click(function(){
|
||||
$("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= @user_activity_id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= @user_activity_id %>").hide();
|
||||
$("#intro_content_show_<%= @user_activity_id %>").show();
|
||||
});
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
|
@ -58,6 +58,23 @@
|
|||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == @article.author.id %>
|
||||
</li>
|
||||
<li>
|
||||
<% if @article.id == @article.blog.homepage_id %>
|
||||
<%= link_to(
|
||||
l(:button_cancel_homepage),
|
||||
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>@article.author_id,:id=>@article.blog_id, :article_id => @article.id},
|
||||
:method => :post,
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == @article.blog.author_id %>
|
||||
<% else %>
|
||||
<%= link_to(
|
||||
l(:button_set_homepage),
|
||||
{:controller => 'blogs',:action => 'set_homepage',:user_id=>@article.author_id,:id=>@article.blog_id, :article_id => @article.id},
|
||||
:method => :post,
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == @article.blog.author_id %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -25,6 +25,14 @@
|
|||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == activity.author.id %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_set_homepage),
|
||||
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
|
||||
:method => :post,
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == activity.blog.author_id %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -38,6 +46,9 @@
|
|||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.blog.name+" | 博客", user_blogs_path(:user_id=>activity.author_id,:host=>Setting.host_user), :class => "newsBlue ml15 mr5"%>
|
||||
<% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
|
||||
<span class="red_homework_btn_cir ml5">已设为首页</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostTitle hidden m_w530 fl">
|
||||
|
@ -57,7 +68,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
|
@ -67,17 +78,19 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class=" fl" style="width: 600px">
|
||||
<% if activity.attachments.any?%>
|
||||
<% options = {:author => true, :deletable => false } %>
|
||||
<%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %>
|
||||
<% end %>
|
||||
<!--<div class=" fl" style="width: 600px">
|
||||
<%# if activity.attachments.any?%>
|
||||
<%# options = {:author => true, :deletable => false } %>
|
||||
<%#= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %>
|
||||
<%# end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="cl"></div>-->
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
|
@ -176,3 +189,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -42,6 +42,12 @@
|
|||
<%= @user.name%>的博客
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if blog.homepage_id and BlogComment.where("id=?", blog.homepage_id).count > 0 %>
|
||||
<% homepage = BlogComment.find(blog.homepage_id) %>
|
||||
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
|
||||
<% end %>
|
||||
|
||||
<% if User.current.logged? && User.current.id == @user.id %>
|
||||
<%= labelled_form_for @article, :url =>{:controller=>'blog_comments',:action => 'create',:user_id=>user.id , :blog_id => blog.id},
|
||||
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||
|
@ -75,22 +81,6 @@
|
|||
|
||||
$(function () {
|
||||
init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>");
|
||||
showNormalImage('activity_description_<%= topic.id %>');
|
||||
if($("#intro_content_<%= topic.id %>").height() > 810) {
|
||||
$("#intro_content_show_<%= topic.id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= topic.id %>").click(function(){
|
||||
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= topic.id %>").hide();
|
||||
$("#intro_content_hide_<%= topic.id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= topic.id %>").click(function(){
|
||||
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= topic.id %>").hide();
|
||||
$("#intro_content_show_<%= topic.id %>").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% if topic %>
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" >
|
||||
<div class="homepagePostBrief" onmouseover="$('#homepage_message_setting_<%=activity.id%>').show();" onmouseout="$('#homepage_message_setting_<%= activity.id%>').hide();">
|
||||
<div class="homepagePostDes">
|
||||
<% if activity.author.id == User.current.id%>
|
||||
<div class="homepagePostSetting" id="homepage_message_setting_<%= activity.id%>" style="display: none">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_edit_homepage),
|
||||
{:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id, :is_homepage => 1},
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == activity.author.id %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_delete_homepage),
|
||||
{:controller => 'blog_comments',:action => 'destroy',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
|
||||
:method => :delete,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == activity.author.id %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_cancel_homepage),
|
||||
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
|
||||
:method => :post,
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == activity.blog.author_id %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%end%>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostTitle hidden m_w530 fl">
|
||||
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id,
|
||||
:blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey", :style => 'text-align:center;' %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" >
|
||||
<%= activity.content.to_s.html_safe %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -41,22 +41,6 @@
|
|||
|
||||
$(function () {
|
||||
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
|
||||
showNormalImage('activity_description_<%= topic.id %>');
|
||||
if($("#intro_content_<%= topic.id %>").height() > 810) {
|
||||
$("#intro_content_show_<%= topic.id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= topic.id %>").click(function(){
|
||||
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= topic.id %>").hide();
|
||||
$("#intro_content_hide_<%= topic.id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= topic.id %>").click(function(){
|
||||
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= topic.id %>").hide();
|
||||
$("#intro_content_show_<%= topic.id %>").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% if topic %>
|
||||
|
|
|
@ -40,22 +40,6 @@
|
|||
|
||||
$(function () {
|
||||
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
|
||||
showNormalImage('activity_description_<%= topic.id %>');
|
||||
if($("#intro_content_<%= topic.id %>").height() > 810) {
|
||||
$("#intro_content_show_<%= topic.id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= topic.id %>").click(function(){
|
||||
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= topic.id %>").hide();
|
||||
$("#intro_content_hide_<%= topic.id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= topic.id %>").click(function(){
|
||||
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= topic.id %>").hide();
|
||||
$("#intro_content_show_<%= topic.id %>").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% if topic %>
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#time").change(function(){
|
||||
document.getElementById("end_time").options[document.getElementById("time").selectedIndex].selected = true;
|
||||
});
|
||||
$("#term").change(function(){
|
||||
document.getElementById("end_term").options[document.getElementById("term").selectedIndex].selected = true;
|
||||
});
|
||||
|
||||
var popupHeight = $(".referenceResourcesPopup").outerHeight(true);
|
||||
$(".referenceResourcesPopup").css("marginTop",-popupHeight/2);
|
||||
$(".resourcePopupClose").click(function(){
|
||||
hideModal();
|
||||
});
|
||||
$("#copyResource").click(function(){
|
||||
if ($("#allResource").is(":checked")){
|
||||
$("input[name='course_attachment_type[]']").attr("checked",true);
|
||||
}
|
||||
else{
|
||||
$("input[name='course_attachment_type[]']").attr("checked",false);
|
||||
}
|
||||
});
|
||||
$("#copyResource2").click(function(){
|
||||
if ($("input[name='course_attachment_type[]']:checked").length == 6){
|
||||
$("#allResource").attr("checked",true);
|
||||
}
|
||||
else{
|
||||
$("#allResource").attr("checked",false);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<div class="referenceText">信息配置</div>
|
||||
</div>
|
||||
<ul class="mt10">
|
||||
<%=labelled_form_for @new_course do |f| %>
|
||||
<input name="copy_course" value="<%=@course.id %>" style="display: none"/>
|
||||
<li class="ml45 mb10">
|
||||
<a href="javascript:void(0)" class="upimg fl">
|
||||
<%= image_tag(url_to_avatar(@new_course), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%>
|
||||
</a> <!--<a href="javascript:void(0)" class="upbtn fl ml30" onclick="$('#upload_course_logo').click();">上传图片</a>-->
|
||||
<!--</span>-->
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="course_name" class="courses_input grey_border" maxlength="100" onkeyup="regex_course_name();" value="<%=@course.name %>">
|
||||
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_class_period)%> :</label>
|
||||
<input type="text" name="class_period" id="class_period" class="hwork_input02 grey_border" onkeyup="regex_course_class_period();" maxlength="6" value="<%=@course.class_period %>">
|
||||
<span class="c_red" id="course_class_period_notice" style="display: none;"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_course_term)%> :</label>
|
||||
<%= select_tag :time,options_for_select(course_time_option(@new_course.time),@new_course.time), {} %>
|
||||
<%= select_tag :term,options_for_select(course_term_option,@new_course.term || cur_course_term),{} %>
|
||||
<span class="c_red" id="course_time_term_notice"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> 结束学期 :</label>
|
||||
<%= select_tag :end_time,options_for_select(course_time_option(@new_course.end_time),@new_course.end_time), {} %>
|
||||
<%= select_tag :end_term,options_for_select(course_term_option,@new_course.end_term || cur_course_term),{} %>
|
||||
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_new_course_password)%> :</label>
|
||||
<input type="text" style="display: none;">
|
||||
<input type="text" name="course[password]" id="course_course_password" class="hwork_input02 grey_border" onkeyup="regex_course_password();" value="<%=@course.password %>">
|
||||
<!--<a id="psw_btn" href="javascript:void(0)">显示明码</a>-->
|
||||
<span class="c_red" id="course_course_password_notice"></span>
|
||||
<div class="cl"></div>
|
||||
<span class="ml95 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
|
||||
</li>
|
||||
<li class="ml50">
|
||||
<label class="fl" > <%= l(:label_new_course_description)%> :</label>
|
||||
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl grey_border" ><%= @course.description.nil? ? "" : @course.description %></textarea>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml85">
|
||||
<label >公开 :</label>
|
||||
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox" value="<%=@course.is_public.to_i %>">
|
||||
<span class="c_grey">(选中后课外用户可见该课程,否则仅对课内成员可见)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="ml58">
|
||||
<label class="fl">复制资源 :</label>
|
||||
<ul class="fl" id="copyResource">
|
||||
<li class="sendCourseName fl mr15 ml5">
|
||||
<label>
|
||||
<input name="checkAll" type="checkbox" id="allResource" value="0" class="resourceCopy"/>
|
||||
全部</label>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="fl" id="copyResource2">
|
||||
<li class="sendCourseName fl mr15">
|
||||
<label>
|
||||
<input name="course_attachment_type[]" type="checkbox" value="1" class="resourceCopy"/>
|
||||
课件</label>
|
||||
</li>
|
||||
<li class="sendCourseName fl mr15">
|
||||
<label>
|
||||
<input name="course_attachment_type[]" type="checkbox" value="2" class="resourceCopy"/>
|
||||
软件</label>
|
||||
</li>
|
||||
<li class="sendCourseName fl mr15">
|
||||
<label>
|
||||
<input name="course_attachment_type[]" type="checkbox" value="3" class="resourceCopy"/>
|
||||
媒体</label>
|
||||
</li>
|
||||
<li class="sendCourseName fl mr15">
|
||||
<label>
|
||||
<input name="course_attachment_type[]" type="checkbox" value="4" class="resourceCopy"/>
|
||||
代码</label>
|
||||
</li>
|
||||
<li class="sendCourseName fl mr15">
|
||||
<label>
|
||||
<input name="course_attachment_type[]" type="checkbox" value="6" class="resourceCopy"/>
|
||||
论文</label>
|
||||
</li>
|
||||
<li class="sendCourseName fl mr15">
|
||||
<label>
|
||||
<input name="course_attachment_type[]" type="checkbox" value="5" class="resourceCopy"/>
|
||||
其它</label>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<span class="c_red ml5 fl mb10">您可以通过选择资源类型,将对应资源复制到新课程中。</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div>
|
||||
<a href="javascript:void(0);" class="greyBtn fr mr40 f12" onclick="submit_new_course();">完成</a>
|
||||
<a href="javascript:void(0);" class="greyBtn fr mr10 f12" onclick="hideResource();">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -1,7 +1,42 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
$(this).children(".userCard").css("display","none");
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
$(this).css("display","none");
|
||||
})
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
})
|
||||
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||
$(this).prev().css("color","#ffffff");
|
||||
$(this).css("z-index", "9999");
|
||||
})
|
||||
$(".homepagePostSetting").mouseout(function(){
|
||||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar {
|
||||
|
@ -73,22 +108,6 @@
|
|||
|
||||
$(function () {
|
||||
init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>");
|
||||
showNormalImage('activity_description_<%= activity.id %>');
|
||||
if($("#intro_content_<%= activity.id %>").height() > 360) {
|
||||
$("#intro_content_show_<%= activity.id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= activity.id %>").click(function(){
|
||||
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= activity.id %>").hide();
|
||||
$("#intro_content_hide_<%= activity.id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= activity.id %>").click(function(){
|
||||
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= activity.id %>").hide();
|
||||
$("#intro_content_show_<%= activity.id %>").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% if activity && activity.course_act%>
|
||||
|
|
|
@ -12,13 +12,14 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt15 grey_c lh22">
|
||||
<%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "term_btn fl" %>
|
||||
<!--<a href="javascript:" class="term_btn fl" onclick="copyTerm();">
|
||||
复制学期
|
||||
</a>-->
|
||||
<div class="disable_btn fl">
|
||||
<!--<div class="disable_btn fl">
|
||||
<span style="display: inline-block">复制学期</span>
|
||||
<span style="display: inline-block">(开发中...)</span>
|
||||
</div>
|
||||
</div>-->
|
||||
复制学期将为您创建一个新的课程学期,新学期将继承本学期的相关资源,具体您稍后可以选择。
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
if(document.getElementById("popbox02")) {
|
||||
hideModal("#popbox02");
|
||||
}
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'copy_course') %>');
|
||||
showModal('ajax-modal', '730px');
|
||||
$('#ajax-modal').css('height','530px').css('width','730px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<div class='resourcePopupClose mt5 mr-5'>" +
|
||||
"<a href='javascript:void(0)' class='resourceClose' onclick='hideResource();'></a></div>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("copyCoursePopup");
|
||||
|
||||
|
|
@ -5,29 +5,6 @@
|
|||
$("#Container").css("width","1000px");
|
||||
});
|
||||
|
||||
// 匿评弹框提示
|
||||
<%# if @is_evaluation && !@stundet_works.empty?%>
|
||||
// $(function(){
|
||||
// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'student_work/praise_alert') %>');
|
||||
// showModal('ajax-modal', '500px');
|
||||
// $('#ajax-modal').siblings().remove();
|
||||
// $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
// "<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
// $('#ajax-modal').parent().css("top","").css("left","");
|
||||
// $('#ajax-modal').parent().addClass("anonymos");
|
||||
// });
|
||||
<%# end%>
|
||||
|
||||
//设置评分规则
|
||||
function set_score_rule(){
|
||||
$('#ajax-modal').html('<%#= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>');
|
||||
showModal('ajax-modal', '350px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#homework_info_hidden").click(function(){
|
||||
$("#homeworkInformation").hide();
|
||||
|
@ -84,6 +61,20 @@
|
|||
<!---menu_r end--->
|
||||
</div>
|
||||
<!--div class="hworkInfor"><a href="javascript:void(0);" class="linkBlue">作业信息</a></div-->
|
||||
<% if @is_teacher%>
|
||||
<div class="fr mt5">
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected">
|
||||
<a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="hworkMenu">
|
||||
<li>
|
||||
<%= link_to "导出测验成绩", student_exercise_list_exercise_path(@exercise.id,:course_id => @course.id, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div id="course_list">
|
||||
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments, :page=>2} %>
|
||||
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
|
||||
</div>
|
||||
</div>
|
||||
<% html_title(l(:label_attachment_plural)) -%>
|
|
@ -0,0 +1,34 @@
|
|||
<span class="add_attachment" data-containerid="<%= container.id %>">
|
||||
<button name="button" class="sub_btn" onclick="_file<%=container.id %>.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>" type="button" ><%= l(:label_browse) %></button>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => "_file#{container.id}",
|
||||
:class => ie8? ? '':'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => "addInputFiles_board(this, '#{container.id}','"+"submit_resource"+"');",
|
||||
:style => ie8? ? '': 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js'),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:delete_all_files => l(:text_are_you_sure_all),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:containerid => "#{container.id}"
|
||||
} %>
|
||||
</span>
|
||||
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
|
||||
|
||||
<span id="upload_file_count<%=container.id %>">
|
||||
<%= l(:label_no_file_uploaded)%>
|
||||
</span>
|
||||
(<%= l(:label_max_size) %>:
|
||||
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<span id="attachments_fields<%= container.id %>" data-containerid="<%= container.id %>" xmlns="http://www.w3.org/1999/html">
|
||||
</span>
|
||||
</div>
|
|
@ -45,8 +45,17 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>
|
||||
<% if project_attachments.count == 10%>
|
||||
<% if params[:action] == 'search_project' %>
|
||||
<!--<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%>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
<% else %>
|
||||
<input type="hidden" name="org_subfield_attachment_type" value="<%= org_subfield_attachment_type %>">
|
||||
<% end %>
|
||||
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%= org_subfield_attachment_type%>">-->
|
||||
<%= render :partial => 'files/attachement_list'%>
|
||||
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
|
||||
<%= render :partial => 'files/org_subfield_upload_attachment_list', :locals => {:container => org_subfield}%>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<% if @project %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_project_files',:locals => {:project => @project,:project_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
<% elsif @course %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_course_files',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
<% end %>
|
|
@ -3,9 +3,7 @@
|
|||
<% if @homework_detail_manual.comment_status == 1%>
|
||||
<h2>开启匿评功能</h2>
|
||||
<p>
|
||||
开启匿评后学生将不能对作品进行
|
||||
<span class="c_blue">修改、删除</span>
|
||||
等操作,开启匿评后的提交作品,将
|
||||
开启匿评后提交的作品将
|
||||
<span class="c_blue">不能参与匿评</span>,
|
||||
匿评评分将被记为
|
||||
<span class="c_pink">0分</span>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<a href="javascript:void(0);" class="sendSourceText" onclick="submit_set_evaluation_attr('<%= @homework.end_time%>');">确定</a>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="clickCanel();">取消</a>
|
||||
<a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -2,5 +2,5 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/se
|
|||
showModal('ajax-modal', '350px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
|
@ -3,7 +3,7 @@ var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', bu
|
|||
showModal('ajax-modal', '350px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
||||
$(function() { $('#evaluation_start_time').datepicker(datepickerOptions);
|
||||
$('#evaluation_end_time').datepicker(datepickerOptions);
|
||||
|
|
|
@ -19,22 +19,6 @@
|
|||
|
||||
$(function () {
|
||||
init_activity_KindEditor_data(<%= issue.id%>, null, "87%", "<%= issue.class.name %>");
|
||||
showNormalImage('activity_description_<%= issue.id %>');
|
||||
if ($("#intro_content_<%= issue.id %>").height() > 360) {
|
||||
$("#intro_content_show_<%= issue.id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= issue.id %>").click(function () {
|
||||
$("#activity_description_<%= issue.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= issue.id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= issue.id %>").hide();
|
||||
$("#intro_content_hide_<%= issue.id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= issue.id %>").click(function () {
|
||||
$("#activity_description_<%= issue.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= issue.id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= issue.id %>").hide();
|
||||
$("#intro_content_show_<%= issue.id %>").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
<% if @issue_id %> //issue详情中回复
|
||||
$("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>");
|
||||
$("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>");
|
||||
$("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>')
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
||||
issue_desc_editor = KindEditor.create('#issue_description',
|
||||
{"width":"85%",
|
||||
"resizeType":0,
|
||||
"no_label":true,
|
||||
"at_id":<%= @issue.project_id%>,
|
||||
"at_type":"Project",
|
||||
"autoHeightMode":true,
|
||||
"afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, \"<%=@issue.project_id %>\", 'Project');}; this.loadPlugin('autoheight')})",
|
||||
"emotionsBasePath":'<%= Setting.host_name%>',
|
||||
"height":300,
|
||||
"allowFileManager":true,
|
||||
"uploadJson":"/kindeditor/upload",
|
||||
"fileManagerJson":"/kindeditor/filemanager"});
|
||||
// $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>");
|
||||
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)')
|
||||
sd_create_editor_from_data(<%= @issue.id %>, null, "100%");
|
||||
|
|
|
@ -1,7 +1,26 @@
|
|||
<% courses.each do |course|%>
|
||||
<%# pro = Project.find course.course_id %>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
|
||||
<%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%>
|
||||
<div class="homepagePostSetting mt5 mr10">
|
||||
<ul>
|
||||
<li class="menuSetting">
|
||||
<ul class="homepagePostSettiongText boxShadow">
|
||||
<li><%= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>
|
||||
<li><%= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>
|
||||
<li><%= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>
|
||||
<li><%= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>
|
||||
<li>
|
||||
<% if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'delete',:class => 'postOptionLink',:remote => true %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if courses.size == 5%>
|
||||
|
|
|
@ -1,7 +1,25 @@
|
|||
<% projects.each do |project|%>
|
||||
<%# pro = Project.find project.project_id %>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
|
||||
<div class="homepagePostSetting mt5 mr10">
|
||||
<ul>
|
||||
<li class="menuSetting">
|
||||
<ul class="homepagePostSettiongText boxShadow">
|
||||
<li><%=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>
|
||||
<li><%=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>
|
||||
<li><%= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>
|
||||
<li>
|
||||
<% if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if projects.size == 5%>
|
||||
|
|
|
@ -84,7 +84,7 @@ ID:<%= @course.id%>
|
|||
<ul class="homepagePostSettiongText boxShadow">
|
||||
<li><%= link_to "课程配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %></li>
|
||||
<li><%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %></li>
|
||||
<!--<li><%#= link_to "复制学期", copy_course_course_path(@course.id), :class => "postOptionLink" %></li>-->
|
||||
<li><%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -1,6 +1,25 @@
|
|||
<% courses.each do |course|%>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<li class="homepageLeftMenuCoursesLine pr">
|
||||
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", :title => course.name+"("+course.time.to_s+course.term+")"%>
|
||||
<div class="homepagePostSetting mt8 mr10">
|
||||
<ul>
|
||||
<li class="menuSetting">
|
||||
<ul class="homepagePostSettiongText boxShadow">
|
||||
<li><%= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>
|
||||
<li><%= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>
|
||||
<li><%= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>
|
||||
<li><%= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>
|
||||
<li>
|
||||
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,6 +1,24 @@
|
|||
<% projects.each do |project|%>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<li class="homepageLeftMenuCoursesLine pr">
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
|
||||
<div class="homepagePostSetting mt8 mr10">
|
||||
<ul>
|
||||
<li class="menuSetting">
|
||||
<ul class="homepagePostSettiongText boxShadow">
|
||||
<li><%=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>
|
||||
<li><%=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>
|
||||
<li><%= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>
|
||||
<li>
|
||||
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if projects.size == 5%>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','public', 'leftside','prettify', 'courses','header'%>
|
||||
<%= stylesheet_link_tag 'header','jquery/jquery-ui-1.9.2','public', 'leftside','prettify', 'courses','share'%>
|
||||
<%= javascript_include_tag "course","header","attachments",'prettify' %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','courses','org' %>
|
||||
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','courses','org', 'share' %>
|
||||
<%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
|
@ -140,7 +140,7 @@
|
|||
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageRight" style="margin-top:<%= params[:show_homepage].nil? ? '10px':'0px' %>;">
|
||||
<div class="homepageRight" style="margin-top:<%= (params[:show_homepage].nil? && User.current.logged?) ? '10px':'0px' %>;">
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
|
@ -163,7 +163,7 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<ul class="copyright mt10">
|
||||
<li class="fl mr30">Copyright © 2007-2015, All Rights Reserved</li>
|
||||
<li class="fl mr30">Copyright © 2007-2016, All Rights Reserved</li>
|
||||
<li>ICP备09019772</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
|
||||
<%= stylesheet_link_tag 'header','public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','repository','share' %>
|
||||
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
|
||||
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside','prettify','users',:media => 'all' %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'share','new_user', 'user_leftside','prettify','users',:media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= javascript_include_tag "bootstrap","avatars","new_user",'prettify'%>
|
||||
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
|
@ -27,6 +27,42 @@
|
|||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
$(this).children(".userCard").css("display","none");
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
$(this).css("display","none");
|
||||
})
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
})
|
||||
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||
$(this).prev().css("color","#ffffff");
|
||||
$(this).css("z-index", "9999");
|
||||
})
|
||||
$(".homepagePostSetting").mouseout(function(){
|
||||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="prettyPrint();">
|
||||
|
|
|
@ -5,20 +5,4 @@
|
|||
<% elsif @org_subfield %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
<%end%>
|
||||
init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", "UserActivity");
|
||||
showNormalImage('activity_description_<%= @user_activity_id %>');
|
||||
if($("#intro_content_<%= @user_activity_id %>").height() > 810) {
|
||||
$("#intro_content_show_<%= @user_activity_id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= @user_activity_id %>").click(function(){
|
||||
$("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= @user_activity_id %>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= @user_activity_id %>").hide();
|
||||
$("#intro_content_hide_<%= @user_activity_id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= @user_activity_id %>").click(function(){
|
||||
$("#activity_description_<%= @user_activity_id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= @user_activity_id %>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= @user_activity_id %>").hide();
|
||||
$("#intro_content_show_<%= @user_activity_id %>").show();
|
||||
});
|
||||
init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", "UserActivity");
|
|
@ -1,3 +1,39 @@
|
|||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
$(this).children(".userCard").css("display","none");
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
$(this).css("display","none");
|
||||
})
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
})
|
||||
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||
$(this).prev().css("color","#ffffff");
|
||||
$(this).css("z-index", "9999");
|
||||
})
|
||||
$(".homepagePostSetting").mouseout(function(){
|
||||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<% unless org_activities.nil? %>
|
||||
<% org_activities.each do |act| %>
|
||||
<script>
|
||||
|
@ -11,6 +47,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(User.find(act.user_id)), :width => "45", :height => "45") %></a>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(act.user_id)} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><%= link_to User.find(act.user_id), user_path(act.user_id) %> 创建了 <a href="<%= organization_path(@organization)%>" class="newsBlue ml10"><%= Organization.find(act.org_act_id).name %>
|
||||
|
@ -66,6 +103,6 @@
|
|||
<% end %>
|
||||
|
||||
<% if org_act_count == 10 %>
|
||||
<%= link_to "点击展开更多",organization_path(org,:page => page.to_i + 1, :show_homepage =>params[:show_homepage],:type => params[:type]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<%= link_to "点击展开更多",organization_path(org,:page => @page.to_i + 1, :show_homepage =>params[:show_homepage],:type => params[:type]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end%>
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.teacher), :width => "50", :height => "50"), user_path(activity.tea_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -92,7 +93,7 @@
|
|||
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %> 23:59</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
|
@ -101,6 +102,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= activity.late_penalty%>分
|
||||
|
@ -141,16 +145,13 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||
<div class="mt10">
|
||||
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
||||
<div class="fl mr5 fontGrey3">
|
||||
<div class="fl mr20 fontGrey3">
|
||||
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% projects.each do |pro| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
|
@ -163,7 +164,7 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<div class="mr20 mb10 fl w80" style="text-align: center;">
|
||||
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
|
@ -290,4 +291,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -30,7 +31,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
|
@ -43,6 +44,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
|
@ -138,3 +142,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -22,7 +23,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
|
@ -31,6 +32,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -103,4 +107,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<div class="homepagePostPortrait">
|
||||
<!-- <a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a>-->
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -29,7 +30,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.published_at) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.polls_description.html_safe %>
|
||||
</div>
|
||||
|
@ -53,4 +54,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -1,10 +1,46 @@
|
|||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
$(this).children(".userCard").css("display","none");
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
$(this).css("display","none");
|
||||
})
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
})
|
||||
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||
$(this).prev().css("color","#ffffff");
|
||||
$(this).css("z-index", "9999");
|
||||
})
|
||||
$(".homepagePostSetting").mouseout(function(){
|
||||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<% org_activity_field = organization.org_subfields.where('field_type="default" and name="activity" and field_type="default"').first %>
|
||||
<% org_course_field = organization.org_subfields.where('field_type="default" and name="course" and field_type="default"').first %>
|
||||
<% org_project_field = organization.org_subfields.where('field_type="default" and name="project" and field_type="default"').first %>
|
||||
<div class="homepageLeftMenuBlock" style="display:<%= org_activity_field.hide == 0?'block':'none' %>;" id="org_subfield_<%= org_activity_field.id %>">
|
||||
<div class="homepageLeftMenuBlock" style="display:<%= is_hide_org_left(org_activity_field) ? 'block':'none' %>;" id="org_subfield_<%= org_activity_field.id %>">
|
||||
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
|
||||
</div>
|
||||
<div style="display:<%= org_project_field.hide == 0?'block':'none' %>;" id="org_subfield_<%= org_project_field.id %>">
|
||||
<div style="display:<%= is_hide_org_left(org_project_field) ? 'block':'none' %>;" id="org_subfield_<%= org_project_field.id %>">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
|
||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
||||
|
@ -18,7 +54,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:<%= org_course_field.hide == 0?'block':'none' %>;" id="org_subfield_<%= org_course_field.id %>">
|
||||
<div style="display:<%= is_hide_org_left(org_course_field) ? 'block':'none' %>;" id="org_subfield_<%= org_course_field.id %>">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -33,7 +34,7 @@
|
|||
<%=format_time(activity.created_on) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.description? %>
|
||||
<%= textAreailizable activity, :description, :attachments => activity.attachments %>
|
||||
|
@ -45,32 +46,7 @@
|
|||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<% if activity.attachments.any? %>
|
||||
<% activity.attachments.each do |attachment| %>
|
||||
<div class="break_word">
|
||||
<span class="fl">
|
||||
<span title="<%= attachment.filename %>" id="attachment_">
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%>
|
||||
</span>
|
||||
<% if attachment.is_text? %>
|
||||
<%= link_to image_tag('magnifier.png'),
|
||||
:controller => 'attachments',
|
||||
:action => 'show',
|
||||
:id => attachment,
|
||||
:class => 'fl',
|
||||
:filename => attachment.filename %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="postAttSize">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
@ -150,3 +126,6 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -26,7 +27,7 @@
|
|||
<div class="homepagePostDate">
|
||||
时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
|
@ -39,6 +40,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -115,4 +119,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -26,7 +27,7 @@
|
|||
<div class="homepagePostDate">
|
||||
时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
|
@ -39,6 +40,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -115,4 +119,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="resources <%= User.current.logged? ? 'mt10' :'' %>" id="organization_document_<%= document.id %>">
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
|
||||
<div class="homepagePostDes" style="width:690px;">
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#agree_apply_subdomain_<%= params[:act_id] %>").text("已同意申请");
|
|
@ -54,14 +54,14 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div style="margin-left: 80px " id="check_desc_hint"></div>
|
||||
<!--<div class="orgRow mb10"><span class="ml10">组织URL:</span>-->
|
||||
<!--<div class="w607 fr">https://-->
|
||||
<!--<input type="text" name="organization[domain]" value="<%= @organization.domain%>" class="orgUrlInput" />-->
|
||||
<!--.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;">申请</a>-->
|
||||
<!--<p id="apply_hint"></p></div>-->
|
||||
<!--<!–class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 –>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<div class="orgRow mb10"><span class="ml10">组织URL:</span>
|
||||
<div class="w607 fr">http://
|
||||
<input type="text" name="organization[domain]" id="domain" value="<%= @organization.domain%>" class="orgUrlInput" />
|
||||
.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%= @organization.id %>,$('#domain').val());">申请</a>
|
||||
<p class="c_green f12" id="apply_hint" ></p></div>
|
||||
<!--class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 -->
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开 : </span>
|
||||
<input type="checkbox" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
|
||||
</div>
|
||||
|
@ -139,4 +139,23 @@
|
|||
if ($("#subfield_name").val().trim() != "")
|
||||
$("#add_subfield_form").submit();
|
||||
}
|
||||
function apply_subdomain(id, domain){
|
||||
var reg = new RegExp("^[a-zA-Z0-9_]{1,}$");
|
||||
if (reg.exec(domain)){
|
||||
$.ajax({
|
||||
url:"<%= apply_subdomain_organization_path %>",
|
||||
type:'post',
|
||||
data:{
|
||||
id:id,
|
||||
domain:domain
|
||||
},
|
||||
success:function(){
|
||||
$("#apply_hint").text("您的申请已提交,系统会以消息的形式通知您结果");
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
$("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入");
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -21,7 +21,7 @@
|
|||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<p class="mt5 break_word"><%= textAreailizable activity, :description %><br/></p>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||
<div id="intro_content_<%= user_activity_id %>">
|
||||
<%#= activity.description.html_safe %>
|
||||
</div>
|
||||
|
@ -32,4 +32,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
|
@ -1,4 +1,40 @@
|
|||
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
$(this).children(".userCard").css("display","none");
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
$(this).css("display","none");
|
||||
})
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
})
|
||||
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||
$(this).prev().css("color","#ffffff");
|
||||
$(this).css("z-index", "9999");
|
||||
})
|
||||
$(".homepagePostSetting").mouseout(function(){
|
||||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||
|
@ -33,22 +69,6 @@
|
|||
|
||||
$(function () {
|
||||
init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>");
|
||||
showNormalImage('activity_description_<%= activity.id %>');
|
||||
if ($("#intro_content_<%= activity.id %>").height() > 810) {
|
||||
$("#intro_content_show_<%= activity.id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= activity.id %>").click(function () {
|
||||
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= activity.id %>").hide();
|
||||
$("#intro_content_hide_<%= activity.id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= activity.id %>").click(function () {
|
||||
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= activity.id %>").hide();
|
||||
$("#intro_content_show_<%= activity.id %>").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!--创建-->
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||
<div id="intro_content_<%= user_activity_id %>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
|
@ -31,6 +31,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -103,4 +106,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
location.reload();
|
|
@ -0,0 +1 @@
|
|||
location.reload();
|
|
@ -31,52 +31,50 @@
|
|||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<% if @is_teacher%>
|
||||
<li class="mt10 fl">
|
||||
<span class="tit_fb ">
|
||||
测试结果:
|
||||
</span>
|
||||
<div class="show_hwork_p break_word">
|
||||
<% work.student_work_tests.each_with_index do |test, index| %>
|
||||
<div class="ProResultTop">
|
||||
<p class="c_blue fl">
|
||||
第<%= work.student_work_tests.count - index%>次测试
|
||||
</p>
|
||||
<span class="fr c_grey">
|
||||
<%= test.created_at.to_s(:db) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<li class="mt10 fl">
|
||||
<span class="tit_fb ">
|
||||
测试结果:
|
||||
</span>
|
||||
<div class="show_hwork_p break_word">
|
||||
<% work.student_work_tests.each_with_index do |test, index| %>
|
||||
<div class="ProResultTop">
|
||||
<p class="c_blue fl">
|
||||
第<%= work.student_work_tests.count - index%>次测试
|
||||
</p>
|
||||
<span class="fr c_grey">
|
||||
<%= test.created_at.to_s(:db) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if test.status.to_i == -2 %>
|
||||
<div class="ProResultCon ">
|
||||
<%= test.results.first %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="ProResultTable " >
|
||||
<ul class="ProResultUl " >
|
||||
<% test.results.each_with_index do |x, i| %>
|
||||
<li >
|
||||
<span class="w60 T_C">测试<%=i+1%></span>
|
||||
<% if x["status"].to_i != 0 %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="width150"><%=x["result"]%></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
<span class="width150"><%=x["output"]%></span>
|
||||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<span class="w150 c_green">测试正确!</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if test.status.to_i == -2 %>
|
||||
<div class="ProResultCon ">
|
||||
<%= test.results.first %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="ProResultTable " >
|
||||
<ul class="ProResultUl " >
|
||||
<% test.results.each_with_index do |x, i| %>
|
||||
<li >
|
||||
<span class="w60 T_C">测试<%=i+1%></span>
|
||||
<% if x["status"].to_i != 0 %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="width150"><%=x["result"]%></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
<span class="width150"><%=x["output"]%></span>
|
||||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<span class="w150 c_green">测试正确!</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<% end%>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-modal').find('form').submit();clickCanel();">确定</a>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="clickCanel();">取消</a>
|
||||
<a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -40,18 +40,48 @@
|
|||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
<% if @homework.homework_type != 3 && student_work.user == User.current && !@is_evaluation %>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
|
||||
<% else %>
|
||||
<%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_type == 3 %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% if pro && pro.student_work_id == student_work.id && !@is_evaluation %>
|
||||
<%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
<% if !@is_evaluation && !@is_teacher %>
|
||||
<% work=@homework.student_works.where("user_id = ?",User.current.id).first %>
|
||||
<% unless work.nil? %>
|
||||
<% if @homework.homework_type == 2 %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
|
||||
var program_name = "text/x-csrc";
|
||||
var language = <%= @homework.language %>;
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
var editor = CodeMirror(document.getElementById("work-code"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true,
|
||||
readOnly: true,
|
||||
value: $("#work-src").text()
|
||||
});
|
||||
<% elsif @homework.homework_type == 1 %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
<% elsif @homework.homework_type == 3 %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% if pro && pro.student_work_id == work.id %>
|
||||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
$('#score_<%= work.id%>').peSlider({range: 'min'});
|
||||
<% end %>
|
||||
});
|
||||
</script>
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.teacher), :width => "50", :height => "50"), user_path(activity.tea_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -92,7 +93,7 @@
|
|||
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %> 23:59</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
|
@ -101,7 +102,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= activity.late_penalty%>分
|
||||
|
@ -142,16 +145,13 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||
<div class="mt10">
|
||||
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
||||
<div class="fl mr5 fontGrey3">
|
||||
<div class="fl mr20 fontGrey3">
|
||||
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% projects.each do |pro| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
|
@ -164,7 +164,7 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<div class="mr20 mb10 fl w80" style="text-align: center;">
|
||||
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
|
@ -297,4 +297,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -30,7 +31,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
|
@ -43,7 +44,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
|
||||
<ul>
|
||||
|
@ -159,3 +162,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -22,7 +23,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
|
@ -31,6 +32,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -103,4 +107,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<div class="homepagePostPortrait">
|
||||
<!-- <a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a>-->
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -29,7 +30,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.published_at) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.polls_description.html_safe %>
|
||||
</div>
|
||||
|
@ -53,4 +54,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -45,7 +46,7 @@
|
|||
<%=format_time(activity.created_on) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.description? %>
|
||||
<%= textAreailizable activity, :description, :attachments => activity.attachments %>
|
||||
|
@ -57,33 +58,7 @@
|
|||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<% if activity.attachments.any? %>
|
||||
<% activity.attachments.each do |attachment| %>
|
||||
<div class="break_word">
|
||||
<span class="fl">
|
||||
<span title="<%= attachment.filename %>" id="attachment_">
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%>
|
||||
</span>
|
||||
<% if attachment.is_text? %>
|
||||
<%= link_to image_tag('magnifier.png'),
|
||||
:controller => 'attachments',
|
||||
:action => 'show',
|
||||
:id => attachment,
|
||||
:class => 'fl',
|
||||
:filename => attachment.filename %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="postAttSize">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
@ -163,3 +138,6 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -31,7 +32,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
|
@ -44,7 +45,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
|
@ -146,7 +149,8 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
|
||||
<div class="boxContainer">
|
||||
<div>
|
||||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="resourcesSendTo">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>');">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>');">
|
||||
<option value="1">课程</option>
|
||||
<option value="2" selected>项目</option>
|
||||
<option value="3">组织</option>
|
||||
|
@ -20,13 +18,13 @@
|
|||
<%= hidden_field_tag(:send_ids, send_ids) %>
|
||||
<input type="text" id="search_project_input" value="<%= @search %>" name="search" placeholder="输入项目ID或者名称搜索" class="searchResourcePopup" />
|
||||
<script>
|
||||
observeSearchfieldOnInput('search_project_input','<%= search_user_project_user_path(user)%>','<%= send_id %>','<%= send_ids%>')
|
||||
observeSearchfieldOnInput('search_project_input','<%= search_user_project_user_path(user)%>','<%= send_id %>','<%= send_ids %>')
|
||||
</script>
|
||||
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
|
||||
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= form_tag add_exist_file_to_project_user_path(user),:remote=>true,:id=>'projects_list_form' %>
|
||||
<%= form_tag add_exist_file_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %>
|
||||
<div>
|
||||
|
||||
<%= hidden_field_tag(:send_id, send_id) %>
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>">
|
||||
<div class="userAvatarWrap fl">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像", :target => '_blank' %>
|
||||
<%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %>
|
||||
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />-->
|
||||
</div>
|
||||
<div class="fl">
|
||||
<p class="homepageImageName mb5" style="max-width:88px;font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;"><%= user %></p>
|
||||
<span class="homepageImageSex"></span>
|
||||
<div class="cl"></div>
|
||||
<p class="mb8 c_dark f14">
|
||||
<span class="mr15 hidden fl ml15" style="max-width:90px;"><%= user.show_name %></span>
|
||||
<%= user.user_extensions.technical_title %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="homepageImageBlock mb10">
|
||||
<div><%= link_to User.watched_by(user.id).count, {:controller=>"users", :action=>"user_watchlist",:id=>user.id}, :class => 'homepageImageNumber',:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '关注',{:controller=>"users", :action=>"user_watchlist",:id=>user.id},:target => "_blank" %></div>
|
||||
</div>
|
||||
<div class="homepageVerDiv"></div>
|
||||
<div class="homepageImageBlock">
|
||||
<div><%= link_to user.watcher_users.count,{:controller=>"users", :action=>"user_fanslist",:id=>user.id}, :class => "homepageImageNumber fans_count_#{user.id}",:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>user.id},:target => "_blank" %></div>
|
||||
</div>
|
||||
<div class="homepageVerDiv"></div>
|
||||
<div class="homepageImageBlock">
|
||||
<div><%= link_to user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count, user_blogs_path(user), :class => 'homepageImageNumber',:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '博客', user_blogs_path(user),:target => "_blank" %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if User.current != user %>
|
||||
<div class="add_cancel_watch_<%= user.id %>">
|
||||
<%= render :partial => 'users/watch_btn_for_picture', :locals => {:user => user} %>
|
||||
</div>
|
||||
<!--<a href="javascript:void(0);" class="userFollow mr27 fl">添加关注</a> <a href="javascript:void(0);" class="userCancel mr27 fl" style="display:none;">取消关注</a>-->
|
||||
<%= link_to "留言", feedback_path(user), :class => 'greyBtn fr', :target => "_blank" %>
|
||||
<%= link_to "私信", feedback_path(user), :class => 'greyBtn fr', :style => 'margin-right:20px;', :target => "_blank" %>
|
||||
<!--<a href="javascript:void(0);" class="greyBtn fl">私信</a><a href="javascript:void(0);" class="greyBtn fr">留言</a> -->
|
||||
<% end %>
|
||||
</div>
|
||||
<em></em>
|
||||
<font></font>
|
||||
</div>
|
|
@ -1,7 +1,42 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
})
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseover(function(){
|
||||
$(this).children(".userCard").css("display","block");
|
||||
})
|
||||
$(".homepagePostPortrait").mouseout(function(){
|
||||
$(this).children(".userCard").css("display","none");
|
||||
})
|
||||
$(".userCard").mouseover(function(){
|
||||
$(this).css("display","block");
|
||||
})
|
||||
$(".userCard").mouseout(function(){
|
||||
$(this).css("display","none");
|
||||
})
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
})
|
||||
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||
$(this).prev().css("color","#ffffff");
|
||||
$(this).css("z-index", "9999");
|
||||
})
|
||||
$(".homepagePostSetting").mouseout(function(){
|
||||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||
|
@ -40,22 +75,6 @@
|
|||
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= user_activity.id%>, null, "87%", "<%=user_activity.class.to_s%>");
|
||||
showNormalImage('activity_description_<%= user_activity.id %>');
|
||||
if($("#intro_content_<%= user_activity.id %>").height() > 360) {
|
||||
$("#intro_content_show_<%= user_activity.id %>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= user_activity.id %>").click(function(){
|
||||
$("#activity_description_<%= user_activity.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= user_activity.id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= user_activity.id %>").hide();
|
||||
$("#intro_content_hide_<%= user_activity.id %>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= user_activity.id %>").click(function(){
|
||||
$("#activity_description_<%= user_activity.id %>").toggleClass("maxh360");
|
||||
$("#activity_description_<%= user_activity.id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= user_activity.id %>").hide();
|
||||
$("#intro_content_show_<%= user_activity.id %>").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
|
@ -91,7 +110,9 @@
|
|||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
|
||||
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Blog'%>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
|
@ -28,7 +29,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.content.html_safe %>
|
||||
</div>
|
||||
|
@ -37,6 +38,9 @@
|
|||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -116,4 +120,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="homework_description_<%= homework_common.id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="homework_description_<%= homework_common.id%>">
|
||||
<div id="intro_content_<%= homework_common.id%>">
|
||||
<%= homework_common.description.html_safe %>
|
||||
</div>
|
||||
|
@ -104,7 +104,9 @@
|
|||
<div id="intro_content_show_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => homework_common} %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= homework_common.late_penalty%>分
|
||||
|
@ -145,16 +147,13 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
|
||||
<div class="mt10">
|
||||
<% projects = homework_common.student_work_projects.where("is_leader = 1") %>
|
||||
<div class="fl mr5 fontGrey3">
|
||||
<div class="fl mr20 fontGrey3">
|
||||
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% projects.each do |pro| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
|
@ -166,7 +165,7 @@
|
|||
});
|
||||
});
|
||||
</script>
|
||||
<div class="mr20 mb10 fl w80" style="text-align: center;">
|
||||
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
|
@ -301,4 +300,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWork end-->
|
||||
</div><!----HomeWork end-->
|
||||
<script type="text/javascript">
|
||||
$(homework_description_show_hide(<%=homework_common.id %>));
|
||||
</script>
|
|
@ -18,22 +18,6 @@
|
|||
<script type="text/javascript">
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= homework_common.id%>, null, "87%", "<%=homework_common.class.to_s%>");
|
||||
showNormalImage('homework_description_<%= homework_common.id%>');
|
||||
if($("#intro_content_<%= homework_common.id%>").height() > 360) {
|
||||
$("#intro_content_show_<%= homework_common.id%>").show();
|
||||
}
|
||||
$("#intro_content_show_<%= homework_common.id%>").click(function(){
|
||||
$("#homework_description_<%= homework_common.id%>").toggleClass("maxh360");
|
||||
$("#homework_description_<%= homework_common.id%>").toggleClass("lh18");
|
||||
$("#intro_content_show_<%= homework_common.id%>").hide();
|
||||
$("#intro_content_hide_<%= homework_common.id%>").show();
|
||||
});
|
||||
$("#intro_content_hide_<%= homework_common.id%>").click(function(){
|
||||
$("#homework_description_<%= homework_common.id%>").toggleClass("maxh360");
|
||||
$("#homework_description_<%= homework_common.id%>").toggleClass("lh18");
|
||||
$("#intro_content_hide_<%= homework_common.id%>").hide();
|
||||
$("#intro_content_show_<%= homework_common.id%>").show();
|
||||
});
|
||||
});
|
||||
|
||||
function expand_reply(container,btnid){
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word">
|
||||
<%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||
TO
|
||||
<% if activity.jour %>
|
||||
<%= link_to activity.jour.show_name+"("+(activity.jour.login ? activity.jour.login : activity.jour.show_name ).to_s+")的留言", feedback_path(activity.jour, :host=> Setting.host_user), :class => "newsBlue ml15" %>
|
||||
<%= link_to activity.jour.show_name+"("+(activity.jour.login ? activity.jour.login : activity.jour.show_name ).to_s+")的"+ (activity.private == 1? "私信":"留言"),
|
||||
feedback_path(activity.jour, :host=> Setting.host_user), :class => "newsBlue ml15" %>
|
||||
<% if activity.private == 1 %>
|
||||
<span class="PMTag ml15 f12">私信</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word list_style upload_img">
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<% if ma.class == OrgMessage %>
|
||||
<% if ma.message_type == 'ApplySubdomain'%>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.organization), :width => "30", :height => "30"), organization_path(ma.organization_id) %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to ma.organization.name, organization_path(ma.organization_id), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>申请子域名:</span>
|
||||
</li>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= ma.content %>
|
||||
</li>
|
||||
<li class="homepageHomeworkContentWarn fl">
|
||||
<%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请",
|
||||
agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ),
|
||||
:id => "agree_apply_subdomain_#{ma.id}",
|
||||
:method => 'post',
|
||||
:remote => true,
|
||||
:class => "green_btn_cir ml10",
|
||||
:style => "color:#fff" %>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.message_type == 'AgreeApplySubdomain'%>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>管理员同意了您的子域名申请:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= ma.content %>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,9 @@
|
|||
<% if User.current == user %>
|
||||
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") %>
|
||||
<% else %>
|
||||
<%if(user.watched_by?(User.current))%>
|
||||
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id),:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||
<% else %>
|
||||
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id),:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||
<% end %>
|
||||
<% end %>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue