Merge branch 'develop' into cxt_course

This commit is contained in:
cxt 2016-06-06 16:35:41 +08:00
commit 9594edd45e
140 changed files with 5604 additions and 3404 deletions

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org/'
source 'https://ruby.taobao.org/'
### <20><><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>bundle config mirror.https://rubygems.org https://gems.ruby-china.org <20>л<EFBFBD><D0BB><EFBFBD>ruby-chinaԴ
unless RUBY_PLATFORM =~ /w32/

View File

@ -1,6 +1,6 @@
class OrgDocumentCommentsController < ApplicationController
before_filter :find_organization, :only => [:new, :create, :show, :index]
before_filter :authorize_allowed, :only => [:create, :add_reply]
before_filter :authorize_allowed, :only => [:create]
helper :attachments,:organizations
layout 'base_org'
@ -13,6 +13,7 @@ class OrgDocumentCommentsController < ApplicationController
@org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id)
@org_document_comment.title = params[:org_document_comment][:title]
@org_document_comment.content = params[:org_document_comment][:content]
@org_document_comment.status = params[:org_document_comment][:status] == "on" ? 1 : 0
@org_document_comment.save_attachments(params[:attachments])
if params[:field_id]
@org_document_comment.org_subfield_id = params[:field_id].to_i

View File

@ -6,7 +6,7 @@ class OrgSubfieldsController < ApplicationController
if OrgSubfield.where("organization_id=#{params[:organization_id]} and name=?",params[:name]).count == 0
@res = true
@organization = Organization.find(params[:organization_id])
@subfield = OrgSubfield.create(:name => params[:name], :organization_id => params[:organization_id],:priority => @organization.org_subfields.order("priority").last.priority + 1)
@subfield = OrgSubfield.create(:name => params[:name], :organization_id => params[:organization_id], :priority => @organization.org_subfields.order("priority").last.priority + 1)
if !params[:sub_dir].blank?
sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+
"and org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir]}'"
@ -15,17 +15,31 @@ class OrgSubfieldsController < ApplicationController
end
end
@subfield.update_attributes(:field_type => params[:field_type])
# 如果栏目是教师,不参入类型的配置,定义为右三模式
# 新增模块命名规则左边1开头右边2开头以前的不变
# eg23 右三
if params[:field_type] == "Comptec"
@subfield.update_attributes(:status => 23)
end
# admin配置的类型
update_status_by_type(@subfield, params[:field_type])
else
@res = false
end
end
# status类型说明详见SubField
def update_status_by_type subfield, type
case type
when "Resource"
subfield.update_attribute(:status, 6)
when "Comptec"
subfield.update_attribute(:status, 6)
when "Compstu"
subfield.update_attribute(:status, 7)
when "Comppro"
subfield.update_attribute(:status, 5)
when "Compcou"
subfield.update_attribute(:status, 2)
when "Compact"
subfield.update_attribute(:status, 4)
end
end
def show
@flag = params[:flag] || false
sort = ""

View File

