Merge branch 'szzh' into sw_new_course
Conflicts: db/schema.rb
This commit is contained in:
commit
dd148fb7c5
|
@ -0,0 +1,3 @@
|
|||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
|
@ -0,0 +1,3 @@
|
|||
// Place all the styles related to the org_courses controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -29,6 +29,30 @@ class CoursesController < ApplicationController
|
|||
before_filter :require_login, :only => [:join, :unjoin]
|
||||
#before_filter :allow_join, :only => [:join]
|
||||
|
||||
#查找组织
|
||||
def search_public_orgs_not_in_course
|
||||
condition = '%%'
|
||||
if !params[:name].nil?
|
||||
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||
end
|
||||
course_org_ids = OrgCourse.find_by_sql("select distinct organization_id from org_courses where course_id = #{params[:id]}").map(&:organization_id)
|
||||
if course_org_ids.empty?
|
||||
@orgs_not_in_course = Organization.where("(is_public or creator_id =?) and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(10)
|
||||
@org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count
|
||||
else
|
||||
course_org_ids = "(" + course_org_ids.join(',') + ")"
|
||||
@orgs_not_in_course = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(10)
|
||||
@org_count = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count
|
||||
end
|
||||
# @course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count
|
||||
@orgs_page = Paginator.new @org_count, 10,params[:page]
|
||||
@hint_flag = params[:hint_flag]
|
||||
#render :json => {:orgs => @orgs_not_in_course, :count => @org_count}.to_json
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def join
|
||||
if User.current.logged?
|
||||
cs = CoursesService.new
|
||||
|
|
|
@ -24,7 +24,7 @@ class FilesController < ApplicationController
|
|||
before_filter :auth_login1, :only => [:index]
|
||||
before_filter :logged_user_by_apptoken,:only => [:index]
|
||||
before_filter :find_project_by_project_id#, :except => [:getattachtype]
|
||||
before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment]
|
||||
before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment]
|
||||
|
||||
helper :sort
|
||||
include SortHelper
|
||||
|
|
|
@ -20,11 +20,11 @@ class IssuesController < ApplicationController
|
|||
default_search_scope :issues
|
||||
|
||||
before_filter :authorize1, :only => [:show]
|
||||
before_filter :find_issue, :only => [:show, :edit, :update,:add_journal]
|
||||
before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org]
|
||||
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
|
||||
before_filter :find_project, :only => [:new, :create, :update_form]
|
||||
#before_filter :authorize, :except => [:index, :show]
|
||||
before_filter :authorize, :except => [:index,:add_journal]
|
||||
before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org]
|
||||
|
||||
before_filter :find_optional_project, :only => [:index]
|
||||
before_filter :check_for_default_issue_status, :only => [:new, :create]
|
||||
|
@ -397,6 +397,23 @@ class IssuesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def add_journal_in_org
|
||||
if User.current.logged?
|
||||
jour = Journal.new
|
||||
jour.user_id = User.current.id
|
||||
jour.notes = params[:notes]
|
||||
jour.journalized = @issue
|
||||
jour.save
|
||||
org_activity = OrgActivity.where("org_act_type='Issue' and org_act_id =#{@issue.id}").first
|
||||
org_activity.updated_at = jour.created_on
|
||||
org_activity.save
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_project
|
||||
|
|
|
@ -174,6 +174,11 @@ class MessagesController < ApplicationController
|
|||
user_activity.updated_at = Time.now
|
||||
user_activity.save
|
||||
end
|
||||
org_activity = OrgActivity.where("org_act_type='Message' and org_act_id =#{@topic.id}").first
|
||||
if org_activity
|
||||
org_activity.updated_at = Time.now
|
||||
org_activity.save
|
||||
end
|
||||
#@topic.update_attribute(:updated_on, Time.now)
|
||||
if !@reply.new_record?
|
||||
if params[:asset_id]
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
class OrgCoursesController < ApplicationController
|
||||
def create
|
||||
org_ids = params[:orgNames]
|
||||
@course = Course.find(params[:course_id])
|
||||
org_ids.each do |org_id|
|
||||
OrgCourse.create(:organization_id => org_id.to_i, :course_id => params[:course_id].to_i, :created_at => Time.now)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@course = Course.find(params[:course_id])
|
||||
@org_course = OrgCourse.find(params[:id])
|
||||
@org_course.destroy
|
||||
end
|
||||
end
|
|
@ -12,7 +12,7 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
@org_document_comment.title = params[:org_document_comment][:title]
|
||||
@org_document_comment.content = params[:org_document_comment][:content]
|
||||
if @org_document_comment.save
|
||||
#flash[:notice] = 'success'
|
||||
flash.keep[:notice] = l(:notice_successful_create)
|
||||
OrgActivity
|
||||
redirect_to organization_org_document_comments_path(@organization)
|
||||
else
|
||||
|
@ -20,15 +20,23 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
end
|
||||
end
|
||||
def show
|
||||
|
||||
@document = OrgDocumentComment.find(params[:id])
|
||||
end
|
||||
|
||||
def index
|
||||
@documents = @organization.org_document_comments.where("parent_id is null").order("created_at desc")
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@documents = @organization.org_document_comments.where("parent_id is null").order("created_at desc")
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
def update
|
||||
@org_document = OrgDocumentComment.find(params[:id])
|
||||
@org_document.update_attributes(:title => params[:org_document_comment][:title], :content => params[:org_document_comment][:content])
|
||||
if @org_document.parent.nil?
|
||||
act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first
|
||||
act.update_attributes(:updated_at => @org_document.updated_at)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html {redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)}
|
||||
end
|
||||
|
@ -41,12 +49,24 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
|
||||
def add_reply
|
||||
@document = OrgDocumentComment.find(params[:id]).root
|
||||
@act = OrgActivity.find(params[: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
|
||||
@document.save
|
||||
end
|
||||
|
||||
def add_reply_in_doc
|
||||
@document = OrgDocumentComment.find(params[:id]).root
|
||||
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
|
||||
@comment.content = params[:org_comment][:org_content]
|
||||
@document.children << @comment
|
||||
@document.save
|
||||
respond_to do |format|
|
||||
format.html {redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)}
|
||||
end
|
||||
end
|
||||
|
||||
def find_organization
|
||||
@organization = Organization.find(params[:organization_id])
|
||||
end
|
||||
|
@ -59,5 +79,66 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
org.home_id == nil
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def delete_reply
|
||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||
@document = @org_document_comment.root
|
||||
org = @org_document_comment.organization
|
||||
@org_document_comment.destroy
|
||||
respond_to do |format|
|
||||
format.html {redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)}
|
||||
end
|
||||
end
|
||||
def quote
|
||||
@org_comment = OrgDocumentComment.find(params[:id])
|
||||
@subject = @org_comment.content
|
||||
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
||||
|
||||
@content = "> #{ll(Setting.default_language, :text_user_wrote, User.find(@org_comment.creator_id).realname)}\n> "
|
||||
@temp = OrgDocumentComment.new
|
||||
#@course_id = params[:course_id]
|
||||
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, User.find(@org_comment.creator_id).realname)} <br/>#{@org_comment.content.html_safe}</blockquote>".html_safe
|
||||
respond_to do | format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def reply
|
||||
@document = OrgDocumentComment.find(params[:id]).root
|
||||
@quote = params[:quote][:quote]
|
||||
@org_document = OrgDocumentComment.new(:creator_id => User.current.id, :reply_id => params[:id])
|
||||
|
||||
# params[:blog_comment][:sticky] = params[:blog_comment][:sticky] || 0
|
||||
# params[:blog_comment][:locked] = params[:blog_comment][:locked] || 0
|
||||
@org_document.title = params[:org_document_comment][:title]
|
||||
@org_document.content = params[:org_document_comment][:content]
|
||||
@org_document.content = @quote + @org_document.content
|
||||
#@org_document.title = "RE: #{@article.title}" unless params[:blog_comment][:title]
|
||||
@document.children << @org_document
|
||||
# @user_activity_id = params[:user_activity_id]
|
||||
# user_activity = UserActivity.where("act_type='BlogComment' and act_id =#{@article.id}").first
|
||||
# if user_activity
|
||||
# user_activity.updated_at = Time.now
|
||||
# user_activity.save
|
||||
# end
|
||||
# attachments = Attachment.attach_files(@org_document, params[:attachments])
|
||||
# render_attachment_warning_if_needed(@org_document)
|
||||
#@article.save
|
||||
# redirect_to user_blogs_path(:user_id=>params[:user_id])
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
# if params[:course_id] #如果呆了course_id过来了,那么这是要跳到课程大纲去的
|
||||
# redirect_to syllabus_course_path(:id=>params[:course_id])
|
||||
# else
|
||||
redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)
|
||||
# end
|
||||
|
||||
}
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,6 @@ class OrgProjectsController < ApplicationController
|
|||
@project = Project.find(params[:project_id])
|
||||
org_ids.each do |org_id|
|
||||
OrgProject.create(:organization_id => org_id.to_i, :project_id => params[:project_id].to_i, :created_at => Time.now)
|
||||
p 1
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
@ -14,18 +13,5 @@ class OrgProjectsController < ApplicationController
|
|||
@project = Project.find(params[:project_id])
|
||||
@org_project = OrgProject.find(params[:id])
|
||||
@org_project.destroy
|
||||
|
||||
condition = '%%'
|
||||
project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[:project_id]}").map(&:organization_id)
|
||||
if project_org_ids.empty?
|
||||
@orgs_not_in_project = Organization.where("(is_public or creator_id =?) = 1 and name like ?",User.current.id, condition).page( 1).per(10)
|
||||
@org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count
|
||||
else
|
||||
project_org_ids = "(" + project_org_ids.join(',') + ")"
|
||||
@orgs_not_in_project = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page( 1).per(10)
|
||||
@org_count = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count
|
||||
end
|
||||
# @project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count
|
||||
@orgs_page = Paginator.new @org_count, 10,1
|
||||
end
|
||||
end
|
||||
|
|
|
@ -56,13 +56,29 @@ class OrganizationsController < ApplicationController
|
|||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@organization = Organization.find(params[:id])
|
||||
project_ids = @organization.projects.map(&:id) << 0
|
||||
@org_activities = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and container_id in (#{project_ids.join(',')}))",
|
||||
@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
@org_activities_count = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and container_id in (#{project_ids.join(',')}))" ,
|
||||
@organization.id, 'Organization ').count
|
||||
# @org_project_activties = ForgeActivity.where("project_id in (#{project_ids.join(',')}) and forge_act_type in('Issue','Message','ProjectCreateInfo')").order("updated_at desc").page(params[:page] || 1).per(10)
|
||||
# @org_project_activties_count = ForgeActivity.where('project_id in (?)',project_ids.join(',')).count
|
||||
#@org_activities = paginateHelper @org_activities, 10
|
||||
course_ids = @organization.courses.map(&:id) << 0
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
case params[:type]
|
||||
when nil
|
||||
@org_activities = OrgActivity.where("(container_id =? and container_type =?) " +
|
||||
"or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')})) "+
|
||||
"or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))",
|
||||
@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'project_issue'
|
||||
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Issue' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'project_message'
|
||||
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Message' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'org'
|
||||
@org_activities = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_homework'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'HomeworkCommon' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_news'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'News' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_message'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Message' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'course_poll'
|
||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
end
|
||||
@page = params[:page]
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
@ -135,13 +151,26 @@ class OrganizationsController < ApplicationController
|
|||
end
|
||||
|
||||
def members
|
||||
@members = OrgMember.where("organization_id =?", @organization.id)
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@members = OrgMember.where("organization_id =?", @organization.id)
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
def more_org_projects
|
||||
@organization = Organization.find params[:id]
|
||||
@page = params[:page]
|
||||
@org_projects = @organization.org_projects.reorder('created_at').page((params[:page].to_i || 1) +1).per(5)
|
||||
@org_projects = @organization.projects.reorder('created_at').page((params[:page].to_i || 1) +1).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def more_org_courses
|
||||
@organization = Organization.find(params[:id])
|
||||
@page = params[:page]
|
||||
@org_courses = @organization.courses.reorder('created_at').page((params[:page].to_i || 1) + 1 ).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -86,6 +86,7 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
# @project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count
|
||||
@orgs_page = Paginator.new @org_count, 10,params[:page]
|
||||
@no_roll_hint = params[:hint_flag]
|
||||
#render :json => {:orgs => @orgs_not_in_project, :count => @org_count}.to_json
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
module OrgCoursesHelper
|
||||
end
|
|
@ -18,6 +18,8 @@ class Course < ActiveRecord::Base
|
|||
:conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE})"
|
||||
has_many :principals, :through => :member_principals, :source => :principal
|
||||
has_many :users, :through => :members
|
||||
has_many :org_courses
|
||||
has_many :organizations, :through => :org_courses
|
||||
# has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
# has_many :homework_for_courses, :dependent => :destroy
|
||||
|
|
|
@ -5,8 +5,8 @@ class CourseActivity < ActiveRecord::Base
|
|||
belongs_to :course
|
||||
belongs_to :user
|
||||
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
|
||||
after_save :add_user_activity
|
||||
before_destroy :destroy_user_activity
|
||||
after_save :add_user_activity, :add_course_activity
|
||||
before_destroy :destroy_user_activity, :destroy_org_activity
|
||||
|
||||
#在个人动态里面增加当前动态
|
||||
def add_user_activity
|
||||
|
@ -30,8 +30,34 @@ class CourseActivity < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def add_course_activity
|
||||
org_activity = OrgActivity.where("org_act_type = '#{self.course_act_type.to_s}' and org_act_id = '#{self.course_act_id}'").first
|
||||
if org_activity
|
||||
org_activity.save
|
||||
else
|
||||
if self.course_act_type == 'Message' && !self.course_act.parent_id.nil?
|
||||
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.course_act.parent.id}").first
|
||||
org_activity.created_at = self.created_at
|
||||
org_activity.save
|
||||
else
|
||||
OrgActivity.create(:user_id => self.user_id,
|
||||
:org_act_id => self.course_act_id,
|
||||
:org_act_type => self.course_act_type,
|
||||
:container_id => self.course_id,
|
||||
:container_type => 'Course',
|
||||
:created_at => self.created_at,
|
||||
:updated_at => self.updated_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy_user_activity
|
||||
user_activity = UserActivity.where("act_type = '#{self.course_act_type.to_s}' and act_id = '#{self.course_act_id}'")
|
||||
user_activity.destroy_all
|
||||
end
|
||||
|
||||
def destroy_org_activity
|
||||
org_activity = OrgActivity.where("org_act_type = '#{self.course_act_type.to_s}' and org_act_id = '#{self.course_act_id}'")
|
||||
org_activity.destroy_all
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ class ForgeActivity < ActiveRecord::Base
|
|||
validates :forge_act_type, presence: true
|
||||
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
|
||||
after_save :add_user_activity, :add_org_activity
|
||||
before_destroy :destroy_user_activity
|
||||
before_destroy :destroy_user_activity, :destroy_org_activity
|
||||
|
||||
#在个人动态里面增加当前动态
|
||||
def add_user_activity
|
||||
|
@ -46,17 +46,28 @@ class ForgeActivity < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def add_org_activity
|
||||
OrgActivity.create(:user_id => self.user_id,
|
||||
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
|
||||
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
|
||||
org_activity.created_at = self.created_at
|
||||
org_activity.save
|
||||
else
|
||||
OrgActivity.create(:user_id => self.user_id,
|
||||
:org_act_id => self.forge_act_id,
|
||||
:org_act_type => self.forge_act_type,
|
||||
:container_id => self.project_id,
|
||||
:container_type => 'Project',
|
||||
:created_at => self.created_at,
|
||||
:updated_at => self.updated_at)
|
||||
end
|
||||
end
|
||||
|
||||
def destroy_user_activity
|
||||
user_activity = UserActivity.where("act_type = '#{self.forge_act_type.to_s}' and act_id = '#{self.forge_act_id}'")
|
||||
user_activity.destroy_all
|
||||
end
|
||||
|
||||
def destroy_org_activity
|
||||
org_acts = OrgActivity.where("org_act_type='#{self.forge_act_type.to_s}' and org_act_id = '#{self.forge_act_id}'")
|
||||
org_acts.destroy_all
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class OrgCourse < ActiveRecord::Base
|
||||
#attr_accessible :organization, :course, :created_at
|
||||
belongs_to :organization
|
||||
belongs_to :course
|
||||
end
|
|
@ -11,6 +11,10 @@ class OrgDocumentComment < ActiveRecord::Base
|
|||
def document_save_as_org_activity
|
||||
if(self.parent().nil?)
|
||||
self.org_acts << OrgActivity.new(:user_id => User.current.id, :container_id => self.organization.id, :container_type => 'Organization')
|
||||
else
|
||||
act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", self.root.id).first
|
||||
act.update_attributes(:updated_at => self.updated_at)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -3,7 +3,9 @@ class Organization < ActiveRecord::Base
|
|||
has_many :org_members, :dependent => :destroy
|
||||
has_many :org_projects ,:dependent => :destroy
|
||||
has_many :projects,:through => :org_projects
|
||||
has_many :courses, :through => :org_courses
|
||||
has_many :org_document_comments, :dependent => :destroy
|
||||
has_many :org_courses
|
||||
has_many :users, :through => :org_members
|
||||
validates_uniqueness_of :name
|
||||
after_create :save_as_org_activity
|
||||
|
|
|
@ -186,6 +186,7 @@ class CoursesService
|
|||
#params[:setup_time]:暂不传(貌似已经没用了)
|
||||
#params[:endup_time]: 暂不传(貌似已经没用了)
|
||||
#params[:class_period]:学时总数
|
||||
#params[:course][:publish_resource]允许学生上传资源
|
||||
def create_course(params,current_user)
|
||||
if current_user.user_extensions.identity
|
||||
@course = Course.new
|
||||
|
@ -202,6 +203,7 @@ class CoursesService
|
|||
@course.class_period = params[:class_period].to_i
|
||||
params[:course][:is_public] ? @course.is_public = 1 : @course.is_public = 0
|
||||
params[:course][:open_student] ? @course.open_student = 1 : @course.open_student = 0
|
||||
params[:course][:publish_resource] ? @course.publish_resource = 1 : @course.publish_resource = 0
|
||||
else
|
||||
|
||||
end
|
||||
|
@ -243,6 +245,7 @@ class CoursesService
|
|||
#params[:term]:学期(秋季学期或春季学期)
|
||||
#params[:time]: 年份(例:2014)
|
||||
#params[:class_period]:学时总数
|
||||
#params[:publish_resource] 允许学生上传资源 0 不允许 1 允许
|
||||
def edit_course(params,course,current_user)
|
||||
course.send(:safe_attributes=, params[:course], current_user)
|
||||
#course.safe_attributes = params[:course]
|
||||
|
@ -251,6 +254,7 @@ class CoursesService
|
|||
course.class_period = params[:class_period].to_i
|
||||
params[:course][:is_public] ? course.is_public = 1 : course.is_public = 0
|
||||
params[:course][:open_student] ? course.open_student = 1 : course.open_student = 0
|
||||
params[:course][:publish_resource] ? course.publish_resource = 1 : course.publish_resource = 0
|
||||
if course.save
|
||||
if params[:course][:is_public] == '0'
|
||||
course_status = CourseStatus.find_by_course_id(course.id)
|
||||
|
|
|
@ -50,6 +50,12 @@
|
|||
<span class="c_grey">(打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml30">
|
||||
<label >学生上传资源 :</label>
|
||||
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" />
|
||||
<span class="c_grey">(打钩为"允许学生上传资源",不打钩为"不允许学生上传资源")</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_course();" >提交</a>
|
||||
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<% if @hint_flag.nil? %>
|
||||
if($("#join_orgs_for_course input:checked").size() > 0)
|
||||
{
|
||||
alert("翻页或搜索后将丢失当前选择的用户数据");
|
||||
}
|
||||
<% end %>
|
||||
$("#search_orgs_result_list").html("");
|
||||
$("#search_orgs_result_list").append('<ul class="ml20">');
|
||||
<% @orgs_not_in_course.each do |org|%>
|
||||
link = "<li><label><input type='checkbox'class='mr5 fl mt3' name='orgNames[]' value='<%=org.id%>'/><span class='relateOrgName fl'> <%=org.name %> </span></label></li><div class='cl mt5'></div>";
|
||||
$("#search_orgs_result_list").append(link );
|
||||
<%end %>
|
||||
$("#search_orgs_result_list").append('</ul>')
|
||||
<% if @org_count > 10 %>
|
||||
$("#paginator").html(' <%= pagination_links_full @orgs_page, @org_count ,:per_page_links => true,:remote =>true,:flag=>true%>');
|
||||
$("#paginator").css("display", "block");
|
||||
<% else %>
|
||||
$("#paginator").css("display", "none");
|
||||
<% end %>
|
|
@ -10,6 +10,9 @@
|
|||
<li id="tb_2" class="hwork_normaltab" onclick="course_setting(2);">
|
||||
成员
|
||||
</li>
|
||||
<li id="tb_3" class="hwork_normaltab" onclick="course_setting(3);">
|
||||
组织
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="hwork_dis" id="tbc_01" style="padding-top: 10px;">
|
||||
|
@ -65,6 +68,12 @@
|
|||
<span class="c_grey">(打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml30">
|
||||
<label >学生上传资源 :</label>
|
||||
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" style="margin-left: 1px;"/>
|
||||
<span class="c_grey">(打钩为"允许学生上传资源",不打钩为"不允许学生上传资源")</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_edit_course(<%= @course.id%>);" >提交</a>
|
||||
<%= link_to l(:button_cancel), course_path(@course), :class => "blue_btn grey_btn fl c_white" %>
|
||||
|
@ -91,6 +100,10 @@
|
|||
<%= render :partial => "course_members" %>
|
||||
</div>
|
||||
</div><!---成员结束-->
|
||||
|
||||
<div class="hwork_undis" id="tbc_03">
|
||||
<%= render :partial => 'courses/settings/join_org' %>
|
||||
</div>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
<script type="text/javascript">
|
||||
|
@ -105,4 +118,4 @@
|
|||
}
|
||||
$("#time_selected").click(select);
|
||||
$("#term_selected").click(select);
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<ul>
|
||||
<li><span class="relatedListName fb fl">名称</span><span class="relatedListOption fb fl">操作</span></li>
|
||||
<% orgs.each do |org| %>
|
||||
<li>
|
||||
<a href="<%= organization_path(org) %>" class="relatedListName linkBlue fl"><%= org.name %></a>
|
||||
<a href="javascript:void(0);" onclick="cancel_org_course_relation(<%= OrgCourse.where(:organization_id => org.id, :course_id => course_id).first.id %>, '<%= course_id %>');"
|
||||
class = "relatedListOption fl linkGrey3">取消关联</a>
|
||||
<%#= link_to "取消关联", org_course_path(:id => OrgCourse.where(:organization_id => org.id, :course_id => course_id).first.id, :course_id => course_id),
|
||||
:method => 'delete',:remote => true, :class => "relatedListOption fl linkGrey3" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
|
@ -0,0 +1,86 @@
|
|||
<!--<div class="members_left">-->
|
||||
<!--<input type="text" id="orgs_not_course_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、昵称搜索" class="orgAddSearch mb20" />-->
|
||||
<!--<%#= javascript_tag "observeSearchfield('orgs_not_course_member_search', null, '#{ escape_javascript autocomplete_search_organizations_path(:course_id=> @course.id, :format => 'js') }')" %>-->
|
||||
<!--<div id="new_orgs_for_course">-->
|
||||
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<%= stylesheet_link_tag 'org' %>
|
||||
|
||||
<div>
|
||||
<div class="relateOrg fl">
|
||||
<span class="pic_add fl mr5 mt3"></span><span class="f14 fontBlue fl">关联组织</span>
|
||||
<div class="cl mb5"></div>
|
||||
<%= form_tag url_for(:controller => 'org_courses', :action => 'create', :course_id => @course.id), :id => 'join_orgs_for_course', :remote => true do %>
|
||||
<input type="text" name="orgs" class="searchOrg mb5 ml20" placeholder="请输入组织名称" />
|
||||
<div id="search_orgs_result_list" class="ml20"></div>
|
||||
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
|
||||
<a href="javascript:void(0);" class="saveBtn db fl ml20 mr15 mb5" onclick="course_join_org(<%= @course.id %>);">关联</a>
|
||||
<a href="javascript:void(0);" class="cancelBtn db fl" onclick="cancel_join_orgs();">取消</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="relatedList fr">
|
||||
<div class="fr mr15">
|
||||
<span class="f14 fontBlue">已关联组织</span>
|
||||
<div id="added_orgs">
|
||||
<%= render :partial => 'courses/settings/added_orgs', :locals => {:orgs => @course.organizations, :course_id => params[:id]} %>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var lastSearchCondition = '';
|
||||
var page = 1;
|
||||
var count = 0;
|
||||
var maxPage = 0;
|
||||
function search_orgs(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
page = 1;
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'courses', :action => 'search_public_orgs_not_in_course') %>'+'?name='+ e.target.value+'&page='+page,
|
||||
type:'get'
|
||||
});
|
||||
}
|
||||
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
method.tId=setTimeout(function(){
|
||||
method.call(context,e);
|
||||
},500);
|
||||
}
|
||||
|
||||
//查询组织
|
||||
$("input[name='orgs']").on('input', function (e) {
|
||||
throttle(search_orgs,window,e);
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'courses', :action => 'search_public_orgs_not_in_course') %>'+'?page=1',
|
||||
type:'get'
|
||||
});
|
||||
});
|
||||
function cancel_join_orgs() {
|
||||
$("#search_orgs_result_list").html("");
|
||||
$("#paginator").css("display", "none")
|
||||
}
|
||||
function course_join_org(courseId) {
|
||||
$.ajax({
|
||||
url: "/org_courses?" + $("#join_orgs_for_course").serialize() + "&course_id=" + courseId,
|
||||
type: "post",
|
||||
success: function (data) {
|
||||
$.ajax({
|
||||
url: "/courses/" + courseId + "/search_public_orgs_not_in_course?hint_flag=true&name=" + $("input[name='orgs']").val().trim(),
|
||||
type: "get"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
|
@ -72,7 +72,7 @@
|
|||
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %>
|
||||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||
<% end %>
|
||||
<% if is_course_teacher(User.current,@course) %> <!-- show_window('light','fade','20%','35%')-->
|
||||
<% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %> <!-- show_window('light','fade','20%','35%')-->
|
||||
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
|
||||
<p class="c_grey fr mt10 mr5">
|
||||
上传:
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
||||
|
||||
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
|
||||
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
|
||||
<% if @course.is_public? %>
|
||||
<span id="is_public_<%= file.id %>">
|
||||
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %>
|
||||
|
@ -57,7 +57,7 @@
|
|||
<div class="mt5">
|
||||
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||
<%= link_to( l(:button_delete), attachment_path(file),
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course"%>
|
||||
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
|
||||
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
|
@ -0,0 +1,12 @@
|
|||
<% courses.each do |course|%>
|
||||
<%# pro = Project.find course.course_id %>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if courses.size == 5%>
|
||||
<li class="homepageLeftMenuMore" id="show_more_org_course">
|
||||
<input type="hidden" value="<%= page%>" id="org_course_page_num">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_course('<%= more_org_courses_organization_path(org_id)%>');"></a>
|
||||
</li>
|
||||
<% end%>
|
|
@ -1,7 +1,7 @@
|
|||
<% projects.each do |project|%>
|
||||
<% pro = Project.find project.project_id %>
|
||||
<%# pro = Project.find project.project_id %>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<%= link_to pro.name, project_path(pro.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => pro.name%>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if projects.size == 5%>
|
||||
|
|
|
@ -18,6 +18,18 @@
|
|||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="<%=h body_css_classes %>" onload="prettyPrint();">
|
||||
|
||||
|
|
|
@ -21,6 +21,22 @@
|
|||
<%= javascript_include_tag "course","header","attachments",'prettify' %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!--<script type="text/javascript"-->
|
||||
<!--src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">-->
|
||||
<!--</script>-->
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<!--add by huang-->
|
||||
<body onload="prettyPrint();">
|
||||
|
@ -138,7 +154,7 @@
|
|||
<div class="subNav">
|
||||
<%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %>
|
||||
<%= link_to "(#{course_file_num})", course_files_path(@course), :class => "subnav_num c_orange",:id=>'courses_files_count_nav' %>
|
||||
<% if is_teacher %>
|
||||
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
|
||||
<!--link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white')-->
|
||||
<a class="subnav_green ml95 c_white" href="javascript:void(0);" onclick="course_files_upload();">+上传资源 </a>
|
||||
<% end %>
|
||||
|
|
|
@ -16,6 +16,18 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'base','header','new_user', :media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var desc;
|
||||
function edit_desc(){
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.span_wping{}
|
||||
|
|
|
@ -16,6 +16,18 @@
|
|||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<!--add by huang-->
|
||||
<body class="<%= h body_css_classes %>">
|
||||
|
|
|
@ -86,17 +86,25 @@
|
|||
<%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock"><a href="javascript:void(0);" class="homepageMenuText">项目</a>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a>-->
|
||||
</div>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a>-->
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses borderBottomNone">
|
||||
<ul >
|
||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>@organization.org_projects.reorder('created_at').limit(5),:org_id=>@organization.id,:page=>1}%>
|
||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>@organization.projects.reorder('created_at').limit(5),:org_id=>@organization.id,:page=>1}%>
|
||||
<!--<%#= @organization.org_projects.each do |p|%>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey"><%#= p.name%></a></li>-->
|
||||
<!--<%# end %>-->
|
||||
<!--<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li>-->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock"><a href="javascript:void(0);" class="homepageMenuText">课程</a>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a>-->
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses borderBottomNone">
|
||||
<ul >
|
||||
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>@organization.courses.reorder('created_at').limit(5),:org_id=>@organization.id,:page=>1}%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageRight">
|
||||
|
@ -112,6 +120,11 @@
|
|||
<div class="cl"></div>
|
||||
<%= render :partial => 'layouts/footer' %>
|
||||
<div class="cl"></div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -17,7 +17,18 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<!--add by huang-->
|
||||
|
|
|
@ -21,6 +21,18 @@
|
|||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="<%=h body_css_classes %>">
|
||||
|
||||
|
|
|
@ -21,6 +21,18 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function startXMLHttp()
|
||||
|
|
|
@ -22,7 +22,18 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
|
||||
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="prettyPrint();">
|
||||
|
|
|
@ -20,6 +20,18 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="<%=h body_css_classes %>">
|
||||
<div id="wrapper">
|
||||
|
|
|
@ -22,6 +22,18 @@
|
|||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="<%=h body_css_classes %>">
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -14,6 +14,18 @@
|
|||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<div class="navContainer">
|
||||
<% is_current_user = User.current.logged? && User.current == @user%>
|
||||
|
|
|
@ -17,6 +17,18 @@
|
|||
<%= javascript_include_tag "course","header",'prettify' %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<!--add by huang-->
|
||||
<body onload="prettyPrint();">
|
||||
|
|
|
@ -14,6 +14,19 @@
|
|||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="prettyPrint();">
|
||||
|
|
|
@ -17,6 +17,18 @@
|
|||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -17,6 +17,18 @@
|
|||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'base','header','new_user' ,:media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body onload="prettyPrint();">
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
$("#added_orgs").html("");
|
||||
$("#added_orgs").html('<%= escape_javascript(render :partial => "courses/settings/added_orgs", :locals => {:orgs => @course.organizations, :course_id => @course.id}) %>');
|
|
@ -0,0 +1,4 @@
|
|||
$("#added_orgs").html("");
|
||||
$("#added_orgs").html('<%= escape_javascript(render :partial => "courses/settings/added_orgs", :locals => {:orgs => @course.organizations, :course_id => @course.id}) %>');
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
|
@ -0,0 +1,31 @@
|
|||
<style type="text/css">
|
||||
/*回复框*/
|
||||
.ReplyToMessageInputContainer .ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||
.ReplyToMessageInputContainer .ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||
.ReplyToMessageInputContainer .ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||
.ReplyToMessageInputContainer .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||
.ReplyToMessageInputContainer .ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||
.ReplyToMessageInputContainer .ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||
.ReplyToMessageInputContainer .ke-outline{border:none;}
|
||||
.ReplyToMessageInputContainer .ke-inline-block{display: none;}
|
||||
.ReplyToMessageInputContainer .ke-container{float:left;}
|
||||
</style>
|
||||
|
||||
<div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="ReplyToMessageInputContainer mb10">
|
||||
<div nhname='new_message_<%= reply.id%>'>
|
||||
<%= form_for @org_comment, :as => :reply, :url => {:controller => 'org_document_comments',:action => 'reply', :id => @org_comment.id}, :method => 'post', :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||
<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||
<input type="hidden" name="org_document_comment[title]" id="reply_subject">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="org_document_comment[content]"></textarea>
|
||||
<div nhname='toolbar_container_<%= reply.id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
|
||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>");
|
||||
init_activity_KindEditor_data(<%= @document.id %>,"","87%");
|
||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document, :act => @act}) %>");
|
||||
init_activity_KindEditor_data(<%= @act.id %>,"","87%");
|
|
@ -0,0 +1 @@
|
|||
location.reload();
|
|
@ -1 +1,2 @@
|
|||
location.reload();
|
||||
//location.reload();
|
||||
window.location.href = '<%= organization_org_document_comments_path(:organization_id => @org_document_comment.root.organization_id)%>'
|
|
@ -12,17 +12,19 @@
|
|||
}
|
||||
}
|
||||
</script>
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="homepageRightBanner mb5">
|
||||
<div class="NewsBannerName">编辑文章</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id),:method => 'put', :id => 'new_org_document_form' do |f| %>
|
||||
<div class="resources">
|
||||
<div>
|
||||
<input class="postDetailInput fl mr15" style="margin-bottom:15px;" maxlength="250" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" value="<%= @org_document.title %>" />
|
||||
<input class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" value="<%= @org_document.title %>" />
|
||||
</div>
|
||||
<div id="doc_title_hint"></div>
|
||||
<div class="cl"></div>
|
||||
<div id="org_document_editor" class="mt15" style="">
|
||||
<div id="org_document_editor" >
|
||||
<div class="mt10">
|
||||
<%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org_document_description_editor', :height => "150px" %>
|
||||
</div>
|
||||
|
@ -35,10 +37,11 @@
|
|||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="org_document_description_editor.sync();$('#new_org_document_form').submit();">确定</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" onclick="$('#org_document_editor').hide(); $('#doc_title_hint').hide();" class="fr mr10 mt3">取消</a>
|
||||
<a href="javascript:void(0);" onclick="location=document.referrer;" class="fr mr10 mt3">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -16,9 +16,9 @@
|
|||
<% @documents.each do |document| %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= document.id%>, null, "87%");
|
||||
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first.id %>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %>
|
||||
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first} %>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,10 @@
|
|||
if($("#reply_message_<%= @org_comment.id%>").length > 0) {
|
||||
$("#reply_message_<%= @org_comment.id%>").replaceWith("<%= escape_javascript(render :partial => 'org_document_comments/simple_ke_reply_form', :locals => {:reply => @org_comment,:temp =>@temp,:subject =>@subject}) %>");
|
||||
$(function(){
|
||||
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
|
||||
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
||||
init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%");
|
||||
});
|
||||
}else if($("#reply_to_message_<%= @org_comment.id %>").length >0) {
|
||||
$("#reply_to_message_<%= @org_comment.id%>").replaceWith("<p id='reply_message_<%= @org_comment.id %>'></p>");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
//location.reload();
|
|
@ -0,0 +1,148 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= @document.id%>,null,"85%");
|
||||
showNormalImage('message_description_<%= @document.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="resources mt10" id="organization_document_<%= @document.id %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_path(@document.creator_id) %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to User.find(@document.creator_id), user_path(@document.creator.id), :class => "newsBlue mr15" %>
|
||||
TO <%= link_to @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %>
|
||||
|
|
||||
<% if @document.organization.home_id == @document.id %>
|
||||
<span style="color:#269ac9;">首页</span>
|
||||
<% else %>
|
||||
<span style="color:#269ac9;">组织文章</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostTitle postGrey"><%= link_to @document.title, org_document_comment_path(:id => @document.id, :organization_id => @document.organization.id) %></div>
|
||||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_activity_day(@document.created_at) %> <%= format_time(@document.created_at, false) %></div>
|
||||
<% unless @document.content.blank? %>
|
||||
<div class="homepagePostIntro">
|
||||
<%= @document.content.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- <%# if defined?(home_id) %>
|
||||
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
||||
<%# end %>-->
|
||||
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(@document.organization_id) || User.current.id == @document.creator_id) %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %>
|
||||
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id), :class => "postOptionLink" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id), :method => 'delete',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:remote => true, :class => 'postOptionLink' %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% comments_for_doc = @document.children.reorder("created_at desc") %>
|
||||
<% count = @document.children.count() %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= @document.id %>">
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
</div>
|
||||
<div class="" id="reply_div_<%= @document.id %>">
|
||||
<% comments_for_doc.each_with_index do |reply,i| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% user = User.find(reply.creator_id) %>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id %>').hide();">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_path(user) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<%= link_to User.find(reply.creator_id).realname, user_path(reply.creator_id), :class => "newsBlue mr10 f14" %>
|
||||
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe unless reply.content.nil? %>
|
||||
</div>
|
||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||
<%= format_time(reply.created_at) %>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'org_document_comments',:action => 'quote',:user_id=>reply.creator_id, :id => reply.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue',
|
||||
:title => l(:button_reply)) if User.current.logged? %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'org_document_comments',:action => 'delete_reply', :id => reply.id},
|
||||
:method => :delete,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.creator_id == User.current.id %>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id %>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% if User.current.logged?%>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||
<em class="talkWrapArrow"></em>
|
||||
<div class="cl"></div>
|
||||
<div class="talkConIpt ml5 mb10" id="reply<%= @document.id %>">
|
||||
<%= form_for :org_comment, :url => {:action => 'add_reply_in_doc',:controller => 'org_document_comments', :id => @document.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
||||
<%= f.kindeditor :org_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor' %>
|
||||
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %>
|
||||
<%= link_to l(:button_reply), "javascript:void(0)", :onclick => "message_content_editor.sync();$('#message_form').submit();", :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,6 +1,2 @@
|
|||
|
||||
$("#search_orgs_result_list").html("");
|
||||
//$("#search_orgs_result_list").append('<ul class="ml20">');
|
||||
$("#added_orgs").html("");
|
||||
$("#paginator").css("display", "none");
|
||||
$("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>')
|
|
@ -1,22 +1,4 @@
|
|||
//$("#search_orgs_result_list").html("");
|
||||
////$("#paginator").css("display", "none");
|
||||
$("#added_orgs").html("");
|
||||
$("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>')
|
||||
//$.ajax({
|
||||
// url: '<%#= url_for(:controller => 'projects', :action => 'search_public_orgs_not_in_project') %>'+'?page=1',
|
||||
// type:'get'
|
||||
//});
|
||||
$("#search_orgs_result_list").html("");
|
||||
$("#search_orgs_result_list").append('<ul class="ml20">');
|
||||
<% @orgs_not_in_project.each do |org|%>
|
||||
link = "<li><label><input type='checkbox'class='mr5 fl mt3' name='orgNames[]' value='<%=org.id%>'/><span class='relateOrgName fl'> <%=org.name %> </span></label></li><div class='cl mt5'></div>";
|
||||
$("#search_orgs_result_list").append(link );
|
||||
<%end %>
|
||||
$("#search_orgs_result_list").append('</ul>')
|
||||
<% if @org_count > 10 %>
|
||||
$("#paginator").html(' <%= pagination_links_full @orgs_page, @org_count ,:per_page_links => true,:remote =>true,:flag=>true%>');
|
||||
$("#paginator").css("display", "block");
|
||||
<% else %>
|
||||
$("#paginator").css("display", "none");
|
||||
<% end %>
|
||||
$("#added_orgs").html('<%= escape_javascript(render :partial => "projects/settings/added_orgs", :locals => {:orgs => @project.organizations, :project_id => @project.id}) %>');
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
<% unless org_activities.nil? %>
|
||||
<% org_activities.each do |act| %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= act.id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<% if act.container_type == 'Organization' %>
|
||||
<% if act.org_act_type == 'CreateOrganization' %>
|
||||
<div class="resources mt10">
|
||||
|
@ -17,12 +22,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %>
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if act.container_type == 'Project' %>
|
||||
|
@ -31,8 +31,22 @@
|
|||
<%= render :partial => 'organizations/org_project_issue', :locals => {:activity => Issue.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||
<%# when 'ProjectCreateInfo'%>
|
||||
<%#= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
<%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if act.container_type == 'Course' %>
|
||||
<% case act.org_act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%= render :partial => 'org_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id,:course_activity => 0} %>
|
||||
<% when 'News' %>
|
||||
<%= render :partial => 'org_course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'org_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'org_course_poll', :locals => {:activity => Poll.find(act.org_act_id), :user_activity_id => act.id} %>
|
||||
<% when 'Course'%>
|
||||
<%= render :partial => 'org_course_create', :locals => {:activity => Course.find(act.org_act_id), :user_activity_id => act.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.teacher), :width => "50", :height => "50"), user_path(activity.tea_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:teacher).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:teacher), user_path(activity.tea_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:teacher).try(:realname), user_path(activity.tea_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.name.to_s+" | 课程", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(activity.created_at) %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,187 @@
|
|||
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %> TO <!--+"(课程名称)" -->
|
||||
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"-->
|
||||
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
|
||||
</div>
|
||||
<% if activity.homework_detail_manual%>
|
||||
<% if activity.homework_detail_manual.comment_status == 1%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<% if Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% elsif Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
|
||||
<span class="red_homework_btn_cir ml5">作品补交中</span>
|
||||
<% end %>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 2%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="green_homework_btn_cir ml5">匿评中</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 3%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit">
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
|
||||
<%= user_for_homework_common activity,is_teacher %>
|
||||
</div>
|
||||
|
||||
<% if activity.homework_type == 2 && is_teacher%>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_type == 2%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
语言:
|
||||
<%= activity.language_name%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostDeadline">截止时间:<%= activity.end_time.to_s %> 23:59</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if is_teacher%>
|
||||
<% comment_status = activity.homework_detail_manual.comment_status %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => 0),:class => "postOptionLink", :remote => true) %>
|
||||
</li>
|
||||
<% if activity.anonymous_comment == 0 %>
|
||||
<li>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
|
||||
</li>
|
||||
<li>
|
||||
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% count=activity.journals_for_messages.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount">
|
||||
回复(<%= count %>)
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals_for_messages.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.notes.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
||||
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,140 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.course.name.to_s+" | 课程讨论区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden m_w530 fl">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if activity.sticky == 1%>
|
||||
<span class="sticky_btn_cir ml10">置顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked%>
|
||||
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostDate">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
<% else %>
|
||||
<%= activity.parent.content.to_s.html_safe%>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="topBorder" style="display: <%= count<=0 && !activity.locked ? '': 'none' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<%= count %>
|
||||
)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
<%if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% activity= activity.parent ? activity.parent : activity%>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply|%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||
<%= reply.content.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,106 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %> TO <!--+"(课程名称)"-->
|
||||
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
|
||||
</div>
|
||||
<% if activity.sticky == 1%>
|
||||
<span class="sticky_btn_cir ml10">置顶</span>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=activity.comments.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
|
||||
回复(<%= count %>)
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.comments.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.comments.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,56 @@
|
|||
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||
<% if ( activity.polls_status==2) %>
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<!-- <a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a>-->
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to Course.find(activity.polls_group_id).name.to_s+" | 问卷", poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue ml15" %>
|
||||
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
<%#= link_to activity.polls_name.to_s/*+"(问卷名称)"*/, %>
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, poll_result_poll_path(activity.id), :class => "postGrey"%>
|
||||
<% else %>
|
||||
<%= link_to poll_name, poll_path(activity.id), :class => "postGrey"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.published_at) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= activity.polls_description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -130,7 +130,23 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% project = Project.find(activity.project_id) %>
|
||||
<% project = Project.find(activity.org_act_id) %>
|
||||
<% user = User.find(project.user_id)%>
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
|
|
|
@ -95,6 +95,24 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
|
@ -11,10 +11,10 @@
|
|||
<% if document.organization.home_id == document.id %>
|
||||
<span style="color:#269ac9;">首页</span>
|
||||
<% else %>
|
||||
<span style="color:#269ac9;">组织</span>
|
||||
<span style="color:#269ac9;">组织文章</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostTitle postGrey"><%= document.title %></div>
|
||||
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
|
||||
<% unless document.content.blank? %>
|
||||
|
@ -91,16 +91,16 @@
|
|||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= document.id %>' style="display:none;">
|
||||
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="user_activity_id" value="<%= document.id %>"/>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= document.id %>' name="org_content"></textarea>
|
||||
<div nhname='new_message_<%= act.id %>' style="display:none;">
|
||||
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id), :method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
|
||||
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
|
||||
|
||||
<div nhname='toolbar_container_<%= document.id %>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= document.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
|
||||
<div nhname='toolbar_container_<%= act.id %>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
|
||||
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= document.id %>'></p>
|
||||
<p nhname='contentmsg_<%= act.id %>'></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
$("#show_more_org_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/org_courses',
|
||||
:locals => {:courses => @org_courses,:org_id => @organization, :page => @page} )%>");
|
|
@ -34,8 +34,8 @@
|
|||
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_organization();" >提交</a>
|
||||
<li class=" ml125" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_organization();" >创建</a>
|
||||
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -14,30 +14,60 @@
|
|||
</style>
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">最新动态</div>
|
||||
<!-- <ul class="resourcesSelect">
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="resourcesType">
|
||||
<li class="mt-4"><a href="javascript:void(0);" class="homepagePostTypeAll postTypeGrey">全部动态</a></li>
|
||||
<li class="mt-4"><a href="/users/8523/user_activities?type=current_user" class="homepagePostTypeMine postTypeGrey">我的动态</a> </li>
|
||||
<ul class="homepagePostType">
|
||||
<li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<li class="f14">课程动态</li>
|
||||
<li><%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
||||
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
|
||||
<li><%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
||||
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<li><%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">项目动态</li>
|
||||
<li><%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
|
||||
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">更多</li>
|
||||
<li class="mt-4"><%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>-->
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%");
|
||||
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %>
|
||||
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'organizations/org_activities',
|
||||
<% if @org_activities %>
|
||||
<%= render :partial => 'organizations/org_activities',
|
||||
:locals => {:org_activities =>@org_activities,
|
||||
:page=>@page,
|
||||
:org => @organization,
|
||||
:org_act_count=>@org_activities.count}%>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
//翻页提醒
|
||||
<% if @no_roll_hint.nil? %>
|
||||
if( $("#join_orgs_for_project input:checked").size() > 0)
|
||||
{
|
||||
alert('翻页或搜索后将丢失当前选择的用户数据!');
|
||||
}
|
||||
<% end %>
|
||||
$("#search_orgs_result_list").html("");
|
||||
$("#search_orgs_result_list").append('<ul class="ml20">');
|
||||
<% @orgs_not_in_project.each do |org|%>
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<li><span class="relatedListName fb fl">名称</span><span class="relatedListOption fb fl">操作</span></li>
|
||||
<% orgs.each do |org| %>
|
||||
<li><a href="<%= organization_path(org) %>" class="relatedListName linkBlue fl"><%= org.name %></a>
|
||||
<%= link_to "取消关联", org_project_path(:id => OrgProject.where(:organization_id => org.id, :project_id => project_id).first.id, :project_id => project_id),
|
||||
<a href = "javascript:void(0);" onclick = "cancel_relation('<%= OrgProject.where(:organization_id => org.id, :project_id => project_id).first.id %>','<%=project_id %>')" class="relatedListOption fl linkGrey3" >取消关联</a>
|
||||
<%#= link_to "取消关联", org_project_path(:id => OrgProject.where(:organization_id => org.id, :project_id => project_id).first.id, :project_id => project_id),
|
||||
:method => 'delete',:remote => true, :class => "relatedListOption fl linkGrey3" %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -7,21 +7,17 @@
|
|||
<!--</div>-->
|
||||
<%= stylesheet_link_tag 'org' %>
|
||||
|
||||
<ul class="mb10">
|
||||
<li class="orgSettingOp orgOpActive" id="orgSetting_1">组织</li>
|
||||
<li class="orgBorder" style="width:625px;"></li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<div>
|
||||
<div class="relateOrg fl">
|
||||
<span class="pic_add fl mr5 mt3"></span><span class="f14 fontBlue fl">关联组织</span>
|
||||
<div class="cl mb5"></div>
|
||||
<%= form_tag url_for(:controller => 'org_projects', :action => 'create', :project_id => @project.id), :id => 'join_orgs_for_project', :remote => true %>
|
||||
<input type="text" name="orgs" class="searchOrg mb5 ml20" placeholder="请输入组织名称" />
|
||||
<div id="search_orgs_result_list" class="ml20"></div>
|
||||
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
|
||||
<a href="javascript:void(0);" class="saveBtn db fl ml20 mr15 mb5" onclick="$('#join_orgs_for_project').submit();">关联</a>
|
||||
<a href="javascript:void(0);" class="cancelBtn db fl" onclick="cancel_join_orgs();">取消</a>
|
||||
<%= form_tag url_for(:controller => 'org_projects', :action => 'create', :project_id => @project.id), :id => 'join_orgs_for_project', :remote => true do %>
|
||||
<input type="text" name="orgs" class="searchOrg mb5 ml20" placeholder="请输入组织名称" />
|
||||
<div id="search_orgs_result_list" class="ml20"></div>
|
||||
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
|
||||
<a href="javascript:void(0);" class="saveBtn db fl ml20 mr15 mb5" onclick="join_org(<%= @project.id %>);">关联</a>
|
||||
<a href="javascript:void(0);" class="cancelBtn db fl" onclick="cancel_join_orgs();">取消</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="relatedList fr">
|
||||
<div class="fr mr15">
|
||||
|
@ -50,21 +46,6 @@
|
|||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'projects', :action => 'search_public_orgs_not_in_project') %>'+'?name='+ e.target.value+'&page='+page,
|
||||
type:'get'
|
||||
// success: function(data){
|
||||
// orgs = data.orgs;
|
||||
// count = data.count;
|
||||
// maxPage = Math.ceil(count/10);
|
||||
// $("#search_orgs_result_list").next().html("");
|
||||
// if(orgs.length != undefined && orgs.length != 0){
|
||||
// var i = 0;
|
||||
// for(; i<orgs.length; i++){
|
||||
// link = "<li><label><input type='checkbox'class='mr5 fl mt3' name='orgNames[]' value='"+ orgs[i].organization.id + "'/><span class='relateOrgName fl'>" + orgs[i].organization.name + "</span></label></li><div class='cl mt5'></div>";
|
||||
// console.log(link)
|
||||
// $("#search_orgs_result_list").next().append(link );
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -79,29 +60,27 @@
|
|||
$("input[name='orgs']").on('input', function (e) {
|
||||
throttle(search_orgs,window,e);
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'projects', :action => 'search_public_orgs_not_in_project') %>'+'?page=1',
|
||||
type:'get'
|
||||
// success: function(data){
|
||||
// orgs = data.orgs;
|
||||
// count = data.count;
|
||||
// maxPage = Math.ceil(count/10);
|
||||
// $("#search_orgs_result_list").next().html("");
|
||||
// if(orgs.length != undefined && orgs.length != 0){
|
||||
// var i = 0;
|
||||
// for(; i<orgs.length; i++){
|
||||
// link = "<li><label><input type='checkbox'class='mr5 fl mt3' name='orgNames[]' value='"+ orgs[i].organization.id + "'/><span class='relateOrgName fl'>" + orgs[i].organization.name + "</span></label></li><div class='cl mt5'></div>";
|
||||
// console.log(link)
|
||||
// $("#search_orgs_result_list").next().append(link );
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
});
|
||||
});
|
||||
function cancel_join_orgs() {
|
||||
$("#search_orgs_result_list").html("");
|
||||
$("#paginator").html("");
|
||||
$("#paginator").css("display", "none");
|
||||
}
|
||||
function join_org(projectId) {
|
||||
$.ajax({
|
||||
url: '/org_projects' + "?" + $('#join_orgs_for_project').serialize() + "&project_id=" + projectId,
|
||||
type: 'post',
|
||||
success: function (data) {
|
||||
$.ajax({
|
||||
url: '/projects/'+projectId+'/search_public_orgs_not_in_project?hint_flag=true&name='+ $("input[name='orgs']").val().trim(),
|
||||
type: 'get'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
|
@ -2,16 +2,16 @@
|
|||
<%#= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %>
|
||||
<div class="homepageContentContainer">
|
||||
<div class="homepageContent">
|
||||
<div class="postContainer">
|
||||
<div class="postContainer mb10">
|
||||
<div class="postBanner" style="padding-bottom:5px;">
|
||||
<span class="linkGrey2 f16">组织列表</span>
|
||||
|
||||
<%= form_tag url_for(:controller => 'users', :action => 'search_user_orgs', :id => User.current.id), :method => 'get', :id => "search_org_form", :class=>"resourcesSearchloadBox", :style=>"float:right; margin-top:-5px;" do %>
|
||||
<input type="text" name="search_orgs" placeholder="输入关键词进行搜索" class="problem_search_input fl"/>
|
||||
<!--<%#= form_tag url_for(:controller => 'users', :action => 'search_user_orgs', :id => User.current.id), :method => 'get', :id => "search_org_form", :class=>"resourcesSearchloadBox", :style=>"float:right; margin-top:-5px;" do %>-->
|
||||
<!--<input type="text" name="search_orgs" placeholder="输入关键词进行搜索" class="problem_search_input fl"/>-->
|
||||
|
||||
<!--<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#search_org_form').submit();"></a>-->
|
||||
<a href="javascript:void(0);" class="problem_search_btn fl" onclick="$('#search_org_form').submit();">搜索</a>
|
||||
<% end %>
|
||||
<!--<!–<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#search_org_form').submit();"></a>–>-->
|
||||
<!--<a href="javascript:void(0);" class="problem_search_btn fl" onclick="$('#search_org_form').submit();">搜索</a>-->
|
||||
<!--<%# end %>-->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div id="org_list">
|
||||
|
|
|
@ -201,7 +201,7 @@ default:
|
|||
judge_server: 'http://judge.trustie.net/'
|
||||
|
||||
# Git's url
|
||||
gitlab_address: 'http://gitfast.trustie.net'
|
||||
gitlab_address: 'http://git.trustie.net'
|
||||
|
||||
# specific configuration options for production environment
|
||||
# that overrides the default ones
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Gitlab.configure do |config|
|
||||
# config.endpoint = 'http://192.168.41.130:3000/trustie/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
|
||||
# config.private_token = 'cK15gUDwvt8EEkzwQ_63' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
|
||||
config.endpoint = 'http://gitfast.trustie.net/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
|
||||
config.private_token = 'fPc_gBmEiSANve8TCfxW' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
|
||||
config.endpoint = 'http://git.trustie.net/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
|
||||
config.private_token = 'kZUYYbAY12QSQ2Tx1zes' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
|
||||
# Optional
|
||||
# config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]'
|
||||
# config.sudo = 'user' # username for sudo mode, default: nil
|
||||
|
|
|
@ -38,6 +38,7 @@ RedmineApp::Application.routes.draw do
|
|||
put 'set_homepage'
|
||||
get 'members'
|
||||
get 'more_org_projects'
|
||||
get 'more_org_courses'
|
||||
end
|
||||
collection do
|
||||
get 'check_uniq'
|
||||
|
@ -65,6 +66,10 @@ RedmineApp::Application.routes.draw do
|
|||
resources :org_document_comments do
|
||||
member do
|
||||
post 'add_reply'
|
||||
get 'quote'
|
||||
post 'reply'
|
||||
post 'add_reply_in_doc'
|
||||
delete 'delete_reply'
|
||||
end
|
||||
collection do
|
||||
|
||||
|
@ -79,6 +84,15 @@ RedmineApp::Application.routes.draw do
|
|||
|
||||
end
|
||||
end
|
||||
|
||||
resources :org_courses do
|
||||
member do
|
||||
|
||||
end
|
||||
collection do
|
||||
|
||||
end
|
||||
end
|
||||
#match '/organizations/:organization_id/org_document_comments/new', :to => 'org_document_comments#new', :as => 'new_org_documents', :via => [:get, :post]
|
||||
#match '/organizations/:organization_id/org_document_comments/create', :to => 'org_document_comments#create', :as => 'create_org_documents', :via => [:post]
|
||||
resources :homework_users
|
||||
|
@ -653,6 +667,7 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
member do
|
||||
post 'add_journal'
|
||||
post 'add_journal_in_org'
|
||||
end
|
||||
resources :time_entries, :controller => 'timelog' do
|
||||
collection do
|
||||
|
@ -868,6 +883,7 @@ RedmineApp::Application.routes.draw do
|
|||
post 'search_course_outline'
|
||||
post 'set_course_outline'
|
||||
get 'syllabus'
|
||||
get 'search_public_orgs_not_in_course'
|
||||
end
|
||||
collection do
|
||||
match 'join_private_courses', :via => [:get, :post]
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
class CopyForgeActivitiesToOrgActivities < ActiveRecord::Migration
|
||||
def up
|
||||
ForgeActivity.all.each do |forge_act|
|
||||
OrgActivity.create(:user_id => forge_act.user_id,
|
||||
:org_act_id => forge_act.forge_act_id,
|
||||
:org_act_type => forge_act.forge_act_type,
|
||||
:container_id => forge_act.project_id,
|
||||
:container_type => 'Project',
|
||||
:created_at => forge_act.created_at,
|
||||
:updated_at => forge_act.updated_at)
|
||||
count = ForgeActivity.all.count/30 + 1
|
||||
for i in 1 ... count do
|
||||
transaction do
|
||||
ForgeActivity.page(i).per(30).each do |forge_act|
|
||||
OrgActivity.create(:user_id => forge_act.user_id,
|
||||
:org_act_id => forge_act.forge_act_id,
|
||||
:org_act_type => forge_act.forge_act_type,
|
||||
:container_id => forge_act.project_id,
|
||||
:container_type => 'Project',
|
||||
:created_at => forge_act.created_at,
|
||||
:updated_at => forge_act.updated_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
class AddCreatedAtToOrgMembers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :org_members, :created_at, :timestamp
|
||||
end
|
||||
end
|
|
@ -0,0 +1,12 @@
|
|||
class CreateOrgCourses < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :org_courses do |t|
|
||||
t.integer :organization_id
|
||||
t.integer :course_id
|
||||
t.timestamp :created_at
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddColumnPublistResourceToCourse < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :courses,:publish_resource,:integer ,:default => 0
|
||||
end
|
||||
end
|
|
@ -0,0 +1,27 @@
|
|||
class CopyCourseActivitiesToOrgActivities < ActiveRecord::Migration
|
||||
def up
|
||||
count = CourseActivity.all.count/30 + 1
|
||||
for i in 1 ... count do
|
||||
transaction do
|
||||
CourseActivity.page(i).per(30).each do |course_act|
|
||||
if course_act.course_act_type == 'Message' && !course_act.course_act.parent_id.nil?
|
||||
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{course_act.course_act.parent.id}").first
|
||||
org_activity.created_at = course_act.created_at
|
||||
org_activity.save
|
||||
else
|
||||
OrgActivity.create(:user_id => course_act.user_id,
|
||||
:org_act_id => course_act.course_act_id,
|
||||
:org_act_type => course_act.course_act_type,
|
||||
:container_id => course_act.course_id,
|
||||
:container_type => 'Course',
|
||||
:created_at => course_act.created_at,
|
||||
:updated_at => course_act.updated_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
class ChangecolumnOfOrgDocumentComments < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :org_document_comments, :title, :text
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
71
db/schema.rb
71
db/schema.rb
|
@ -444,6 +444,7 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
|
|||
t.integer "inherit_members", :limit => 1, :default => 1
|
||||
t.integer "open_student", :default => 0
|
||||
t.integer "outline", :default => 0
|
||||
t.integer "publish_resource", :default => 0
|
||||
end
|
||||
|
||||
create_table "custom_fields", :force => true do |t|
|
||||
|
@ -572,6 +573,7 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
|
|||
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
|
||||
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
|
||||
|
||||
<<<<<<< .mine
|
||||
create_table "exercise_answers", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "exercise_question_id"
|
||||
|
@ -632,6 +634,68 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
|
|||
t.integer "show_result"
|
||||
end
|
||||
|
||||
=======
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>> .theirs
|
||||
create_table "first_pages", :force => true do |t|
|
||||
t.string "web_title"
|
||||
t.string "title"
|
||||
|
@ -1109,6 +1173,12 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "org_courses", :force => true do |t|
|
||||
t.integer "organization_id"
|
||||
t.integer "course_id"
|
||||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
create_table "org_document_comments", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "content"
|
||||
|
@ -1130,6 +1200,7 @@ ActiveRecord::Schema.define(:version => 20151120021958) do
|
|||
create_table "org_members", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "organization_id"
|
||||
t.string "role"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
/*margin: 0 0 15px 0;*/
|
||||
/*margin-bottom:15pt;*/
|
||||
line-height:1.5;
|
||||
letter-spacing: 1px;
|
||||
/*letter-spacing: 1px;*/
|
||||
}
|
||||
|
||||
.ke-content div.ref {border:1px solid #ddd;margin:0 0 10px 0;padding:2px;font-size:9pt;background:#ffe;}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* /MathJax/config/MMLorHTML.js
|
||||
*
|
||||
* Copyright (c) 2009-2014 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
(function(c,g){var f="2.4.0";var a=MathJax.Hub.CombineConfig("MMLorHTML",{prefer:{MSIE:"MML",Firefox:"HTML",Opera:"HTML",Chrome:"HTML",Safari:"HTML",other:"HTML"}});var e={Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4};var b=(g.version==="0.0"||g.versionAtLeast(e[g]||0));var d=(g.isFirefox&&g.versionAtLeast("1.5"))||(g.isMSIE&&g.hasMathPlayer)||(g.isSafari&&g.versionAtLeast("5.0"))||(g.isOpera&&g.versionAtLeast("9.52"));c.Register.StartupHook("End Config",function(){var h=(a.prefer&&typeof(a.prefer)==="object"?a.prefer[MathJax.Hub.Browser]||a.prefer.other||"HTML":a.prefer);if(b||d){if(d&&(h==="MML"||!b)){if(MathJax.OutputJax.NativeMML){MathJax.OutputJax.NativeMML.Register("jax/mml")}else{c.config.jax.unshift("output/NativeMML")}c.Startup.signal.Post("NativeMML output selected")}else{if(MathJax.OutputJax["HTML-CSS"]){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}else{c.config.jax.unshift("output/HTML-CSS")}c.Startup.signal.Post("HTML-CSS output selected")}}else{c.PreProcess.disabled=true;c.prepareScripts.disabled=true;MathJax.Message.Set(["MathJaxNotSupported","Your browser does not support MathJax"],null,4000);c.Startup.signal.Post("MathJax not supported")}})})(MathJax.Hub,MathJax.Hub.Browser);MathJax.Ajax.loadComplete("[MathJax]/config/MMLorHTML.js");
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* /MathJax/config/Safe.js
|
||||
*
|
||||
* Copyright (c) 2009-2014 The MathJax Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
MathJax.Hub.Register.StartupHook("End Config",function(){if(!MathJax.Hub.config.extensions){MathJax.Hub.config.extensions=[]}MathJax.Hub.config.extensions.push("Safe.js")});MathJax.Ajax.loadComplete("[MathJax]/config/Safe.js");
|
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue