Merge branch 'develop' into cxt_course

Conflicts:
	db/schema.rb
This commit is contained in:
cxt 2016-05-17 16:30:03 +08:00
commit 357e143c9a
96 changed files with 4200 additions and 3446 deletions

View File

@ -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'

View File

@ -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

View File

@ -15,6 +15,12 @@ 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
else
@res = false
end

View File

@ -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])
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)

View File

@ -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)

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -5,4 +5,5 @@ class School < ActiveRecord::Base
def to_s
self.name.to_s
end
end

View File

@ -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

View File

@ -36,7 +36,7 @@
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
<p nhname='contentmsg_'></p>
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10">取消</a>
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="new_message_submit_btn_" >留言</a>
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="submit_feedback_course" >留言</a>
<% end %>
</div>
<% end %>
@ -55,6 +55,9 @@
<script type="text/javascript">
$(function(){
$("#submit_feedback_course").one('click',function() {
$("#course_feedback_new").submit();
});
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
@ -65,7 +68,6 @@
params.textarea = $("textarea[name='user_notes']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
params.submit_btn = $("input[nhname='submit_btn']",params.div_form);
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
params.height = 55;
if(params.textarea.data('init') == undefined){
@ -74,9 +76,6 @@
params.cancel_btn.click(function(){
nh_reset_form(params);
});
params.submit_btn.one('click', function () {
params.form.submit();
});
}
params.cancel_btn.click();
toggleAndSettingWordsVal(params.div_form, params.textarea);

View File

@ -77,7 +77,7 @@
</div>
</div>
<!--导航-->
<div class="sn-row sn-bg-blue">
<div class="sn-row sn-bg-blue sn-p-relative">
<ul class="sn-nav">
<% @subfield_content.each do |field| %>
<% if is_default_field?(field) %>
@ -105,6 +105,7 @@
<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>
@ -156,6 +157,8 @@
<%= 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>
@ -190,16 +193,19 @@
</body>
<script>
$(".nav-element").mouseover(function(){
$(this).next(".sn-grey-opacity").show();
$(this).next(".sn-grey-opacity").show(0);
});
$(".sn-grey-opacity").mouseover(function(){
$(this).show();
$(this).show(0);
});
$(".nav-element").mouseout(function(){
$(this).next(".sn-grey-opacity").hide();
$(this).next(".sn-grey-opacity").delay(150).hide(0);
});
$(".sn-grey-opacity").mouseout(function(){
$(this).hide();
$(this).delay(150).hide(0);
});
$(".sn-sub-nav").each(function(){
$(this).children(".sn-subnav-slice:last").hide();
});
</script>

View File

@ -33,16 +33,19 @@
<script>
$(document).ready(function(){
$(".nav-element").mouseover(function(){
$(this).next(".sn-grey-opacity").show();
$(this).next(".sn-grey-opacity").show(0);
});
$(".sn-grey-opacity").mouseover(function(){
$(this).show();
$(this).show(0);
});
$(".nav-element").mouseout(function(){
$(this).next(".sn-grey-opacity").hide();
$(this).next(".sn-grey-opacity").delay(150).hide(0);
});
$(".sn-grey-opacity").mouseout(function(){
$(this).hide();
$(this).delay(150).hide(0);
});
$(".sn-sub-nav").each(function(){
$(this).children(".sn-subnav-slice:last").hide();
});
});
</script>
@ -91,7 +94,7 @@
</div>
</div>
<!--导航-->
<div class="sn-row sn-bg-blue">
<div class="sn-row sn-bg-blue sn-p-relative">
<ul class="sn-nav">
<% @subfield_content.each do |field| %>
<% if is_default_field?(field) %>
@ -119,6 +122,7 @@
<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 => @org_subfield.id), :class => "sn-link-grey" %></li>
<li class="sn-subnav-slice">|</li>
<% end %>
</ul>
</div>

View File

@ -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%>");

View File

@ -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("");

View File

@ -3,3 +3,4 @@ $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organiza
: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') %>");

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" %> <!--讨论帖子-->
<% if field.field_type == "Post" || field.field_type == "Complex" || field.field_type == "Compstu" || field.field_type == "Comptec" %> <!--讨论帖子-->
<div class="homepageLeftMenuBlock">
<!--<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>-->
<% if !field.subfield_subdomain_dir.nil? %> <!--讨论帖子-->
@ -100,10 +100,14 @@
<% else %>
<%= 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 %>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<% end %>
<% if User.current.logged? and User.current.admin_of_org?(organization) && field.field_type != "Comptec" %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
<% end %>
</div>
@ -118,7 +122,6 @@
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a>
</li>
<% end %>
<% else %>
<div class="homepageLeftMenuBlock">
<% if !field.subfield_subdomain_dir.nil? %>

View File

@ -24,8 +24,9 @@
</h3>
<span class="txt-grey"><%= format_date activity.updated_at %></span>
<div class="sn-news-txt">
<p><%= activity.description.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", activity.name.to_s, student_work_index_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
</div>
<% 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 %>
<h3>
<% 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" %>
</h3>
<span class="txt-grey"><%= format_date activity.updated_on %></span>
<div class="sn-news-txt">
<p><%= activity.content.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= activity.content.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=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" %></div>
</div>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
@ -62,8 +60,10 @@
</h3>
<span class="txt-grey"><%= format_date activity.created_on %></span>
<div class="sn-news-txt">
<p><%= activity.description.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", activity.title.to_s, news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
</div>
<% elsif act.org_act_type == "Poll" %>
<% activity = Poll.find(act.org_act_id) %>
@ -86,8 +86,9 @@
</h3>
<span class="txt-grey"><%= format_date activity.published_at %></span>
<div class="sn-news-txt">
<p><%= activity.polls_description.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= activity.polls_description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
</div>
<% end %>
<% end %>
@ -116,8 +117,9 @@
</h3>
<span class="txt-grey"><%= format_date activity.updated_on %></span>
<div class="sn-news-txt">
<p><%= activity.description.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", activity.subject.to_s, issue_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
</div>
<% 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 %>
<h3>
<% 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 %>
<h3> <!--+"(帖子标题)"-->
<%= 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" %>
</h3>
<span class="txt-grey"><%= format_date activity.updated_on %></span>
<div class="sn-news-txt">
<p><%= activity.content.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= activity.content.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=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" %></div>
</div>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
@ -154,8 +153,9 @@
</h3>
<span class="txt-grey">2016-04-08</span>
<div class="sn-news-txt">
<p><%= activity.description.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
</div>
<% end %>
<% end %>
@ -190,8 +190,9 @@
</h3>
<span class="txt-grey"><%= format_date document.created_at %></span>
<div class="sn-news-txt">
<p><%= document.content.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= document.content.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
</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 %>
@ -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 %>
<h3>
<% 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 %>
<h3> <!--+"(帖子标题)"-->
<%= 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" %>
</h3>
<span class="txt-grey"><%= format_date message.created_on %></span>
<div class="sn-news-txt">
<p><%= content.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= content.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=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" %></div>
</div>
<% else %>
<div class="sn-news-bigbox fl">
@ -237,7 +235,14 @@
</h3>
<span class="txt-grey"><%= format_date message.created_on %></span>
<div class="sn-news-txt">
<p><%= content.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= content.to_s.html_safe %></div>
</div>
<div class="sn-read-more">
<% 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 %>
</div>
</div>
<% end %>
@ -256,8 +261,9 @@
</h3>
<span class="txt-grey"><%= format_date news.created_on %></span>
<div class="sn-news-txt">
<p><%= news.description.to_s.html_safe %></p>
<div class="sn-news-wrap"><%= news.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", news.title.to_s, news_path(news), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
</div>
<% end %>
<% end %>
@ -266,4 +272,14 @@
<% end %>
<% end %>
<script>
$(".sn-read-more").hide();
$(".sn-news-txt").each(function(){
var txtHeight = $(this).children().height();
if (txtHeight > 180){
$(this).next().show();
}
});
</script>

View File

@ -10,7 +10,7 @@
<% org_acts = get_subfield_acts field %>
<% unless org_acts.blank? %>
<% activity = org_acts.first %>
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
<div class="sn-index-smallbanner sn-mb20" style="display:<%= field.hide == 0?'block':'none' %>;">
<% 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 %>
</div>
<% else %>
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
<div class="sn-index-smallbanner sn-mb20" style="display:<%= field.hide == 0?'block':'none' %>;">
<a href="javascript:void(0);" target="_blank" ><img src="/images/default_blank/right-03.jpg" width="369" height="169" alt=""/></a>
</div>
<% end %>
<% elsif field.field_type == "Resource" %>
<% org_attachs = get_attach_org2(field) %>
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
<div class="sn-index-smallbanner sn-mb20" style="display:<%= field.hide == 0?'block':'none' %>;">
<% 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" %>

View File

@ -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 %>
<p class="fl sn-index-txt sn-w229"><%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></p>
<p class="fl sn-index-txt sn-w229"><%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %></p>
<p class="fl sn-f12 sn-read-all" style="display:none;"><%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2" %></p>
<div class="cl"></div>
</div>
<% 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 %>
<p class="fl sn-index-txt sn-w229"><%=link_to message.content.to_s.html_safe, board_message_url_in_org(message.board.id, message.id), :target => "_blank" %></p>
<p class="fl sn-f12 sn-read-all" style="display:none;"><%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2" %></p>
<div class="cl"></div>
</div>
<% 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 %>
<p class="fl sn-index-txt sn-w229"><%=link_to message.content.to_s.html_safe, board_message_path(message.board, activity), :target => "_blank" %></p>
<p class="fl sn-f12 sn-read-all" style="display:none;"><%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2" %></p>
<div class="cl"></div>
</div>
<% 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 %>
<p class="fl sn-index-txt sn-w229"><%=link_to news.description.to_s.html_safe, news_path(news), :target => "_blank" %></p>
<p class="fl sn-f12 sn-read-all" style="display:none;"><%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2" %></p>
<div class="cl"></div>
</div>
<% end %>
@ -96,3 +100,12 @@
</div>
<% end %>
<% end %>
<script>
$(".sn-index-txt").each(function(){
var wholeHeight = $(this).children().height();
if (wholeHeight > 54){
$(this).next().show();
}
});
</script>

View File

@ -0,0 +1,33 @@
<% unless excellent_teachers.count == 0 %>
<div class="sn-teacher-wrap" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title sn-mb5"><%= field.name %>
<%= link_to "更多", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => field.id), :target => "_blank", :class => "more" %>
</h2>
<% excellent_teachers.each do |teacher| %>
<div class="sn-teacher-list">
<%= 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' %>
<!--<a href="javascript:void(0);" target="_blank"><img src="images/avatar_default.png" width="60" height="60" style="display:block;" class="sn-fl" /></a>-->
<div class="sn-teacher-info">
<%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "sn-teacher-name sn-hidden", :title => '', :target => '_blank' %></a>
<span class="sn-teacher-unit sn-hidden" title="<%= teacher.my_workplace %>"><%= teacher.my_workplace %></span> </div>
<div class="sn-teacher-social">
<% unless teacher.my_blogs_count == 0 %>
<span class="sn-mr20">博客 <%= teacher.my_blogs_count %></span>
<% end %>
<% unless teacher.courses.count == 0 %>
<span class="sn-mr20">课程 <%= teacher.courses.count %></span>
<% end %>
<% unless teacher.my_students == 0 %>
<span>学生 <%= teacher.my_students %></span>
<% end %>
</div>
<div class="sn-cl"></div>
</div>
<% end %>
</div>
<script>
$(".sn-teacher-list:last").addClass("sn-border-none");
</script>
<% end %>

View File

@ -0,0 +1,59 @@
<% org_teachers.each do |org_teacher| %>
<% school = School.where("id =?", org_teacher.school_id).first %>
<div class="teacher-list-row">
<div>
<div class="teacher-avatar">
<%= link_to image_tag(url_to_avatar(org_teacher), :width => "90", :height => "90"), user_url_in_org(org_teacher), :alt => "用户头像" %>
</div>
<div class="fl">
<div class="ml25 mb20"><span class="teacher-name"><%=link_to org_teacher.try(:realname).nil? ? org_teacher.try(:login) : org_teacher.try(:realname), user_url_in_org(org_teacher) %></span>
<% unless school.nil? %>
<span class="f12 fontGrey2 mr15"><%= school.name %></span>
<% end %>
<% unless org_teacher.nil? %>
<span class="f12 fontGrey2"><%= org_teacher.technical_title %></span></div>
<% end %>
<div class="teacher-social-block">
<div class="block-num"><%= org_teacher.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.my_students %></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_teacher) %></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_teacher.id %>');" id="hide_<%= org_teacher.id %>"><%= org_teacher.excellent_teacher==0?"设为名师":"取消设置" %></a>
<!--<a href="javascript:void(0);" class="fr teacher-select">设为名师</a>-->
<% else %>
<!--<%# if(org_teacher.watched_by?(User.current)) %>-->
<!--<%#= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>org_teacher.id,:target_id=>org_teacher.id),:class => "fr teacher-select", :method => "delete",:remote => "true", :title => "取消关注"%>-->
<!--<%# else %>-->
<!--<%#= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>org_teacher.id,:target_id=>org_teacher.id),:class => "fr teacher-select", :method => "post",:remote => "true", :title => "添加关注"%>-->
<!--<%# end %>-->
<% end %>
</div>
<div class="cl"></div>
</div>
<% end %>
<script>
function hide(content, id){
if (content.text() == '设为名师')
$.ajax({
url: "/organizations/set_excellent_teacher?user=" + id,
type: "post"
});
else
$.ajax({
url: "/organizations/reset_excellent_teacher?user=" + id,
type: "post"
});
}
</script>