@ -28,7 +28,8 @@ class OrganizationsController < ApplicationController
helper :project_score
helper :issues
include UsersHelper
before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout, :teachers]
before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout, :teachers, :students, :projects, :courses]
before_filter :allow_as_admin, :only => [:students, :teachers, :projects, :courses, :acts]
layout 'base_org'
def index
@ -76,22 +77,34 @@ class OrganizationsController < ApplicationController
def show
# 组织新类型 show_mode判断标准 1为新类型0为旧
if @organization.show_mode.to_i == 1 && params[:org_subfield_id].nil? && params[:list] .nil?
if @organization.switch_type && params[:org_subfield_id].nil? && params[:list] .nil?
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
# REDO:时间紧,暂时先这样
@org_logo_attchment = Attachment.find_by_sql("SELECT * from attachments WHERE container_id = #{@organization.id} and container_type = 'Organization' and attachtype = 0 and filename REGEXP '(.jpg|.png|.bmp|.gif|.jpeg)' ORDER BY created_on desc limit 1").first
@org_banner_attchment = Attachment.find_by_sql("SELECT * from attachments WHERE container_id = #{@organization.id} and container_type = 'Organization' and attachtype = 1 and filename REGEXP '(.jpg|.png|.bmp|.gif|.jpeg)' ORDER BY created_on desc limit 1").first
@subfield_content = @organization.org_subfields.order("priority")
@organization = Organization.find(params[:id])
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')"
@project_acts = get_project_activities_org @organization, project_ids
@course_acts = get_course_activities_org @organization, course_ids
render :layout => 'base_org2'
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')"
@project_acts = get_project_activities_org @organization, project_ids
@course_acts = get_course_activities_org @organization, course_ids
# 精品课程, 不符合条件的组织则不查询
if @organization.org_subfields.where(:field_type => "Compcou", :hide => 0).count > 0
@excellent_courses = Course.find_by_sql("select c.*, (select count(*) from course_activities where course_activities.course_id = c.id) as course_count
from courses c where c.is_delete =0 and c.is_public =1 and is_excellent =1 order by course_count desc limit 5;")
end
# 热门项目
if @organization.org_subfields.where(:field_type => "Comppro", :hide => 0).count > 0
# @excellent_projects = Project.where(:is_public => true, :status => true, :hot => true).order("project_score")
@excellent_projects = Project.find_by_sql("select p.*, (select count(*) from forge_activities where forge_activities.project_id = p.id) as project_count
from projects p where p.status =1 and p.is_public =1 and hot =1 order by project_count desc limit 5;")
end
# 最新动态, 来自我关联的项目和课程
if @organization.org_subfields.where(:field_type => "Compact", :hide => 0).count > 0
@acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and
((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')})))
order by created_at desc limit 6;")
end
render :layout => 'base_org_custom'
else
render_403
end
@ -159,22 +172,12 @@ class OrganizationsController < ApplicationController
end
def teachers
unless @organization.allow_set_teachers
render_403
return
end
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comptec").first : OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
if @type == "courses" || @type.nil?
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc")
elsif @type == "students"
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc")
elsif @type == "resources"
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from attachments where attachments.author_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc")
elsif @type == "famous"
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and u.excellent_teacher =1 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc")
@ -192,6 +195,73 @@ class OrganizationsController < ApplicationController
end
end
def students
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Compstu").first : OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
if @type == "courses" || @type.nil?
@org_students = User.find_by_sql("select u.*, ue.student_id, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity= 1 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc")
elsif @type == "famous"
@org_students = User.find_by_sql("select u.*, ue.student_id, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity= 1 and u.excellent_student =1 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc")
end
limit = 10
# @is_remote = true
@students_count = @org_students.count
@atta_pages = Paginator.new @students_count, limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@org_students = paginateHelper @org_students, limit
respond_to do |format|
format.html
format.js
end
end
def atta_page_public container
limit = 10
@containers_count = container.count
@atta_pages = Paginator.new @containers_count, limit, params['page'] || 1
@offset ||= @atta_pages.offset
@containers = paginateHelper container, limit
respond_to do |format|
format.html
format.js
end
end
def projects
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comppro").first : OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
if @type.nil?
@containers = Project.find_by_sql("select p.*, (select count(*) from forge_activities where forge_activities.project_id = p.id) as project_count
from projects p where p.status =1 and p.is_public =1 and name like '%#{q}%' order by project_count desc;")
elsif @type == "famous"
@containers = Project.find_by_sql("select p.*, (select count(*) from forge_activities where forge_activities.project_id = p.id) as project_count
from projects p where p.status =1 and p.is_public =1 and hot =1 and name like '%#{q}%' order by project_count desc;")
end
atta_page_public @containers
end
def courses
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Compstu").first : OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
if @type.nil?
@containers = Course.find_by_sql("select c.*, (select count(*) from course_activities where course_activities.course_id = c.id) as course_count
from courses c where c.is_delete =0 and c.is_public =1 and name like '%#{q}%' order by course_count desc;")
elsif @type == "famous"
@containers = Course.find_by_sql("select c.*, (select count(*) from course_activities where course_activities.course_id = c.id) as course_count
from courses c where c.is_delete =0 and c.is_public =1 and is_excellent = 1 and name like '%#{q}%' order by course_count desc;")
end
atta_page_public @containers
end
def acts
end
def searchmember_by_name members, name
#searchPeopleByRoles(project, StudentRoles)
mems = []
@ -322,6 +392,13 @@ class OrganizationsController < ApplicationController
@organization = Organization.find(params[:id])
end
def allow_as_admin
unless User.current.admin?
render_403
return
end
end
def setting
@organization = Organization.find(params[:id])
@ -471,6 +548,18 @@ class OrganizationsController < ApplicationController
end
end
def update_field_by_admin
@type = params[:type]
@status = params[:status]
if @type == "project"
@container = Project.find(params[:container])
@status == "reset" ? @container.update_column(:hot, 0) : @container.update_column(:hot, 1)
else
@container = Course.find(params[:container])
@status == "reset" ? @container.update_column(:is_excellent, 0) : @container.update_column(:is_excellent, 1)
end
end
# 设置为名师
def set_excellent_teacher
@ex_teacher = User.find(params[:user])
@ -483,6 +572,16 @@ class OrganizationsController < ApplicationController
@ex_teacher.update_column(:excellent_teacher, 0)
end
def set_excellent_student
@ex_student = User.find(params[:user])
@ex_student.update_column(:excellent_student, 1)
end
def reset_excellent_student
@ex_student = User.find(params[:user])
@ex_student.update_column(:excellent_student, 0)
end
def hide_org_subfield
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
@org_subfield.update_attribute(:hide, 1)

View File

@ -1,7 +1,7 @@
class SubDocumentCommentsController < ApplicationController
before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy, :edit]
before_filter :find_subfield_content, :only => [:show, :index]
before_filter :authorize_allowed, :only => [:create, :add_reply]
before_filter :authorize_allowed, :only => [:create]
helper :attachments,:organizations
layout 'base_sub_domain'

View File

@ -18,6 +18,9 @@ class SubDomainsController < ApplicationController
else
@res = false
end
respond_to do |format|
format.js
end
end
def update

View File

@ -123,6 +123,20 @@ class UsersController < ApplicationController
end
#未读消息弹窗
def user_messages_unviewed
@message_alls = []
messages = MessageAll.where("user_id =?", User.current.id).includes(:message).order("created_at desc")
onclick_time = User.current.onclick_time.onclick_time
messages.each do |message_all|
# 未读的消息存放在数组
if (message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0) || (message_all.message_type == "SystemMessage"&& !message_all.message.nil? && message_all.message.created_at > onclick_time)
@message_alls << message_all.message
break if @message_alls.length == 5
end
end
end
# 用户消息
# 说明: homework 发布作业message讨论区 news新闻 poll问卷works_reviewers作品评阅works_reply:作品回复,exercise:课程测验
# issue问题journal缺陷状态更新 forum公共贴吧: user_feedback: 用户留言; new_reply:新闻回复comment
@ -443,12 +457,7 @@ class UsersController < ApplicationController
# 资源分享请求弹框
def apply_resource
if User.current.logged?
@attachment = Attachment.find params[:attachment_id]
@state = 2
else
@state = 1
end
@attachment = Attachment.find params[:attachment_id]
respond_to do |format|
format.js
end
@ -2036,7 +2045,7 @@ class UsersController < ApplicationController
@score = @b_sort == "desc" ? "asc" : "desc"
user_project_ids = User.current.projects.map {|p| p.id}
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
if(params[:type].blank? || params[:type] == "1") # 我的资源
if(params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@ -2050,7 +2059,7 @@ class UsersController < ApplicationController
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
end
elsif params[:type] == "6" # 公共资源
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
if params[:status] == "2"
@attachments = get_course_resources_public( user_course_ids, @order, @score)
elsif params[:status] == "3"
@ -2190,7 +2199,7 @@ class UsersController < ApplicationController
@score = @b_sort == "desc" ? "asc" : "desc"
user_project_ids = User.current.projects.map {|p| p.id}
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
if(params[:type].blank? || params[:type] == "1") # 我的资源
if(params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@ -2204,7 +2213,7 @@ class UsersController < ApplicationController
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
end
elsif params[:type] == "6" # 公共资源
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
if params[:status] == "2"
@attachments = get_course_resources_public( user_course_ids, @order, @score)
elsif params[:status] == "3"
@ -2331,7 +2340,7 @@ class UsersController < ApplicationController
@score = @b_sort == "desc" ? "asc" : "desc"
user_project_ids = User.current.projects.map {|p| p.id}
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
if(params[:type].blank? || params[:type] == "1") # 我的资源
if(params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@ -2345,7 +2354,7 @@ class UsersController < ApplicationController
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
end
elsif params[:type] == "6" # 公共资源
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
if params[:status] == "2"
@attachments = get_course_resources_public( user_course_ids, @order, @score)
elsif params[:status] == "3"

View File

@ -121,7 +121,7 @@ class WechatsController < ActionController::Base
on :fallback, respond: 'fallback message'
on :click, with: 'FEEDBACK' do |request, key|
request.reply.text "如有反馈问题,请直接切入至输入框,发微信给我们即可"
request.reply.text "如有反馈问题,请直接切换至输入框,发微信给我们即可"
end
on :click, with: 'MY_NEWS' do |request, key|

View File

@ -70,7 +70,6 @@ module ApplicationHelper
attach = Attachment.find(attachment_id)
# 条件取否result结果为true则不能下载
result = attach.is_public == 0 && attach.author != User.current && !attach.get_apply_resource_status(attach.id, User.current.id) && !attach_show_allow(attach)
return result
end
# Time 2015-03-24 15:27:29
@ -3104,9 +3103,10 @@ def named_attachment_url_without_domain(id, filename, option={})
attachment_id = (Attachment === id ? id.id : id)
Setting.protocol + "://" + Setting.host_name + "/attachments/" + attachment_id.to_s + "/" + filename
end
#判断是否为默认的组织栏目
def is_default_field? field
(field.name == 'activity' || field.name == 'course' || field.name == 'project') && field.field_type == 'default'
(field.name == 'activity' || field.name == 'course' || field.name == 'project' ) && field.field_type == 'default'
end
def host_with_protocol

View File

@ -42,11 +42,15 @@ module OrganizationsHelper
Attachment.find_by_sql("SELECT * FROM `attachments` where container_id =#{field_id} and container_type = 'OrgSubfield' and is_public =1 order by created_on limit 6;")
end
# 获取两种类型的隐藏状态数量大于0说明是可见
def double_field_show org
OrgSubfield.find_by_sql("SELECT * FROM `org_subfields` where organization_id = #{org.id} and (field_type = 'Compstu' or field_type = 'Comptec') and hide = 0;").count
end
def get_attach_org2(field)
org_attachments = field.attachments
attachments = User.current.admin? ? org_attachments : visable_attachemnts(org_attachments)
return attachments.sort_by{|x| x.created_on}.reverse.first(6)
# Attachment.find_by_sql("SELECT * FROM `attachments` where container_id =#{field_id} and container_type = 'OrgSubfield' and is_public =1 order by created_on limit 6;")
attachments = User.current.admin? ? org_attachments.first(5) : visable_attachemnts(org_attachments).first(5)
attachments.sort_by{|x| x.created_on}.reverse
end
# 从内容中获取路径
@ -59,6 +63,58 @@ module OrganizationsHelper
end
end
def org_user_by_type obj
case obj.act_type
when "Message"
user = obj.act.author
when "News"
user = obj.act.author
when "HomeworkCommon"
user = obj.act.user
when "Issue"
user = obj.act.author
end
end
def org_title_by_type obj
case obj.act_type
when "Message"
user = obj.act.parent_id.nil? ? obj.act.subject : obj.act.parent.subject
when "News"
user = obj.act.title
when "HomeworkCommon"
user = obj.act.name
when "Issue"
user = obj.act.subject
end
end
def org_content_by_type obj
case obj.act_type
when "Message"
user = obj.act.parent_id.nil? ? obj.act.content : obj.act.parent.content
when "News"
user = obj.act.description
when "HomeworkCommon"
user = obj.act.description
when "Issue"
user = obj.act.description
end
end
def org_time_by_type obj
case obj.act_type
when "Message"
time = obj.act.updated_on
when "News"
user = obj.act.created_on
when "HomeworkCommon"
user = obj.act.updated_at
when "Issue"
user = obj.act.updated_on
end
end
#排列下拉框
def subfield_status_option
type = []
@ -66,34 +122,14 @@ module OrganizationsHelper
option1 << "左一"
option1 << "1"
type << option1
# option2 = []
# option2 << "中一"
# option2 << "2"
# type << option2
option2 = []
option2 << "左二"
option2 << "2"
type << option2
option3 = []
option3 << ""
option3 << ""
option3 << "3"
type << option3
option4 = []
option4 << "左三"
option4 << "4"
type << option4
option5 = []
option5 << "左四"
option5 << "5"
type << option5
option6 = []
option6 << "右一"
option6 << "6"
type << option6
option7 = []
option7 << "右二"
option7 << "7"
type << option7
option8 = []
option8 << "右三"
option8 << "8"
type << option8
type
end
@ -104,18 +140,22 @@ module OrganizationsHelper
option1 << "左一"
option1 << "1"
type << option1
option2 = []
option2 << "左二"
option2 << "2"
type << option2
option3 = []
option3 << "左二"
option3 << "3"
option3 << ""
option3 << "2"
type << option3
option4 = []
option4 << "左三"
option4 << "4"
option4 << "右一"
option4 << "3"
type << option4
option6 = []
option6 << "右一"
option6 << "6"
type << option6
option5 = []
option5 << "右二"
option5 << "5"
type << option5
type
end
@ -128,30 +168,36 @@ module OrganizationsHelper
when 3
resulet = "左二"
when 4
resulet = "左三"
when 5
resulet = "左四"
when 6
resulet = "右一"
when 7
when 5
resulet = "右二"
when 8
when 6
resulet = "右三"
end
end
# 系统栏目只有管理员才能看到
def subfield_to_addmin?(org)
if User.current.admin?
@organization.org_subfields.order("priority")
else
@organization.org_subfields.select { |os| (os.field_type != "Comptec" && os.field_type != "Compstu" && os.field_type != "Comppro" && os.field_type != "Compcou" && os.field_type != "Compact") }.sort_by {|os| os.priority}
end
end
def get_subfield_acts field
org_subfield = OrgSubfield.find(field.id)
org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0
org_acts = 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')
org_acts
end
def allow_to_create?(org, type)
!org_subfield_had_created?(org, type) && User.current.admin?
end
def org_subfield_had_created?(org, type)
sub_field = org.org_subfields.select{|subfield| subfield.field_type == type}
result = sub_field.length > 0 ? true : false
result
end
def org_subfield_type(field)
@ -166,9 +212,20 @@ module OrganizationsHelper
result = "教师"
when "Complex"
result = "综合"
when "Compcou"
result = "课程"
when "Comppro"
result = "项目"
when "Compact"
result = "动态"
end
end
# 获取最新动态
# def get_latest_acts
# acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'news', 'message', 'Issue') and (container_type = 'Course' or container_type = 'Project') order by created_at limit 10;")
# end
def org_teacher_resource_count user
results = Attachment.find_by_sql("SELECT * FROM attachments where author_id = #{user.id};").count
end
@ -187,4 +244,33 @@ module OrganizationsHelper
from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and u.excellent_teacher =1 order by course_count desc").first(5)
end
def excellent_students
User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity = 1 and u.excellent_student = 1 order by course_count desc").first(5)
end
def excellent_teachers_hide? org
org.org_subfields.where(:field_type => "Comptec").first.hide
end
def excellent_students_hide? org
org.org_subfields.where(:field_type => "Compstu").first.hide
end
#当前学期(2015春季学期)
def current_time_and_term course
str = ""
term = cur_course_term
if (course.time == course.end_time && course.term == course.end_term) || (course.end_term.nil? && course.end_time.nil?) || course.time > Time.now.year
str = course.time.to_s + course.term.to_s
elsif course.time == Time.now.year && set_term_value(cur_course_term) <= set_term_value(course.term)
str = course.time.to_s + course.term.to_s
elsif course.end_time < Time.now.year || (course.end_time == Time.now.year && set_term_value(cur_course_term) >= set_term_value(course.term))
str = course.end_time.to_s + course.end_term.to_s
else
str = Time.now.year.to_s + cur_course_term.to_s
end
str
end
end

View File

@ -143,7 +143,7 @@ class Attachment < ActiveRecord::Base
def get_apply_resource_status attachment_id, author_id
status = ApplyResource.where("attachment_id =? and user_id =?", attachment_id, author_id).first.try(:status)
status == 2 ? true :false
status == 2
end
# add by nwb

View File

@ -21,7 +21,7 @@ class BlogComment < ActiveRecord::Base
after_save :add_user_activity
after_update :update_activity
after_create :update_parent_time, :blog_wechat_message
after_create :update_parent_time
before_destroy :destroy_user_activity
scope :like, lambda {|arg|

View File

@ -30,7 +30,7 @@ class HomeworkCommon < ActiveRecord::Base
:author => :author,
:url => Proc.new {|o| {:controller => 'student_work', :action => 'index', :homework => o.id}}
after_create :act_as_activity, :send_mail,:act_as_course_message
after_update :update_activity, :wechat_message
after_update :update_activity
after_save :act_as_course_activity
after_destroy :delete_kindeditor_assets

View File

@ -55,7 +55,6 @@ class Journal < ActiveRecord::Base
# fq
after_save :act_as_activity,:be_user_score, :act_as_forge_message, act_as_at_message(:notes, :user_id)
after_create :issue_wechat_message
# end
#after_destroy :down_user_score
#before_save :be_user_score

View File

@ -1,5 +1,6 @@
class OrgDocumentComment < ActiveRecord::Base
attr_accessible :content, :creator_id, :organization_id, :parent_id, :reply_id, :title,:sticky,:locked
# status: 1 模式二中置顶 0模式二中正常显示
attr_accessible :content, :creator_id, :organization_id, :parent_id, :reply_id, :title, :sticky, :locked, :status
include Redmine::SafeAttributes
include ApplicationHelper
belongs_to :organization

View File

@ -11,6 +11,8 @@ class OrgSubfield < ActiveRecord::Base
acts_as_attachable
after_create :create_board_sync
after_destroy :update_priority
# status 为栏目定制决定参数1 左一 2 左二 3 左三 4 右一 5 右二 6 右三 默认的 7 学霸 8 热门项目 9 精品课程 10 最新动态
# 创建资源栏目讨论区
def create_board_sync
@board = self.boards.build

View File

@ -18,17 +18,17 @@ class Organization < ActiveRecord::Base
end
def add_default_subfields
OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default', :priority => 1)
OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2)
OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3)
OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default', :priority => 1, :status => 0)
OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2, :status => 2)
OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3, :status => 2)
end
def switch_type
self.show_mode.to_i == 1 ? true : false
self.show_mode.to_i == 1
end
def allow_set_teachers
self.allow_teacher.to_i == 1 ? true : false
self.allow_teacher.to_i == 1
end
def secdomain_name

View File

@ -4,7 +4,7 @@
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="https://forge.trustie.net/projects/2/feedback" class="f_grey mw20" target="_blank"><%= l(:label_contact_us)%></a>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_recruitment_information)%></a>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "https://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey ml20" target="_blank"><%= l(:label_language)%></a>
<select class="languageBox">

View File

@ -4,7 +4,7 @@
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "https://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li>
</ul>

View File

@ -78,12 +78,15 @@
</ul>
</div>
<div class="navHomepageNews">
<div class="navHomepageNews" id="user_messages">
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
<% if User.current.count_new_message.to_i >0 %>
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
<% end %>
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
<!--<div class="shadowbox_news undis" id="user_messages_list">
<%#=render :partial => 'layouts/message_loading' %>
</div>-->
</div>
</div>
@ -95,6 +98,16 @@
$("#navHomepageSearchType").hide();
});
/*$("#user_messages").mouseenter(function(){
$("#user_messages_list").show();
$.get('<%#=user_messages_unviewed_users_path %>');
$("#ajax-indicator").hide();
}).mouseleave(function(){
$("#user_messages_list").hide();
$("#user_messages_list").html("<%#=escape_javascript(render :partial => 'layouts/message_loading') %>");
});*/
$("#navHomepageProfile").mouseenter(function(){
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
$("#topnav_login_list").show();

View File

@ -0,0 +1,6 @@
<font></font>
<div style="margin: 5px auto;width:150px;">
<img class="mr5 fl mt2" src="/images/loading.gif">
<span class="fl">正在加载中,请稍后...</span>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,10 @@
<div class="por_footer_con">
<ul>
<li ><a href="<%= about_us_path %>" target="_blank" class="" >关于我们<span>|</span></a></li>
<li ><a href="<%= agreement_path %>" target="_blank" class="" >服务协议<span>|</span></a></li>
<li ><a href="http://forge.trustie.net/forums/1/memos/1168" target="_blank" class="" >帮助中心<span>|</span></a></li>
<li ><a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="" > 贴吧交流</a></li>
<div class="cl"></div>
</ul>
<p>Copyright 2007~2016, All Rights Reserved 湘ICP备09019772</p>
</div>

View File

@ -0,0 +1,74 @@
<font></font>
<h4 class="shadowbox_news_title">未读消息</h4>
<ul class="shadowbox_news_list">
<%# user_messages = User.current.user_messages_unviewed %>
<% messages.each do |ma| %>
<% if ma.class == SystemMessage %>
<li><a href="<%=user_system_messages_path(User.current) %>" target="_blank" title="Trustie平台 发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%>"><span class="shadowbox_news_user">Trustie平台 </span>发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%></a></li>
<% elsif ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<li><a href="<%=news_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 发布了通知:<%= ma.course_message.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>发布了通知:<%= ma.course_message.title%></a></li>
<% elsif ma.course_message_type == "Comment" %>
<li><a href="<%=news_path(ma.course_message.commented.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 评论了通知:<%=ma.course_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>评论了通知:<%= ma.course_message.commented.title%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
<li><a href="<%= (!User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil?) ? new_student_work_path(:homework => ma.course_message.id) : student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程作业:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程作业:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了</a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 启动了作业匿评:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>启动了作业匿评:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 4 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 启动作业匿评失败:<%= ma.course_message.name%>(失败原因提交作品的人数低于2人)"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>启动作业匿评失败:<%= ma.course_message.name%>(失败原因提交作品的人数低于2人)</a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=User.find(ma.apply_user_id).show_name %> 申请引用作业:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=User.find(ma.apply_user_id).show_name %> </span>申请引用作业:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 6 %>
<li><a href="<%= (User.current.member_of_course?(ma.course_message.course) || User.current.admin? || (ma.course_message.is_open == 1 && ma.course_message.course.is_public == 1)) ? student_work_index_path(:homework => ma.course_message.id) : 'javascript:void(0)' %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "ApplyResource" && ma.status == 0 %>
<% if ma.course_message.container_type == "Course" %>
<% href = course_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "Project" %>
<% href = project_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "OrgSubfield" %>
<% href = org_subfield_files_path(ma.course_message.container_id) %>
<% else %>
<% href = 'javascript:void(0)' %>
<% end %>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.user.show_name %> 申请引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>申请引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
<% elsif ma.course_message_type == "ApplyResource" && ma.status == 1 %>
<% if ma.course_message.container_type == "Course" %>
<% href = course_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "Project" %>
<% href = project_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "OrgSubfield" %>
<% href = org_subfield_files_path(ma.course_message.container_id) %>
<% else %>
<% href = 'javascript:void(0)' %>
<% end %>
<li><a href="<%= href %>" target="_blank" title="<%=User.find(ma.course_message.apply_user_id).show_name %> <%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=User.find(ma.course_message.apply_user_id).show_name %> </span><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
<% elsif ma.course_message_type == "Poll" %>
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
<% elsif ma.course_message_type == "Message" %>
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
<% href = course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id) %>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%></a></li>
<% elsif ma.course_message_type == "StudentWorksScore" %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
<% elsif ma.course_message_type == "JournalsForMessage" %>
<% if ma.course_message.jour_type == 'Course' %>
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在课程中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在课程中留言了:<%= ma.course_message.notes.html_safe%></a></li>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%></a></li>
<% else %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= ma.course_message.notes%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> </span>回复了作品评论:<%= ma.course_message.notes%></a></li>
<% end %>
<% end %>
<% end %>
<% end %>
<!--<li><span class="shadowbox_news_user">教辅测试老师</span><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试老师</a><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试老师</a><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试辅测试老辅测试老老师</a><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试老师</a><a href="#" target="_blank"><span class="c_red">【课程通知】</span>发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试老师</a><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
-->
</ul>
<%= link_to '查看全部', user_message_path(User.current), :class => "shadowbox_news_all", :target =>"_Blank" %>

View File

@ -86,39 +86,39 @@
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<%= link_to "首页", organization_path(@organization), :class => "sn-link-white" %>
</li>
<% when 'course' %>
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<a href="#course_<%= field.id %>" class="sn-link-white"> 课程动态</a>
</li>
<% when 'project' %>
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<a href="#project_<%= field.id %>" class="sn-link-white">项目动态</a>
</li>
<% end %>
<% else %>
<% if field.field_type == "Post" && field.hide == 0 %>
<li class="nav-element">
<a href="#message_<%= field.id %>" class="sn-link-white"><%= field.name %></a>
<% if !field.subfield_subdomain_dir.nil? %> <!--讨论帖子-->
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
<%= link_to field.name, show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "sn-link-white", :target => "_blank" %>
<% else %>
<%= link_to field.name, show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "sn-link-white", :target => "_blank" %>
<% end %>
<% else %>
<%= link_to field.name, organization_path(@organization, :org_subfield_id => field.id), :class => "sn-link-white", :target => "_blank" %>
<% end %>
</li>
<!--二级目录-->
<div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;">
<ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;">
<% field.sub_domains.each do |subdomain| %>
<li><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => field.id), :class => "sn-link-grey" %></li>
<li><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => field.id), :class => "sn-link-grey", :target => "_blank" %></li>
<li class="sn-subnav-slice">|</li>
<% end %>
</ul>
</div>
<% elsif field.field_type == "Resource" && field.hide == 0 %>
<li class="nav-element">
<a href="#resource_<%= field.id %>" class="sn-link-white"><%= field.name %></a>
<%= link_to field.name, org_subfield_files_path(field), :class => "sn-link-white", :target => "_blank" %>
</li>
<% end %>
<% end %>
<% end %>
<% if User.current.admin_of_org?(@organization) %>
<li class="nav-element">
<a href="<%= setting_organization_path(@organization) %>" class="sn-link-white">配置</a>
<a href="<%= setting_organization_path(@organization) %>" class="sn-link-white" target ="_blank">配置</a>
</li>
<% end %>
</ul>
@ -173,7 +173,7 @@
<li class="sn-mr50"><a href="<%= about_us_path %>" class="sn-link-white sn-f18">关于我们</a></li>
<li class="sn-mr50"><a href="<%= agreement_path %>" class="sn-link-white sn-f18">服务协议</a></li>
<li class="sn-mr50"><a href="http://forge.trustie.net/forums/1/memos/1168" class="sn-link-white sn-f18">帮助中心</a></li>
<li><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="sn-link-white sn-f18">在线报名</a></li>
</ul>
<div class="sn-contact">联系人:魏小姐 | 电 话0731-84761282 | 传 真0731-84761268 | 邮 箱office@gnssopenlab.org</div>
<div class="sn-address">地 址湖南省长沙市开福区东风路89号观园大厦23层<br />

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'new_user', 'public', 'org_custom','jquery/jquery-ui-1.9.2' %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<%=render :partial => "math_js" %>
</head>
<body style="background: #fff">
<% update_visiti_count @organization %>
<header id="por_header">
<%= render :partial => 'org_custom_header', :locals => {:subfield_content => @subfield_content} %>
</header>
<%# 内容开始 %>
<div id="por_container">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
</div>
<%# 内容结束 %>
<%# 页面底部 %>
<footer class="por_footer"><%= render :partial => "layouts/org_custom_footer" %></footer>
<div class="cl"></div>
<%# 弹框 %>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
<%= call_hook :view_layouts_base_body_bottom %>
<%# JS提前加载 %>
<%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
<%= javascript_include_tag 'attachments' %>
</body>
</html>

View File

@ -95,7 +95,7 @@
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= reply.content.html_safe%></div>
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= h reply.content%></div>
</div>
<script type="text/javascript">
$(function(){

View File

@ -104,10 +104,11 @@
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<% if @topic.author.id == User.current.id %>
<li>
<%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'postOptionLink') if @message.editable_by?(User.current) %>
</li>
<% if @topic.author.id == User.current.id %>
<li>
<%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic},:method => :post,
:data => {:confirm => l(:text_are_you_sure)},

View File

@ -0,0 +1,30 @@
<div>
<input class="postDetailInput fl mr15" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" placeholder="请输入文章标题"></input>
</div>
<div id="doc_title_hint">
</div>
<div class="cl"></div>
<div class="" >
<div class="mt10">
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='description_textarea' name="org_document_comment[content]"></textarea>
<%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
</div>
<div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div>
<div class="mt10">
<div class="fl" id="topic_attachments">
<%= render :partial => 'org_document_comments/attachment', :locals => {:container => nil} %>
</div>
</div>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_topic_submit_btn">确定</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" onclick="cancel_create_org_document();" id="new_topic_cancel_btn" class="fr mr10 mt3">取消</a>
<div class="cl"></div>
</div>
</div>

View File

@ -36,7 +36,7 @@
$('#doc_title_hint').hide();
}
</script>
<div class="resources" nhname="new_topic_form">
<div class="resources" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>;" nhname="new_topic_form">
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
<div>
<input class="postDetailInput fl" maxlength="250" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" placeholder="请输入文章标题" />

View File

@ -27,37 +27,37 @@
<div class="cl"></div>
<div>
<div class="resources" nhname="new_topic_form">
<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag, :org_subfield_id => params[:org_subfield_id]),:method => 'put', :id => 'new_org_document_form' do |f| %>
<div>
<input class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" value="<%= @org_document.title %>" />
</div>
<div id="doc_title_hint"></div>
<div class="cl"></div>
<div>
<div class="mt10">
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='description_textarea' name="org_document_comment[content]"><%=@org_document.content.html_safe %></textarea>
<%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag, :org_subfield_id => params[:org_subfield_id]),:method => 'put', :id => 'new_org_document_form' do |f| %>
<div>
<input class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" value="<%= @org_document.title %>" />
</div>
<div id="doc_title_hint"></div>
<div class="cl"></div>
<div>
<div class="mt10">
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='description_textarea' name="org_document_comment[content]"><%=@org_document.content.html_safe %></textarea>
<%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
</div>
<div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div>
<div class="mt10">
<div class="fl" id="topic_attachments">
<%= render :partial => 'org_document_comments/attachment', :locals => {:container => @org_document} %>
<div class="mt10">
<div class="fl" id="topic_attachments">
<%= render :partial => 'org_document_comments/attachment', :locals => {:container => @org_document} %>
</div>
</div>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_topic_submit_btn">确定</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" id="new_topic_cancel_btn" onclick="location=document.referrer;" class="fr mr10 mt3">取消</a>
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_topic_submit_btn">确定</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" id="new_topic_cancel_btn" onclick="location=document.referrer;" class="fr mr10 mt3">取消</a>
<div class="cl"></div>
</div>
</div>
<% end %>
</div>
</div>
</div>

