Merge branch 'szzh' into develop

This commit is contained in:
huang 2015-11-19 16:25:50 +08:00
commit 7d1b8dfe42
1550 changed files with 26041 additions and 227 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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
@ -41,6 +41,7 @@ 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

View File

@ -16,7 +16,7 @@ class OrgMemberController < ApplicationController
member_ids = params[:membership][:user_ids]
role_id = params[:orgRole]
member_ids.each do |user_id|
member = OrgMember.create(:user_id=>user_id)
member = OrgMember.create(:user_id=>user_id, :created_at => Time.now)
@org.org_members << member
OrgMemberRole.create(:org_member_id => member.id, :role_id => role_id)
end

View File

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

View File

@ -55,22 +55,38 @@ class OrganizationsController < ApplicationController
def show
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@organization = Organization.find(params[:id])
@org_activities = OrgActivity.where('container_id =? and container_type =? ',
@organization.id, 'Organization ').order('updated_at desc').page(params[:page]).per(10)
@org_activities_count = OrgActivity.where('container_id =? and container_type =? ',
@organization.id, 'Organization ').order('updated_at desc').count
project_ids = @organization.projects.map(&:id) << 0
@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
format.js
end
else
render_403
end
respond_to do |format|
format.html
format.js
end
end
def update
@ -141,7 +157,16 @@ class OrganizationsController < ApplicationController
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

View File

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

View File

@ -1918,6 +1918,20 @@ class UsersController < ApplicationController
end
end
def search_user_orgs
name=""
if !params[:search_orgs].nil?
name = params[:search_orgs].strip
end
name = "%"+name+"%"
@orgs = User.current.organizations.where("name like ?", name)
@user = User.current
respond_to do |format|
format.html {render :layout => 'static_base'}
format.js
end
end
private
def find_user

View File

@ -2374,8 +2374,10 @@ module ApplicationHelper
link_to "作品(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
else #学生显示提交作品、修改作品等按钮
work = cur_user_works_for_homework homework
if work.nil?
if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
link_to "提交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
link_to "补交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_red'
else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"

View File

@ -0,0 +1,2 @@
module OrgCoursesHelper
end

View File

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

View File

@ -5,7 +5,7 @@ class CourseActivity < ActiveRecord::Base
belongs_to :course
belongs_to :user
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
after_save :add_user_activity
after_save :add_user_activity, :add_course_activity
before_destroy :destroy_user_activity
#在个人动态里面增加当前动态
@ -30,6 +30,27 @@ 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

View File

@ -20,7 +20,7 @@ class ForgeActivity < ActiveRecord::Base
validates :forge_act_id,presence: true
validates :forge_act_type, presence: true
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
after_save :add_user_activity
after_save :add_user_activity, :add_org_activity
before_destroy :destroy_user_activity
#在个人动态里面增加当前动态
@ -45,6 +45,16 @@ class ForgeActivity < ActiveRecord::Base
end
end
def add_org_activity
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
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

5
app/models/org_course.rb Normal file
View File

@ -0,0 +1,5 @@
class OrgCourse < ActiveRecord::Base
#attr_accessible :organization, :course, :created_at
belongs_to :organization
belongs_to :course
end

View File

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

View File

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

View File

@ -50,6 +50,12 @@
<span class="c_grey">(打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">
<label >学生上传资源&nbsp;&nbsp;</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"%>

View File

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

View File

@ -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 >学生上传资源&nbsp;&nbsp;</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>

View File

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

View File

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

View File

@ -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">
上传:

View File

@ -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) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div>
<div class="cl"></div>

View File

@ -13,10 +13,10 @@
</div>
<% author = topic.last_reply.try(:author)%>
<% if author%>
<div class="postDetailCreater">最后回复<a href="<%= user_path(author) %>" class="linkBlue2" target="_blank"><%= author.name%></a></div>
<div class="postDetailCreater">最后回复:<a href="<%= user_path(author) %>" class="linkBlue2" target="_blank"><%= author.name%></a></div>
<div class="postDetailDate"><%= format_date(topic.last_reply.created_at)%></div>
<% end%>
<div class=" fr" style="color: #888888;font-size: 12px">最后更新:<%= format_date(topic.updated_at)%></div>
</div>
<div class="postDetailReply">
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -79,6 +79,7 @@
<%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
<% end %>
</div>
<div class=" fr" style="color: #888888;font-size: 12px">最后更新:<%= format_date(@memo.updated_at)%></div>
</div>
<div class="cl"></div>
</div>

View File

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

View File

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

View File

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

View File