View File

@ -0,0 +1,6 @@
<% 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 %>

View File

@ -0,0 +1,36 @@
<div class="resources mt10">
<div class="function-row">
<input type="text" placeholder="搜索" class="teacher-list-search fl" />
<a href="javascript:void(0);" class="teacher-search-icon fl"></a>
<select class="teacher-search-type fr">
<option>课程数</option>
<option>学生数</option>
<option>资源数</option>
</select>
<div class="cl"></div>
</div>
<div class="teacher-list-row">
<div>
<div class="teacher-avatar"><img src="images/homepageImage.jpg" width="90" height="90" /></div>
<div class="fl">
<div class="ml25 mb20"><span class="teacher-name">尹刚</span><span class="f12 fontGrey2 mr15">国防科学技术大学</span><span class="f12 fontGrey2">教授</span></div>
<div class="teacher-social-block">
<div class="block-num">6000</div>
<div class="block-title">课程数</div>
</div>
<div class="block-slice"></div>
<div class="teacher-social-block">
<div class="block-num">500</div>
<div class="block-title">学生数</div>
</div>
<div class="block-slice"></div>
<div class="teacher-social-block">
<div class="block-num">8000</div>
<div class="block-title">资源数</div>
</div>
</div>
<a href="javascript:void(0);" class="fr teacher-select">添加</a>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -0,0 +1,22 @@
<div class="resources mt10">
<div class="function-row">
<%= form_tag( url_for(:controller => 'organizations', :action => 'teacher_search'),
: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();', :style => 'border-style:none', :class => "teacher-search-icon fl" %>
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
<% end %>
<!--<a href="javascript:" class="f_l" onclick="$('#search_student').submit();">搜索</a>-->
<!--<input type="text" placeholder="搜索" class="teacher-list-search fl" />-->
<!--<a href="javascript:void(0);" class="teacher-search-icon fl"></a>-->
<select class="teacher-search-type fr" onclick="chooseTeacherType();">
<option value="1">课程数</option>
<option value="2">学生数</option>
<option value="3">资源数</option>
</select>
<div class="cl"></div>
</div>
<div id="org_teachers_list">
<%=render 'organizations/org_teachers_list' %>
</div>
</div>

View File

@ -8,7 +8,6 @@
<li class="orgListOperation fb"><span class="mr10">操作</span></li>
<div class="cl"></div>
</ul>
<% subfields.each do |field| %>
<% if is_default_field?(field) %>
<% name = get_default_name(field) %>
@ -35,7 +34,6 @@
{ :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %>
<% end %>
<% end %>
</li>
<li class="orgListType">默认</li>
<a href="javascript:void(0);" class="linkGrey fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"隐藏":"可见" %></a>
@ -59,8 +57,8 @@
</li>
<li class="orgListStatus">新增</li>
<li class="orgListStatusList">
<% 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 %>
<div class="update_status_class"><span class="hidden"><%= subfield_list_type(field.status) %></span>
@ -68,12 +66,11 @@
</div>
<%= 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;"}) %>
{ :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %>
<% end %>
<% end %>
</li>
<li class="orgListType"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
<li class="orgListType"><%= org_subfield_type field %></li>
<li class="orgListCatalog hidden">
<% if Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 %>
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3; width:30px; margin-left:20px;" title="双击可编辑">
@ -95,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" %>
<% unless field.field_type == "Resource" || field.field_type == "Comptec" %>
<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 @@
$("#hide_<%= @ex_teacher.id %>").text("设为名师");

View File

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

View File

@ -87,6 +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 %>
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org('<%=@organization.id %>','<%= @organization.name %>', $('#organization_name'));">保存</a>
<% end %>
</div>
@ -152,10 +157,9 @@
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
<!--<li class="fl">-->
<!--<input type="radio" id="orgCom" value="Complex" name="field_type" />-->
<!--<label for="orgMeb">综合</label>-->
<!--</li>-->
<div id="org_excellent_teachers">
<%= render :partial => 'organizations/setting_excellent_teachers' %>
</div>
<li class="fr"><a href="javascript:void(0);" class="saveBtn db" onclick="add_org_subfield();">新增</a></li>
<li class="cl"></li>
</ul>

View File

@ -5,7 +5,7 @@
<% end %>
<% if params[:show_homepage].nil? and User.current.logged? %>
<div class="homepageRightBanner">
<div class="homepageRightBanner">
<div class="NewsBannerName"><%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %></div>
<% if params[:org_subfield_id].nil? %>
<ul class="resourcesSelect">
@ -44,7 +44,7 @@
</li>
</ul>
<% end %>
</div>
</div>
<% end %>
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
<script>
@ -67,3 +67,6 @@

View File

@ -0,0 +1 @@
$("#org_teachers_list").html('<%= escape_javascript( render :partial => 'organizations/org_teachers_list')%>');

View File

@ -0,0 +1,39 @@
<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_teacher_search">
<%= form_tag( url_for(:controller => 'organizations', :action => 'teachers', :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 %>
<!--<a href="javascript:" class="f_l" onclick="$('#search_student').submit();">搜索</a>-->
<!--<input type="text" placeholder="搜索" class="teacher-list-search fl" />-->
<!--<a href="javascript:void(0);" class="teacher-search-icon fl"></a>-->
<!--<select id="teacher_type_select" class="teacher-search-type fr" onclick="chooseTeacherType('<%#= @organization.id %>');">-->
<!--<option value="1">课程数</option>-->
<!--<option value="2">学生数</option>-->
<!--<option value="3">资源数</option>-->
<!--</select>-->
<div class="sn-font-grey fr">
<%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %>
</div>
<div class="cl"></div>
</div>
<div id="org_teachers_list">
<%=render 'organizations/org_teachers_list', :org_teachers => @org_teachers %>
</div>
<div>
<ul class="wlist" id="pages" style="margin-top: 15px;">
<%= pagination_links_full @atta_pages, @teachers_count, :per_page_links => false, :flag => true %>
</ul>
</div>
</div>

View File

@ -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) %>');

View File

@ -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: '<b style="font-weight:normal ">改动或增加</b>',
name: '<b style="font-weight:normal;text-align: center ">改动或增加</b>',
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) %>
},

View File

@ -43,7 +43,7 @@
</div>
</td>
<td class="tree-age c_grey">
<div class="hidden" title="<%= distance_of_time_in_words(latest_changes.time, Time.now + 8.hours) if latest_changes && latest_changes.time %>">
<div class="hidden" title="<%= format_time(latest_changes.time) %>">
<%# 为了转换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 %>

View File

@ -1,6 +1,8 @@
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
<div class="project_r_h">
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
<!--<a href="javascript:void(0);" class="btn_zipdown fr" onclick="">ZIP下载</a>-->
</div>
<div class="repository_con" style="line-height:1.9;">
<% if @entries.nil? %>

View File

@ -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}) %>");