View File

@ -37,35 +37,6 @@
</div>
<div class="resources" nhname="new_topic_form" >
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %>
<div>
<input class="postDetailInput fl mr15" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" placeholder="请输入文章标题"></input>
</div>
<div id="doc_title_hint">
</div>
<div class="cl"></div>
<div class="" >
<div class="mt10">
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='description_textarea' name="org_document_comment[content]"></textarea>
<%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
</div>
<div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div>
<div class="mt10">
<div class="fl" id="topic_attachments">
<%= render :partial => 'org_document_comments/attachment', :locals => {:container => nil} %>
</div>
</div>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_topic_submit_btn">确定</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" onclick="cancel_create_org_document();" id="new_topic_cancel_btn" class="fr mr10 mt3">取消</a>
<div class="cl"></div>
</div>
</div>
<%= render :partial => "form" %>
<% end %>
</div>

View File

@ -5,7 +5,7 @@
showNormalImage('message_description_<%= @document.id %>');
});
</script>
<div class="resources" id="organization_document_<%= @document.id %>">
<div class="resources" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>;" id="organization_document_<%= @document.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %>
@ -124,7 +124,7 @@
</div>
<div class="cl"></div>
<%# end %>
<% if User.current.logged?%>
<%# if User.current.logged?%>
<div class="talkWrapMsg" nhname="about_talk_reply">
<em class="talkWrapArrow"></em>
<div class="cl"></div>
@ -137,7 +137,7 @@
<div class="cl"></div>
</div>
</div>
<% end %>
<%# end %>
</div>
</div>

View File

@ -1,10 +1,9 @@
<% if @res %>
$("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#org_excellent_teachers").html("<%= escape_javascript(render :partial => 'organizations/setting_excellent_teachers') %>");
$("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>");
<% end %>
$("#subfield_name").val("");
$("#sub_dir").val("");

View File

@ -1,6 +1,5 @@
$("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#org_excellent_teachers").html("<%= escape_javascript(render :partial => 'organizations/setting_excellent_teachers') %>");
$("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>");

View File

@ -1,3 +1,4 @@
$("#subfield_show_<%= @subfield.id %>").html("<%= @subfield.name %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");

View File

@ -1,2 +1,2 @@
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields.order("priority")}) %>");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");

View File

@ -1,9 +1,9 @@
<% if !field.subfield_subdomain_dir.nil? %> <!--讨论帖子-->
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
<%= link_to "更多", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more" , :target => "_blank" %>
<%= link_to "更多", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "f12 fontGrey2 fr" , :target => "_blank" %>
<% else %>
<%= link_to "更多", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more" , :target => "_blank" %>
<%= link_to "更多", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "f12 fontGrey2 fr" , :target => "_blank" %>
<% end %>
<% else %>
<%= link_to "更多", organization_path(@organization, :org_subfield_id => field.id), :class => "more" , :target => "_blank" %>
<%= link_to "更多", organization_path(@organization, :org_subfield_id => field.id), :class => "f12 fontGrey2 fr" , :target => "_blank" %>
<% end %>

View File

@ -0,0 +1,11 @@
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 在生成的公式图片上去掉Math定义的右键菜单$$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>

View File

@ -0,0 +1,12 @@
<div class="sn-row sn-bg-grey2">
<div class="sn-footer">
<ul class="sn-footer-link">
<li class="sn-mr50"><a href="<%= about_us_path %>" class="sn-link-white sn-f18">关于我们</a></li>
<li class="sn-mr50"><a href="<%= agreement_path %>" class="sn-link-white sn-f18">服务协议</a></li>
<li class="sn-mr50"><a href="http://forge.trustie.net/forums/1/memos/1168" class="sn-link-white sn-f18">帮助中心</a></li>
<li><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="sn-link-white sn-f18">在线报名</a></li>
</ul>
<div class="sn-contact">联系人:魏小姐 | 电 话0731-84761282 | 传 真0731-84761268 | 邮 箱office@gnssopenlab.org</div>
<div class="sn-address">地 址湖南省长沙市开福区东风路89号观园大厦23层<br />卫星导航仿真与测试开放实验室</div>
</div>
</div>

View File

@ -0,0 +1,8 @@
<% if @org_logo_attchment.blank? || !User.current.logged? %>
<img src="/images/org_new_style/logo.jpg" width="367" height="63" class="sn-mt13 sn-fl" alt=""/>
<% else %>
<img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" width="367" height="63" class="sn-mt13 sn-fl" alt="">
<% end %>
<% if User.current.admin_of_org?(@organization) %>
<a href="#" class="sn-logo-add" title="点击替换LOGO" onclick="org_new_files_upload();"></a>
<% end %>

View File

@ -0,0 +1,24 @@
<% containers.each do |container| %>
<div class="teacher-list-row">
<div>
<div class="teacher-avatar">
<%= link_to image_tag(url_to_avatar(container), :width => "90", :height => "90"), container.class == Course ? course_path(container) : project_path(container) %>
</div>
<div class="fl">
<div class="ml25 mb20"><span class="teacher-name"><%=link_to container.name, container.class == Course ? course_path(container) : project_path(container) %></span></div>
<div class="teacher-social-block">
<div class="block-num"><%= container.members.count %></div>
<div class="block-title">成员</div>
</div>
<div class="block-slice"></div>
<div class="teacher-social-block">
<div class="block-num"><%= container.attachments.count %></div>
<div class="block-title">资源</div>
</div>
</div>
<a href="javascript:void(0);" class="fr teacher-select" onclick="admin_hide_org($(this),'<%= container.id %>');" id="hide_<%= container.id %>"><%= container.class == Course ? (container.is_excellent == 0 ? "设为精品" : "取消精品") : (container.hot ==0 ? "设为热门" : "取消热门") %></a>
</div>
<div class="cl"></div>
</div>
<% end %>

View File

@ -0,0 +1,30 @@
<% if allow_to_create?(@organization, "Comptec") %>
<li class="fl mr15">
<input type="radio" id="orgTec" value="Comptec" name="field_type" />
<label for="Comptec">教师</label>
</li>
<% end %>
<% if allow_to_create?(@organization, "Compstu") %>
<li class="fl mr15">
<input type="radio" id="orgStu" value="Compstu" name="field_type" />
<label for="Comptec">学生</label>
</li>
<% end %>
<% if allow_to_create?(@organization, "Comppro") %>
<li class="fl mr15">
<input type="radio" id="orgPro" value="Comppro" name="field_type" />
<label for="Comppro">热门项目</label>
</li>
<% end %>
<% if allow_to_create?(@organization, "Compcou") %>
<li class="fl mr15">
<input type="radio" id="orgCou" value="Compcou" name="field_type" />
<label for="Compcou">精品课程</label>
</li>
<% end %>
<% if allow_to_create?(@organization, "Compact") %>
<li class="fl mr15">
<input type="radio" id="orgAct" value="Compact" name="field_type" />
<label for="Compact">最新动态</label>
</li>
<% end %>

View File

@ -0,0 +1,96 @@
<div class="por_header_top">
<div class="por_header_con" >
<%= image_tag(url_to_avatar(@organization), width:"67", height: "61", :id => 'nh_user_tx', :class => "por_logo fl ", :target => "_blank") %>
<% if User.current.logged? %>
<div class="navHomepageProfile" id="navHomepageProfile">
<ul>
<li class="homepageProfileMenuIcon fr mt15" id="homepageProfileMenuIcon">
<%= link_to "<div class='user-img' id='user_avatar'>#{image_tag(url_to_avatar(User.current), :width =>"40", :height => "40", :class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe, user_activities_path(User.current.id) %>
<ul class="topnav_login_list none sn-f12" id="topnav_login_list" style="text-align:left;">
<li><%= link_to "修改资料", my_account_path, :class => "menuGrey"%></li>
<li><%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%></li>
<li><%= link_to "新建组织", new_organization_path, :class => "menuGrey"%></li>
<li><%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%></li>
</ul>
</li>
</ul>
</div>
<% else %>
<ul class="por_login fr">
<li><a href="<%= signin_url_without_domain %>" target="_blank" class=" ">登录</a></li>
<li><a href="<%= register_url_without_domain %>" target="_blank" class=" ">注册</a></li>
</ul>
<% end %>
<!--<div class="por_search fr">-->
<!--<input type="text" class="pro_input_search fl" value="00000" />-->
<!--<a href="javascript:void(0);" class="por_search_btn fl"></a>-->
<!--</div>-->
</div>
</div>
<div class="cl"></div>
<div class="por_nav" >
<ul >
<% subfield_content.each do |field| %>
<% if is_default_field?(field) %>
<% case field.name %>
<% when 'activity' %>
<li style="display:<%= field.hide == 0 ? 'block':'none' %>;">
<%= link_to "首页", organization_path(@organization), :class => "por_index_act" %>
</li>
<% when 'course' %>
<% when 'project' %>
<% end %>
<% else %>
<% if field.field_type == "Post" && field.hide == 0 %>
<li>
<% if !field.subfield_subdomain_dir.nil? %> <!--讨论帖子-->
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
<%= link_to field.name, show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "sn-link-white", :target => "_blank" %>
<% else %>
<%= link_to field.name, show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "sn-link-white", :target => "_blank" %>
<% end %>
<% else %>
<%= link_to field.name, organization_path(@organization, :org_subfield_id => field.id), :class => "sn-link-white", :target => "_blank" %>
<% end %>
</li>
<!--二级目录-->
<div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;">
<ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;">
<% field.sub_domains.each do |subdomain| %>
<li><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => field.id), :class => "sn-link-grey" %></li>
<li class="sn-subnav-slice">|</li>
<% end %>
</ul>
</div>
<% elsif field.field_type == "Resource" && field.hide == 0 %>
<li class="nav-element">
<%= link_to field.name, org_subfield_files_path(field), :class => "sn-link-white", :target => "_blank" %>
</li>
<% end %>
<% end %>
<% end %>
</ul>
<% if User.current.admin_of_org?(@organization) %>
<a href="<%= setting_organization_path(@organization) %>" class="link-black fr por_edit_index" target="_blank">配置</a>
<% end %>
<div class="cl"></div>
</div><!--por_nav end-->
<script type="text/javascript">
$("#navHomepageProfile").mouseenter(function(){
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
$("#topnav_login_list").show();
});
$("#navHomepageProfile").mouseleave(function(){
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
$("#topnav_login_list").hide();
});
function signout(){
$.post(
'<%= signout_path%>',
{}
);
}
</script>

