diff --git a/Gemfile b/Gemfile
index f3b06c2d4..9f31edad1 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,11 +1,13 @@
source 'https://rubygems.org/'
-### 这里执行bundle config mirror.https://rubygems.org https://gems.ruby-china.org 切换到ruby-china源
+### ִbundle config mirror.https://rubygems.org https://gems.ruby-china.org лruby-chinaԴ
unless RUBY_PLATFORM =~ /w32/
# unix-like only
gem 'iconv'
end
+gem 'certified'
+
gem 'wechat',path: 'lib/wechat'
gem 'grack', path:'lib/grack'
gem 'gitlab', path: 'lib/gitlab-cli'
diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb
index d1a8b23dd..c6047d227 100644
--- a/app/controllers/org_document_comments_controller.rb
+++ b/app/controllers/org_document_comments_controller.rb
@@ -79,7 +79,7 @@ class OrgDocumentCommentsController < ApplicationController
def add_reply
@document = OrgDocumentComment.find(params[:id]).root
- @act = OrgActivity.find(params[:id])
+ @act = OrgActivity.find(params[:act_id])
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
@comment.content = params[:org_content]
@document.children << @comment
diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb
index 661073cdc..c628b25fc 100644
--- a/app/controllers/org_subfields_controller.rb
+++ b/app/controllers/org_subfields_controller.rb
@@ -15,6 +15,12 @@ class OrgSubfieldsController < ApplicationController
end
end
@subfield.update_attributes(:field_type => params[:field_type])
+ # 如果栏目是教师,不参入类型的配置,定义为右三模式
+ # 新增模块命名规则,左边1开头,右边2开头,以前的不变
+ # eg:23 右三
+ if params[:field_type] == "Comptec"
+ @subfield.update_attributes(:status => 23)
+ end
else
@res = false
end
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 3709dd24b..c94f734e1 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -28,7 +28,7 @@ class OrganizationsController < ApplicationController
helper :project_score
helper :issues
include UsersHelper
- before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout]
+ before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout, :teachers]
layout 'base_org'
def index
@@ -98,10 +98,26 @@ class OrganizationsController < ApplicationController
else
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@organization = Organization.find(params[:id])
+ # params[:org_subfield_id] 存在即对应的栏目,否则进入组织动态
if params[:org_subfield_id]
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
- @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
- @org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
+ if @org_subfield.field_type == "Comptec" || @org_subfield.field_type == "Compstu"
+
+ # @org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,( SELECT `courses`.* FROM `courses` INNER JOIN `members` ON `courses`.`id` = `members`.`course_id` WHERE `members`.`user_id` = u.id AND (courses.status<>9)) as course_count
+ # from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 order by course_count desc")
+ @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 order by course_count desc")
+ # @org_count = @org_teachers.count
+ # @limit = 25
+ # @is_remote = true
+ # @atta_count = @attachments.count
+ # @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
+ # @offset ||= @atta_pages.offset
+ # #@curse_attachments_all = @all_attachments[@offset, @limit]
+ # @attachments = paginateHelper @attachments,25
+ else
+ @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
+ @org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
+ end
else
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
@@ -142,6 +158,57 @@ class OrganizationsController < ApplicationController
end
+ def teachers
+ unless @organization.allow_set_teachers
+ render_403
+ return
+ end
+ q = params[:search].nil? ? "" : "#{params[:search].strip}"
+ @field = 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")
+ end
+ limit = 10
+ # @is_remote = true
+ @teachers_count = @org_teachers.count
+ @atta_pages = Paginator.new @teachers_count, limit, params['page'] || 1
+ @offset ||= @atta_pages.offset
+ #@curse_attachments_all = @all_attachments[@offset, @limit]
+ @org_teachers = paginateHelper @org_teachers, limit
+ respond_to do |format|
+ format.html
+ format.js
+ end
+ end
+
+ def searchmember_by_name members, name
+ #searchPeopleByRoles(project, StudentRoles)
+ mems = []
+ if name != ""
+ name = name.to_s.downcase
+ members.each do |m|
+ username = m.user[:lastname].to_s.downcase + m.user[:firstname].to_s.downcase
+ if(m.user[:login].to_s.downcase.include?(name) || m.user.user_extensions[:student_id].to_s.downcase.include?(name) || username.include?(name))
+ mems << m
+ end
+ end
+ else
+ mems = members
+ end
+ mems
+ end
+
def get_project_message_activities_org org
project_ids = org.projects.map{|project| project.id}.join(",")
unless project_ids.blank?
@@ -221,6 +288,7 @@ class OrganizationsController < ApplicationController
# @organization.domain = params[:organization][:domain]
@organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0
@organization.allow_guest_download = params[:organization][:allow_guest_download] == 'on' ? 1 : 0
+ @organization.allow_teacher = params[:organization][:allow_teacher] == 'on' ? 1 : 0
@organization.show_mode = params[:show_mode]
#@organization.name = params[:organization][:name]
@organization.save
@@ -403,6 +471,18 @@ class OrganizationsController < ApplicationController
end
end
+ # 设置为名师
+ def set_excellent_teacher
+ @ex_teacher = User.find(params[:user])
+ @ex_teacher.update_column(:excellent_teacher, 1)
+ end
+
+ # 取消名师
+ def reset_excellent_teacher
+ @ex_teacher = User.find(params[:user])
+ @ex_teacher.update_column(:excellent_teacher, 0)
+ end
+
def hide_org_subfield
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
@org_subfield.update_attribute(:hide, 1)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index b73ecf9b9..4a148bb8b 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -32,9 +32,9 @@ class RepositoriesController < ApplicationController
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo, :stats]
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
- before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked]
+ before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :project_archive]
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
- before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff]
+ before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff, :project_archive]
accept_rss_auth :revisions
# hidden repositories filter // 隐藏代码过滤器
before_filter :check_hidden_repo, :only => [:show, :stats, :revisions, :revision, :diff ]
@@ -95,6 +95,13 @@ class RepositoriesController < ApplicationController
end
+ # 一键ZIP下载
+ def project_archive
+ g = Gitlab.client
+ g.get()
+ # g.project_archive(params[:gpid].to_i, params[:rev])
+ end
+
# 判断用户是否已经fork过该项目
def has_forked?(project, user)
projects = Project.where("user_id =?", user)
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 16c6ab935..deab2feb6 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -123,6 +123,7 @@ class StudentWorkController < ApplicationController
#-1 默认值 0全部正确并结束 2 超时 -2 编译错误
resultObj[:status] = -1
resultObj[:results] = result["results"].first #本次测试结果
+ result["error_msg"] = result["error_msg"][0..2047]
resultObj[:error_msg] = result["error_msg"] #编译错误时的信息
#该状态用于存入CodeTests
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 4e8e14559..a81ade3fa 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -2618,6 +2618,9 @@ class UsersController < ApplicationController
# 获取我的资源
def get_my_resources author_id, user_course_ids, user_project_ids, order, score
+ unless author_id.to_i.to_s == author_id
+ author_id = User.find_by_login(author_id).id
+ end
attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('OrgSubfield','Principal','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
@@ -2625,6 +2628,7 @@ class UsersController < ApplicationController
# 获取我的资源查询结果
def get_my_resources_search (author_id, user_course_ids, user_project_ids, order, score, search)
+ author_id = User.find_by_login(author_id).id
@attachments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
@@ -2632,6 +2636,7 @@ class UsersController < ApplicationController
# 获取我的课程资源
def get_course_resources author_id, user_course_ids, order, score
+ author_id = User.find_by_login(author_id).id
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
@@ -2639,6 +2644,7 @@ class UsersController < ApplicationController
# 获取我的课程资源中搜索结果
def get_course_resources_search author_id, user_course_ids, order, score, search
+ author_id = User.find_by_login(author_id).id
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
and is_publish = 1 and container_id is not null)) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
@@ -2656,6 +2662,7 @@ class UsersController < ApplicationController
# 获取我的项目资源
def get_project_resources author_id, user_project_ids, order, score
+ author_id = User.find_by_login(author_id).id
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
and is_publish = 1 and container_id is not null)").order("#{order.nil? ? 'created_on' : order} #{score}")
@@ -2663,6 +2670,7 @@ class UsersController < ApplicationController
# 获取我的项目资源搜索
def get_project_resources_search author_id, user_project_ids, order, score, search
+ author_id = User.find_by_login(author_id).id
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
and is_publish = 1 and container_id is not null)) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
@@ -2680,12 +2688,14 @@ class UsersController < ApplicationController
# 获取我上传的附件
def get_attch_resources author_id, order, score
+ author_id = User.find_by_login(author_id).id
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
'Document','Message','News','StudentWorkScore','HomewCommon'))").order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我上传的附件搜索结果
def get_attch_resources_search author_id, order, score, search
+ author_id = User.find_by_login(author_id).id
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
'Document','Message','News','StudentWorkScore','HomewCommon')) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
end
@@ -2704,11 +2714,13 @@ class UsersController < ApplicationController
# 获取我的用户类型资源
def get_principal_resources author_id, order, score
+ author_id = User.find_by_login(author_id).id
attchments = Attachment.where("author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Principal'").order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我的用户类型资源搜索
def get_principal_resources_search author_id, order, score, search
+ author_id = User.find_by_login(author_id).id
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Principal') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
end
@@ -2725,7 +2737,7 @@ class UsersController < ApplicationController
# 资源库 分为全部 课程资源 项目资源 附件
def user_resource
# 别人的资源库是没有权限去看的
- if User.current.id.to_i != params[:id].to_i
+ if User.current.id.to_i != @user.id.to_i
render_403
return
end
@@ -2780,13 +2792,13 @@ class UsersController < ApplicationController
# 导入资源
def import_resources
# 别人的资源库是没有权限去看的
- if User.current.id.to_i != params[:id].to_i
+ @user = User.find_by_login(params[:id])
+ if User.current != @user
render_403
return
end
@resource_id = params[:project_id].nil? ? (params[:course_id].nil? ? params[:subfield_file_id] : params[:course_id]) : params[:project_id]
@resource_type = params[:project_id].nil? ? (params[:course_id].nil? ? "SubfieldFile" : "Course") : "Project"
- @user = User.find(params[:id])
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
@score = @b_sort == "desc" ? "asc" : "desc"
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index bbf67f6a3..229aceb1c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -33,6 +33,19 @@ module ApplicationHelper
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
+
+ def user_path(resource, parameters = {})
+ if Fixnum === resource
+ resource = User.find(resource)
+ end
+ super
+ end
+
+ # def user_blogs_path(resource,parameters={})
+ # super
+ # end
+
+
def update_visiti_count container
container.update_column(:visits, container.visits + 1)
end
diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb
index 917ccc01c..cba4fa210 100644
--- a/app/helpers/organizations_helper.rb
+++ b/app/helpers/organizations_helper.rb
@@ -148,4 +148,43 @@ module OrganizationsHelper
org_acts
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)
+ case field.field_type
+ when "Post"
+ result = "帖子"
+ when "Resource"
+ result = "资源"
+ when "Compstu"
+ result = "学生"
+ when "Comptec"
+ result = "教师"
+ when "Complex"
+ result = "综合"
+ end
+ end
+
+ def org_teacher_resource_count user
+ results = Attachment.find_by_sql("SELECT * FROM attachments where author_id = #{user.id};").count
+ end
+
+ def org_teacher_course_count user
+ results = Course.find_by_sql("select * from courses where courses.tea_id = #{user.id}").count
+ end
+
+ def org_student_course_count user
+ course_ids = user.courses.map { |c| c.is_delete == 0 && c.id}
+ results = Member.find_by_sql("select id from courses where courses.tea_id = #{user.id}").count
+ end
+
+ def excellent_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 order by course_count desc").first(5)
+ end
+
end
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 79ddcd917..d5d148117 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -262,7 +262,7 @@ class Issue < ActiveRecord::Base
# set default values for new records only
self.status ||= IssueStatus.default
self.priority ||= IssuePriority.default
- self.watcher_user_ids = []
+ # self.watcher_user_ids = []
end
end
diff --git a/app/models/organization.rb b/app/models/organization.rb
index 8f9d290eb..311a37bf8 100644
--- a/app/models/organization.rb
+++ b/app/models/organization.rb
@@ -26,4 +26,8 @@ class Organization < ActiveRecord::Base
def switch_type
self.show_mode.to_i == 1 ? true : false
end
+
+ def allow_set_teachers
+ self.allow_teacher.to_i == 1 ? true : false
+ end
end
diff --git a/app/models/school.rb b/app/models/school.rb
index 6cafb0473..b9a1d88cb 100644
--- a/app/models/school.rb
+++ b/app/models/school.rb
@@ -5,4 +5,5 @@ class School < ActiveRecord::Base
def to_s
self.name.to_s
end
+
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 9e4f227b7..035aff625 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -309,6 +309,20 @@ class User < Principal
end
# ======================================================================
+ def my_workplace
+ self.user_extensions.try(:occupation).to_s
+ end
+
+ def my_blogs_count
+ self.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count
+ end
+
+ def my_students
+ my_students=StudentsForCourse.find_by_sql("SELECT SUM(student_count) as students_count, c.tea_id FROM courses c, (SELECT course_id , COUNT(id) AS student_count FROM students_for_courses GROUP BY course_id) AS ct
+ WHERE c.id= ct.course_id and c.tea_id = #{self.id} GROUP BY c.tea_id").first
+ results = my_students.blank? ? 0 : my_students.students_count
+ results
+ end
# 查询用户未读过的记录
# 用户留言记录
@@ -1073,16 +1087,25 @@ class User < Principal
anonymous_user
end
+ def self.is_id?(id)
+ Fixnum===id || id.to_i.to_s == id
+ end
+
# refactor User model find function,
# return anonymous user when can not find user id = user_id
def self.find (*args, &block)
begin
+ return find_by_login(args.first) if args.size==1 && !is_id?(args.first)
super
rescue
self.anonymous
end
# super
end
+
+ def to_param
+ login
+ end
# Salts all existing unsalted passwords
# It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password))
# This method is used in the SaltPasswords migration and is to be kept as is
diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb
index 4a9b07ec7..c7e4a7428 100644
--- a/app/views/courses/_courses_jours.html.erb
+++ b/app/views/courses/_courses_jours.html.erb
@@ -36,7 +36,7 @@
取消
- 留言
+ 留言
<% end %>
<% end %>
@@ -55,6 +55,9 @@
diff --git a/app/views/layouts/base_sub_domain.html.erb b/app/views/layouts/base_sub_domain.html.erb
index b2d26d309..871e2cdea 100644
--- a/app/views/layouts/base_sub_domain.html.erb
+++ b/app/views/layouts/base_sub_domain.html.erb
@@ -1,187 +1,191 @@
-
-
-
-
- <%= h html_title %>
-
-
- <%= csrf_meta_tag %>
- <%= favicon %>
- <%= javascript_heads %>
- <%= heads_for_theme %>
- <%= stylesheet_link_tag 'org_new_style','jquery/jquery-ui-1.9.2', 'org2' %>
- <%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
- <%= javascript_include_tag 'attachments' %>
- <%#= call_hook :view_layouts_base_html_head %>
-
- <%#= yield :header_tags -%>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<%# 更新访问数,刷新的时候更新访问次数 %>
- <% update_visiti_count @organization %>
-<%# over %>
-
-
-
- <%= render_flash_messages %>
- <%= yield %>
- <%= call_hook :view_layouts_base_content %>
-
-
-
-
-
-
-
-
-
-
- <%= l(:label_loading) %>
-
-
-
-
-
-
+
+
+
+
+ <%= h html_title %>
+
+
+ <%= csrf_meta_tag %>
+ <%= favicon %>
+ <%= javascript_heads %>
+ <%= heads_for_theme %>
+ <%= stylesheet_link_tag 'org_new_style','jquery/jquery-ui-1.9.2', 'org2' %>
+ <%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
+ <%= javascript_include_tag 'attachments' %>
+ <%#= call_hook :view_layouts_base_html_head %>
+
+ <%#= yield :header_tags -%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<%# 更新访问数,刷新的时候更新访问次数 %>
+ <% update_visiti_count @organization %>
+<%# over %>
+
+
+
+ <%= render_flash_messages %>
+ <%= yield %>
+ <%= call_hook :view_layouts_base_content %>
+
+
+
+
+
+
+
+
+
+
+ <%= l(:label_loading) %>
+
+
+
+
+
+
diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb
index 79858dd03..d904cb920 100644
--- a/app/views/org_document_comments/add_reply.js.erb
+++ b/app/views/org_document_comments/add_reply.js.erb
@@ -1,2 +1,2 @@
-$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
+$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
diff --git a/app/views/org_subfields/create.js.erb b/app/views/org_subfields/create.js.erb
index 3e08d9f9e..5cc6d5c91 100644
--- a/app/views/org_subfields/create.js.erb
+++ b/app/views/org_subfields/create.js.erb
@@ -4,6 +4,7 @@
:locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
$("#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') %>");
<% end %>
$("#subfield_name").val("");
$("#sub_dir").val("");
\ No newline at end of file
diff --git a/app/views/org_subfields/destroy.js.erb b/app/views/org_subfields/destroy.js.erb
index d069b1cd8..c14eeae8f 100644
--- a/app/views/org_subfields/destroy.js.erb
+++ b/app/views/org_subfields/destroy.js.erb
@@ -2,4 +2,5 @@ $("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
$("#sub_field_left_lists").html("");
-$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
\ No newline at end of file
+$("#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') %>");
\ No newline at end of file
diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb
index 39837df88..4340213a4 100644
--- a/app/views/organizations/_org_left_subfield_list.html.erb
+++ b/app/views/organizations/_org_left_subfield_list.html.erb
@@ -91,7 +91,7 @@
<% end %>
<% else %>
- <% if field.field_type == "Post" %>
+ <% if field.field_type == "Post" || field.field_type == "Complex" || field.field_type == "Compstu" || field.field_type == "Comptec" %>
@@ -118,7 +122,6 @@
<% end %>
-
<% else %>
<% elsif act.org_act_type == "Message" %>
<% activity = Message.find(act.org_act_id) %>
@@ -37,16 +38,13 @@
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<% end %>
- <% if activity.parent_id.nil? %>
- <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
- <% else %>
- <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
- <% end %>
+ <%= link_to activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
<%= format_date activity.updated_on %>
-
<%= activity.content.to_s.html_safe %>
+
<%= activity.content.to_s.html_safe %>
+
<%=link_to "查看全文>>", activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
@@ -62,8 +60,10 @@
<%= format_date activity.created_on %>
-
<%= activity.description.to_s.html_safe %>
+
<%= activity.description.to_s.html_safe %>
+
+ <%=link_to "查看全文>>", activity.title.to_s, news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% elsif act.org_act_type == "Poll" %>
<% activity = Poll.find(act.org_act_id) %>
@@ -86,8 +86,9 @@
<%= format_date activity.published_at %>
-
<%= activity.polls_description.to_s.html_safe %>
+
<%= activity.polls_description.to_s.html_safe %>
+ <%=link_to "查看全文>>", poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% end %>
<% end %>
@@ -116,8 +117,9 @@
<%= format_date activity.updated_on %>
-
<%= activity.description.to_s.html_safe %>
+
<%= activity.description.to_s.html_safe %>
+ <%=link_to "查看全文>>", activity.subject.to_s, issue_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% elsif act.org_act_type == "Message" %>
<% activity = Message.find(act.org_act_id) %>
@@ -128,17 +130,14 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<% end %>
-
- <% if activity.parent_id.nil? %>
- <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
- <% else %>
- <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
- <% end %>
+
+ <%= link_to activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
<%= format_date activity.updated_on %>
-
<%= activity.content.to_s.html_safe %>
+
<%= activity.content.to_s.html_safe %>
+ <%=link_to "查看全文>>", activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
@@ -154,8 +153,9 @@
2016-04-08
-
<%= activity.description.to_s.html_safe %>
+
<%= activity.description.to_s.html_safe %>
+ <%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% end %>
<% end %>
@@ -190,8 +190,9 @@
<%= format_date document.created_at %>
-
<%= document.content.to_s.html_safe %>
+
<%= document.content.to_s.html_safe %>
+ <%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% 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 %>
@@ -209,17 +210,14 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<% end %>
-
- <% if message.parent_id.nil? %>
- <%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %>
- <% else %>
- <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %>
- <% end %>
+
+ <%= link_to message.parent_id.nil? ? message.subject.to_s.html_safe : message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %>
<%= format_date message.created_on %>
-
<%= content.to_s.html_safe %>
+
<%= content.to_s.html_safe %>
+ <%=link_to "查看全文>>", message.parent_id.nil? ? message.subject.to_s.html_safe : message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% else %>
@@ -237,7 +235,14 @@
<%= format_date message.created_on %>
-
<%= content.to_s.html_safe %>
+
<%= content.to_s.html_safe %>
+
+
+ <% if message.parent_id.nil? %>
+ <%=link_to "查看全文>>", message.subject.to_s.html_safe, board_message_path(message.board,message), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+ <% else %>
+ <%=link_to "查看全文>>", message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+ <% end %>
<% end %>
@@ -256,8 +261,9 @@
<%= format_date news.created_on %>
-
<%= news.description.to_s.html_safe %>
+
<%= news.description.to_s.html_safe %>
+ <%=link_to "查看全文>>", news.title.to_s, news_path(news), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% end %>
<% end %>
@@ -266,4 +272,14 @@
<% end %>
<% end %>
+
+
diff --git a/app/views/organizations/_org_subfield_rightD.html.erb b/app/views/organizations/_org_subfield_rightD.html.erb
index 398f679e1..2953d1a0a 100644
--- a/app/views/organizations/_org_subfield_rightD.html.erb
+++ b/app/views/organizations/_org_subfield_rightD.html.erb
@@ -10,7 +10,7 @@
<% org_acts = get_subfield_acts field %>
<% unless org_acts.blank? %>
<% activity = org_acts.first %>
-
+
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
<% document = activity.org_act %>
<% org_subfield_id = params[:org_subfield_id] %>
@@ -52,13 +52,13 @@
<% end %>
<% else %>
-
+
<% end %>
<% elsif field.field_type == "Resource" %>
<% org_attachs = get_attach_org2(field) %>
-
+
<% 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 image_tag("/images/default_blank/right-03.jpg", :width => "369", :height => "169"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
diff --git a/app/views/organizations/_org_subfield_rightM.html.erb b/app/views/organizations/_org_subfield_rightM.html.erb
index e8dfa6b3f..d1b86f047 100644
--- a/app/views/organizations/_org_subfield_rightM.html.erb
+++ b/app/views/organizations/_org_subfield_rightM.html.erb
@@ -23,7 +23,8 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %>
<% end %>
-
<%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %>
+
<%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
+
<%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2" %>
<% else activity.container_type == 'OrgSubfield' %>
@@ -39,6 +40,7 @@
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %>
<% end %>
<%=link_to message.content.to_s.html_safe, board_message_url_in_org(message.board.id, message.id), :target => "_blank" %>
+
<%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2" %>
<% else %>
@@ -51,6 +53,7 @@
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %>
<% end %>
<%=link_to message.content.to_s.html_safe, board_message_path(message.board, activity), :target => "_blank" %>
+
<%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2" %>
<% end %>
@@ -66,6 +69,7 @@
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %>
<% end %>
<%=link_to news.description.to_s.html_safe, news_path(news), :target => "_blank" %>
+
<%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2" %>
<% end %>
@@ -96,3 +100,12 @@
<% end %>
<% end %>
+
+
diff --git a/app/views/organizations/_org_subfield_rightM2.html.erb b/app/views/organizations/_org_subfield_rightM2.html.erb
new file mode 100644
index 000000000..1482f64a2
--- /dev/null
+++ b/app/views/organizations/_org_subfield_rightM2.html.erb
@@ -0,0 +1,33 @@
+<% unless excellent_teachers.count == 0 %>
+
+
<%= field.name %>
+ <%= link_to "更多", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => field.id), :target => "_blank", :class => "more" %>
+
+ <% excellent_teachers.each do |teacher| %>
+
+ <%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sn-fl sn-avatar-circle", :style => "display:block;"), user_path(teacher), :alt => "用户头像", :target => '_blank' %>
+
+
+ <%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "sn-teacher-name sn-hidden", :title => '', :target => '_blank' %>
+ <%= teacher.my_workplace %>
+
+ <% unless teacher.my_blogs_count == 0 %>
+ 博客 <%= teacher.my_blogs_count %>
+ <% end %>
+ <% unless teacher.courses.count == 0 %>
+ 课程 <%= teacher.courses.count %>
+ <% end %>
+ <% unless teacher.my_students == 0 %>
+ 学生 <%= teacher.my_students %>
+ <% end %>
+
+
+
+ <% end %>
+
+
+
+<% end %>
+
diff --git a/app/views/organizations/_org_teachers_list.html.erb b/app/views/organizations/_org_teachers_list.html.erb
new file mode 100644
index 000000000..f2523fb9f
--- /dev/null
+++ b/app/views/organizations/_org_teachers_list.html.erb
@@ -0,0 +1,59 @@
+<% org_teachers.each do |org_teacher| %>
+ <% school = School.where("id =?", org_teacher.school_id).first %>
+
+
+
+ <%= link_to image_tag(url_to_avatar(org_teacher), :width => "90", :height => "90"), user_url_in_org(org_teacher), :alt => "用户头像" %>
+
+
+
<%=link_to org_teacher.try(:realname).nil? ? org_teacher.try(:login) : org_teacher.try(:realname), user_url_in_org(org_teacher) %>
+ <% unless school.nil? %>
+ <%= school.name %>
+ <% end %>
+ <% unless org_teacher.nil? %>
+ <%= org_teacher.technical_title %>
+ <% end %>
+
+
<%= org_teacher.courses.count %>
+
课程数
+
+
+
+
<%= org_teacher.my_students %>
+
学生数
+
+
+
+
<%= org_teacher_resource_count(org_teacher) %>
+
资源数
+
+
+ <% if User.current.admin_of_org?(@organization) %>
+
<%= org_teacher.excellent_teacher==0?"设为名师":"取消设置" %>
+
+ <% else %>
+
+
+
+
+
+ <% end %>
+
+
+
+<% end %>
+
+
\ No newline at end of file
diff --git a/app/views/organizations/_setting_excellent_teachers.html.erb b/app/views/organizations/_setting_excellent_teachers.html.erb
new file mode 100644
index 000000000..ea6c1c9a6
--- /dev/null
+++ b/app/views/organizations/_setting_excellent_teachers.html.erb
@@ -0,0 +1,6 @@
+<% if @organization.allow_set_teachers && !org_subfield_had_created?(@organization, "Comptec") %>
+
+
+ 教师
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/organizations/_show_students.html.erb b/app/views/organizations/_show_students.html.erb
new file mode 100644
index 000000000..7f8d90203
--- /dev/null
+++ b/app/views/organizations/_show_students.html.erb
@@ -0,0 +1,36 @@
+
+
+
+
+
+ 课程数
+ 学生数
+ 资源数
+
+
+
+
+
+
+
+
尹刚 国防科学技术大学 教授
+
+
+
+
+
+
+
添加
+
+
+
+
\ No newline at end of file
diff --git a/app/views/organizations/_show_teachers.html.erb b/app/views/organizations/_show_teachers.html.erb
new file mode 100644
index 000000000..355e5a731
--- /dev/null
+++ b/app/views/organizations/_show_teachers.html.erb
@@ -0,0 +1,22 @@
+
+
+ <%= form_tag( url_for(:controller => 'organizations', :action => 'teacher_search'),
+ :remote => true , :method => 'get', :id => 'resource_search_form') do %>
+
+ <%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :style => 'border-style:none', :class => "teacher-search-icon fl" %>
+
+ <% end %>
+
+
+
+
+ 课程数
+ 学生数
+ 资源数
+
+
+
+
+ <%=render 'organizations/org_teachers_list' %>
+
+
\ No newline at end of file
diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb
index 4619ed337..f16e53b0e 100644
--- a/app/views/organizations/_subfield_list.html.erb
+++ b/app/views/organizations/_subfield_list.html.erb
@@ -8,7 +8,6 @@
操作
-
<% subfields.each do |field| %>
<% if is_default_field?(field) %>
<% name = get_default_name(field) %>
@@ -32,10 +31,9 @@
<%= select( :name,:group_id, subfield_status_option_default, { :include_blank => false,:selected => field.status},
- { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %>
+ { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %>
<% end %>
<% end %>
-
默认
<%= field.hide==0?"隐藏":"可见" %>
@@ -59,21 +57,20 @@
新增
- <% if field.field_type == "Resource" %>
- 列表
+ <% if field.field_type == "Resource" || field.field_type == "Comptec" %>
+ 默认
<% 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 %>
<%= subfield_list_type(field.status) %>
<%= select( :name,:group_id, subfield_status_option,
- { :include_blank => false,:selected => field.status},
- {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %>
+ { :include_blank => false,:selected => field.status},
+ { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %>
<% end %>
-
<% end %>
- <%= field.field_type == "Post" ? "帖子" : "资源" %>
+ <%= org_subfield_type field %>
<% if Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 %>
@@ -95,7 +92,7 @@
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %>
|
编辑
- <% unless field.field_type == "Resource" %>
+ <% unless field.field_type == "Resource" || field.field_type == "Comptec" %>
|
diff --git a/app/views/organizations/reset_excellent_teacher.js.erb b/app/views/organizations/reset_excellent_teacher.js.erb
new file mode 100644
index 000000000..fdf160bc4
--- /dev/null
+++ b/app/views/organizations/reset_excellent_teacher.js.erb
@@ -0,0 +1 @@
+$("#hide_<%= @ex_teacher.id %>").text("设为名师");
\ No newline at end of file
diff --git a/app/views/organizations/set_excellent_teacher.js.erb b/app/views/organizations/set_excellent_teacher.js.erb
new file mode 100644
index 000000000..32dc53689
--- /dev/null
+++ b/app/views/organizations/set_excellent_teacher.js.erb
@@ -0,0 +1 @@
+$("#hide_<%= @ex_teacher.id %>").text("取消设置");
\ No newline at end of file
diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb
index c989b259c..2caeee726 100644
--- a/app/views/organizations/setting.html.erb
+++ b/app/views/organizations/setting.html.erb
@@ -87,6 +87,11 @@
允许游客下载
<%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
+ <% if User.current.admin? %>
+ 允许设置名师榜 :
+ class="ml3" />
+
+ <% end %>
保存
<% end %>
@@ -152,10 +157,9 @@
资源
-
-
-
-
+
+ <%= render :partial => 'organizations/setting_excellent_teachers' %>
+
新增
diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb
index f217f006e..d93ead84b 100644
--- a/app/views/organizations/show.html.erb
+++ b/app/views/organizations/show.html.erb
@@ -5,46 +5,46 @@
<% end %>
<% if params[:show_homepage].nil? and User.current.logged? %>
-
<% end %>
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
<% 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} %>
+ <%= 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',
@@ -67,3 +67,6 @@
+
+
+
diff --git a/app/views/organizations/teacher_search.js.erb b/app/views/organizations/teacher_search.js.erb
new file mode 100644
index 000000000..6b27f0998
--- /dev/null
+++ b/app/views/organizations/teacher_search.js.erb
@@ -0,0 +1 @@
+$("#org_teachers_list").html('<%= escape_javascript( render :partial => 'organizations/org_teachers_list')%>');
diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb
new file mode 100644
index 000000000..c368adef7
--- /dev/null
+++ b/app/views/organizations/teachers.html.erb
@@ -0,0 +1,39 @@
+
+
+
+ <%= form_tag( url_for(:controller => 'organizations', :action => 'teachers', :type => @type),
+ :remote => true , :method => 'get', :id => 'resource_search_form') do %>
+
+ <%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %>
+
+ <% end %>
+
+
+
+
+
+
+
+
+
+ <%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %>
+
+
+
+
+ <%=render 'organizations/org_teachers_list', :org_teachers => @org_teachers %>
+
+
+
+ <%= pagination_links_full @atta_pages, @teachers_count, :per_page_links => false, :flag => true %>
+
+
+
\ No newline at end of file
diff --git a/app/views/organizations/teachers.js.erb b/app/views/organizations/teachers.js.erb
new file mode 100644
index 000000000..cd7323a4a
--- /dev/null
+++ b/app/views/organizations/teachers.js.erb
@@ -0,0 +1,3 @@
+$("#org_teachers_list").html('<%= escape_javascript( render :partial => 'organizations/org_teachers_list', :locals => {:org_teachers => @org_teachers})%>');
+$("#pages").html('<%= pagination_links_full @atta_pages, @teachers_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
+$("#org_teacher_search").attr('href','<%= teachers_organization_path(@organization, :type => @type) %>');
\ No newline at end of file
diff --git a/app/views/projects/_rep_static.html.erb b/app/views/projects/_rep_static.html.erb
index 9ebf68d0c..d687c8f7e 100644
--- a/app/views/projects/_rep_static.html.erb
+++ b/app/views/projects/_rep_static.html.erb
@@ -20,6 +20,11 @@
// text: 'Source: WorldClimate.com'
},
xAxis: {
+ title: {
+ text: '作者',
+ x: -23, //center设置标题的位置
+ y: 6
+ },
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
categories: <%= raw(@a_uname_code) %>
},
@@ -70,7 +75,7 @@
lineWidth: 1.5
},
{
- name: '改动或增加 ',
+ name: '改动或增加 ',
color: '#5b6b76',
data: <%= @a_commits_add %>,
dataLabels: {
@@ -122,6 +127,11 @@
// text: 'Source: WorldClimate.com'
},
xAxis: {
+ title: {
+ text: '作者',
+ x: -20, //center设置标题的位置
+ y: 6
+ },
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
categories: <%= raw(@a_uname) %>
},
diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb
index 60c4aa3bf..4dee108ee 100644
--- a/app/views/repositories/_dir_list_content.html.erb
+++ b/app/views/repositories/_dir_list_content.html.erb
@@ -43,7 +43,7 @@
-
+
<%# 为了转换UTC时间,时差8小时 %>
<%= distance_of_time_in_words(latest_changes.time, Time.now + 8.hours) if latest_changes && latest_changes.time %>
<%#= latest_changes.time if latest_changes && latest_changes.time %>
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index 82e6f871f..276283e97 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -1,6 +1,8 @@
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
+
+
<% if @entries.nil? %>
diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb
index 8655ccedd..8fc98c6ca 100644
--- a/app/views/student_work/_student_work_list.html.erb
+++ b/app/views/student_work/_student_work_list.html.erb
@@ -56,8 +56,8 @@
<% else %>
<% work= params[:show_work_id].nil? ? @homework.student_works.where("user_id = ?",User.current.id).first : StudentWork.find(params[:show_work_id]) %>
<% end %>
- location.hash = "<%=work.id %>";
<% unless work.nil? %>
+ location.hash = "<%=work.id %>";
<% if @homework.homework_type == 2 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc"),:is_focus => @is_focus}) %>");
diff --git a/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb b/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb
index 0af0bb698..a82e24ad4 100644
--- a/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb
+++ b/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb
@@ -14,7 +14,7 @@
<%=link_to document.title, org_subfield_sub_domain_sub_document_comment_path(document, :org_subfield_id => @org_subfield, :sub_domain_id => @subdomain), :class => "sn-newslist-titile fl", :target => "_blank" %>
<%= format_date(document.created_at) %>
- 回复(<%= document.children.count %>)
+ 回复(<%= document.children.count %>)
diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb
index 5f61d26ef..55f576db1 100644
--- a/app/views/users/_project_boardlist.html.erb
+++ b/app/views/users/_project_boardlist.html.erb
@@ -44,7 +44,7 @@
<% end %>
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %>
-
+
发帖时间:<%= format_time(activity.created_on) %>
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
<% count=0 %>
diff --git a/app/views/users/_user_resource_info.html.erb b/app/views/users/_user_resource_info.html.erb
index a3bc45481..58829386c 100644
--- a/app/views/users/_user_resource_info.html.erb
+++ b/app/views/users/_user_resource_info.html.erb
@@ -28,7 +28,7 @@
-
+
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
@@ -37,7 +37,7 @@
-