View File

@ -14,7 +14,7 @@
<li>
<div class="sn-circle fl"></div><%=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" %>
<span class=" txt-grey fr"><%= format_date(document.created_at) %></span>
<a href="javascript:void(0)" target="_blank" class="sn-newslist-reply fr mr10">回复(<%= document.children.count %></a>
<span class="sn-newslist-reply fr mr10 txt-grey">回复(<%= document.children.count %></span>
<!--<a href="javascript:void(0)" target="_blank" class="sn-newslist-zan fr mr10">100</a>-->
<div class="cl"></div>
</li>

View File

@ -44,7 +44,7 @@
<% end %>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %></p>
</div>
<div class="ml15 mt10">
<div class="ml15 mt10 f12">
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
<span class="grayTxt">更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %></span>
<% count=0 %>

View File

@ -28,7 +28,7 @@
</form>
<div>
<ul class="wlist" id="pages" style="margin-top: 5px;">
<ul class="wlist" id="pages" style="margin-top: 15px;">
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
</ul>
</div>
@ -37,7 +37,7 @@
<!--<div id="upload_box" style="display: none">-->
<!--<%#= render :partial => 'upload_resource' ,:locals => {:user=>@user}%>-->
<!--</div>-->
<ul class="resource-list">
<ul>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" id="contextMenu">
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)preview();" onfocus="this.blur()">预览</a></li>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)rename();" onfocus="this.blur()">重命名</a></li>
@ -228,4 +228,22 @@
alert('您无法修改此资源!')
}
}
//发送至按钮控制
$("input[name='checkbox1[]']").click(function(){
if($("input[name='checkbox1[]']:checked").length >= 1){
$(".resourcesSelectSendButton").removeClass("inactive-border");
$(".resourcesSelectSendButton").mouseover(function(){
$(this).css("backgroundColor","#297fb8");
});
$(".resourcesSelectSendButton").mouseout(function(){
$(this).css("backgroundColor","#fff");
});
$(".sendButtonBlue").removeClass("inactive-text");
}else{
$(".resourcesSelectSendButton").addClass("inactive-border");
$(".sendButtonBlue").addClass("inactive-text");
$(".resourcesSelectSendButton").unbind("mouseover").unbind("mouseout");
}
});
</script>