View File

@ -0,0 +1,170 @@
<div class="por_hotbar clear" style="display:<%= field.hide == 0 ? 'block':'none' %>;">
<% if acts.blank? %>
<h2 class="por_h2_index clear"><%= field.name %></h2>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<h2 class="por_h2_index clear"><%= field.name %>
<%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %>
</h2>
<ul class="por_hotbar_left fl">
<% if acts.count > 1 %>
<% acts[1..2].each do |activity| %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
<li>
<%= link_to "<span class='por_icons_hot fl'>热门推荐</span>#{document.title}".html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), class: 'por_hot_title link-black', :target => "_blank", :title => document.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(document.created_at) %></span>
<%= link_to document.creator.show_name, user_path(document.creator), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => document.id, :content=> document.content, :maxheight => 60, :maxwordsnum => 80, :maxwidth => 0, :cl => "por_hot_txt"} %>
</li>
<% else activity.container_type == 'OrgSubfield' %>
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
<% message = activity.org_act %>
<% content = message.parent_id.nil? ? message.content : message.parent.content %>
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
<% if message.board.org_subfield_id %>
<li>
<%= link_to "<span class='por_icons_hot fl'>热门推荐</span>#{title}".html_safe, board_message_url_in_org(message.board.id,message.id), class: 'por_hot_title link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span>
<%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 60, :maxwordsnum => 80, :maxwidth => 0, :cl => "por_hot_txt"} %>
</li>
<% else %>
<li>
<%= link_to "<span class='por_icons_hot fl'>热门推荐</span>#{title}".html_safe, board_message_path(message.board.id,message.id), class: 'por_hot_title link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span>
<%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 60, :maxwordsnum => 80, :maxwidth => 0, :cl => "por_hot_txt"} %>
</li>
<% end %>
<% end %>
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
<% news = activity.org_act %>
<li>
<%= link_to "<span class='por_icons_hot fl'>热门推荐</span>#{news.title}".html_safe, news_path(news), class: 'por_hot_title link-black', :target => "_blank", :title => news.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(news.created_on) %></span>
<%= link_to news.author.show_name, user_path(news.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 60, :maxwordsnum => 80, :maxwidth => 0, :cl => "por_hot_txt"} %>
</li>
<% end %>
<% end %>
<% end %>
<% end %>
<% if acts.count > 3 %>
<% activity = acts[3] %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
<li>
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), class: 'por_hot_title link-black', :target => "_blank", :title => document.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(document.created_at) %></span>
<%= link_to document.creator.show_name, user_path(document.creator), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => document.id, :content=> document.content, :maxheight => 60, :maxwordsnum => 80, :maxwidth => 0, :cl => "por_hot_txt"} %>
</li>
<% else activity.container_type == 'OrgSubfield' %>
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
<% message = activity.org_act %>
<% content = message.parent_id.nil? ? message.content : message.parent.content %>
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
<% if message.board.org_subfield_id %>
<li>
<%= link_to title, board_message_url_in_org(message.board.id,message.id), class: 'por_hot_title link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span>
<%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 60, :maxwordsnum => 80, :maxwidth => 0, :cl => "por_hot_txt"} %>
</li>
<% else %>
<li>
<%= link_to title, board_message_path(message.board.id,message.id), class: 'por_hot_title link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span>
<%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 60, :maxwordsnum => 80, :maxwidth => 0, :cl => "por_hot_txt"} %>
</li>
<% end %>
<% end %>
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
<% news = activity.org_act %>
<li>
<%= link_to news.title, news_path(news), class: 'por_hot_title link-black', :target => "_blank", :title => news.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(news.created_on) %></span>
<%= link_to news.author.show_name, user_path(news.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 60, :maxwordsnum => 80, :maxwidth => 0, :cl => "por_hot_txt"} %>
</li>
<% end %>
<% end %>
<% end %>
</ul>
<%# if acts.count > 3 %>
<% activity = acts.first %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
<div class="por_hotbar_right fl">
<% if get_image_path_from_content(document.content).nil? %>
<%= link_to image_tag("/images/default_blank/mo-1.jpg", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(document.content)}", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
<% end %>
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => 'por_hot_title_r link-black', :target => "_blank", :title => document.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(document.created_at) %></span><%= link_to document.creator.show_name, user_path(document.creator), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => document.id, :content=> document.content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
<% else activity.container_type == 'OrgSubfield' %>
<!--发送过来的帖子-->
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
<% message = activity.org_act %>
<% content = message.parent_id.nil? ? message.content : message.parent.content %>
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
<% if message.board.org_subfield_id %>
<div class="por_hotbar_right fl">
<% if get_image_path_from_content(content).nil? %>
<%= link_to image_tag("/images/default_blank/mo-1.jpg", :width => "299", :height => "246"), board_message_url_in_org(message.board.id, message.id), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(content)}", :width => "299", :height => "246"), board_message_url_in_org(message.board.id, message.id), :target => "_blank" %>
<% end %>
<%= link_to title, board_message_url_in_org(message.board.id, message.id), :class => 'por_hot_title_r link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span><%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
<% else %>
<div class="por_hotbar_right fl">
<% if get_image_path_from_content(document.content).nil? %>
<%= link_to image_tag("/images/default_blank/mo-1.jpg", :width => "299", :height => "246"), board_message_path(message.board.id, message.id), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(content)}", :width => "299", :height => "246"), board_message_path(message.board.id, message.id), :target => "_blank" %>
<% end %>
<%= link_to title, board_message_path(message.board.id, message.id), :class => 'por_hot_title_r link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span><%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
<% end %>
<% end %>
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
<% news = activity.org_act %>
<% path = get_image_path_from_content(news.description) %>
<div class="por_hotbar_right fl">
<% if path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-1.jpg", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{path}", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<% end %>
<%= link_to news.title, news_path(news), :class => 'por_hot_title_r link-black', :target => "_blank", :title => news.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(news.created_on) %></span><%= link_to news.author.show_name, user_path(news.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
<% end %>
<% end %>
<% end %>
<%# end %>
<div class="cl"></div>
</div><!--por_hotbar end-->

View File

@ -0,0 +1,212 @@
<div class="por_course mt10 clear" style="display:<%= field.hide == 0 ? 'block':'none' %>;">
<% if is_default_field?(field) %>
<% case field.name %>
<% when 'course' %>
<h2 class="por_h2_index clear">课程动态</h2>
<% if @course_acts.blank? %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<% @course_acts.first(4).each do |act| %>
<% if act.org_act_type == "HomeworkCommon" %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="por_course_bar fl clear">
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "por_course_title link-black", :title => activity.name.to_s %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now(activity.updated_at) %></span>
</div>
<% elsif act.org_act_type == "Message" %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.content) %>
<div class="por_course_bar fl clear">
<%= link_to activity.parent_id.nil? ? activity.subject : activity.parent.subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "por_course_title link-black", :title => activity.parent_id.nil? ? activity.subject : activity.parent.subject %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now activity.updated_on %></span>
</div>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="por_course_bar fl clear">
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "por_course_title link-black", :title => activity.title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), news_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), news_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now activity.created_on %></span>
</div>
<% elsif act.org_act_type == "Poll" %>
<% activity = act.org_act %>
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
<% if ( activity.polls_status==2) %>
<div class="por_course_bar fl clear">
<% if has_commit %>
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "por_course_title link-black", :title => poll_name %>
<% else %>
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "por_course_title link-black", :title => poll_name %>
<% end %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.polls_description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now activity.published_at %></span>
</div>
<% end %>
<% end %>
<% end %>
<% end %>
<% when 'project' %>
<h2 class="por_h2_index clear">项目动态</h2>
<% if @project_acts.blank? %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<% @project_acts.first(4).each do |act| %>
<% if act.org_act_type == "Issue" %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="por_course_bar fl clear">
<%= link_to activity.subject, issue_url_in_org(activity.id), :target => '_blank', :class => "por_course_title link-black", :title => activity.subject %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), issue_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), issue_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now activity.updated_on %></span>
</div>
<% elsif act.org_act_type == "Message" %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.content) %>
<% subject = activity.parent_id.nil? ? activity.subject : activity.parent.subject %>
<div class="por_course_bar fl clear">
<%= link_to subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "por_course_title link-black", :title => subject %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now activity.updated_on %></span>
</div>
<% elsif act.org_act_type == "News" %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="por_course_bar fl clear">
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "por_course_title link-black", :title => activity.title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), news_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), news_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now activity.created_on %></span>
</div>
<% end %>
<% end %>
<% end %>
<% end %>
<% else %>
<% if field.field_type == "Post" %>
<% org_acts = get_subfield_acts field %>
<% if org_acts.blank? %>
<h2 class="por_h2_index clear"><%= field.name %></h2>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<h2 class="por_h2_index clear"><%= field.name %>
<%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %>
</h2>
<% org_acts.first(4).each do |activity| %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
<% org_subfield_id = params[:org_subfield_id] %>
<% iamge_path = get_image_path_from_content(document.content) %>
<div class="por_course_bar fl clear">
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "por_course_title link-black", :title => document.title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => document.id, :content=> document.content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now document.created_at %></span>
</div>
<% else activity.container_type == 'OrgSubfield' %>
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where(:id => activity.org_act_id).count > 0 %>
<% message = activity.org_act %>
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
<% content = message.parent_id.nil? ? message.content : message.parent.content%>
<% iamge_path = get_image_path_from_content(content) %>
<% if message.board.org_subfield_id %>
<div class="por_course_bar fl clear">
<%= link_to title, board_message_url_in_org(message.board.id, message.id), :target => '_blank', :class => "por_course_title link-black", :title => title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), board_message_url_in_org(message.board.id, message.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), board_message_url_in_org(message.board.id, message.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now message.created_on %></span>
</div>
<% else %>
<div class="por_course_bar fl clear">
<%= link_to title, board_message_path(message.board, message.id), :target => '_blank', :class => "por_course_title link-black", :title => title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), board_message_path(message.board.id, message.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), board_message_path(message.board.id, message.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now message.created_on %></span>
</div>
<% end %>
<% end %>
<% if activity.org_act_type == 'News' and News.where(:id => activity.org_act_id).count > 0 %>
<% news = activity.org_act %>
<% iamge_path = get_image_path_from_content(news.description) %>
<div class="por_course_bar fl clear">
<%= link_to news.title, news_path(news), :target => '_blank', :class => "por_course_title link-black", :title => news.title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-2.jpg", :width => "140", :height => "100"), news_path(news), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), news_path(news), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= time_from_now news.created_on %></span>
</div>
<% end %>
<% end %>
<% end %>
<% end %>
<% elsif 'Compcou' %>
<h2 class="por_h2_index clear"><%= field.name %></h2>
<% if @excellent_courses.blank? %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<% @excellent_courses.first(4).each do |course| %>
<div class="por_course_bar fl clear">
<%= link_to course.name, course_path(course.id), :target => '_blank', :class => "por_course_title link-black", :title => course.name %>
<%= link_to image_tag(url_to_avatar(course),:width => "140", :height => "100"), course_path(course), :target => "_blank", :class => "fl" %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => course.id, :content=> course.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<span class=" por_course_time"><%= current_time_and_term course %></span>
</div>
<% end %>
<% end %>
<% end %>
<% end %>
<div class="cl"></div>
</div><!--por_course end-->

View File

@ -0,0 +1,149 @@
<div class="por_post mt10" style="display:<%= field.hide == 0 ? 'block':'none' %>;">
<% if acts.blank? %>
<h2 class="por_h2_index clear"><%= field.name %></h2>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<h2 class="por_h2_index clear"><%= field.name %>
<%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %>
</h2>
<div class="por_post_left fl">
<div class="por_post_leftbar ">
<% activity = acts.first %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
<% if get_image_path_from_content(document.content).nil? %>
<%= link_to image_tag("/images/default_blank/mo-3.jpg", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(document.content)}", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
<% end %>
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "por_post_title link-black", :title => document.title %>
<p class="mt5 mb5">
<span class="por_time mr10"><%= time_from_now(document.created_at) %> </span>
<%= link_to document.creator.show_name, user_path(document.creator), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => acts.first.org_act.id, :content=> acts.first.org_act.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %>
<% else activity.container_type == 'OrgSubfield' %>
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
<% message = activity.org_act %>
<% content = message.parent_id.nil? ? message.content : message.parent.content %>
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
<% iamge_path = get_image_path_from_content(content) %>
<% if message.board.org_subfield_id %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-3.jpg", :width => "299", :height => "246"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
<% end %>
<%= link_to title, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "por_post_title link-black", :title => title %>
<p class="mt5 mb5">
<span class="por_time mr10"><%= time_from_now(message.created_on) %> </span>
<%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %>
<% else %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-3.jpg", :width => "299", :height => "246"), board_message_path(message.board, message), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), board_message_path(message.board, message), :target => "_blank" %>
<% end %>
<%= link_to title, board_message_path(message.board, message), :target => '_blank', :class => "por_post_title link-black", :title => title %>
<p class="mt5 mb5">
<span class="por_time mr10"><%= time_from_now(message.created_on) %> </span>
<%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %>
<% end %>
<% end %>
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
<% news = News.find(activity.org_act_id) %>
<% iamge_path = get_image_path_from_content(news.description) %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/mo-3.jpg", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<% end %>
<%= link_to news.title, news_path(news), :target => '_blank', :class => "por_post_title link-black", :title => news.title %>
<p class="mt5 mb5">
<span class="por_time mr10"><%= time_from_now(news.created_on) %> </span>
<%= link_to news.author.show_name, user_path(news.author), :class => "por_hot_name link-blue", :target => "_blank" %>
</p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %>
<% end %>
<% end %>
</div>
<% unless acts[1..5].nil? %>
<% acts[1..5].each do |activity| %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
<ul class="por_post_list">
<li><%= link_to "<span class='post_icons_grey fl'></span>#{document.title}".html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), class: 'por_hidden_w390 link-black', :target => "_blank" %></li>
</ul>
<% else activity.container_type == 'OrgSubfield' %>
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
<% message = Message.find(activity.org_act_id) %>
<% if message.board.org_subfield_id %>
<ul class="por_post_list">
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
<li><%= link_to "<span class='post_icons_grey fl'></span>#{message.subject}".html_safe, board_message_url_in_org(message.board.id, message.id), class: 'por_hidden_w390 link-black', :target => "_blank" %></li>
<% else %>
<li><%= link_to "<span class='post_icons_grey fl'></span>#{message.parent.subject}".html_safe, board_message_url_in_org(message.board.id, message.id), class: 'por_hidden_w390 link-black', :target => "_blank" %></li>
<% end %>
</ul>
<% else %>
<ul class="por_post_list">
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
<li><%= link_to "<span class='post_icons_grey fl'></span>#{message.subject}".html_safe, board_message_path(message.board,message), class: 'por_hidden_w390 link-black', :target => "_blank" %></li>
<% else %>
<li><%= link_to "<span class='post_icons_grey fl'></span>#{message.parent.subject}".html_safe, board_message_path(message.board, message), class: 'por_hidden_w390 link-black', :target => "_blank" %></li>
<% end %>
</ul>
<% end %>
<% end %>
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
<% news = News.find(activity.org_act_id) %>
<% iamge_path = get_image_path_from_content(news.description) %>
<ul class="por_post_list">
<li><%= link_to "<span class='post_icons_grey fl'></span>#{news.title}".html_safe, news_path(news), class: 'por_hidden_w390 link-black', :target => "_blank" %></li>
</ul>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<% unless acts[6..19].nil? %>
<div class="fl">
<ul class="por_post_right por_post_list">
<% acts[6..19].each do |activity| %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
<li><%= link_to "<span class='post_icons_grey fl'></span>#{document.title}".html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), class: 'por_hidden_w270 link-black', :target => "_blank" %></li>
<% else activity.container_type == 'OrgSubfield' %>
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
<% message = Message.find(activity.org_act_id) %>
<% if message.board.org_subfield_id %>
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
<li><%= link_to "<span class='post_icons_grey fl'></span>#{message.subject}".html_safe, board_message_url_in_org(message.board.id, message.id), class: 'por_hidden_w270 link-black', :target => "_blank" %></li>
<% else %>
<li><%= link_to "<span class='post_icons_grey fl'></span>#{message.parent.subject}".html_safe, board_message_url_in_org(message.board.id, message.id), class: 'por_hidden_w270 link-black', :target => "_blank" %></li>
<% end %>
<% else %>
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
<li><%= link_to "<span class='post_icons_grey fl'></span>#{message.subject}".html_safe, board_message_path(message.board,message), class: 'por_hidden_w270 link-black', :target => "_blank" %></li>
<% else %>
<li><%= link_to "<span class='post_icons_grey fl'></span>#{message.parent.subject}".html_safe, board_message_path(message.board, message), class: 'por_hidden_w270 link-black', :target => "_blank" %></li>
<% end %>
<% end %>
<% end %>
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
<% news = News.find(activity.org_act_id) %>
<% iamge_path = get_image_path_from_content(news.description) %>
<li><%= link_to "<span class='post_icons_grey fl'></span>#{news.title}".html_safe, news_path(news), class: 'por_hidden_w270 link-black', :target => "_blank" %></li>
<% end %>
<% end %>
<% end %>
</ul>
</div>
<% end %>
<div class="cl"></div>
<% end %>
</div><!--por_post end-->