@ -12,19 +12,21 @@
}
}
</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" %>
<%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org1_document_description_editor', :height => "150px" %>
</div>
<div class="cl"></div>
@ -41,4 +43,5 @@
</div>
</div>
<% end %>
<% end %>
</div>

View File

@ -19,6 +19,6 @@
init_activity_KindEditor_data(<%= document.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 %>

View File

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

View File

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

View File

@ -0,0 +1,70 @@
<% 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">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(User.find(act.user_id)), :width => "45", :height => "45") %></a>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo"><%= link_to User.find(act.user_id), user_path(act.user_id) %>&nbsp;&nbsp;创建了 <a href="<%= organization_path(@organization)%>" class="newsBlue ml10"><%= Organization.find(act.org_act_id).name %>
| 组织</a></div>
<div class="homepagePostDate"> 创建时间:<%= format_activity_day(act.created_at) %> <%= format_time(act.created_at, false) %> </div>
</div>
<div class="cl"></div>
</div>
</div>
<% end %>
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act} %>
<% end %>
<% end %>
<% if act.container_type == 'Project' %>
<% case act.org_act_type.to_s %>
<% when 'Issue' %>
<%= 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} %>
<% 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 %>
<!--<ul class="wlist" style=" border:none; padding-top: 15px;">-->
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
<!--</ul>-->
<% end %>
<% if org_act_count == 10 %>
<div id="show_more_activities" class="loadMore mt10 f_grey">展开更多<%=link_to "", organization_path(org,:page => page.to_i + 1),:id => "more_org_activities_link",:remote => "true",:class => "none" %></div>
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end%>
<script>
$(function(){
$("#show_more_activities").mouseover(function(){
$("#more_org_activities_link").click();
})
})
</script>

View File

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

View File

@ -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 %>&nbsp;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>

View File

@ -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="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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>

View File

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

View File

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

View File

@ -5,7 +5,7 @@
</div>
<div class="st_list" style="width: 720px;">
<div class="st_box">
<!--<span class="fr fb fontGrey3">加入时间</span>-->
<span class="fr fb fontGrey3">加入时间</span>
<div class="cl"></div><!--st_box_top end-->
<% members.each do |member| %>
@ -16,6 +16,9 @@
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml5 c_blue02") %><br />
<span class="fl c_grey ml10">身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %></span>
<% if member.created_at %>
<span class="fr c_grey"><%= format_time(member.created_at) %></span>
<% end %>
</div>
<div class="cl"></div>
<% end%>

View File

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

View File

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

View File

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

View File

@ -11,7 +11,7 @@
<% 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>
@ -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>

View File

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

View File

@ -14,65 +14,61 @@
</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 %>
<% unless @org_activities.nil? %>
<% @org_activities.each do |act| %>
<% if act.org_act_type == 'CreateOrganization' %>
<div class="resources mt10">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(User.find(act.user_id)), :width => "45", :height => "45") %></a>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo"><%= link_to User.find(act.user_id), user_path(act.user_id) %>&nbsp;&nbsp;创建了 <a href="<%= organization_path(@organization)%>" class="newsBlue ml10"><%= Organization.find(act.org_act_id).name %>
| 组织</a></div>
<div class="homepagePostDate"> 创建时间:<%= format_activity_day(act.created_at) %> <%= format_time(act.created_at, false) %> </div>
</div>
<div class="cl"></div>
</div>
</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} %>
<% end %>
<% end %>
<!--<ul class="wlist" style=" border:none; padding-top: 15px;">-->
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
<!--</ul>-->
<% end %>
<%# @org_project_activties.each do |org_act|%>
<%= render :partial => 'organizations/org_project_activities',
:locals => {:org_project_activties =>@org_project_activties,
:page=>@page,
:org => @organization,
:org_act_count=>@org_activities.count,
:pro_act_count=>@org_project_activties.count}%>
<%# end %>
<% if @org_activities %>
<%= render :partial => 'organizations/org_activities',
:locals => {:org_activities =>@org_activities,
:page=>@page,
:org => @organization,
:org_act_count=>@org_activities.count}%>
<% end %>

View File

@ -1,7 +1,6 @@
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'organizations/org_project_activities',
:locals => {:org_project_activties =>@org_project_activties,
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'organizations/org_activities',
:locals => {:org_activities =>@org_activities,
:page=>@page,
:org => @organization,
:org_act_count=>@org_activities.count,
:pro_act_count=>@org_project_activties.count} )%>");
:org_act_count=>@org_activities.count} )%>");

View File

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

View File

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

View File

@ -7,11 +7,6 @@
<!--</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>
@ -20,7 +15,7 @@
<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="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>
@ -51,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 );
// }
//
// }
// }
});
}
@ -80,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>