View File

@ -5,13 +5,16 @@
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
$("input[name='subject-list-name']").click(function(){
if($("input[name='subject-list-name']:checked").length >= 1){
$("input[name='checkMenu']").click(function(){
if($("input[name='checkMenu']:checked").length >= 1){
$(".resourcesSelectSendButton").removeClass("inactive-border");
$(".resourcesSelectSendButton").mouseover(function(){
$(this).css("backgroundColor","#297fb8");
});
$(".resourcesSelectSendButton").mouseout(function(){
$(this).css("backgroundColor","#fff");
});
$(".sendButtonBlue").removeClass("inactive-text");
}else {
$(".resourcesSelectSendButton").addClass("inactive-border");
$(".sendButtonBlue").addClass("inactive-text");
}
});
});
@ -33,7 +36,7 @@
<div class="homepageContentContainer">
<div class="homepageContent">
<div class="resource-wrapper">
<div class="resource-wrapper mb10">
<ul class="resource-banner">
<li class="fl resource-switch">
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">题库</a>

View File

@ -12,8 +12,8 @@
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
<input nhname="submit_btn" type="button" class="reply_btn" value="<%=l(:button_feedback_respond) %>"/>
<%#= submit_tag l(:button_feedback_respond), :name => nil ,
<!--<input nhname="submit_btn" type="button" class="reply_btn" value="<%#=l(:button_feedback_respond) %>"/>-->
<%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "reply_btn"%>
<input nhname="cancel_btn" type="button" style="display:none;"/>
<% end %>

View File

@ -17,7 +17,7 @@ RedmineApp::Application.configure do
# config.logger.level = Logger::INFO
# Full error reports are disabled and caching is turned on
config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly
# config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly
config.action_controller.perform_caching = true
# to additional_environment.rb

View File

@ -194,36 +194,36 @@ require 'fileutils'
# end
# # e.g. "Thu Sep 22 08:51:08 GMT+9:00 2005: hello world"
#
class Logger
#具体内容请看https://bugs.ruby-lang.org/issues/7303
# Device used for logging messages.
class LogDevice
def shift_log_period(period_end)
postfix = period_end.strftime("%Y%m%d") # YYYYMMDD
age_file = "#{@filename}.#{postfix}"
if FileTest.exist?(age_file)
# try to avoid filename crash caused by Timestamp change.
idx = 0
# .99 can be overridden; avoid too much file search with 'loop do'
while idx < 100
idx += 1
age_file = "#{@filename}.#{postfix}.#{idx}"
break unless FileTest.exist?(age_file)
end
end
# @dev.close rescue nil
# File.rename("#{@filename}", age_file)
# @dev = create_logfile(@filename)
#覆盖原来lib库的方法将上边三行删除增加下边两行
FileUtils.cp(@filename, age_file)
reset_logfile(@dev) # see below for this new method return true
return true
end
#打开原来lib库新增一个方法
def reset_logfile(logdev)
logdev.truncate( 0 )
logdev.sync = true
add_log_header(logdev)
end
end
end
# class Logger
# #具体内容请看https://bugs.ruby-lang.org/issues/7303
# # Device used for logging messages.
# class LogDevice
# def shift_log_period(period_end)
# postfix = period_end.strftime("%Y%m%d") # YYYYMMDD
# age_file = "#{@filename}.#{postfix}"
# if FileTest.exist?(age_file)
# # try to avoid filename crash caused by Timestamp change.
# idx = 0
# # .99 can be overridden; avoid too much file search with 'loop do'
# while idx < 100
# idx += 1
# age_file = "#{@filename}.#{postfix}.#{idx}"
# break unless FileTest.exist?(age_file)
# end
# end
# # @dev.close rescue nil
# # File.rename("#{@filename}", age_file)
# # @dev = create_logfile(@filename)
# #覆盖原来lib库的方法将上边三行删除增加下边两行
# FileUtils.cp(@filename, age_file)
# reset_logfile(@dev) # see below for this new method return true
# return true
# end
# #打开原来lib库新增一个方法
# def reset_logfile(logdev)
# logdev.truncate( 0 )
# logdev.sync = true
# add_log_header(logdev)
# end
# end
# end

View File

@ -76,6 +76,7 @@ RedmineApp::Application.routes.draw do
get 'more_org_projects'
get 'more_org_courses'
get 'search_courses'
get 'teachers'
post 'join_course_menu'
post 'join_courses'
get 'search_projects'
@ -92,6 +93,8 @@ RedmineApp::Application.routes.draw do
get 'autocomplete_search'
post 'hide_org_subfield'
post 'show_org_subfield'
post 'set_excellent_teacher'
post 'reset_excellent_teacher'
post 'agree_apply_subdomain'
end
end
@ -523,6 +526,10 @@ RedmineApp::Application.routes.draw do
match 'courses/:course_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news'
match 'courses/:course_id/news/new', :to => 'news#new', :via => [:get, :post]
scope ":username" do
resources :posts
end
#added by young
resources :users do
collection do
@ -905,6 +912,7 @@ RedmineApp::Application.routes.draw do
get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes'
get 'projects/:id/repository/forked', :to => 'repositories#forked'
get 'projects/:id/repository/project_archive', :to => 'repositories#project_archive', :as => 'project_archive'
get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
get 'projects/:id/repository/revision', :to => 'repositories#revision'

View File

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

View File

@ -0,0 +1,5 @@
class AddAllowTeacherToOrganization < ActiveRecord::Migration
def change
add_column :organizations, :allow_teacher, :integer, :default => false
end
end

View File

@ -0,0 +1,18 @@
class DeleteEmptyApplyHomework < ActiveRecord::Migration
def up
count = ApplyHomework.all.count / 30 + 2
transaction do
for i in 1 ... count do i
ApplyHomework.page(i).per(30).each do |ah|
homework = HomeworkCommon.where("id = ?",ah.homework_common_id)
if homework.empty?
ah.destroy
end
end
end
end
end
def down
end
end

View File

@ -11,8 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160517013659) do
ActiveRecord::Schema.define(:version => 20160511055221) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
t.string "act_type", :null => false