View File

@ -0,0 +1,37 @@
<div class="por_news" style="display:<%= field.hide == 0 ? 'block':'none' %>;">
<h2 class="por_h2_index clear"><%= field.name %></h2>
<% if @acts.blank? %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<ul class="por_news_list clear">
<% @acts.each do |obj| %>
<% user = org_user_by_type(obj) %>
<% title = org_title_by_type(obj) %>
<% content = org_content_by_type(obj) %>
<% time = org_time_by_type(obj) %>
<li>
<%= link_to image_tag(url_to_avatar(user),:width => "43", :height => "43", :class => "por_users_img"), user_path(user), :target => "_blank", :class => "fl" %>
<div class="por_news_txt fl">
<p class="por_news_p fl">
<%= link_to user.show_name, user_path(user), :class => "por_hot_name link-blue fl", :target => "_blank" %>
<span class="fl">&nbsp;:&nbsp;</span>
<% if obj.act_type == "Message" %>
<%= link_to title, board_message_path(obj.act.board.id, obj.act.id) %>
<% elsif obj.act_type == "News" %>
<%= link_to title, news_path(obj.act.id) %>
<% elsif obj.act_type == "HomeworkCommon" %>
<%= link_to title, student_work_index_url_in_org(obj.act.id) %>
<% elsif obj.act_type == "Issue" %>
<%= link_to title, issue_path(obj.act.id) %>
<% end %>
</p>
<p><span class="por_time fl"><%= time_from_now(time) %> </span>
<!--<a href="javascript:void(0);" target="_blank" class="por_zan fr">50</a>-->
</p>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<% end %>
</div><!--por_news end-->

View File

@ -0,0 +1,24 @@
<div class="por_projects" style="display:<%= field.hide == 0 ? 'block':'none' %>;">
<h2 class="por_h2_index clear">热点项目</h2>
<% if containers.blank? %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<ul>
<% container = containers.first %>
<li class="por_project_li">
<%= link_to "<span class='post_icons_grey fl'></span>#{container.name}".html_safe, project_path(container), :class => "por_hidden_w205 link-black fl", :title => container.name, :target => "_blank" %>
<p class="fr por_time">活跃度<a class="ml5" ><%= static_project_score(container.project_score) %></a></p>
<div class="cl"></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => container.id, :content=> container.description, :maxheight => 40, :maxwordsnum => 55, :maxwidth => 0, :cl => "por_project_p"} %>
</li>
<% containers[1..4].each do |container| %>
<li>
<%= link_to "<span class='post_icons_grey fl'></span>#{container.name}".html_safe, project_path(container), :class => "por_hidden_w205 link-black fl", :title => container.name, :target => "_blank" %>
<p class="fr por_time">活跃度<a class="ml5" ><%= static_project_score(container.project_score) %></a></p>
<div class="cl"></div>
</li>
<% end %>
</ul>
<% end %>
</div><!--por_projects end-->

View File

@ -0,0 +1,105 @@
<% if field.field_type == "Resource" %>
<div class="por_teachers" style="display:<%= field.hide == 0 ? 'block' : 'none' %>;">
<h2 class="por_h2_index clear"><%= field.name %><%= link_to "更多>", org_subfield_files_path(field), :target => "_blank", :class => "f12 fontGrey2 fr" %></h2>
<div>
<ul class="por_teachers_li">
<% get_attach_org2(field).each do |attach| %>
<li >
<%= link_to image_tag(url_to_avatar(attach.author),:width => "43", :height => "43", :class => "por_teachers_img fl mr15"), user_path(attach.author), :target => "_blank", :class => "fl" %>
<!--<a href="javascript:void(0);" target="_blank" class="fl"><img src="/images/org_custom/homepageImage.jpg" width="43" height="43" alt="" class="por_teachers_img fl mr15"/></a>-->
<div class="por_teachers_txt fl mt5">
<%= link_to attach.author, user_path(attach.author), :class => " por_teachers_name link-black fl", :target => "_blank" %>
<p class="por_teachers_p fr">
<%= link_to truncate(attach.filename,length: 20, omission: '...'),
download_named_attachment_path(attach.id, attach.filename),
:title => attach.filename+"\n"+attach.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</p>
<div class="cl"></div>
<p class="por_teachers_span ">
<span class="mr10">类型:<span><%= attach.tag_list[0] %></span></span>
<span class="mr10">下载:<span><%= attach.downloads %></span></span>
<span class="mr10">引用:<span><%= attach.quotes.nil? ? 0 : attach.quotes %></span></span>
</p>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
</div>
<% elsif field.field_type == "Comptec" || field.field_type == "Compstu" %>
<div class="por_teachers" style="display:<%= field.hide == 0 ? 'block' : 'none' %>;">
<ul id="por_teachers_nav">
<li id="por_teachers_nav_1" class="por_teachers_hover" onclick="HoverLi(1);">
<a href="javascript:void(0);" class="por_teachers_type">名师风采</a>
</li>
<li id="por_teachers_nav_2" onclick="HoverLi(2);">
<a href="javascript:void(0);" class="por_teachers_type">学生英雄榜</a>
</li>
<!--<a href="javascript:void(0);" target="_blank" class="f12 fontGrey2 fr mt5">更多></a>-->
<div class="cl"></div>
</ul>
<div id="por_teachers_content_1">
<ul class="por_teachers_li">
<% excellent_teachers.each do |teacher| %>
<li >
<%= link_to image_tag(url_to_avatar(teacher), :width => "43", :height => "43", :class => "por_teachers_img fl mr15"), user_path(teacher), :alt => "用户头像", :target => '_blank', :class => "fl" %>
<div class="por_teachers_txt fl mt5">
<%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "por_teachers_name link-black fl", :target => '_blank' %>
<p class="por_teachers_p fr" title="<%= teacher.my_workplace %>"><%= teacher.my_workplace %></p>
<div class="cl"></div>
<p class="por_teachers_span ">
<% unless teacher.my_blogs_count == 0 %>
<span class=" mr10">博客 <%= teacher.my_blogs_count %></span>
<% end %>
<% unless teacher.courses.count == 0 %>
<span class="mr10">课程 <%= teacher.courses.count %></span>
<% end %>
<% unless teacher.my_students == 0 %>
<span class="mr10">学生 <%= teacher.my_students %></span>
<% end %>
</p>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<div id="por_teachers_content_2" class="undis">
<ul class="por_teachers_li">
<% excellent_students.each do |student| %>
<li >
<%= link_to image_tag(url_to_avatar(student), :width => "43", :height => "43", :class => "por_teachers_img fl mr15"), user_path(student), :alt => "用户头像", :target => '_blank', :class => "fl" %>
<div class="por_teachers_txt fl mt5">
<%=link_to student.try(:realname) ? student.try(:realname) :student.try(:login), user_path(student), :class => "por_teachers_name link-black fl", :target => '_blank' %>
<p class="por_teachers_p fr" title="<%= student.my_workplace %>"><%= student.my_workplace %></p>
<div class="cl"></div>
<p class="por_teachers_span ">
<% unless student.my_blogs_count == 0 %>
<span class=" mr10">博客 <%= student.my_blogs_count %></span>
<% end %>
<% unless student.courses.count == 0 %>
<span class="mr10">课程 <%= student.courses.count %></span>
<% end %>
</p>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
</div>
<script>
//名师列表
function g(o){return document.getElementById(o);}
function HoverLi(n){
for(var i=1;i<=2;i++){
g('por_teachers_nav_'+i).className='por_teachers_nomal';
g('por_teachers_content_'+i).className='undis';
}
g('por_teachers_content_'+n).className='dis';
g('por_teachers_nav_'+n).className='por_teachers_hover';
}
</script>
<% end %>

View File

@ -0,0 +1,44 @@
<ul class="sn-nav">
<% subfield_content.each do |field| %>
<% if is_default_field?(field) %>
<% case field.name %>
<% when 'activity' %>
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<%= link_to "首页", organization_path(@organization), :class => "sn-link-white" %>
</li>
<% when 'course' %>
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<a href="#course_<%= field.id %>" class="sn-link-white"> 课程动态</a>
</li>
<% when 'project' %>
<li class="nav-element-default" style="display:<%= field.hide == 0?'block':'none' %>;">
<a href="#project_<%= field.id %>" class="sn-link-white">项目动态</a>
</li>
<% end %>
<% else %>
<% if field.field_type == "Post" && field.hide == 0 %>
<li class="nav-element">
<a href="#message_<%= field.id %>" class="sn-link-white"><%= field.name %></a>
</li>
<!--二级目录-->
<div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;">
<ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;">
<% field.sub_domains.each do |subdomain| %>
<li><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => field.id), :class => "sn-link-grey" %></li>
<li class="sn-subnav-slice">|</li>
<% end %>
</ul>
</div>
<% elsif field.field_type == "Resource" && field.hide == 0 %>
<li class="nav-element">
<a href="#resource_<%= field.id %>" class="sn-link-white"><%= field.name %></a>
</li>
<% end %>
<% end %>
<% end %>
<% if User.current.admin_of_org?(@organization) %>
<li class="nav-element">
<a href="<%= setting_organization_path(@organization) %>" class="sn-link-white">配置</a>
</li>
<% end %>
</ul>

View File