View File

@ -23,7 +23,11 @@
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5">作品提交中</span>
<% 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>

View File

@ -0,0 +1,39 @@
<%= stylesheet_link_tag 'pleft','header','new_user','repository','org', 'project' %>
<%#= 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="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"/>
<!--<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">
<% orgs.each do |org| %>
<div class="postRow">
<div class="postPortrait">
<%= link_to image_tag(url_to_avatar(org), :width => '78', :height => '78', :alt => '组织logo'), organization_path(org), :class => "linkGrey2" %>
</div>
<div class="orgWrap">
<div class="orgTitle">
<%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %>
</div>
<div class="orgIntro"><%= org.description %></div>
<div class="postCreater">创建者:<%= link_to User.find(org.creator_id), user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %></div>
<div class="postDate fl mr40">创建时间:<%= format_activity_day(org.created_at) %> <%= format_time(org.created_at, false) %></div>
<div class="postCreater">您的身份:<%= User.current.admin_of_org?(org) ? "组织管理员" : "组织成员" %></div>
</div>
<!--<div class="mt28 fr"><a href="javascript:void(0);" class="linkGrey5">申请加入</a></div>-->
<div class="cl"></div>
</div>
<% end %>
</div>
</div>
</div>
</div>

View File

@ -23,7 +23,11 @@
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5">作品提交中</span>
<% if Time.parse(homework_common.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(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
<span class="red_homework_btn_cir ml5">作品补交中</span>
<% end %>
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
<% if homework_common.anonymous_comment == 0%>
<span class="green_homework_btn_cir ml5">匿评中</span>

View File

@ -126,7 +126,7 @@
</ul>
<% end %>
</div>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp; 截止时间快到了</li>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp; 截止时间快到了.</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
@ -158,7 +158,7 @@
<li>匿评截止:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li>
</ul>
<% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%>
<p>请您尽早完成匿评如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。</p>
<p>请您尽早完成匿评,如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。</p>
<p>例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分</p>
<% end%>
</div>
@ -209,7 +209,7 @@
<div style="display: none" class="message_title_red system_message_style">
<p>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher, ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败
<%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败.
</p>
<ul class="ul_normal_color">
@ -315,7 +315,7 @@
<% end %>
</ul>
<p>
本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59结束匿评到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。 期待您取得更大的进步!
本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59结束匿评到时您将可以看到所有其他同学的作品啦.大家可以进一步互相学习。 期待您取得更大的进步.
</p>
</div>
<% end %>
@ -404,14 +404,16 @@
</ul>
<p>如需获得最终成绩,请您联系主讲老师对您的作品进行单独评分!</p>
</div>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp;您迟交了作品</li>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp;您迟交了作品</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!-- 创建课程消息 -->
<% if ma.course_message_type == "Course" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"></a></li>
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您成功创建了课程:</span>
@ -443,7 +445,9 @@
<% end %>
<% if ma.course_message_type == "JoinCourseRequest" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"></a></li>
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的课程成员申请:</span>
@ -482,7 +486,9 @@
<% end %>
<% if ma.course_message_type == "CourseRequestDealResult" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"></a></li>
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
@ -548,7 +554,7 @@
<% if ma.course_message_type == "JoinCourse" and ma.status == 1 %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"></a>
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>

View File

@ -0,0 +1 @@
<%= render :partial => 'show_user_org', :locals => {:orgs => @orgs} %>

View File

@ -0,0 +1,2 @@
//$("#org_list").replaceWith("<%#= escape_javascript(render :partial => 'show_user_org', :locals => {:orgs => @orgs}) %>")

View File

@ -1,4 +1,4 @@
<%= stylesheet_link_tag 'pleft','header','new_user','repository','org' %>
<%= stylesheet_link_tag 'pleft','header','new_user','repository','org', 'project' %>
<%#= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %>
<div class="homepageContentContainer">
<div class="homepageContent">
@ -6,30 +6,34 @@
<div class="postBanner" style="padding-bottom:5px;">
<span class="linkGrey2 f16">组织列表</span>
<!--<form class="resourcesSearchloadBox" style="float:right; margin-top:-5px;">-->
<!--<input type="text" name="serach" placeholder="输入关键词进行搜索" class="searchResource"/>-->
<!--<a href="javascript:void(0);" class="homepageSearchIcon"></a>-->
<!--</form>-->
<!--<%#= 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"/>-->
<!--&lt;!&ndash;<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#search_org_form').submit();"></a>&ndash;&gt;-->
<!--<a href="javascript:void(0);" class="problem_search_btn fl" onclick="$('#search_org_form').submit();">搜索</a>-->
<!--<%# end %>-->
<div class="cl"></div>
</div>
<% @orgs.each do |org| %>
<div class="postRow">
<div class="postPortrait">
<%= link_to image_tag(url_to_avatar(org), :width => '78', :height => '78', :alt => '组织logo'), organization_path(org), :class => "linkGrey2" %>
</div>
<div class="orgWrap">
<div class="orgTitle">
<%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %>
<div id="org_list">
<% @orgs.each do |org| %>
<div class="postRow">
<div class="postPortrait">
<%= link_to image_tag(url_to_avatar(org), :width => '78', :height => '78', :alt => '组织logo'), organization_path(org), :class => "linkGrey2" %>
</div>
<div class="orgIntro"><%= org.description %></div>
<div class="postCreater">创建者:<%= link_to User.find(org.creator_id), user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %></div>
<div class="postDate fl mr40">创建时间:<%= format_activity_day(org.created_at) %> <%= format_time(org.created_at, false) %></div>
<div class="postCreater">您的身份:<%= User.current.admin_of_org?(org) ? "组织管理员" : "组织成员" %></div>
<div class="orgWrap">
<div class="orgTitle">
<%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %>
</div>
<div class="orgIntro"><%= org.description %></div>
<div class="postCreater">创建者:<%= link_to User.find(org.creator_id), user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %></div>
<div class="postDate fl mr40">创建时间:<%= format_activity_day(org.created_at) %> <%= format_time(org.created_at, false) %></div>
<div class="postCreater">您的身份:<%= User.current.admin_of_org?(org) ? "组织管理员" : "组织成员" %></div>
</div>
<!--<div class="mt28 fr"><a href="javascript:void(0);" class="linkGrey5">申请加入</a></div>-->
<div class="cl"></div>
</div>
<!--<div class="mt28 fr"><a href="javascript:void(0);" class="linkGrey5">申请加入</a></div>-->
<div class="cl"></div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
</div>

View File

@ -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'
@ -79,6 +80,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
@ -444,6 +454,7 @@ RedmineApp::Application.routes.draw do
get 'dealwith_apply_request'
get 'store_selected_resource'
get 'user_organizations'
get 'search_user_orgs'
# end
end
#resources :blogs
@ -633,6 +644,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
@ -848,6 +860,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]

View File

@ -0,0 +1,21 @@
class CopyForgeActivitiesToOrgActivities < ActiveRecord::Migration
def up
count = ForgeActivity.all.count/30 + 1
for i in 1 ... count do
transaction do
ForgeActivity.page(i).per(30).each do
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
def down
end
end

View File

@ -0,0 +1,5 @@
class AddCreatedAtToOrgMembers < ActiveRecord::Migration
def change
add_column :org_members, :created_at, :timestamp
end
end

View File

@ -0,0 +1,13 @@
class SetTimeForOrgMember < ActiveRecord::Migration
def up
OrgMember.all.each do |member|
if(member.created_at.nil?)
member.created_at = Time.now - 5.days
member.save
end
end
end
def down
end
end

View File

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

View File

@ -0,0 +1,5 @@
class AddColumnPublistResourceToCourse < ActiveRecord::Migration
def change
add_column :courses,:publish_resource,:integer ,:default => 0
end
end

View File

@ -0,0 +1,21 @@
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|
OrgActivity.create(:user_id => course_act.user_id,
:org_act_type => course_act.course_act_type,
:org_act_id => course_act.course_act_id,
: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
def down
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20151112072948) do
ActiveRecord::Schema.define(:version => 20151118031602) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -425,8 +425,8 @@ ActiveRecord::Schema.define(:version => 20151112072948) do
t.string "code"
t.integer "time"
t.string "extra"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "location"
t.string "term"
t.string "string"
@ -436,14 +436,15 @@ ActiveRecord::Schema.define(:version => 20151112072948) do
t.string "class_period"
t.integer "school_id"
t.text "description"
t.integer "status", :default => 1
t.integer "attachmenttype", :default => 2
t.integer "status", :default => 1
t.integer "attachmenttype", :default => 2
t.integer "lft"
t.integer "rgt"
t.integer "is_public", :limit => 1, :default => 1
t.integer "inherit_members", :limit => 1, :default => 1
t.integer "open_student", :default => 0
t.integer "outline", :default => 0
t.integer "is_public", :limit => 1, :default => 1
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|
@ -1056,6 +1057,12 @@ ActiveRecord::Schema.define(:version => 20151112072948) 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"

View File

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

19
public/javascripts/MathJax/MathJax.js vendored Normal file

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

View File

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

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