View File

@ -137,11 +137,20 @@ class Gitlab::Client
end
alias_method :repo_commit_diff, :commit_diff
#Get the commits count of each contributor in a project
#@param [Integer] project the ID fo a project.
# Get the commits count of each contributor in a project
# @param [Integer] project the ID fo a project.
# @return [Gitlab::ObjectifiedHash]
def contributors(project)
get("/projects/#{project}/repository/contributors")
end
# Get an archive of the repository
# @param [Integer] project the ID fo a project.
# sha (optional) - The commit SHA to download defaults to the tip of the default branch
# @return [Gitlab::ObjectifiedHash]
def project_archive(project, sha)
get("/projects/#{project}/repository/archive?sha=#{sha}")
end
alias_method :repo_project_archive, :project_archive
end
end

View File

@ -5,7 +5,7 @@ PATH
rack (~> 1.5.1)
GEM
remote: https://ruby.taobao.org/
remote: https://rubygems.org/
specs:
byebug (4.0.5)
columnize (= 0.9.0)

View File

@ -119,6 +119,59 @@ class Kindeditor::AssetsController < ApplicationController
render :text => @result.to_json
end
#在KE里面复制粘贴的时候 把图片下载到服务器上
def uploadpic
picStr = params["pic"]
picArry = picStr.split("|")
#图片存放目录
dirPath = "public/files/uploads/image/"
dirDate = Time.now.strftime('%Y%m')
unless Dir.exist?("public")
Dir.mkdir("public")
end
unless Dir.exist?("public/files")
Dir.mkdir("public/files")
end
unless Dir.exist?("public/files/uploads")
Dir.mkdir("public/files/uploads")
end
unless Dir.exist?("public/files/uploads/image")
Dir.mkdir("public/files/uploads/image")
end
unless Dir.exist?(dirPath+dirDate)
Dir.mkdir(dirPath+dirDate)
end
fileStr = ""
picArry.each_with_index do |picUrl,index|
imgBaseName = File.basename(picUrl)
tmpImgType = imgBaseName.split(".").last.split("?")[0]
# 仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF
fileType = tmpImgType.match("gif|jpg|jpeg|png|bmp|BMP|JPEG|JPG|PNG|GIF")
fileName = fileType.nil? ? Time.now.to_i.to_s+index.to_s : Time.now.to_i.to_s+index.to_s+"."+fileType[0]
# fileType = File.basename(picurl).split(".").last[0..2]
# fileName = Time.now.to_i.to_s+index.to_s
fileDir = dirPath + dirDate + "/"+fileName
#重点!!
begin
File.open(fileDir,'wb'){ |f| f.write(open(picUrl).read) }
fileDir = fileDir.split("public")[1]
rescue
fileDir = picUrl
end
fileStr = fileStr+fileDir + "|"
end
render :text =>fileStr
end
private
def show_error(msg)
render :text => ({:error => 1, :message => msg}.to_json)

View File

@ -2,5 +2,6 @@ Rails.application.routes.draw do
namespace :kindeditor do
post "/upload" => "assets#create"
get "/filemanager" => "assets#list"
get "/uploadpic" => "assets#uploadpic"
end
end

View File