@ -91,7 +91,7 @@
<% end %>
<% else %>
<div style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
<% if field.field_type == "Post" || field.field_type == "Complex" || field.field_type == "Compstu" || field.field_type == "Comptec" %> <!--讨论帖子-->
<% if field.field_type == "Post" || field.field_type == "Complex" %> <!--讨论帖子-->
<div class="homepageLeftMenuBlock">
<!--<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>-->
<% if !field.subfield_subdomain_dir.nil? %> <!--讨论帖子-->
@ -101,28 +101,47 @@
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<% else %>
<% if field.field_type == "Comptec" %>
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<% if User.current.logged? and User.current.admin_of_org?(organization) && field.field_type != "Comptec" %>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
<% end %>
</div>
<div class="<%= (field.sub_domains.count == 0) ? 'homepageLeftMenuCourses':'homepageLeftMenuCourses borderBottomNone' %>" id="PostDomain_<%= field.id %>" style="display:none;">
<ul>
<%= render :partial => 'organizations/org_subdomain',:locals=>{:subdomains => field.sub_domains.reorder('priority').uniq.limit(5), :org_subfield_id => field.id} %>
<%= render :partial => 'organizations/org_subdomain',:locals=>{:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
</ul>
</div>
<% unless (field.sub_domains.count == 0 || !if_hidden_subdomain(field)) %>
<li class="homepageLeftMenuMore" id="sub_domain_jiantou_<%= field %>">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a>
</li>
<% end %>
<% else %>
<% elsif field.field_type == "Comptec" && User.current.admin? %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Compstu" && User.current.admin? %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Compstu" && User.current.admin? %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Comppro" && User.current.admin? %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", projects_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Compcou" && User.current.admin? %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", courses_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Compact" && User.current.admin? %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", acts_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Resource" %>
<div class="homepageLeftMenuBlock">
<% if !field.subfield_subdomain_dir.nil? %>
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>

View File

@ -31,8 +31,9 @@
<% end %>
</li>
<% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%>
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 30px;float: left" onclick="$(this).parent().height(70);$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 30px;float: left" onclick="$(this).parent().height();$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
<%= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
<div class="cl"></div>
</ul>
<div class="cl"></div>
<% end %>

View File

@ -0,0 +1,45 @@
<% org_students.each do |org_student| %>
<% school = School.where("id =?", org_student.school_id).first %>
<div class="teacher-list-row">
<div>
<div class="teacher-avatar">
<%= link_to image_tag(url_to_avatar(org_student), :width => "90", :height => "90"), user_url_in_org(org_student), :alt => "用户头像" %>
</div>
<div class="fl">
<div class="ml25 mb20"><span class="teacher-name"><%=link_to org_student.try(:realname).nil? ? org_student.try(:login) : org_student.try(:realname), user_url_in_org(org_student) %></span>
<% unless school.nil? %>
<span class="f12 fontGrey2 mr15"><%= school.name %></span>
<% end %>
</div>
<div class="teacher-social-block">
<div class="block-num"><%= org_student.courses.count %></div>
<div class="block-title">课程数</div>
</div>
<div class="block-slice"></div>
<div class="teacher-social-block">
<div class="block-num"><%= org_teacher_resource_count(org_student) %></div>
<div class="block-title">资源数</div>
</div>
</div>
<% if User.current.admin_of_org?(@organization) %>
<a href="javascript:void(0);" class="fr teacher-select" onclick="hide($(this),'<%= org_student.id %>');" id="hide_<%= org_student.id %>"><%= org_student.excellent_student ==0 ? "设为学霸" : "取消设置" %></a>
<% end %>
</div>
<div class="cl"></div>
</div>
<% end %>
<script>
function hide(content, id){
if (content.text() == '设为学霸')
$.ajax({
url: "/organizations/set_excellent_student?user=" + id ,
type: "post"
});
else
$.ajax({
url: "/organizations/reset_excellent_student?user=" + id ,
type: "post"
});
}
</script>

View File

@ -0,0 +1,24 @@
<div class="<%= cl %>" id="activity_description_<%= user_activity_id %>">
<span id="intro_content_<%= user_activity_id%>">
<%= content.to_s.html_safe%>
</span>
</div>
<script type="text/javascript">
$("#intro_content_<%= user_activity_id %>").hide();
$(function() {
var heightType = <%= maxheight %>;
if (heightType > 0) {
$("#activity_description_<%= user_activity_id %>").css("max-height", heightType + "px");
}
var maxWidth = <%= maxwidth %>
if (maxWidth > 0) {
$("#intro_content_<%= user_activity_id%>").css("max-width", maxWidth + "px");
}
description_showwords_ellipsis(<%= user_activity_id %>,<%= maxwordsnum %>);
});
</script>

View File

@ -0,0 +1,12 @@
<% if @organization.allow_set_teachers && !org_subfield_had_created?(@organization, "Comptec") %>
<li class="fl mr15">
<input type="radio" id="orgTec" value="Comptec" name="field_type" />
<label for="Comptec">教师</label>
</li>
<% end %>
<% if User.current.admin? && !org_subfield_had_created?(@organization, "Compstu") %>
<li class="fl mr15">
<input type="radio" id="orgStu" value="Compstu" name="field_type" />
<label for="Comptec">学生</label>
</li>
<% end %>

View File

@ -0,0 +1,24 @@
<div class="por_left">
<% @subfield_content.each do |field| %>
<% if field.status.to_i == 1 %>
<%= render :partial => 'organizations/org_custom_left1', :locals => {:field => field, :acts => get_subfield_acts(field) } %>
<% elsif field.status.to_i == 2 %>
<%= render :partial => 'organizations/org_custom_left2', :locals => {:field => field} %>
<% elsif field.status.to_i == 3 %>
<%= render :partial => 'organizations/org_custom_left3', :locals => {:field => field, :acts => get_subfield_acts(field) }%>
<% end %>
<% end %>
</div>
<!--右侧-->
<div class="por_right">
<% @subfield_content.each do |field| %>
<% if field.status.to_i == 4 %>
<%= render :partial => 'organizations/org_custom_right1', :locals => {:field => field} %>
<% elsif field.status.to_i == 5 %>
<%= render :partial => 'organizations/org_custom_right2', :locals => {:field => field, :containers => @excellent_projects} %>
<% elsif field.status.to_i == 6 %>
<%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %>
<% end %>
<% end %>
</div>
<div class="cl"></div>

View File

@ -0,0 +1,33 @@
<div class="sn-content-left fl sn-mt15">
<% @subfield_content.each do |field| %>
<% if field.status.to_i == 1 %>
<%= render :partial => 'organizations/org_subfield_leftT', :locals => {:field => field} %>
<% elsif field.status.to_i == 3 %>
<%#= render :partial => 'organizations/org_subfield_leftM', :locals => {:field => field} %>
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
<%= render :partial => 'organizations/org_subfield_leftM1', :locals => {:field => field} %>
<%= render :partial => 'organizations/org_subfield_leftM2', :locals => {:field => field} %>
<div class="cl"></div>
</div>
<% elsif field.status.to_i == 4 %>
<%= render :partial => 'organizations/org_subfield_leftMD', :locals => {:field => field} %>
<% elsif field.status.to_i == 5 %>
<%= render :partial => 'organizations/org_subfield_leftD', :locals => {:field => field} %>
<% end %>
<% end %>
</div>
<!--右侧-->
<div class="sn-content-right fr sn-mt15">
<% @subfield_content.each do |field| %>
<% if field.status.to_i == 6 %>
<%= render :partial => 'organizations/org_subfield_rightT', :locals => {:field => field} %>
<% elsif field.status.to_i == 7 %>
<%= render :partial => 'organizations/org_subfield_rightM', :locals => {:field => field} %>
<% elsif field.status.to_i == 8 %>
<%= render :partial => 'organizations/org_subfield_rightD', :locals => {:field => field} %>
<% elsif field.status.to_i == 23 %>
<%= render :partial => 'organizations/org_subfield_rightM2', :locals => {:field => field} %>
<% end %>
<% end %>
</div>
<div class="cl"></div>

View File

@ -23,7 +23,7 @@
<li class="orgListUser" title="<%= name %>"><%= name %></li>
<li class="orgListStatus">默认</li>
<li class="orgListStatusList">
<% if field.name == "activity" %>
<% if field.name == "activity" || field.name == "course" || field.name == "project" %>
默认
<% else %>
<%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>
@ -57,7 +57,7 @@
</li>
<li class="orgListStatus">新增</li>
<li class="orgListStatusList">
<% if field.field_type == "Resource" || field.field_type == "Comptec" %>
<% if field.field_type == "Resource" || field.field_type == "Comptec" || field.field_type == "Comppro" || field.field_type == "Compcou" || field.field_type == "Compact" || field.field_type == "Compstu" %>
默认
<% else %>
<%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>
@ -92,7 +92,7 @@
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %>
<span class="fr">|</span>
<a href="javascript:void(0);" class="linkGrey fr ml5 mr5" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
<% unless field.field_type == "Resource" || field.field_type == "Comptec" %>
<% unless field.field_type == "Resource" || field.field_type == "Comptec" || field.field_type == "Compstu" || field.field_type == "Comppro" || field.field_type == "Compcou" || field.field_type == "Compact" %>
<span class="fr">|</span>
<!--escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)-->
<!--<a href="javascript:void(0);" class="linkGrey fr mr5" onclick="org_submain_new('<%#= escape_javascript new_org_subfield_sub_domain_path(:org_subfield_id => field.id, :field => field) %>');">添加二级目录</a>-->

View File

@ -0,0 +1,30 @@
<div class="homepageRightBanner">
<div class="f16 fontGrey3">
<% if @type == "famous" %>
精品课程
<% else %>
<%= @field.name %>
<% end %>
</div>
</div>
<div class="resources mt10">
<div class="function-row" id="org_student_search">
<%= form_tag(url_for(:controller => 'organizations', :action => 'courses', :type => @type), :remote => true , :method => 'get', :id => 'resource_search_form') do %>
<input type="text" name="search" placeholder="输入项目名进行搜索" class="teacher-list-search fl" />
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %>
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
<% end %>
<div class="sn-font-grey fr">
<%= link_to "精品课程", courses_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %>
</div>
<div class="cl"></div>
</div>
<div id="org_container_list">
<%=render 'organizations/org_container', :containers => @containers %>
</div>
<div>
<ul class="wlist" id="pages" style="margin-top: 15px;">
<%= pagination_links_full @atta_pages, @containers_count, :per_page_links => false, :flag => true %>
</ul>
</div>
</div>

View File

@ -0,0 +1,3 @@
$("#org_container_list").html('<%= escape_javascript( render :partial => 'organizations/org_container', :locals => {:containers => @containers})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#org_student_search").attr('href','<%= courses_organization_path(@organization, :type => @type) %>');

View File

@ -0,0 +1,30 @@
<div class="homepageRightBanner">
<div class="f16 fontGrey3">
<% if @type == "famous" %>
热门项目
<% else %>
<%= @field.name %>
<% end %>
</div>
</div>
<div class="resources mt10">
<div class="function-row" id="org_student_search">
<%= form_tag(url_for(:controller => 'organizations', :action => 'projects', :type => @type), :remote => true , :method => 'get', :id => 'resource_search_form') do %>
<input type="text" name="search" placeholder="输入项目名进行搜索" class="teacher-list-search fl" />
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %>
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
<% end %>
<div class="sn-font-grey fr">
<%= link_to "热门项目", projects_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %>
</div>
<div class="cl"></div>
</div>
<div id="org_container_list">
<%=render 'organizations/org_container', :containers => @containers %>
</div>
<div>
<ul class="wlist" id="pages" style="margin-top: 15px;">
<%= pagination_links_full @atta_pages, @containers_count, :per_page_links => false, :flag => true %>
</ul>
</div>
</div>

View File

@ -0,0 +1,3 @@
$("#org_container_list").html('<%= escape_javascript( render :partial => 'organizations/org_container', :locals => {:containers => @containers})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#org_student_search").attr('href','<%= projects_organization_path(@organization, :type => @type) %>');

View File

@ -0,0 +1 @@
$("#hide_<%= @ex_student.id %>").text("设为学霸");

View File

@ -0,0 +1 @@
$("#hide_<%= @ex_student.id %>").text("取消设置");

View File

@ -87,11 +87,11 @@
&nbsp;<span>允许游客下载</span>
<span class="c_green f12" id="allow_down_hint"><%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %></span>
</div>
<% if User.current.admin? %>
<div class="orgRow mb10 mt5"><span style="margin-left:10px;">允许设置名师榜&nbsp;: </span>
<input id="allow_set_excellent_teachers" type="checkbox" style="margin-top:5px;" name="organization[allow_teacher]" <%= @organization.allow_teacher==1 ? 'checked': ''%> class="ml3" />
</div>
<% end %>
<!--<%# if User.current.admin? %>-->
<!--<div class="orgRow mb10 mt5"><span style="margin-left:10px;">允许设置名师榜&nbsp;: </span>-->
<!--<input id="allow_set_excellent_teachers" type="checkbox" style="margin-top:5px;" name="organization[allow_teacher]" <%#= @organization.allow_teacher==1 ? 'checked': ''%> class="ml3" />-->
<!--</div>-->
<!--<%# end %>-->
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org('<%=@organization.id %>','<%= @organization.name %>', $('#organization_name'));">保存</a>
<% end %>
</div>
@ -162,8 +162,8 @@
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
<div id="org_excellent_teachers">
<%= render :partial => 'organizations/setting_excellent_teachers' %>
<div id="org_custom_admin">
<%= render :partial => 'organizations/org_custom_admin' %>
</div>
<li class="fr"><a href="javascript:void(0);" class="saveBtn db" onclick="add_org_subfield();">新增</a></li>
<li class="cl"></li>
@ -172,7 +172,7 @@
</div>
<!--over-->
<div class="orgColumnList" id="org_subfield_list">
<%= render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority")} %>
<%= render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)} %>
</div>
</div>
</div>
@ -184,7 +184,7 @@
function add_org_subfield_subdomain(){
if ($("#subfield_name_subdomain").val().trim() != "")
$("#add_subfield_form_subdomain").submit();
$("#org_subfield_list").html('<%= escape_javascript(render(:partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority")} )) %>');
$("#org_subfield_list").html('<%= escape_javascript(render(:partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)})) %>');
}
var $is_exist = false;
function apply_subdomain(id, domain){

View File

@ -1,66 +1,71 @@
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<%# 区分两种模式 params[:org_subfield_id] 不为空的时候则跳到栏目%>
<% if @organization.switch_type && params[:org_subfield_id].nil? %>
<%= render :partial => 'show_custom' %>
<% else %>
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<% if params[:show_homepage].nil? and User.current.logged? %>
<div class="homepageRightBanner">
<div class="NewsBannerName"><%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %></div>
<% if params[:org_subfield_id].nil? %>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<li>
<ul class="homepagePostTypeHomework fl">
<li class="f14">课程动态</li>
<li><%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
<li><%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<li><%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">项目动态</li>
<li><%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">更多</li>
<li class="mt-4"><%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
<% if params[:show_homepage].nil? and User.current.logged? %>
<div class="homepageRightBanner">
<div class="NewsBannerName"><%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %></div>
<% if params[:org_subfield_id].nil? %>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<li>
<ul class="homepagePostTypeHomework fl">
<li class="f14">课程动态</li>
<li><%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
<li><%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<li><%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">项目动态</li>
<li><%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">更多</li>
<li class="mt-4"><%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<% end %>
</div>
<% end %>
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
<script>
$(function() {
sd_create_editor_from_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "100%", 'OrgActivity');
});
</script>
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
<%= render :partial => 'show_home_page', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %>
<% end %>
<% if @org_activities %>
<%= render :partial => 'organizations/org_activities',
:locals => {:org_activities => @org_activities,
:page=> @page,
:org => @organization,
:org_act_count=> @org_activities.count} %>
<% end %>
</div>
<% end %>
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
<script>
$(function() {
sd_create_editor_from_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "100%", 'OrgActivity');
});
</script>
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
<%= render :partial => 'show_home_page', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %>
<% end %>
<% if @org_activities %>
<%= render :partial => 'organizations/org_activities',
:locals => {:org_activities => @org_activities,
:page=> @page,
:org => @organization,
:org_act_count=> @org_activities.count} %>
<% end %>
<% end %>
@ -70,3 +75,4 @@

View File

@ -0,0 +1,30 @@
<div class="homepageRightBanner">
<div class="f16 fontGrey3">
<% if @type == "famous" %>
学霸列表
<% else %>
<%= @field.name %>
<% end %>
</div>
</div>
<div class="resources mt10">
<div class="function-row" id="org_student_search">
<%= form_tag(url_for(:controller => 'organizations', :action => 'students', :type => @type), :remote => true , :method => 'get', :id => 'resource_search_form') do %>
<input type="text" name="search" placeholder="输入学生名进行搜索" class="teacher-list-search fl" />
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %>
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
<% end %>
<div class="sn-font-grey fr">
<%= link_to "学霸列表", students_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %>
</div>
<div class="cl"></div>
</div>
<div id="org_students_list">
<%=render 'organizations/org_students_list', :org_students => @org_students %>
</div>
<div>
<ul class="wlist" id="pages" style="margin-top: 15px;">
<%= pagination_links_full @atta_pages, @students_count, :per_page_links => false, :flag => true %>
</ul>
</div>
</div>

View File

@ -0,0 +1,3 @@
$("#org_students_list").html('<%= escape_javascript( render :partial => 'organizations/org_students_list', :locals => {:org_students => @org_students})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @students_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#org_student_search").attr('href','<%= students_organization_path(@organization, :type => @type) %>');

View File

@ -0,0 +1,5 @@
<% if @type == "course" %>
$("#hide_<%= @container.id %>").text("<%= (@status == 'reset' ? '设为精品' : '取消精品') %>");
<% elsif @type == "project" %>
$("#hide_<%= @container.id %>").text("<%= (@status == 'reset' ? '设为热门' : '取消热门') %>");
<% end %>

View File

@ -30,6 +30,11 @@
<input id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
<div class="cl"></div>
</li>
<li >
<label class="label02">隐藏代码库&nbsp;&nbsp;</label>
<input id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
<div class="cl"></div>
</li>
</ul>
<a href="javascript:void(0)" class="blue_btn ml110" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
<% end %>

View File

@ -29,13 +29,16 @@
<!--CONTENT LIST-->
</div>
<% unless @project.gpid.nil? || @project.project_score.changeset_num == 0 || @project.rep_statics.blank? %>
<div class="resources mt10">
<div class="homepagePostBrief">
<%= render :partial => "rep_static" %>
<div class="cl"></div>
</div>
</div>
<%# 时间紧,权限待优化 %>
<% unless @project.hidden_repo && !User.current.member_of?(@project) && !User.current.admin? %>
<% unless @project.gpid.nil? || @project.project_score.changeset_num == 0 || @project.rep_statics.blank? %>
<div class="resources mt10">
<div class="homepagePostBrief">
<%= render :partial => "rep_static" %>
<div class="cl"></div>
</div>
</div>
<% end %>
<% end %>
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>

View File

@ -36,7 +36,7 @@
$('#doc_title_hint').hide();
}
</script>
<div class="resources" nhname="new_topic_form">
<div class="resources" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>;" nhname="new_topic_form">
<%= form_tag org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @subdomain.id), :id => 'new_sub_document_form' do |f| %>
<div>
<input class="postDetailInput fl" maxlength="250" name="sub_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#sub_document_editor').show();" placeholder="请输入文章标题" />

View File

@ -8,7 +8,7 @@
showNormalImage('message_description_<%= @document.id %>');
});
</script>
<div class="resources" id="organization_document_<%= @document.id %>">
<div class="resources" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>;" id="organization_document_<%= @document.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %>
@ -138,7 +138,7 @@
</div>
<div class="cl"></div>
<%# end %>
<% if User.current.logged?%>
<%# if User.current.logged?%>
<div class="talkWrapMsg" nhname="about_talk_reply">
<em class="talkWrapArrow"></em>
<div class="cl"></div>
@ -151,7 +151,7 @@
<div class="cl"></div>
</div>
</div>
<% end %>
<%# end %>
</div>
</div>

View File

@ -9,10 +9,6 @@
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
<label for="orgMng">帖子</label>
</li>
<!--<li class="fl mr15">-->
<!--<input type="radio" id="orgMeb" value="Resource" name="field_type" />-->
<!--<label for="orgMeb">资源</label>-->
<!--</li>-->
<li class="cl"></li>
</ul>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="add_org_subfield_subdomain();hideModal()">确定</a></div>
@ -20,8 +16,3 @@
<% end %>
<div class="cl"></div>
</div>
<script type="javascript">
</script>

View File

@ -1,8 +1,5 @@
<% if @res %>
$("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
<% end %>
$("#subfield_name").val("");
$("#sub_dir").val("");

View File

@ -1,4 +1,4 @@
$("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");

View File

@ -1,2 +1,2 @@
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields.order("priority")}) %>");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");

View File

@ -1,3 +1,4 @@
$("#subsubdomain_show_<%= @subdomain.id %>").html("<%= @subdomain.name %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)}) %>");

View File

@ -49,8 +49,6 @@
alert("您只能删除没有历史记录的资源,请重新选择后再删除。");
return;
}
if(data != "" && confirm('确认要删除这些资源吗?')) {
$.post(
'<%= user_resource_delete_user_path(User.current.id,:type=>@type,:status=>@status)%>',
@ -62,8 +60,6 @@
}
}
function show_send(){
$("#contextMenu").hide();
document.oncontextmenu = function() {return true;}

View File

@ -1,3 +1 @@
<% if @type != "2" %>
<div class="resourcesUploadBox mt10" ><a href="javascript:void(0);" onclick="show_upload();" class="uploadBoxIcon">上传资源</a></div>
<% end %>
<div class="resourcesUploadBox mt10" ><a href="javascript:void(0);" onclick="show_upload();" class="uploadBoxIcon">上传资源</a></div>

View File

@ -259,7 +259,7 @@
'您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请已通过'
:
'您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请被拒绝' %>
<% if User.current.member_of_course?(ma.course_message.course) || User.current.admin? || ma.course_message.is_open == 1 %>
<% if User.current.member_of_course?(ma.course_message.course) || User.current.admin? || (ma.course_message.is_open == 1 && ma.course_message.course.is_public == 1) %>
<%= link_to link_str, student_work_index_path(:homework => ma.course_message.id), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}", :target => '_blank' %>
<% else %>
<span title='<%=link_str %>' style="color:#4b4b4b; cursor: default;" class="<%= ma.viewed == 0 ? 'newsBlack' : 'newsGrey'%>"><%=link_str %></span>
@ -399,7 +399,7 @@
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a>

View File

@ -1,6 +1,6 @@
<% if @state == 1 %>
<% if !User.current.logged? %>
alert("您还未登录");
<% elsif @state == 2 %>
<% else %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/apply_resource', :locals => {:attachment => @attachment}) %>');
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();

View File

@ -0,0 +1 @@
$("#user_messages_list").html("<%=escape_javascript(render :partial => 'layouts/show_messages_list', :locals => {:messages => @message_alls}) %>");

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html ng-app="wechat">
<head>
<title>最新动态</title>
<title>我的动态</title>
<meta charset='utf-8' />
<meta name="keywords" content="" />
<meta name="description" content="" />

View File

@ -358,7 +358,7 @@ zh:
# 意见反馈
#
label_feedback: 意见反馈
label_feedback_tips: "请在此提问平台问题,或直接加入师姐答疑群,谢谢!"
label_feedback_tips: "请在此发布平台问题和建议,或直接加入答疑群,谢谢!"
label_technical_support: "QQ 在线支持:"
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
label_feedback_value: "该帖来自用户反馈:)"

View File

@ -1,8 +1,8 @@
button:
-
type: "view"
name: "最新动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.course.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
name: "我的动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
-
type: "click"
name: "意见反馈"
@ -13,8 +13,8 @@ button:
-
type: "view"
name: "进入网站"
url: "https://test.course.trustie.net/"
url: "https://www.trustie.net/"
-
type: "view"
name: "使用手册"
url: "https://test.course.trustie.net/organizations/1/downloads"
url: "https://www.trustie.net/organizations/1/downloads"

View File

@ -77,6 +77,10 @@ RedmineApp::Application.routes.draw do
get 'more_org_courses'
get 'search_courses'
get 'teachers'
get 'students'
get 'projects'
get 'courses'
get 'acts'
post 'join_course_menu'
post 'join_courses'
get 'search_projects'
@ -94,8 +98,12 @@ RedmineApp::Application.routes.draw do
post 'hide_org_subfield'
post 'show_org_subfield'
post 'set_excellent_teacher'
post 'set_excellent_student'
post 'reset_excellent_teacher'
post 'reset_excellent_student'
post 'agree_apply_subdomain'
post 'update_field_by_admin'
post 'reset_update_field_by_admin'
end
end
@ -538,6 +546,7 @@ RedmineApp::Application.routes.draw do
get 'new_user_commit_homework'
get 'reply_to'
get 'show_all_replies'
get 'user_messages_unviewed'
post "user_commit_homework"
post 'user_select_homework'
end

View File

@ -3,19 +3,19 @@ default: &default
# corpsecret: "corpsecret"
# agentid: 1
# Or if using public account, only need above two line
appid: "wxc09454f171153c2d"
secret: "dff5b606e34dcafe24163ec82c2715f8"
appid: "wx8e1ab05163a28e37"
secret: "beb4d3bc4b32b3557811680835357841"
token: "123456"
access_token: "1234567"
encrypt_mode: false # if true must fill encoding_aes_key
encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6"
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#template
binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU"
journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE"
homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ"
class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk"
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
production:
<<: *default

View File

@ -0,0 +1,5 @@
class AddStatusToOrgDocumentComment < ActiveRecord::Migration
def change
add_column :org_document_comments, :status, :integer, :default => false
end
end

View File

@ -0,0 +1,5 @@
class AddExcellentStudentToUser < ActiveRecord::Migration
def change
add_column :users, :excellent_student, :integer, :default => false
end
end

View File