@ -3,8 +3,7 @@
// for (var property in myObject) {
// s = s + "\n "+property +": " + myObject[property] ;
// }
// alert(s);
//}
// alert(s)
/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2013 kindsoft.net
@ -291,14 +290,14 @@ K.options = {
],
table: [
'id', 'class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
'.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
'.padding', '.margin', '.border','.border-color', 'bgcolor', '.text-align', '.color', '.background-color',
'.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
'.width', '.height', '.border-collapse'
'.width', '.height', '.border-collapse','.table-layout'
],
'td,th': [
'id', 'class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
'.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
'.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
'.font-style', '.text-decoration', '.vertical-align', '.background', '.border', '.text-overflow','.overflow','.white-space'
],
a : ['id', 'class', 'href', 'target', 'name'],
embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
@ -737,6 +736,8 @@ function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
html = html.replace(/\u200B/g, '');
html = html.replace(/\u00A9/g, '&copy;');
html = html.replace(/\u00AE/g, '&reg;');
html = html.replace(/\u2003/g, '&emsp;');
html = html.replace(/\u3000/g, '&emsp;');
html = html.replace(/<[^>]+/g, function($0) {
return $0.replace(/\s+/g, ' ');
});
@ -3788,6 +3789,7 @@ _extend(KEdit, KWidget, {
} else {
val = body.innerHTML;
}
//yk
if (self.beforeGetHtml) {
val = self.beforeGetHtml(val);
}
@ -5994,7 +5996,24 @@ _plugin('core', function(K) {
html = html.replace(/\n/g, '<br />$&');
}
}
// var kePasteContainer = document.getElementById("ke_paste");
// if (kePasteContainer == null) {
// kePasteContainer = document.createElement("div");
// kePasteContainer.id = "ke_paste";
// var last=document.body.lastChild;//得到页面的最后个元素
// document.body.insertBefore(kePasteContainer,last);//在得到的最后元素之前插入
// }
// kePasteContainer.innerHTML = html;
// $("#ke_paste").hide();
//
// var imglist = $("#ke_paste").find("img");
//
// if (imglist.length > 0){
// df(self);
// }
self.insertHtml(html, true);
df(self);
}
K(doc.body).bind('paste', function(e){
if (self.pasteType === 0) {

View File

@ -1,8 +1,8 @@
// Generated by CoffeeScript 1.9.0
/*
paste.js is an interface to read data ( text / image ) from clipboard in different browsers. It also contains several hacks.
https://github.com/layerssss/paste.js
paste.js is an interface to read data ( text / image ) from clipboard in different browsers. It also contains several hacks.
https://github.com/layerssss/paste.js
*/
(function() {
@ -352,3 +352,88 @@ function enablePasteImg(_editor) {
});
return;
};
//复制粘贴时把远程图片上传到服务器
function df(myself) {
// var img = $("#ke_paste").find("img");
var currele = document.activeElement;
var img = $(currele).contents().find("img");
var piccount = 0;
var sstr = "";
$(img).each(function (i) {
var that = $(this);
if(that.attr("src")) {
if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) {
piccount++;
if (i == $(img).length - 1)
sstr += that.attr("src");
else
sstr += that.attr("src") + "|";
}
}
});
uploadpic(sstr,myself);
}
function keShadow(myself)
{
var keShadowContainer = document.getElementById("ke_shadow");
if (keShadowContainer == null) {
keShadowContainer = document.createElement("div");
keShadowContainer.id = "ke_shadow";
keShadowContainer.innerHTML = "<div class='ui-widget-overlay' z-index: 1001;'></div>";
$("#ajax-modal").after(keShadowContainer);
}
var tWidth = document.body.scrollWidth;
var tHeight = document.body.scrollHeight;
$(".ui-widget-overlay").css("width", tWidth);
$(".ui-widget-overlay").css("height", tHeight);
$("#ke_shadow").show();
myself.readonly();
}
function uploadpic(piclist,myself) {
if (piclist.length == 0) return false;
$.ajax({
url: "/kindeditor/uploadpic",
data:{"pic":piclist},
type: "GET",
beforeSend: function () {
// $("#ajax-indicator span").text("图片上传中请稍等...");
keShadow(myself);
},
success: function (msg) {
if (msg !== "") {
var str = new Array();
str = msg.split('|');
var currele = document.activeElement;
var img = $(currele).contents().find("img");
var tIndex = 0;
$(img).each(function (i) {
var that = $(this);
if(that.attr("src")){
if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) {
that.attr("src", str[tIndex]);
that.attr("data-ke-src", str[tIndex]);
that.removeAttr("class");
that.parent().removeAttr("class");
that.parent().removeAttr("href");
that.parent().removeAttr("data-ke-src");
tIndex = tIndex + 1;
}
}
});
}
// $("#ajax-indicator span").text("载入中...");
$("#ke_shadow").hide();
myself.readonly(false);
}
}).fail(function(xhr, status){
// $("#ajax-indicator span").text("载入中...");
$("#ke_shadow").hide();
myself.readonly(false);
return;
});
}

View File

@ -1,6 +1,6 @@
.ke-content {
font-size: 12px;
font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢ÈíÑźÚ, ËÎÌå;
font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢<EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
font-family:Tahoma;
}
.ke-content pre {
@ -49,3 +49,7 @@
.ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;}
span.at {color:#269ac9;}
span.at a{color:#269ac9;text-decoration: none;}
/*yk*/
.ke-content ol li{list-style-type: decimal;margin-left: 20px;}
.ke-content ul li{list-style-type: disc;margin-left: 20px;}

View File

@ -353,3 +353,4 @@ KindEditor.plugin('paste', function(K) {
return;
});

View File

@ -283,7 +283,7 @@ KindEditor.plugin('table', function(K) {
for (var i = 0; i < rows; i++) {
html += '<tr>';
for (var j = 0; j < cols; j++) {
html += '<td style="border:solid windowtext 1.0px; text-overflow:inherit;overflow: hidden;white-space: nowrap" >' + (K.IE ? '&nbsp;' : '<br />') + '</td>';
html += '<td style="text-overflow:inherit;overflow: hidden;white-space: nowrap" >' + (K.IE ? '&nbsp;' : '<br />') + '</td>';
}
html += '</tr>';
}

View File

@ -3,7 +3,7 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span></div>
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span><span ng-if="discussion.locked" class="locked_btn_cir ml10" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{discussion.user.realname}}</td>
@ -38,7 +38,7 @@
</div>
</div>
</div>
<div class="post-input-wrap">
<div ng-if="!discussion.locked" class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">

View File

@ -3,7 +3,7 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span></div>
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span><span ng-if="discussion.locked" class="locked_btn_cir ml10" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{discussion.user.realname}}</td>
@ -38,7 +38,7 @@
</div>
</div>
</div>
<div class="post-input-wrap">
<div ng-if="!discussion.locked" class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">

BIN
public/images/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1039,15 +1039,18 @@ function showNormalImage(id) {
var image=$(description_images[i]);
var _path = getRootPath();
//如果图片是视频图片,不处理。
if($(image).hasClass("mediaIco")){
var _src = _path+"/"+$(image).attr('src');
$(image).attr('src',_src);
return;
}
var element=$("<a></a>").attr("href",image.attr('src'));
var tmpsrc = image.attr('src');
if (tmpsrc.indexOf('.gif') >= 0 || tmpsrc.indexOf('.jpg') >= 0 || tmpsrc.indexOf('.jpeg') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.bmp') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.BMP') >= 0 || tmpsrc.indexOf('.JPEG') >= 0 || tmpsrc.indexOf('.JPG') >= 0 || tmpsrc.indexOf('.PNG') >= 0 || tmpsrc.indexOf('.GIF') >= 0) {
var element = $("<a></a>").attr("href", image.attr('src'));
image.wrap(element);
$(image).parent().colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
$(image).parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false});
}
}
//$('#'+id+' a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); //有图片才将链接变为弹出框
}