@ -0,0 +1,5 @@
class AddHotToProject < ActiveRecord::Migration
def change
add_column :projects, :hot, :integer, :default => false
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160526093715) do
ActiveRecord::Schema.define(:version => 20160601073753) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -52,6 +52,28 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
create_table "application_settings", :force => true do |t|
t.integer "default_projects_limit"
t.boolean "signup_enabled"
t.boolean "signin_enabled"
t.boolean "gravatar_enabled"
t.text "sign_in_text"
t.datetime "created_at"
t.datetime "updated_at"
t.string "home_page_url"
t.integer "default_branch_protection", :default => 2
t.boolean "twitter_sharing_enabled", :default => true
t.text "restricted_visibility_levels"
t.boolean "version_check_enabled", :default => true
t.integer "max_attachment_size", :default => 10, :null => false
t.integer "default_project_visibility"
t.integer "default_snippet_visibility"
t.text "restricted_signup_domains"
t.boolean "user_oauth_applications", :default => true
t.string "after_sign_out_path"
t.integer "session_expire_delay", :default => 10080, :null => false
end
create_table "applied_projects", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false
@ -156,6 +178,20 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.string "typeName", :limit => 50
end
create_table "audit_events", :force => true do |t|
t.integer "author_id", :null => false
t.string "type", :null => false
t.integer "entity_id", :null => false
t.string "entity_type", :null => false
t.text "details"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id"
add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type"
add_index "audit_events", ["type"], :name => "index_audit_events_on_type"
create_table "auth_sources", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false
t.string "name", :limit => 60, :default => "", :null => false
@ -253,6 +289,17 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
add_index "boards", ["project_id"], :name => "boards_project_id"
create_table "broadcast_messages", :force => true do |t|
t.text "message", :null => false
t.datetime "starts_at"
t.datetime "ends_at"
t.integer "alert_type"
t.datetime "created_at"
t.datetime "updated_at"
t.string "color"
t.string "font"
end
create_table "bug_to_osps", :force => true do |t|
t.integer "osp_id"
t.integer "relative_memo_id"
@ -552,6 +599,10 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "visits", :default => 0
end
add_index "courses", ["id"], :name => "id", :unique => true
add_index "courses", ["tea_id"], :name => "tea_id"
add_index "courses", ["visits"], :name => "visits"
create_table "custom_fields", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false
t.string "name", :limit => 30, :default => "", :null => false
@ -613,6 +664,15 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "deploy_keys_projects", :force => true do |t|
t.integer "deploy_key_id", :null => false
t.integer "project_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id"
create_table "discuss_demos", :force => true do |t|
t.string "title"
t.text "body"
@ -662,6 +722,16 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.datetime "created_at"
end
create_table "emails", :force => true do |t|
t.integer "user_id", :null => false
t.string "email", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true
add_index "emails", ["user_id"], :name => "index_emails_on_user_id"
create_table "enabled_modules", :force => true do |t|
t.integer "project_id"
t.string "name", :null => false
@ -684,6 +754,25 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
create_table "events", :force => true do |t|
t.string "target_type"
t.integer "target_id"
t.string "title"
t.text "data"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "action"
t.integer "author_id"
end
add_index "events", ["action"], :name => "index_events_on_action"
add_index "events", ["author_id"], :name => "index_events_on_author_id"
add_index "events", ["created_at"], :name => "index_events_on_created_at"
add_index "events", ["project_id"], :name => "index_events_on_project_id"
add_index "events", ["target_id"], :name => "index_events_on_target_id"
add_index "events", ["target_type"], :name => "index_events_on_target_type"
create_table "exercise_answers", :force => true do |t|
t.integer "user_id"
t.integer "exercise_question_id"
@ -786,6 +875,15 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type"
add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at"
create_table "forked_project_links", :force => true do |t|
t.integer "forked_to_project_id", :null => false
t.integer "forked_from_project_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true
create_table "forums", :force => true do |t|
t.string "name", :null => false
t.text "description"
@ -915,6 +1013,17 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.datetime "updated_at", :null => false
end
create_table "identities", :force => true do |t|
t.string "extern_uid"
t.string "provider"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id"
add_index "identities", ["user_id"], :name => "index_identities_on_user_id"
create_table "invite_lists", :force => true do |t|
t.integer "project_id"
t.integer "user_id"
@ -1058,6 +1167,20 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "private", :default => 0
end
create_table "keys", :force => true do |t|
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
t.text "key"
t.string "title"
t.string "type"
t.string "fingerprint"
t.boolean "public", :default => false, :null => false
end
add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id"
add_index "keys", ["user_id"], :name => "index_keys_on_user_id"
create_table "kindeditor_assets", :force => true do |t|
t.string "asset"
t.integer "file_size"
@ -1069,6 +1192,27 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "owner_type", :default => 0
end
create_table "label_links", :force => true do |t|
t.integer "label_id"
t.integer "target_id"
t.string "target_type"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id"
add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type"
create_table "labels", :force => true do |t|
t.string "title"
t.string "color"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "labels", ["project_id"], :name => "index_labels_on_project_id"
create_table "member_roles", :force => true do |t|
t.integer "member_id", :null => false
t.integer "role_id", :null => false
@ -1119,6 +1263,47 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "viewed_count", :default => 0
end
create_table "merge_request_diffs", :force => true do |t|
t.string "state"
t.text "st_commits", :limit => 2147483647
t.text "st_diffs", :limit => 2147483647
t.integer "merge_request_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true
create_table "merge_requests", :force => true do |t|
t.string "target_branch", :null => false
t.string "source_branch", :null => false
t.integer "source_project_id", :null => false
t.integer "author_id"
t.integer "assignee_id"
t.string "title"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "milestone_id"
t.string "state"
t.string "merge_status"
t.integer "target_project_id", :null => false
t.integer "iid"
t.text "description"
t.integer "position", :default => 0
t.datetime "locked_at"
end
add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id"
add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id"
add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id"
add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at"
add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id"
add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch"
add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id"
add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch"
add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true
add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title"
create_table "message_alls", :force => true do |t|
t.integer "user_id"
t.integer "message_id"
@ -1153,6 +1338,39 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
add_index "messages", ["parent_id"], :name => "messages_parent_id"
create_table "milestones", :force => true do |t|
t.string "title", :null => false
t.integer "project_id", :null => false
t.text "description"
t.date "due_date"
t.datetime "created_at"
t.datetime "updated_at"
t.string "state"
t.integer "iid"
end
add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id"
add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date"
add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true
add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id"
create_table "namespaces", :force => true do |t|
t.string "name", :null => false
t.string "path", :null => false
t.integer "owner_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "type"
t.string "description", :default => "", :null => false
t.string "avatar"
end
add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id"
add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true
add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id"
add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true
add_index "namespaces", ["type"], :name => "index_namespaces_on_type"
create_table "news", :force => true do |t|
t.integer "project_id"
t.string "title", :limit => 60, :default => "", :null => false
@ -1178,6 +1396,31 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.datetime "updated_at", :null => false
end
create_table "notes", :force => true do |t|
t.text "note"
t.string "noteable_type"
t.integer "author_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "project_id"
t.string "attachment"
t.string "line_code"
t.string "commit_id"
t.integer "noteable_id"
t.boolean "system", :default => false, :null => false
t.text "st_diff", :limit => 2147483647
end
add_index "notes", ["author_id"], :name => "index_notes_on_author_id"
add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id"
add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id"
add_index "notes", ["created_at"], :name => "index_notes_on_created_at"
add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type"
add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type"
add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type"
add_index "notes", ["project_id"], :name => "index_notes_on_project_id"
add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at"
create_table "notificationcomments", :force => true do |t|
t.string "notificationcommented_type"
t.integer "notificationcommented_id"
@ -1187,6 +1430,49 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.datetime "updated_at", :null => false
end
create_table "oauth_access_grants", :force => true do |t|
t.integer "resource_owner_id", :null => false
t.integer "application_id", :null => false
t.string "token", :null => false
t.integer "expires_in", :null => false
t.text "redirect_uri", :null => false
t.datetime "created_at", :null => false
t.datetime "revoked_at"
t.string "scopes"
end
add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true
create_table "oauth_access_tokens", :force => true do |t|
t.integer "resource_owner_id"
t.integer "application_id"
t.string "token", :null => false
t.string "refresh_token"
t.integer "expires_in"
t.datetime "revoked_at"
t.datetime "created_at", :null => false
t.string "scopes"
end
add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true
add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id"
add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true
create_table "oauth_applications", :force => true do |t|
t.string "name", :null => false
t.string "uid", :null => false
t.string "secret", :null => false
t.text "redirect_uri", :null => false
t.string "scopes", :default => "", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "owner_id"
t.string "owner_type"
end
add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type"
add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true
create_table "onclick_times", :force => true do |t|
t.integer "user_id"
t.datetime "onclick_time"
@ -1277,6 +1563,7 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.boolean "locked", :default => false
t.integer "sticky", :default => 0
t.integer "org_subfield_id"
t.integer "status", :default => 0
end
create_table "org_member_roles", :force => true do |t|
@ -1343,6 +1630,23 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "allow_teacher", :default => 0
end
create_table "permissions", :force => true do |t|
t.string "controller", :limit => 30, :default => "", :null => false
t.string "action", :limit => 30, :default => "", :null => false
t.string "description", :limit => 60, :default => "", :null => false
t.boolean "is_public", :default => false, :null => false
t.integer "sort", :default => 0, :null => false
t.boolean "mail_option", :default => false, :null => false
t.boolean "mail_enabled", :default => false, :null => false
end
create_table "permissions_roles", :id => false, :force => true do |t|
t.integer "permission_id", :default => 0, :null => false
t.integer "role_id", :default => 0, :null => false
end
add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
create_table "phone_app_versions", :force => true do |t|
t.string "version"
t.text "description"
@ -1425,6 +1729,11 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.datetime "updated_at", :null => false
end
create_table "project_import_data", :force => true do |t|
t.integer "project_id"
t.text "data"
end
create_table "project_infos", :force => true do |t|
t.integer "project_id"
t.integer "user_id"
@ -1501,6 +1810,7 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "journals_count", :default => 0
t.integer "boards_reply_count", :default => 0
t.integer "visits", :default => 0
t.integer "hot", :default => 0
end
add_index "projects", ["lft"], :name => "index_projects_on_lft"
@ -1514,6 +1824,16 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true
add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id"
create_table "protected_branches", :force => true do |t|
t.integer "project_id", :null => false
t.string "name", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "developers_can_push", :default => false, :null => false
end
add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id"
create_table "queries", :force => true do |t|
t.integer "project_id"
t.string "name", :default => "", :null => false
@ -1648,6 +1968,25 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "is_teacher_score", :default => 0
end
create_table "services", :force => true do |t|
t.string "type"
t.string "title"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "active", :default => false, :null => false
t.text "properties"
t.boolean "template", :default => false
t.boolean "push_events", :default => true
t.boolean "issues_events", :default => true
t.boolean "merge_requests_events", :default => true
t.boolean "tag_push_events", :default => true
t.boolean "note_events", :default => true, :null => false
end
add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id"
add_index "services", ["project_id"], :name => "index_services_on_project_id"
create_table "settings", :force => true do |t|
t.string "name", :default => "", :null => false
t.text "value"
@ -1686,6 +2025,26 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.datetime "updated_at", :null => false
end
create_table "snippets", :force => true do |t|
t.string "title"
t.text "content", :limit => 2147483647
t.integer "author_id", :null => false
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "file_name"
t.datetime "expires_at"
t.string "type"
t.integer "visibility_level", :default => 0, :null => false
end
add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id"
add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id"
add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at"
add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at"
add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id"
add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level"
create_table "softapplications", :force => true do |t|
t.string "name"
t.text "description"
@ -1758,9 +2117,9 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "absence_penalty", :default => 0
t.float "system_score", :default => 0.0
t.boolean "is_test", :default => false
t.float "work_score"
t.integer "simi_id"
t.integer "simi_value"
t.float "work_score"
end
add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
@ -1808,13 +2167,13 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
create_table "sub_domains", :force => true do |t|
t.integer "org_subfield_id"
t.integer "priority", :default => 0
t.integer "priority"
t.string "name"
t.string "field_type"
t.integer "hide", :default => 0
t.integer "status", :default => 0
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "hide"
t.integer "status"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "subfield_subdomain_dirs", :force => true do |t|
@ -1824,6 +2183,17 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.datetime "updated_at", :null => false
end
create_table "subscriptions", :force => true do |t|
t.integer "user_id"
t.integer "subscribable_id"
t.string "subscribable_type"
t.boolean "subscribed"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true
create_table "system_messages", :force => true do |t|
t.integer "user_id"
t.string "content"
@ -2057,12 +2427,24 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.integer "gid"
t.integer "visits", :default => 0
t.integer "excellent_teacher", :default => 0
t.integer "excellent_student", :default => 0
end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
add_index "users", ["id", "type"], :name => "index_users_on_id_and_type"
add_index "users", ["type"], :name => "index_users_on_type"
create_table "users_star_projects", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id"
add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true
add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id"
create_table "versions", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.string "name", :default => "", :null => false
@ -2114,6 +2496,23 @@ ActiveRecord::Schema.define(:version => 20160526093715) do
t.datetime "updated_at", :null => false
end
create_table "web_hooks", :force => true do |t|
t.string "url"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "type", :default => "ProjectHook"
t.integer "service_id"
t.boolean "push_events", :default => true, :null => false
t.boolean "issues_events", :default => false, :null => false
t.boolean "merge_requests_events", :default => false, :null => false
t.boolean "tag_push_events", :default => false
t.boolean "note_events", :default => false, :null => false
end
add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id"
add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id"
create_table "wechat_logs", :force => true do |t|
t.string "openid", :null => false
t.text "request_raw"

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org'
source 'https://ruby.taobao.org/'
gemspec

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org'
source 'https://ruby.taobao.org/'
# Specify your gem's dependencies in gitlab.gemspec
gemspec

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org/'
source 'https://ruby.taobao.org/'
gemspec

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org'
source 'https://ruby.taobao.org/'
gemspec

View File

@ -1,4 +1,4 @@
source "https://rubygems.org"
source "https://ruby.taobao.org/"
gemspec

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org'
source 'https://ruby.taobao.org/'
gemspec

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org/'
source 'https://ruby.taobao.org/'
gem 'rich', '1.4.6'
gem 'kaminari'

View File

@ -83,7 +83,8 @@ function _inString(val, str, delimiter) {
}
function _addUnit(val, unit) {
unit = unit || 'px';
return val && /^\d+$/.test(val) ? val + unit : val;
//return val && /^\d+$/.test(val) ? val + unit : val;
return val && /^-?\d+(?:\.\d+)?$/.test(val) ? val + unit : val;
}
function _removeUnit(val) {
var match;
@ -304,7 +305,7 @@ K.options = {
img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
'id', 'class', 'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left', '.margin', '.border', '.padding'
],
pre : ['id', 'class'],
hr : ['id', 'class', '.page-break-after'],
@ -597,7 +598,7 @@ function _ready(fn) {
}
_bind(window, 'load', readyFunc);
}
if (_IE) {
if (window.attachEvent) {
window.attachEvent('onunload', function() {
_each(_eventData, function(key, events) {
if (events.el) {
@ -2531,6 +2532,7 @@ K.START_TO_START = _START_TO_START;
K.START_TO_END = _START_TO_END;
K.END_TO_END = _END_TO_END;
K.END_TO_START = _END_TO_START;
function _nativeCommand(doc, key, val) {
try {
doc.execCommand(key, false, val);
@ -3361,6 +3363,10 @@ function _drag(options) {
});
}
clickEl.mousedown(function(e) {
//新加的
if(e.button !== 0 && e.button !== 1) {
return;
}
e.stopPropagation();
var self = clickEl.get(),
x = _removeUnit(moveEl.css('left')),
@ -3681,13 +3687,20 @@ _extend(KEdit, KWidget, {
if (isDocumentDomain) {
doc.domain = document.domain;
}
doc.write(_getInitHtml(themesPath, bodyClass, cssPath, cssData));
doc.close();
self.win = self.iframe[0].contentWindow;
self.doc = doc;
var cmd = _cmd(doc);
self.afterChange(function(e) {
cmd.selection();
// if (e.which == 8) {
// var range = cmd.range
// var bookmark = range.createBookmark();
// cmd.doc.body.innerHTML = cmd.doc.body.innerHTML.replace(/<p>\s*<\/p>/g,"");
// range.moveToBookmark(bookmark);
// }
cmd.selection();
});
if (_WEBKIT) {
K(doc).click(function(e) {
@ -3824,9 +3837,20 @@ _extend(KEdit, KWidget, {
if (!self.designMode) {
val = self.html();
self.designMode = true;
self.html(val);
//self.html(val);
//self.textarea.hide();
//self.iframe.show();
//新加
self.textarea.hide();
self.iframe.show();
self.html(val);
var iframe = self.iframe;
var height = _removeUnit(self.height);
iframe.height(height - 2);
iframe.show();
setTimeout(function() {
iframe.height(height);
}, 0);
}
} else {
if (self.designMode) {
@ -3958,7 +3982,7 @@ _extend(KToolbar, KWidget, {
}else if(!$("#full",container).is(':hidden')){
pdiv = $("#full",container);
}
return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent());
return (this._itemMap[name] = K('span.ke-icon-' + name, this.div).parent());
},
select : function(name) {
_selectToolbar.call(this, name, function(knode) {
@ -4864,6 +4888,11 @@ KEditor.prototype = {
},
loadPlugin : function(name, fn) {
var self = this;
//新加
var _pluginStatus = this._pluginStatus;
if (!_pluginStatus) {
_pluginStatus = this._pluginStatus = {};
}
if (_plugins[name]) {
if (!_isFunction(_plugins[name])) {
setTimeout(function() {
@ -4871,7 +4900,12 @@ KEditor.prototype = {
}, 100);
return self;
}
_plugins[name].call(self, KindEditor);
//_plugins[name].call(self, KindEditor);
//新加
if(!_pluginStatus[name]) {
_plugins[name].call(self, KindEditor);
_pluginStatus[name] = 'inited';
}
if (fn) {
fn.call(self);
}
@ -5510,6 +5544,11 @@ function _create(expr, options) {
_each(_plugins, function(name, fn) {
if (_isFunction(fn)) {
fn.call(editor, KindEditor);
//新加
if (!editor._pluginStatus) {
editor._pluginStatus = {};
}
editor._pluginStatus[name] = 'inited';
}
});
return editor.create();
@ -5772,13 +5811,14 @@ _plugin('core', function(K) {
click : function() {
self.select().exec('formatblock', '<' + key + '>').hideMenu();
//by yk利用html的特性使h1 h2 h3 h4标签之间不能相互包含 并将空的标签去掉
if (key != "p"){
// if (key != "p"){
var val = self.select().html();
self.select().html(val);
self.cmd.doc.body.innerHTML = self.cmd.doc.body.innerHTML.replace(/<p>\s*<\/p>/g,"");
val = self.select().html().replace(/(<h1>\s*<\/h1>)|(<h2>\s*<\/h2>)|(<h3>\s*<\/h3>)|(<h4>\s*<\/h4>)/g,"");
self.select().html(val);
self.select();
}
// }
}
});
});
@ -6059,6 +6099,9 @@ _plugin('core', function(K) {
} else {
cmd.range.selectNodeContents(div[0]);
cmd.select();
//新加
div[0].tabIndex = -1;
div[0].focus();
}
setTimeout(function() {
movePastedData();

Some files were not shown because too many files have changed in this diff Show More