View File

@ -31,7 +31,7 @@ function sd_create_editor(params){
//params.toolbar_container.hide();
sd_check_editor_form_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
if(this.isEmpty()) {
this.edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
this.edit.html("<span id='hint' style='color:#999999;font-size:12px;'>我要回复</span>");
}
//params.toolbar_container.hide();
$('#reply_image_' + id).addClass('imageFuzzy');
@ -78,7 +78,7 @@ function sd_create_editor(params){
//reset height
paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight;
edit.iframe.height(paramsHeight);
edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
edit.html("<span id='hint' style='color:#999999;font-size:12px;'>我要回复</span>");
this.resize(null,paramsHeight);// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
// params.toolbar_container.hide();
if(typeof enableAt === 'function'){

View File

@ -49,9 +49,6 @@ function nh_check_field(params){
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
params.submit_btn.one('click', function(){
params.form.submit();
});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
@ -71,9 +68,7 @@ function init_form(params){
issubmit:true,
content:params.editor,
contentmsg:params.contentmsg,
textarea:params.textarea,
submit_btn:params.submit_btn,
form:params.form
textarea:params.textarea
});
if(is_checked){
if(flag){
@ -120,7 +115,7 @@ function init_KindEditor_data(id){
params.cancel_btn.click(function () {
nh_reset_form(params);
});
params.submit_btn.one('click', function () {
params.submit_btn.click(function () {
params.form.submit();
});
params.textarea.data('init', 1);

View File

@ -75,3 +75,37 @@ function search_tag_attachment(url,tag_name,q,course_id,sort)
}
}
// 教师选项
var sendType = '1';
var lastSendType ;//初始为发送到我的课程
function chooseTeacherType(org_id){
sendType = $("#teacher_type_select").val();
if (sendType === lastSendType) {
alert("666");
return;
} else if(lastSendType != null) { //不是第一次点击的时候
if (sendType == '1') {
alert("te");
$.ajax({
type: 'get',
url: '/organizations/' + org_id + '/teachers',
data:{type:"teachers"}
});
} else if(sendType == '2') {
alert(org_id);
$.ajax({
type: 'get',
url: '/organizations/' + org_id + '/teachers',
data:{type:"students"}
});
}else if(sendType == '3'){
$.ajax({
type: 'get',
url: '/organizations/' + org_id + '/teachers',
data:{type:"resources"}
});
}
}
lastSendType = sendType;
}

View File

@ -134,12 +134,14 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostDes {float:left; width:655px; margin-left:15px;}
.homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;}
.homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;}
.homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;}
.homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;}
.homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;}
.homepagePostSubmit:hover {background-color:#d8d8d8;}
.homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;}
.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
@ -181,6 +183,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;}
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;}
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
@ -1122,6 +1125,9 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;}
.postDetailDes ul li{list-style-type: disc;margin-left: 20px;}
.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}

View File

@ -76,6 +76,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
.ml15{ margin-left:15px;}
.ml20{ margin-left:20px;}
.ml24{margin-left:24px;}
.ml25{margin-left:25px;}
.ml36{ margin-left:36px; }
.ml40{ margin-left:40px;}
.ml45{ margin-left:45px;}
@ -426,7 +427,6 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;}
.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #269ac9; border-radius:5px; }
a.sendButtonBlue {color:#269ac9;}
a.sendButtonBlue:hover {color:#ffffff;}
.resourcesSelectSendButton:hover {background-color:#297fb8;}
.db {display:block !important;}
.dropdown-menu {
@ -680,7 +680,11 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;}.borderBottomNone {border-bottom:none !important;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;}
.borderBottomNone {border-bottom:none !important;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
.borderBottomNone {border-bottom:none !important;}
.topBorder {border-top: 1px solid #e4e4e4;}
div.minHeight48{min-height: 48px;}
.homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:15px;}

View File

@ -160,3 +160,21 @@ a.blue-btn {
cursor: pointer;
text-align: center;
}
/*名师榜20160505*/
.function-row {border-bottom:1px dashed #b2b2b2; padding-bottom:16px;}
.teacher-list-search {width:310px; height:23px; border:1px solid #ccc; border-right:none; outline:none;}
.teacher-search-icon {background:url(../images/search.png) 0 3px no-repeat; width:25px; height:25px; border:1px solid #ccc; border-left:none; cursor:pointer;}
.teacher-search-type {width:84px; height:23px; border:1px solid #ccc; outline:none;}
.teacher-list-row {border-bottom:1px dashed #b2b2b2; padding:18px 0;}
.teacher-avatar {float:left;}
.teacher-name {font-size:18px; color:#333; margin-right:15px;}
.teacher-social-block {width:90px; float:left; text-align:center;}
.block-num {font-size:16px; color:#000;}
.block-title {font-size:12px; color:#999;}
.block-slice {width:1px; height:40px; background-color:#e0e0e0; float:left; margin-top:3px;}
.teacher-intro {font-size:13px; color:#999; line-height:24px; height:72px; overflow:hidden;}
a.teacher-select {font-size:13px; color:#fff; padding:3px 18px; background-color:#269ac9;}
a.teacher-select:hover {background-color:#297fb8;}
a.follow-button {font-size:13px; color:#272727; padding:3px 5px; background-color:#f2efef;}
a.follow-button:hover {background-color:#c1c1c1;}

View File

@ -14,6 +14,7 @@ a:hover,a:active{color:#24366e;}
.sn-cl {clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
.sn-container {width:100%; background-color:#fff;}
.sn-p-absolute {position:absolute;}
.sn-p-relative {position:relative;}
.sn-grey-opacity {background:rgba(230, 230, 230, 0.9)!important; filter:Alpha(opacity=90); background:#e6e6e6;}
.sn-border {border-top:1px solid #dfdfdf; border-bottom:1px solid #dfdfdf;}
/* 公共 */
@ -32,7 +33,7 @@ a:hover,a:active{color:#24366e;}
.sn-font-grey3 {color:#999;}
a.sn-link-blue {color:#24366e;}
a.sn-link-white {color:#fff;}
a.sn-link-grey {color:#999;}
a.sn-link-grey {color:#666;}
a.sn-link-grey:hover {color:#24366e;}
a.sn-link-grey2 {color:#888;}
a.sn-link-select {color:#809df9;}
@ -47,11 +48,13 @@ a.sn-link-select {color:#809df9;}
.sn-mt13 {margin-top:13px;}
.sn-mt15 {margin-top:15px;}
.sn-mt28 {margin-top:28px;}
.sn-mb20 {margin-bottom:20px;}
.sn-mb40 {margin-bottom:40px;}
.sn-ml15 {margin-left:15px;}
.sn-ml20 {margin-left:20px;}
.sn-ml55 {margin-left:55px;}
.sn-mr0 {margin-right:0px !important;}
.sn-mr20 {margin-right:20px;}
.sn-mr50 {margin-right:50px;}
.sn-w229 {width:229px;}
/*头部样式*/
@ -66,11 +69,11 @@ a.sn-link-select {color:#809df9;}
.sn-logo {width:1200px; height:90px; line-height:90px; margin:0 auto; vertical-align:middle;position:relative;}
.sn-search-input {width:328px; height:40px; font-size:16px; color:#ccc; padding-left:10px; border:1px solid #ccc; border-right:none; float:right; background-color:#fff; outline:none;}
a.sn-search-button {width:53px; height:40px; border:1px solid #ccc; border-left:none; float:right; outline:none; background:url(../images/sn_search_icon.jpg) 0 3px no-repeat;}
.sn-nav {width:1200px; height:55px; margin:0 auto; font-size:16px; position:relative; line-height:1; overflow:hidden;}
.sn-nav {width:1200px; height:55px; margin:0 auto; font-size:16px; line-height:1; overflow:hidden;}
.nav-element-default, .nav-element {float:left; padding-top:11px; padding-bottom:12px; margin-right:50px;}
.nav-element-default a, .nav-element a {display:inline-block; padding:8px 6px; border-radius:5px;}
.nav-element-default a:hover, .nav-element a:hover {background-color:#809df9;}
.sn-subnav-position {position:fixed; left:0; top:203px; z-index:99;}
.sn-subnav-position {position:absolute; left:0; top:55px; z-index:99;}
.sn-sub-nav {width:1200px; margin:0 auto; font-size:14px; position:relative; line-height:1;}
.sn-sub-nav li {color:#999; float:left;}
.sn-sub-nav li a {height:40px; line-height:40px; vertical-align:middle; margin:0 5px; padding:0 5px; display:inline-block;}
@ -238,11 +241,16 @@ ul.sn-inner-pages li a:hover{ background-color:#24366e; color:#fff; text-decorat
/*名师榜*/
.sn-teacher-list {margin:0 20px; padding:15px 0; border-bottom:1px solid #e9e9e9;}
a.sn-teacher-name {width:75px; font-size:18px; color:#777; float:left;}
.sn-teacher-unit {width:154px; font-size:14px; color:#999; float:left; margin-left:15px; margin-top:3px;}
a.sn-teacher-name {width:60px; font-size:18px; color:#777; float:left;}
.sn-teacher-unit {width:169px; font-size:14px; color:#999; float:left; margin-left:15px; margin-top:3px;}
.sn-teacher-info {height:30px; line-height:30px; vertical-align:middle; float:left; margin-left:15px;}
.sn-teacher-social {height:30px; line-height:30px; vertical-align:middle; float:left; color:#999; font-size:12px; margin-left:15px;}
.sn-border-none {border:none;}
.sn-teacher-block {width:163px; height:222px; border-right:1px solid #e5e7ec; margin:40px 0 24px 0; float:left;}
.sn-teacher-avatar2 {margin:0 18px; padding:18px 0;}
.sn-teacher-info2 {color:#666; text-align:center; font-size:16px;}
.sn-info2-hidden {width:153px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0 auto;}
.sn-avatar-circle {border-radius:50%;}
/*弹框*/
.upload_con h2 {

View File

@ -973,6 +973,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
}
.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.topBorder {
border-top: 1px solid #E4E4E4;
}
@ -1111,6 +1112,9 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;}
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;}
.postDetailDes ul li{list-style-type: disc;margin-left: 20px;}
.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}

View File

@ -605,6 +605,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;}
.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
@ -640,6 +641,7 @@ a.postReplyCancel:hover {color:#ffffff;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;}
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;}
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#15bccf;}
@ -928,7 +930,6 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;}
.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #269ac9; border-radius:5px; }
a.sendButtonBlue {color:#269ac9;}
a.sendButtonBlue:hover {color:#ffffff;}
.resourcesSelectSendButton:hover {background-color:#297fb8;}
.db {display:block !important;}
.dropdown-menu {
@ -976,8 +977,8 @@ a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-r
.AgreementTxt{text-indent:2em; margin-bottom:15px;}
.AgreementImg{ margin:0px auto;}
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
.list_style ul li{list-style-type: disc;margin-left: 20px;}
.list_style ol li{list-style-type:decimal; margin-left:20px;}
.list_style ul li{list-style-type:disc; margin-left:20px;}
/* @功能 定义 */
span.at {color:#269ac9;}

View File

@ -495,7 +495,6 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;}
.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; margin-top:5px; margin-right:10px; margin-left:15px; text-align:center; border:1px solid #15bccf; border-radius:5px; float:right;}
a.sendButtonBlue {color:#15bccf;}
a.sendButtonBlue:hover {color:#ffffff;}
.resourcesSelectSendButton:hover {background-color:#15bccf;}
.db {display:block !important;}
.dropdown-menu {

View File

@ -288,3 +288,6 @@ li.commit .commit-row-info .committed_ago {
color: #7F7F7F;
}
.rep_mail_name{max-width: 150px; overflow: hidden; text-overflow: ellipsis;}
a.btn_zipdown{ display:block; height:25px; width:80px; text-align: center; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);
color: #7f7f7f; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-top: 7px; margin-right: 5px;}
a:hover.btn_zipdown{color:#269ac9;}

View File

@ -77,3 +77,6 @@ a.underline {text-decoration:underline;}
.loading-box {position:absolute; top:50%; background:white; width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;}
.loading-box img {margin-top: 3px; text-align: center;}
.loading-box span {display: block; font-size:12px;}
/*帖子锁定样式*/
.locked_btn_cir {background: url("/images/locked.png") 0 0 no-repeat; cursor: default;}