Merge branch 'szzh' into gitlab_guange

This commit is contained in:
huang 2015-11-14 15:22:05 +08:00
commit ca8b62b8bd
124 changed files with 2474 additions and 277 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 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 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 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_document_comment controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the OrgMember controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the org_projects controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the organizations controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -374,30 +374,29 @@ class FilesController < ApplicationController
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
Mailer.run.attachments_added(attachments[:files])
end
if params[:course_attachment_type] && params[:course_attachment_type] != "5"
case params[:course_attachment_type]
when "1"
tag_name = l(:label_courseware)
when "2"
tag_name = l(:label_software)
when "3"
tag_name = l(:label_media)
when "4"
tag_name = l(:label_code)
when "6"
tag_name = "论文"
else
tag_name = ""
if params[:course_attachment_type] && params[:course_attachment_type].is_a?(Array)
params[:course_attachment_type].each do |type|
tag_name = get_tag_name_by_type_number type
if !attachments.empty? && attachments[:files] && tag_name != ""
attachments[:files].each do |attachment|
attachment.tag_list.add(tag_name)
attachment.save
end
end
end
if !attachments.empty? && attachments[:files] && tag_name != ""
attachments[:files].each do |attachment|
attachment.tag_list.add(tag_name)
attachment.save
else
if params[:course_attachment_type] && params[:course_attachment_type] != "5"
tag_name = get_tag_name_by_type_number params[:course_attachment_type]
if !attachments.empty? && attachments[:files] && tag_name != ""
attachments[:files].each do |attachment|
attachment.tag_list.add(tag_name)
attachment.save
end
end
end
end
# TODO: 临时用 nyan
sort_init 'created_on', 'desc'
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
@ -424,6 +423,23 @@ class FilesController < ApplicationController
end
end
def get_tag_name_by_type_number type
case type
when "1"
tag_name = l(:label_courseware)
when "2"
tag_name = l(:label_software)
when "3"
tag_name = l(:label_media)
when "4"
tag_name = l(:label_code)
when "6"
tag_name = "论文"
else
tag_name = ""
end
end
def tag_saveEx
@tags = params[:tag_name][:name]
@obj_id = params[:object_id]

View File

@ -74,10 +74,10 @@ class NewsController < ApplicationController
@q = params[:subject]
if params[:subject].nil? || params[:subject].blank?
scope_order = scope.all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
:order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC")
else
scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
:order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC")
end
# :offset => @offset,

View File

@ -0,0 +1,63 @@
class OrgDocumentCommentsController < ApplicationController
before_filter :find_organization, :only => [:new, :create, :show, :index]
layout 'base_org'
def new
@org_document_comment = OrgDocumentComment.new
end
def create
@org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id)
@org_document_comment.title = params[:org_document_comment][:title]
@org_document_comment.content = params[:org_document_comment][:content]
if @org_document_comment.save
#flash[:notice] = 'success'
OrgActivity
redirect_to organization_org_document_comments_path(@organization)
else
redirect_to new_org_document_comment_path(:organization_id => @organization.id)
end
end
def show
end
def index
@documents = @organization.org_document_comments.where("parent_id is null").order("created_at desc")
end
def update
@org_document = OrgDocumentComment.find(params[:id])
@org_document.update_attributes(:title => params[:org_document_comment][:title], :content => params[:org_document_comment][:content])
respond_to do |format|
format.html {redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)}
end
end
def edit
@org_document = OrgDocumentComment.find(params[:id])
@organization = Organization.find(params[:organization_id])
end
def add_reply
@document = OrgDocumentComment.find(params[:id]).root
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
@comment.content = params[:org_content]
@document.children << @comment
@document.save
end
def find_organization
@organization = Organization.find(params[:organization_id])
end
def destroy
@org_document_comment = OrgDocumentComment.find(params[:id])
org = @org_document_comment.organization
if @org_document_comment.destroy
if @org_document_comment.id == org.id
org.home_id == nil
end
end
end
end

View File

@ -0,0 +1,57 @@
class OrgMemberController < ApplicationController
def org_member_autocomplete
@org = Organization.find(params[:org])
@flag = params[:flag] || false
respond_to do |format|
format.js
end
end
def create
@org = Organization.find(params[:org])
if params[:membership].nil?
@fail_hint = l(:label_blank_user_lists_for_org)
else
member_ids = params[:membership][:user_ids]
role_id = params[:orgRole]
member_ids.each do |user_id|
member = OrgMember.create(:user_id=>user_id)
@org.org_members << member
OrgMemberRole.create(:org_member_id => member.id, :role_id => role_id)
end
end
respond_to do |format|
format.js
end
end
def update
@member = OrgMember.find(params[:id])
#@member.change_role params[:org_member][:role_ids]
@member_role = @member.org_member_roles[0]
@member_role.role_id = params[:org_member][:role_ids][0]
@member_role.save
@org = @member.organization
respond_to do |format|
format.js
end
end
def new
end
def destroy
member = OrgMember.find(params[:id])
@org = member.organization
member.destroy
respond_to do |format|
format.js
end
end
def index
end
end

View File

@ -0,0 +1,31 @@
class OrgProjectsController < ApplicationController
def create
org_ids = params[:orgNames]
@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
end
end
def destroy
@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

@ -1,55 +0,0 @@
class OrganizationController < ApplicationController
# layout 'base_projects'
before_filter :require_admin, :except => [:index]
def index
#@projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)")
@organizations = Organization.all
respond_to do |format|
format.html
end
end
def new
@organizations = Organization.new
respond_to do |format|
format.html
end
end
def create
@organizations = Organization.new
@organizations.name = params[:organization][:name]
if @organizations.save
redirect_to admin_organization_url
end
end
def edit
@organization = Organization.find params[:id]
respond_to do |format|
format.html
end
rescue Exception => e
render_404
end
def update
@organization = Organization.find params[:id]
@organization.name = params[:organization][:name]
if @organization.save
redirect_to admin_organization_url
end
rescue Exception => e
render_404
end
def destroy
@organization = Organization.find params[:id]
if @organization.destroy
redirect_to admin_organization_url
end
rescue Exception => e
render_404
end
end

View File

@ -0,0 +1,149 @@
# encoding: utf-8
class OrganizationsController < ApplicationController
helper :sort
include SortHelper
helper :custom_fields
include CustomFieldsHelper
include AvatarHelper
include WordsHelper
include GitlabHelper
include UserScoreHelper
include PollHelper
helper :user_score
helper :journals
# added by liuping 关注
helper :watchers
helper :activities
### added by william
include ActsAsTaggableOn::TagsHelper
# fq
helper :words
helper :project_score
helper :issues
include UsersHelper
before_filter :find_organization, :only => [:show, :members]
layout 'base_org'
def index
end
def new
@organization = Organization.new
render :layout => 'new_base'
end
def create
@organization = Organization.new
@organization.name = params[:organization][:name]
@organization.description = params[:organization][:description]
@organization.is_public = params[:organization][:is_public]
@organization.creator_id = User.current.id
member = OrgMember.new(:user_id => User.current.id)
@organization.org_members << member
if @organization.save
OrgMemberRole.create(:org_member_id => member.id, :role_id => 11)
redirect_to organization_path(@organization)
end
end
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
@page = params[:page]
else
render_403
end
respond_to do |format|
format.html
format.js
end
end
def update
@organization = Organization.find(params[:id])
@organization.name = params[:organization][:name]
@organization.description = params[:organization][:description]
@organization.domain = params[:organization][:domain]
@organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0
#@organization.name = params[:organization][:name]
@organization.save
respond_to do |format|
format.html { redirect_to setting_organization_path(@organization)}
end
end
def check_uniq
@check = false;
@org_name = params[:org_name].strip
@config_page = params[:config_page]
sameName = @config_page ? Organization.where('name = ? and id != ?',params[:org_name],params[:org_id].to_i).count == 0 : Organization.where('name = ?',params[:org_name]).count == 0
if sameName == true
@check = true
end
respond_to do |format|
format.js
end
end
def find_organization
@organization = Organization.find(params[:id])
end
def setting
@organization = Organization.find(params[:id])
if User.current.admin? || User.current.admin_of_org?(@organization)
else
render_403
end
end
def clear_org_avatar_temp
end
def set_homepage
@org = Organization.find(params[:id])
@org.home_id = params[:home_id]
@org.save
# respond_to do |format|
# format.html {redirect_to organization_path(org)}
# end
end
def autocomplete_search
@project = Project.find(params[:project_id])
#@flag = params[:flag] || false
respond_to do |format|
format.js
end
end
def members
@members = OrgMember.where("organization_id =?", @organization.id)
end
def more_org_projects
@organization = Organization.find params[:id]
@page = params[:page]
@org_projects = @organization.org_projects.reorder('created_at').page((params[:page].to_i || 1) +1).per(5)
respond_to do |format|
format.js
end
end
end

View File

@ -69,6 +69,29 @@ class ProjectsController < ApplicationController
### added by william
include ActsAsTaggableOn::TagsHelper
#查找组织
def search_public_orgs_not_in_project
condition = '%%'
if !params[:name].nil?
condition = "%#{params[:name].strip}%".gsub(" ","")
end
project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[: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((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
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((params[:page].to_i || 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,params[:page]
#render :json => {:orgs => @orgs_not_in_project, :count => @org_count}.to_json
respond_to do |format|
format.js
end
end
def index
render_404
end
@ -338,6 +361,15 @@ class ProjectsController < ApplicationController
@wiki ||= @project.wiki
@select_tab = params[:tab]
#找出所有不属于项目的公共组织
project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{@project.id}")
if project_org_ids.empty?
@orgs_not_in_project = Organization.where("is_public = 1")
else
project_org_ids = "(" + project_org_ids.join(',') + ")"
@orgs_not_in_project = Organization.where("id not in #{project_org_ids} and is_public = 1")
end
# 处理从新建版本库返回来的错误信息
if !params[:repository_error_message].to_s.blank?
html = ""
@ -833,5 +865,4 @@ class ProjectsController < ApplicationController
end
#gcmend
end

View File

@ -1910,6 +1910,14 @@ class UsersController < ApplicationController
end
end
def user_organizations
@user = User.current
@orgs = @user.organizations
respond_to do |format|
format.html {render :layout => 'static_base'}
end
end
private
def find_user

View File

@ -48,6 +48,15 @@ module ApplicationHelper
end
end
end
# 获取组织成员中文名字
def get_org_member_role_name member
case member.roles[0].name
when 'orgManager'
'管理人员'
when 'orgMember'
'组织成员'
end
end
# Time 2015-03-24 16:38:05
# Author lizanle

View File

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

View File

@ -0,0 +1,16 @@
module OrgMemberHelper
include ApplicationHelper
def find_user_not_in_current_org_by_name org
if params[:q] && params[:q].lstrip.rstrip != ""
scope = Principal.active.sorted.not_member_of_org(org).like(params[:q])
else
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, org_member_autocomplete_org_member_index_path(parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js')), :remote => true
}
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
end
end

View File

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

View File

@ -1,2 +1,22 @@
module EnterprisesHelper
# encoding: utf-8
module OrganizationsHelper
include ApplicationHelper
def find_user_not_in_current_org_by_name org
if params[:q] && params[:q].lstrip.rstrip != ""
scope = Principal.active.sorted.not_member_of_org(org).like(params[:q])
else
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, org_member_autocomplete_org_member_index_path( parameters.merge(:q => params[:q],:flag => true,:org=>org, :format => 'js')), :remote => true
}
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
end
end

View File

@ -66,7 +66,7 @@ class News < ActiveRecord::Base
scope :course_visible, lambda {|*args|
includes(:course).where(Course.allowed_to_condition(args.shift || User.current, :view_course_news, *args))
}
safe_attributes 'title', 'summary', 'description'
safe_attributes 'title', 'summary', 'description', 'sticky'
def visible?(user=User.current)
!user.nil? && user.allowed_to?(:view_news, project)

View File

@ -0,0 +1,5 @@
class OrgActivity < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :org_act ,:polymorphic => true
belongs_to :container,:polymorphic => true
end

View File

@ -0,0 +1,16 @@
class OrgDocumentComment < ActiveRecord::Base
attr_accessible :content, :creator_id, :organization_id, :parent_id, :reply_id, :title,:sticky,:locked
include Redmine::SafeAttributes
belongs_to :organization
belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id'
acts_as_tree :order => "#{OrgDocumentComment.table_name}.sticky asc, #{OrgDocumentComment.table_name}.created_at desc"
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
after_create :document_save_as_org_activity
def document_save_as_org_activity
if(self.parent().nil?)
self.org_acts << OrgActivity.new(:user_id => User.current.id, :container_id => self.organization.id, :container_type => 'Organization')
end
end
end

8
app/models/org_member.rb Normal file
View File

@ -0,0 +1,8 @@
class OrgMember < ActiveRecord::Base
attr_accessible :organization_id, :role, :user_id
belongs_to :organization
belongs_to :user
has_many :roles ,:through => :org_member_roles,:foreign_key => 'role_id'
has_many :org_member_roles,:dependent => :destroy
end

View File

@ -0,0 +1,5 @@
class OrgMemberRole < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :org_member
belongs_to :role
end

View File

@ -0,0 +1,5 @@
class OrgProject < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :organization
belongs_to :project
end

View File

@ -1,5 +1,14 @@
class Organization < ActiveRecord::Base
attr_accessible :logo_link, :name
attr_accessible :name, :description, :creator_id, :home_id, :domain, :is_public
has_many :org_members, :dependent => :destroy
has_many :org_projects ,:dependent => :destroy
has_many :projects,:through => :org_projects
has_many :org_document_comments, :dependent => :destroy
has_many :users, :through => :org_members
validates_uniqueness_of :name
after_create :save_as_org_activity
has_many :projects
def save_as_org_activity
OrgActivity.create(:user_id => User.current.id, :org_act_id => self.id, :org_act_type => 'CreateOrganization', :container_id => self.id, :container_type => 'Organization')
end
end

View File

@ -87,6 +87,16 @@ class Principal < ActiveRecord::Base
end
}
scope :not_member_of_org, lambda {|org|
orgs = [org] unless org.is_a?(Array)
if orgs.empty?
where("1=0")
else
ids = orgs.map(&:id)
where("#{Principal.table_name}.id NOT IN (SELECT DISTINCT user_id FROM #{OrgMember.table_name} WHERE organization_id IN (?))", ids)
end
}
scope :sorted, lambda { order(*Principal.fields_for_order_statement)}
scope :applied_members, lambda {|project|

View File

@ -69,6 +69,7 @@ class Project < ActiveRecord::Base
has_many :applied_projects, :dependent => :destroy
has_many :invite_lists, :dependent => :destroy
has_one :dts
has_many :organizations,:through => :org_projects
# end
#ADDED BY NIE
@ -96,7 +97,8 @@ class Project < ActiveRecord::Base
# 关联虚拟表
has_many :forge_messages, :class_name =>'ForgeMessage', :as => :forge_message, :dependent => :destroy
belongs_to :organization
has_many :org_projects,:dependent => :destroy
has_many :organization,:through => :org_projects
# has_many :journals

View File

@ -55,6 +55,8 @@ class Role < ActiveRecord::Base
has_many :member_roles, :dependent => :destroy
has_many :members, :through => :member_roles
has_many :org_member_roles, :dependent => :destroy
has_many :org_members,:through => :org_member_roles
acts_as_list
serialize :permissions, ::Role::PermissionsAttributeCoder

View File

@ -94,8 +94,11 @@ class User < Principal
has_one :preference, :dependent => :destroy, :class_name => 'UserPreference'
has_one :rss_token, :class_name => 'Token', :conditions => "action='feeds'"
has_one :blog, :class_name => 'Blog', :foreign_key => "author_id"
has_many :org_document_comments, :dependent =>:destroy
has_one :api_token, :class_name => 'Token', :conditions => "action='api'"
belongs_to :auth_source
has_many :org_members
has_many :organizations, :through => :org_members
belongs_to :ucourse, :class_name => 'Course', :foreign_key => :id #huang
## added by xianbo for delete
# has_many :biding_projects, :dependent => :destroy
@ -769,6 +772,21 @@ class User < Principal
courses.to_a.include?(course)
end
def member_of_org?(org)
OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count > 0
end
def admin_of_org?(org)
if OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count == 0
return false
end
role = OrgMember.where("user_id =? and organization_id =?", self.id, org.id)[0].roles[0]
unless role.nil?
role.name == 'orgManager' ? true : false
else
false
end
end
def member_of_course_group?(course_group)
course_groups.to_a.include?(course_group)
end

View File

@ -28,7 +28,7 @@
showNormalImage('message_description_<%= @article.id %>');
});
</script>
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @article.id%>').show();" onmouseout="$('#message_setting_<%= @article.id%>').hide();">
<div class="postRightContainer" onmouseover="$('#message_setting_<%= @article.id%>').show();" onmouseout="$('#message_setting_<%= @article.id%>').hide();">
<div class="postThemeContainer">
<div class="postDetailPortrait">
<%= link_to image_tag(url_to_avatar(@article.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.author) %>
@ -165,7 +165,7 @@
<%= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-right: 5px;" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %>
<% end %>
<div class="cl"></div>
</div>

View File

@ -32,7 +32,7 @@
<%#end%>
</script>
<div class="homepageRight mt0 ml10">
<div class="homepageRight mt0">
<div class="homepageRightBanner">
<div class="NewsBannerName">
<%= @user.name%>的博客

View File

@ -10,12 +10,12 @@
<input type="hidden" name="in_course_toolbar" value="Y">
<!--<p class="c_grey fr mt10 mr5">-->
<div class="c_dark">
<input name="course_attachment_type" type="radio" value="1" checked class="c_dark" >课件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type" type="radio" value="2" class="c_dblue">软件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type" type="radio" value="3" class="c_dblue">媒体</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type" type="radio" value="4" class="c_dblue">代码</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type" type="radio" value="6" class="c_dblue">论文</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type" type="radio" value="5" class="c_dblue">其他</input></a>
<input name="course_attachment_type[]" type="checkbox" value="1" checked class="c_dark" >课件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type[]" type="checkbox" value="2" class="c_dblue">软件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type[]" type="checkbox" value="3" class="c_dblue">媒体</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type[]" type="checkbox" value="4" class="c_dblue">代码</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type[]" type="checkbox" value="6" class="c_dblue">论文</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="course_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>
</div>
<div class="cl"></div>
<div>

View File

@ -86,6 +86,12 @@
<li>
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
</li>
<li>
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
</li>
<li>
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
</li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li>
<%= link_to "退出",signout_path,:class => "menuGrey",:method => "post"%>

View File

@ -0,0 +1,12 @@
<% projects.each do |project|%>
<% 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%>
</li>
<% end %>
<% if projects.size == 5%>
<li class="homepageLeftMenuMore" id="show_more_org_project">
<input type="hidden" value="<%= page%>" id="org_project_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_project('<%= more_org_projects_organization_path(org_id)%>');"></a>
</li>
<% end%>

View File

@ -0,0 +1,117 @@
<% @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 %>
<%#@nav_dispaly_project_label = 1 %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<!--add by huang-->
<body onload="prettyPrint();">
<div class="navContainer">
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else %>
<%= render :partial => 'layouts/unlogin_header' %>
<% end %>
</div>
<div class="cl"></div>
<div class="homepageContentContainer">
<div class="homepageContent">
<div class="homepageLeft">
<div class="homepagePortraitContainer">
<!--<div class="pr_info_logo fl mr10 mb5">-->
<!--<%#= image_tag(url_to_avatar(@organization), :width=>"60", :height=>"60", :alt=>"组织logo") %>-->
<!--</div>-->
<div class="pr_info_logo fl fl mr10 mb5" id="homepage_portrait_image">
<%= image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_user_tx') %>
<% if User.current.logged?%>
<% if User.current.id == @organization.creator_id%>
<div id="edit_org_file_btn" class="none">
<div class="homepageEditProfile">
<a href="<%= clear_org_avatar_temp_organization_path(@organization) %>" data-remote="true" class="homepageEditProfileIcon"></a>
</div>
</div>
<% end %>
<% end%>
</div>
<!--<div class="orgName fl mb5 f14">组织id<%#= @organization.id %></div>-->
<div class="orgName fl mb5 f14">
<%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
<% if @organization.is_public? %>
<span class="img_private"><%= l(:label_public)%></span>
<% else %>
<span class="img_private"><%= l(:label_private)%></span>
<% end %>
</div>
<% if User.current.admin_of_org?(@organization) %>
<a href="<%= setting_organization_path(@organization) %>" class="pr_join_a c_white"><span class="pr_setting"></span>配置</a>
<% end %>
<!--<div style="clear:both;">-->
<!--<%#= link_to l(:label_org_name)+"#{@organization.name}", organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>-->
<!--<%# if @organization.is_public? %>-->
<!--<span class="img_private"><%#= l(:label_public)%></span>-->
<!--<%# else %>-->
<!--<span class="img_private"><%#= l(:label_private)%></span>-->
<!--<%# end %>-->
<!--</div>-->
<div class="cl"></div>
<div class="f12 fontGrey3">
<%= link_to '文章', organization_org_document_comments_path(@organization) %>&nbsp;(
<%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %>
)&nbsp;|&nbsp;
<%= link_to '成员', members_organization_path(@organization.id) %>&nbsp;<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>
</div>
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock">
<%= 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>
<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}%>
<!--<%#= @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>
</div>
<div class="homepageRight">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
</div>
</div>
<!--页面底部-->
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
</body>
</html>

View File

@ -13,7 +13,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'public', 'leftside', 'courses','header','prettify'%>
<%= stylesheet_link_tag 'public', 'leftside', 'courses','header','prettify', 'org'%>
<%= javascript_include_tag "course","header",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -4,6 +4,10 @@
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
<p id="title_notice_span" class="ml55"></p>
</li>
<li style="margin-left: 45px;">
<%= f.check_box :sticky, :value => is_new ? 0 : @news.sticky %>
<%= label_tag 'news_sticky', l(:label_board_sticky) %>
</li>
<li class="mb10">
<% if is_new %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>

View File

@ -13,6 +13,9 @@
<%= l(:label_release_news) %>
</span>
<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
<% if news.sticky == 1%>
<span class="sticky_btn_cir ml10">置顶</span>
<% end%>
<%=link_to "<span class = 'pic_mes'>#{news.comments.all.count}</span>".html_safe, news_path(news.id), :class => "pro_mes_w" %>
<br />
<div class="cl mb5"></div>

View File

@ -8,6 +8,9 @@
<h4 class="r_txt_tit mb5">
<%=h @news.title %>
</h4>
<% if @news.sticky == 1%>
<span class="sticky_btn_cir ml10 fl">置顶</span>
<% end%>
<%= link_to(l(:button_edit),
edit_news_path(@news),
:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %>

View File

@ -0,0 +1,57 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
<script>
function check_org_title()
{
if($("#document_title").val().trim() == "")
{
$("#doc_title_hint").html("<span class='c_red'>标题不能为空</span>").show();
return false;
}
else
{
$("#doc_title_hint").hide();
return true;
}
}
function create_org_document()
{
if(check_org_title() == true)
{
org_document_description_editor.sync();
$('#new_org_document_form').submit();
}
}
function cancel_create_org_document(){
$("#document_title").val("");
org_document_description_editor.html("");
org_document_description_editor.sync();
$('#org_document_editor').hide(); $('#doc_title_hint').hide();
}
</script>
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
<div class="resources">
<div>
<input class="postDetailInput fl" maxlength="250" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" placeholder="请输入文章标题" />
</div>
<div id="doc_title_hint"></div>
<div class="cl"></div>
<div id="org_document_editor" class="mt10" style="display: none">
<div>
<%= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
</div>
<div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="create_org_document();">确定</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" onclick="cancel_create_org_document();" class="fr mr10 mt3">取消</a>
<div class="cl"></div>
</div>
</div>
</div>
<% end %>

View File

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

View File

@ -0,0 +1 @@
location.reload();

View File

@ -0,0 +1,44 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
<script>
function check_org_title(title)
{
if($("#document_title").val().trim() == "")
{
$("#doc_title_hint").html("<span class='c_red'>标题不能为空</span>").show();
}
else
{
$("#doc_title_hint").hide();
}
}
</script>
<div class="homepageRightBanner mb10">
<div class="NewsBannerName">编辑文章</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 %>" />
</div>
<div id="doc_title_hint"></div>
<div class="cl"></div>
<div id="org_document_editor" class="mt15" style="">
<div class="mt10">
<%= kindeditor_tag 'org_document_comment[content]',@org_document.content, :editor_id => 'org_document_description_editor', :height => "150px" %>
</div>
<div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="org_document_description_editor.sync();$('#new_org_document_form').submit();">确定</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" onclick="$('#org_document_editor').hide(); $('#doc_title_hint').hide();" class="fr mr10 mt3">取消</a>
<div class="cl"></div>
</div>
</div>
</div>
<% end %>

View File

@ -0,0 +1,24 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-outline {border: none;}
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
.homepagePostReplyInputContainer .ke-container {float: left;}
</style>
<%= render :partial => 'new' %>
<% unless @documents.nil? %>
<% @documents.each do |document| %>
<script>
$(function() {
init_activity_KindEditor_data(<%= document.id%>, null, "87%");
});
</script>
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %>
<% end %>
<% end %>

View File

@ -0,0 +1,40 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
<script>
function check_org_title(title)
{
if($("#document_title").val().trim() == "")
{
$("#doc_title_hint").html("<span class='c_red'>标题不能为空</span>").show();
}
else
{
$("#doc_title_hint").hide();
}
}
</script>
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
<div class="resources">
<div>
<textarea 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();" placeholder="请输入文章标题"></textarea>
</div>
<div id="doc_title_hint"></div>
<div id="org_document_editor" class="mt15" style="display: none">
<div class="mt10">
<%= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
</div>
<div class="cl"></div>
<p id="homework_course_id_span" class="c_red mt5"></p>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="org_document_description_editor.sync();$('#new_org_document_form').submit();">确定</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" onclick="$('#org_document_editor').hide(); $('#doc_title_hint').hide();" class="fr mr10 mt3">取消</a>
<div class="cl"></div>
</div>
</div>
</div>
<% end %>

View File

@ -0,0 +1,7 @@
<% if @fail_hint %>
alert("<%= @fail_hint %>");
<% else %>
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
$("#principals_for_new_member").html('');
$("#org_members_count_id").html("<%= @org.org_members.count %>");
<% end %>

View File

@ -0,0 +1,3 @@
$("#org_members_count_id").html("");
$("#org_members_count_id").html("<%= @org.org_members.count %>")
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');

View File

@ -0,0 +1,23 @@
<% if @org%>
var checked = $("#principals_for_new_member input:checked").size();
if(checked > 0)
{
alert('翻页或搜索后将丢失当前选择的用户数据!');
}
<% if @flag == "true"%>
$('#principals_for_new_member').html('<%= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
<% else%>
$('#principals_for_new_member').html('<%= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
<% end%>
<%end%>
var collection=$("#principals_for_new_member").children("#principals").children("label");
collection.css("text-overflow","ellipsis");
collection.css("white-space","nowrap");
collection.css("width","200px");
collection.css("overflow","hidden");
for(i=0;i<collection.length;i++){ //增加悬浮显示
var label=collection[i];
var text=$(label).text();
$(label).attr("title",text);
}

View File

@ -0,0 +1 @@
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');

View File

@ -0,0 +1,6 @@
$("#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

@ -0,0 +1,22 @@
//$("#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 %>

View File

@ -1,21 +0,0 @@
<%= error_messages_for 'project' %>
<!--[form:project]-->
<% unless @organizations.new_record? %>
<p>
<%= render :partial=>"avatar/avatar_form",:locals=> {source:@organizations} %>
</p>
<% end %>
<p>
<label for="project_description">
<%= l(:label_organization_name)%>
<span class="required">&nbsp;&nbsp;</span>
</label>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:290px;" %>
</p>
<!--<p>-->
<!--<label for="project_description">-->
<%#= l(:field_description)%>
<!--<span class="required">&nbsp;&nbsp;</span>-->
<!--</label>-->
<!--<%#= f.text_area :description, :required => true, :size => 60, :style => "width:490px;" %>-->
<!--</p>-->

View File

@ -1,25 +0,0 @@
<%= form_for(@organization) do |f|%>
<h3>
<%=l(:label_organization_edit)%>
</h3>
<div class="box tabular" >
<%= error_messages_for 'project' %>
<p>
<%= render :partial=>"avatar/avatar_form",:locals=> {source:@organization} %>
</p>
<p>
<label for="project_description">
<%= l(:label_organization_name)%>
<span class="required">&nbsp;&nbsp;</span>
</label>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:290px;" %>
</p>
<span style="padding-left: 60px">
<%= submit_tag l(:button_create), :class => "enterprise"%>
</span>
</div>
<%#= submit_tag l(:button_create_and_continue), :name => 'continue' %>
<%= javascript_tag "$('#project_name').focus();" %>
<% end %>
<% html_title(l(:label_organization_edit)) -%>

View File

@ -1,31 +0,0 @@
<title>
<%= l(:label_all_enterprises) %>
</title>
<div class="content_syqy">
<div class="list">
<%= l(:label_all_enterprises) %>
</div>
<div class="syqy_box">
<% if @organizations.empty? %>
<h3>
<%= l(:label_enterprise_nil) %>
</h3>
<% else %>
<% @organizations.each do |organization| %>
<% unless organization.name.blank? %>
<ul>
<li >
<img src="/images/organization_logo.jpg" width="30" height="30" alt="<%= organization.name%>" />
<%= link_to organization.name, home_path(:organization => organization.id) %>
</li>
</ul>
<% end %>
<% end %>
<% end %>
</div>
</div>
<div style="clear: both"></div>
<div class="school-index">
<ul id="schoollist" style="line-height: 25px"></ul>
</div>
<% html_title(l(:label_enterprise_all)) -%>

View File

@ -1,18 +0,0 @@
<%= form_for(@organizations, :method => :post,
:name => 'new_form',
:url => {:controller => 'organization',
:action => 'create'}) do |f|%>
<h3>
<%=l(:label_organization_new)%>
</h3>
<div class="box tabular" >
<%= render :partial => 'form', :locals => { :f => f } %>
<span style="padding-left: 60px">
<%= submit_tag l(:button_create), :class => "enterprise"%>
</span>
</div>
<%#= submit_tag l(:button_create_and_continue), :name => 'continue' %>
<%= javascript_tag "$('#project_name').focus();" %>
<% end %>
<% html_title(l(:label_organization_new)) -%>

View File

@ -0,0 +1,33 @@
<!--<a href="javascript:void(0)" class="mr10 logoBorder fl ml10">-->
<!--<%#= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%>-->
<!--</a>-->
<div class="orgLogo mb10">
<a href="javascript:void(0);">
<%= image_tag(url_to_avatar(source), id: "avatar_image",:height => 55,:width => 55, :class=>'mr10 logoBorder fl ml10',:alt=>"上传图片") %>
</a>
<a href="javascript:void(0);" onclick="$('#upload_org_logo').click();" class="logoEnter fl linkGrey4"><%= l(:button_upload_photo) %></a>
<div class="cl"></div>
</div>
<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %>
<%= file_field_tag 'avatar[image]',
:id => 'upload_org_logo',
:class => 'undis upload_file',
:size => "1",
:multiple => true,
:data => {
:max_file_size => Setting.upload_avatar_max_size,
:max_file_size_message => l(:error_upload_avatar_to_large, :max_size => number_to_human_size(Setting.upload_avatar_max_size.to_i)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => source.class.to_s,
:source_id => source.id.to_s
} %>
<!--</span>-->
<% content_for :header_tags do %>
<%= javascript_include_tag 'jq-upload/jquery.ui.widget', 'jq-upload/jquery.iframe-transport', 'jq-upload/jquery.fileupload', 'jq-upload/upload' %>
<% end %>
<div class="cl"></div>

View File

@ -0,0 +1,42 @@
<% members.each do |member|%>
<ul class="orgListRow">
<li class="orgListUser"><a href="<%= user_path(User.find(member.user_id))%>" class="linkBlue"><%= User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname %></a></li>
<li class="orgListRole">
<%= get_org_member_role_name member %>
<%= form_for(member, {:as => :org_member, :remote => true, :url => org_member_path(member),
:method => :put,
:html => {:id => "org-member-#{member.id}-roles-form", :style=>'display:none'}}
) do |f| %>
<% Role.givable.where("id in (11,12)").each do |role| %>
<ul style="text-align: left;" >
<%= radio_button_tag 'org_member[role_ids][]', role.id, member.roles.include?(role) %>
<!--编辑时候显示成员,中英文切换后面需从数据库的角度优化-->
<% if User.current.language == "zh" %>
<% if role.id == 11 %>
<label >管理人员</label>
<% elsif role.id == 12 %>
<label >组织成员</label>
<% end %>
<% else %>
<label ><%= h role %></label>
<% end %>
</ul>
<!--<br/>-->
<% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %>
<div class="pt5">
<a href="javascript:void(0)" class="org_member_btn" onclick="$('#org-member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<%= l(:button_change)%>
</a>
<a href="javascript:void(0)" class="org_member_btn" onclick="$('#org-member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(18)">
<%= l(:button_cancel)%>
</a>
</div>
<% end %>
</li>
<% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%>
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 30px;float: left" onclick="$(this).parent().height(70);$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
<%= link_to '删除', org_member_path(member.id),:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
<div class="cl"></div>
</ul>
<% end %>

View File

@ -0,0 +1,29 @@
<%= stylesheet_link_tag 'courses' %>
<div class="resources mt10">
<div class="project_r_h" style="width: 720px;">
<h2 class="project_h2"> 组织成员</h2>
</div>
<div class="st_list" style="width: 720px;">
<div class="st_box">
<!--<span class="fr fb fontGrey3">加入时间</span>-->
<div class="cl"></div><!--st_box_top end-->
<% members.each do |member| %>
<div class="st_boxlist">
<a href="javascript:" class="st_img">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<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>
</div>
<div class="cl"></div>
<% end%>
<ul class="wlist">
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div>
</div>
</div>

View File

@ -0,0 +1,28 @@
<% org_project_activties.each do |act|%>
<% if act %>
<% if act %>
<% case act.forge_act_type.to_s %>
<% when 'Issue' %>
<%= render :partial => 'organizations/org_project_issue', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
<% when 'Message' %>
<%= render :partial => 'organizations/project_message', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
<% when 'ProjectCreateInfo'%>
<%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if org_act_count == 10 || pro_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,136 @@
<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 activity.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.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle break_word">
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %>
<span class='<%#= get_issue_priority(activity.priority_id)[0] %>'>
<%#= get_issue_priority(activity.priority_id)[1] %>
</span>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostAssignTo">指派给&nbsp;&nbsp;
<% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% end %>
<% end %>
</div>
<div class="homepagePostDeadline">
时间:
<%=format_time(activity.created_on) %>
</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%>">
<% if activity.description? %>
<%= textAreailizable activity, :description, :attachments => activity.attachments %>
<% 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="mt10" style="font-weight:normal;">
<% if activity.attachments.any? %>
<% activity.attachments.each do |attachment| %>
<div class="break_word">
<span class="fl">
<span title="<%= attachment.filename %>" id="attachment_">
<%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%>
</span>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments',
:action => 'show',
:id => attachment,
:class => 'fl',
:filename => attachment.filename %>
<% end %>
</span>
<span class="postAttSize">(
<%= number_to_human_size attachment.filesize %>)
</span>
<span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
<%= format_time(attachment.created_on) %>
</span>
</div>
<% end %>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
<% count = activity.journals.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.journals.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.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4">
<% if reply.try(:user).try(:realname) == ' ' %>
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :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 %>">
<% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %>
<p><%= string %></p>
<% end %>
<% end %>
<P><%= reply.notes.nil? ? "" : reply.notes.html_safe %></P>
</div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<% end %>
</div>
</div>

View File

@ -0,0 +1,38 @@
<% project = Project.find(activity.project_id) %>
<% user = User.find(project.user_id)%>
<div class="resources mt10">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4">
<% if user.try(:realname) == ' ' %>
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
<% else %>
<%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
</div>
<div class="homepagePostDate">
创建时间:<%= format_time(project.created_on) %>
</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,100 @@
<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 activity.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.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
</div>
<div class="homepagePostTitle break_word">
<% if activity.parent_id.nil? %>
<%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey"
%>
<% else %>
<%= link_to activity.parent.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey"
%>
<% end %>
</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>
<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 ? '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_id.nil? ? activity : activity.parent %>
<% 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), :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), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :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 %>
</div>
</div>

View File

@ -0,0 +1,130 @@
<div class="resources mt10" id="organization_document_<%= document.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo">
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
<% if document.organization.home_id == document.id %>
<span style="color:#269ac9;">首页</span>
<% else %>
<span style="color:#269ac9;">组织</span>
<% end %>
</div>
<div class="homepagePostTitle postGrey"><%= document.title %></div>
<div class="homepagePostDate">
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
<% unless document.content.blank? %>
<div class="homepagePostIntro">
<%= document.content.html_safe %>
</div>
<% end %>
<!-- <%# if defined?(home_id) %>
<div style="float:right;">最后编辑:<%#= User.find() %></div>
<%# end %>-->
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
<% end %>
</li>
<li>
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %>
</li>
<li>
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
:data => {:confirm => l(:text_are_you_sure)},
:remote => true, :class => 'postOptionLink' %>
</li>
</ul>
</li>
</ul>
</div>
<div class="cl"></div>
<% end %>
</div>
</div>
<% comments_for_doc = document.children.reorder("created_at desc") %>
<% count = document.children.count() %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
<div class="homepagePostReplyBanner" style="display:<%= count == 0 ? 'none' : 'block' %>">
<div class="homepagePostReplyBannerCount">回复(<%= count %></div>
<% if count > 3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
展开更多
</a>
</div>
<% end %>
</div>
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
<ul>
<% reply_id = 0 %>
<% comments_for_doc.each do |comment| %>
<% reply_id += 1 %>
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_path(comment.creator_id) %></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<%= link_to User.find(comment.creator_id), user_path(comment.creator_id), :class => "newsBlue mr10 f14" %>
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
</div>
<% unless comment.content.blank? %>
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
<% end %>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15">
<%= 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='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 class="cl"></div>
<p nhname='contentmsg_<%= document.id %>'></p>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
<script type="text/javascript">
function expand_reply(container, btnid) {
var target = $(container);
var btn = $(btnid);
if (btn.data('init') == '0') {
btn.data('init', 1);
btn.html('收起回复');
target.show();
} else {
btn.data('init', 0);
btn.html('展开更多');
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
}
}
</script>

View File

@ -0,0 +1,13 @@
<% if @project%>
var checked = $("#not_org_members input:checked").size();
if(checked > 0)
{
alert('翻页或搜索后将丢失当前选择的用户数据!');
}
<% if @flag == "true"%>
$('#new_orgs_for_project').html('<%= escape_javascript(search_public_orgs_not_in_project(@project.id)) %>');
<% else%>
$('#new_orgs_for_project').html('<%= escape_javascript(search_public_orgs_not_in_project(@project.id)) %>');
<% end%>
<%end%>

View File

@ -0,0 +1,22 @@
<% if !@org_name.blank? %>
<%if @check == false %>
$checkName = false
<% if @config_page%>
$("#check_name_hint").html('<span class="c_red">名字不能重复<span>').show();
<% else%>
$("#organization_name_notice").html('<span class="c_red">名字不能重复<span>').show();
<%end%>
<% else %>
$checkName = true;
<% if @config_page%>
$("#check_name_hint").html('<span class="c_green">名字可以使用</span>').show();
<% else%>
$("#organization_name_notice").html('<span class="c_green">名字可以使用</span>').show();
<%end%>
<%end%>
<% else %>
$("#check_name_hint").html('<span class="c_green">名字不能为空</span>').show();
<% end %>

View File

View File

@ -0,0 +1 @@
<%= render :partial => 'org_members', :locals => {:members => @members, :organization => @organization} %>

View File

@ -0,0 +1 @@
$("#show_more_org_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/org_projects',:locals => {:projects => @org_projects,:org_id => @organization, :page => @page} )%>");

View File

@ -0,0 +1,110 @@
<% @nav_dispaly_organization_label = 1
@nav_dispaly_forum_label = 1 %>
<%= error_messages_for 'organization' %>
<div class="organization_r_h02">
<h2 class="organization_h2"><%= l(:label_organization_new)%></h2>
</div>
<div class="hwork_new">
<ul>
<%= labelled_form_for @organization do |f| %>
<li class="ml45">
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label><span class="c_red">*</span>&nbsp;<%= l(:label_organization_name)%>&nbsp;&nbsp;</label>
<input type="text" name="organization[name]" id="organization_name" class="courses_input" maxlength="100" onblur="check_uniq(this);" onkeyup="regex_organization_name();">
<span id="organization_name_notice" ></span>
</li>
<div class="cl"></div>
<div class="cl"></div>
<li class="ml45">
<label class="fl" >&nbsp;&nbsp;<%= l(:label_organization_description) %>&nbsp;&nbsp;</label>
<textarea name="organization[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>
<div class="cl"></div>
</li>
<li>
<p style="display: none" >
<%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :maxlength => Project::IDENTIFIER_MAX_LENGTH,
value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
</p>
</li>
<li class=" mb5 ml80">
<label >公开&nbsp;&nbsp;</label>
<input id="organization_is_public" name="organization[is_public]" type="checkbox" value="1" checked="checked">
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)</span>
<div class="cl"></div>
</li>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_organization();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
<div class="cl"></div>
</li>
<% end%>
</ul>
</div><!--talknew end-->
<div class="cl"></div>
<% html_title(l(:label_organization_new)) -%>
<script>
//////////////////////////////////////////////////////////////
//新建组织
//验证组织名称
function regex_organization_name()
{
var name = $.trim($("#organization_name").val());
if(name.length == 0)
{
$("#organization_name_notice").html('<span class="c_red">名字不能为空<span>').show();
return false;
}
else
{
$("#organization_name_notice").html('').hide();
return true;
}
}
var $checkName = false;
function check_uniq(dom){
if($("#organization_name").val().trim() == ""){
$("#organization_name_notice").html('<span class="c_red">名字不能为空<span>').show();
return;
}
$.get(
'<%= check_uniq_organizations_path%>'+'?org_name='+$("#organization_name").val().trim()
)
}
//提交新建项目
function submit_new_organization()
{
$.get(
'<%= check_uniq_organizations_path%>'+'?org_name='+$("#organization_name").val().trim()
)
if(regex_organization_name() && $checkName)
{
$("#new_organization").submit();
}
}
$(function(){
$('#organization_new_type').change(function(){
var type = $('#organization_new_type').val();
if(type == '1'){
$(this).next().html("<%= l(:label_type_des_development)%>");
}
else if(type == '2'){
$(this).next().html("<%= l(:label_type_des_research)%>");
}
else if(type == '3'){
$(this).next().html("<%= l(:label_type_des_friend)%>");
}
// var p1=$(this).children('option:selected').val("研讨模式:面向小组研究,支持任务分工、论坛交流、资源分享等。");//这就是selected的值
// var p2=$('#param2').val();//获取本页面其他标签的值
})
})
</script>

View File

@ -0,0 +1,2 @@
//location.reload();
window.location.href ='<%= organization_path(@org)%>'

View File

@ -0,0 +1,109 @@
<script>
function g(o){return document.getElementById(o);}
function HoverLi(n){
//如果有N个标签,就将i<=N;
for(var i=1;i<=2;i++){
g('orgSetting_'+i).className='orgSettingOp';
g('orgContent_'+i).className='undis';}
g('orgContent_'+n).className='dis ml15 mr15';
g('orgSetting_'+n).className='orgSettingOp orgOpActive';}
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
//]]>
$checkName = true;
function check_uniq(id){
if($("#organization_name").val().trim() == ""){
$("#check_name_hint").html('<span class="c_red">名字不能为空<span>').show();
return false ;
}
$.get(
'<%= check_uniq_organizations_path%>'+'?org_name='+$("#organization_name").val().trim()+"&config_page=Y" + "&org_id="+id
)
}
function update_org(id){
check_uniq(id);
if( $checkName){
$("#edit_organization_"+id).submit();
}
}
</script>
<div class="homepageRightBanner">
<div class="NewsBannerName">配置</div>
</div>
<div class="resources mt10">
<ul class="mb10">
<li class="orgSettingOp orgOpActive" id="orgSetting_1" onclick="HoverLi(1);">信息</li>
<li class="orgSettingOp" id="orgSetting_2" onclick="HoverLi(2);">成员</li>
<li class="orgBorder"></li>
<div class="cl"></div>
</ul>
<div class="ml15 mr15" id="orgContent_1">
<!--<div class="orgLogo mb10"><a href="javascript:void(0);"><img src="images/0" width="55" height="55" alt="组织logo" class="mr10 logoBorder fl ml10" /></a>-->
<!--<a href="javascript:void(0);" class="logoEnter fl linkGrey4">上传图片</a>-->
<%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %>
<%= labelled_form_for @organization do |f|%>
<%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
<!--<div class="cl"></div>-->
<!--</div>-->
<div class="orgRow mb10"><span class="c_red">*&nbsp;</span>组织名称:
<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" />
<div class="cl"></div>
</div>
<div style="margin-left: 80px " id="check_name_hint"></div>
<div class="orgRow mb10"><span class="ml10">组织描述:</span>
<textarea type="text" name="organization[description]" class="orgDes" id="org_desc" placeholder="最多3000个汉字或6000个英文字符"><%= @organization.description%></textarea>
<div class="cl"></div>
</div>
<div style="margin-left: 80px " id="check_desc_hint"></div>
<!--<div class="orgRow mb10"><span class="ml10">组织URL</span>-->
<!--<div class="w607 fr">https//-->
<!--<input type="text" name="organization[domain]" value="<%= @organization.domain%>" class="orgUrlInput" />-->
<!--.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;">申请</a>-->
<!--<p id="apply_hint"></p></div>-->
<!--&lt;!&ndash;class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 &ndash;&gt;-->
<!--</div>-->
<!--<div class="cl"></div>-->
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span>
<input type="checkbox" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
</div>
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org(<%=@organization.id %>);">保存</a>
<% end %>
</div>
<div class="undis ml15 mr15" id="orgContent_2">
<div class="orgMemberList">
<ul class="orgListRow">
<li class="orgListUser fb">用户</li>
<li class="orgListRole fb">角色</li>
<div class="cl"></div>
</ul>
<div id="org_member_list">
<%= render :partial=>"org_member_list",:locals=> {:members=>@organization.org_members} %>
</div>
</div>
<div class="fr orgMemContainer">
<div class="orgMemberAdd">
<p class="fontBlue fb mb5">添加成员</p>
<%= form_tag url_for(:controller => 'org_member',:action => 'create',:org=>@organization),:id=>'org_member_add_form',:remote=>true do |f|%>
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、昵称搜索" class="orgAddSearch mb20" />
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript org_member_autocomplete_org_member_index_path(:org=>@organization, :format => 'js') }')" %>
<div id="principals_for_new_member">
<%= find_user_not_in_current_org_by_name(@project) %>
</div>
<div class="cl"></div>
<ul class="orgAddRole">
<li class="fontGrey3 fb mb10">角色</li>
<li>
<input type="radio" id="orgMng" name="orgRole" value="11" />
<label for="orgMng">管理人员</label>
</li>
<li>
<input type="radio" id="orgMeb" name="orgRole" checked value="12" />
<label for="orgMeb">组织成员</label>
</li>
</ul><a href="javascript:void(0);" onclick="submit_add_org_members();" class="saveBtn db fl mt10">新增成员</a>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -0,0 +1,79 @@
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-outline {border: none;}
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
.homepagePostReplyInputContainer .ke-container {float: left;}
</style>
<div class="homepageRightBanner">
<div class="NewsBannerName">最新动态</div>
<!-- <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>
</li>
</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%");
});
</script>
<%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %>
<% 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 %>

View File

@ -0,0 +1,7 @@
$("#show_more_activities").replaceWith("<%= escape_javascript( 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} )%>");

View File

@ -0,0 +1,13 @@
$("#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 %>

View File

@ -12,6 +12,7 @@
project_setting(6);
$("#pro_st_edit_ku").toggle();
<%else%>
project_setting(5);
<% end%>
<% end%>
$("div[nhname='pro_setting']").show();
@ -36,6 +37,7 @@
<% if User.current.allowed_to?(:manage_members, @project) %>
<li id="pro_st_tb_3" class="<%= show_memu == 'manage_members' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(3);">成员</li>
<% end %>
<li id="pro_st_tb_5" class="<%= show_memu == 'join_org' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(5);">组织</li>
<% if User.current.allowed_to?(:manage_versions, @project) %>
<li id="pro_st_tb_4" class="<%= show_memu == 'manage_versions' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(4);">版本</li>
<% end %>
@ -63,6 +65,7 @@
<%= render :partial=>"projects/settings/new_members" if User.current.allowed_to?(:manage_members, @project)%>
</div><!--tbc_03 end-->
<div class="<%= show_memu == 'manage_versions' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_04">
<%= render :partial=>"projects/settings/new_versions" if User.current.allowed_to?(:manage_versions, @project)%>
</div><!--tbc_04 end-->
@ -70,6 +73,9 @@
<!--<div class="pro_st_undis" id="pro_st_tbc_05">-->
<!--<%#= render :partial=>"projects/settings/new_issue_categories" %>-->
<!--</div>&lt;!&ndash;tbc_05 end&ndash;&gt;-->
<div class="<%= show_memu == 'join_org' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_05">
<%= render :partial=>"projects/settings/join_org" %>
</div>
<div class="<%= show_memu == 'manage_repository' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_06">
<%= render :partial=>"projects/settings/new_repositories" if User.current.allowed_to?(:manage_repository, @project)%>

View File

@ -0,0 +1,9 @@
<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>
<%= 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 %>
</ul>

View File

@ -0,0 +1,107 @@
<!--<div class="members_left">-->
<!--<input type="text" id="orgs_not_project_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、昵称搜索" class="orgAddSearch mb20" />-->
<!--<%#= javascript_tag "observeSearchfield('orgs_not_project_member_search', null, '#{ escape_javascript autocomplete_search_organizations_path(:project_id=> @project.id, :format => 'js') }')" %>-->
<!--<div id="new_orgs_for_project">-->
<!--</div>-->
<!--</div>-->
<%= stylesheet_link_tag 'org' %>
<ul class="mb10">
<li class="orgSettingOp orgOpActive" id="orgSetting_1">组织</li>
<li class="orgBorder" style="width:625px;"></li>
<div class="cl"></div>
</ul>
<div>
<div class="relateOrg fl">
<span class="pic_add fl mr5 mt3"></span><span class="f14 fontBlue fl">关联组织</span>
<div class="cl mb5"></div>
<%= form_tag url_for(:controller => 'org_projects', :action => 'create', :project_id => @project.id), :id => 'join_orgs_for_project', :remote => true %>
<input type="text" name="orgs" class="searchOrg mb5 ml20" placeholder="请输入组织名称" />
<div id="search_orgs_result_list" class="ml20"></div>
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
<a href="javascript:void(0);" class="saveBtn db fl ml20 mr15 mb5" onclick="$('#join_orgs_for_project').submit();">关联</a>
<a href="javascript:void(0);" class="cancelBtn db fl" onclick="cancel_join_orgs();">取消</a>
</div>
<div class="relatedList fr">
<div class="fr mr15">
<span class="f14 fontBlue">已关联组织</span>
<div id="added_orgs">
<%= render :partial => 'projects/settings/added_orgs', :locals => {:orgs => @project.organizations, :project_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 => '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 );
// }
//
// }
// }
});
}
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 => '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("");
}
</script>

View File

@ -5,7 +5,7 @@
<li class="hworkPortrait mt15 mr10">
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40"),user_activities_path(student_work.user)) %>
</li>
<div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;" class="student_work_<%= student_work.id%>">
<li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>">
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<div>
@ -25,7 +25,7 @@
</div>
</ul>
</li>
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<li class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<% if student_work.created_at && @homework.end_time%>
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
@ -80,6 +80,15 @@
</div>
<% end%>
</li>
<li class="hworkTip" style="display: none"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
</ul>
<script type="text/javascript">
$(".student_work_<%= student_work.id%>").mouseenter(function(){
if($("#about_hwork_<%= student_work.id%>").html().trim() == "") {
$("#work_click_<%= student_work.id%>").show();
}
}).mouseleave(function(){
$("#work_click_<%= student_work.id%>").hide();
}).mouse;
</script>

View File

@ -7,13 +7,13 @@
<li class="hworkPortrait mt15 mr10">
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
</li>
<li class="hworkName mt15 mr15 width285">
<li class="hworkName mt15 mr15 width285 student_work_<%= student_work.id%>">
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<div>
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
</div>
</li>
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;" class="student_work_<%= student_work.id%>">
<ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="姓名">
<%= student_work.user.show_name%>
@ -27,12 +27,12 @@
<li class="hworkPortrait mt15 mr10">
<%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
</li>
<li class="hworkName mt15 mr15 width285">
<li class="hworkName mt15 mr15 width285 student_work_<%= student_work.id%>">
<div>
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
</div>
</li>
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;" class="student_work_<%= student_work.id%>">
<ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="姓名">
匿名
@ -46,7 +46,7 @@
</ul>
</li>
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<li class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span>
@ -58,6 +58,13 @@
<li class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10">
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
</li>
<li class="hworkTip" style="display: none"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
</ul>
<script type="text/javascript">
$(".student_work_<%= student_work.id%>").mouseenter(function(){
$("#work_click_<%= student_work.id%>").show();
}).mouseleave(function(){
$("#work_click_<%= student_work.id%>").hide();
}).mouse;
</script>

View File

@ -9,10 +9,10 @@
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
<li class="fr" >
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
</li>
<li class="fr" >
<%= link_to "",edit_student_work_path(work),:class => "pic_edit"%>
<li class="fr mr5" >
<%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
</li>
<% end%>
<% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%>

View File

@ -2,10 +2,14 @@
<span class="c_dark f14 fb fl mr30">
作品
<font class="f12 c_red">
(已有<%= @student_work_count%>人提交)
(<%= @student_work_count%>人已交)
</font>
<% if !@is_teacher && @stundet_works.empty?%>
<span class="f12 c_red">您尚未提交作品</span>
<% elsif !@is_teacher &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
<span class="f12 c_red">您已提交且不可再修改,因为截止日期已过</span>
<% elsif !@is_teacher &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
<span class="f12 c_red">您已提交,您还可以修改</span>
<% end %>
</span>
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>

View File

@ -12,9 +12,13 @@
<% end %> TO <!--+"(课程名称)"-->
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word"> <!--+"(通知标题)"-->
<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>

View File

@ -7,7 +7,7 @@
<% attachments.each do |attach| %>
<ul class="resourcesList" onmouseover="$(this).children().css('background-color', '#e1e1e1')" onmouseout="$(this).children().css('background-color', 'white')">
<li class="resourcesListCheckbox fl">
<input name="checkbox1[]" type="checkbox" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
<input name="checkbox1[]" type="checkbox" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
</li>
<li class="resourcesListName fl">
<!--<a href="javascript:void(0);" class="resourcesBlack"><%#=truncate(attach.filename,:length=>18)%></a>-->

View File

@ -17,11 +17,17 @@
<div class=" mt10">
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
<div class="calendar_div fl">
<% if edit_mode %>
<label class="fl c_grey f14" style="margin-top: 4px;">截止日期:</label>
<% end %>
<div class="calendar_div fl mr10">
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
<%= calendar_for('homework_end_time')%>
</div>
<div class="calendar_div fl ml10">
<% if edit_mode %>
<label class="fl c_grey f14" style="margin-top: 4px;">发布日期(可选)</label>
<% end %>
<div class="calendar_div fl">
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" placeholder="发布日期(可选)" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.publish_time%>" >
<%= calendar_for('homework_publish_time')%>
</div>

View File

@ -0,0 +1,35 @@
<%= stylesheet_link_tag 'pleft','header','new_user','repository','org' %>
<%#= 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 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>-->
<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>
<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>

View File

@ -287,7 +287,11 @@
//批量删除
function batch_delete(){
var data = $("#resources_list_form").serialize();
if(data != "" && confirm('您删不掉这其中上传者不是您的资源,确认要删除这些资源吗?')) {
if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){
alert("您只能删除自己上传的资源,请重新选择后再删除。");
return;
}
if(data != "" && confirm('确认要删除这些资源吗?')) {
$.post(
'<%= user_resource_delete_user_path(@user)%>',
$("#resources_list_form").serialize(),//只会对选中的控件进行序列化提交

View File

@ -2,6 +2,6 @@
closeModal();
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
//这里不能将翻页的更新
$("#res_all_count").html(parseInt($("#res_all_count").html())+1);
$("#res_all_count").html('<%= @atta_count%>');
$("#res_count").html(0);
$("#checkboxAll").attr('checked',false);

View File

@ -1,2 +1,5 @@
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#res_all_count").html('<%= @atta_count%>')
$("#res_count").html(0);
$("#checkboxAll").attr('checked',false);

View File

@ -289,6 +289,10 @@ zh:
label_projects_new_name: "项目名称"
label_tags_project_description: "项目描述"
label_organization_name: "组织名称"
label_organization_description: "组织描述"
label_organization_new: "新建组织"
label_tags_user_mail: "用户邮箱:"
label_tags_user_name: "用户名:"

View File

@ -2090,5 +2090,7 @@ zh:
label_forums: 贴吧交流
label_language: 语言
label_license: 湘ICP备09019772
label_org_name: 组织名称:
label_blank_user_lists_for_org: 用户不能为空

View File

@ -31,6 +31,56 @@ RedmineApp::Application.routes.draw do
# Enable Grack support
# mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post]
resources :organizations do
member do
get 'setting'#, :action => 'settings', :as => 'settings'
get 'clear_org_avatar_temp'
put 'set_homepage'
get 'members'
get 'more_org_projects'
end
collection do
get 'check_uniq'
get 'autocomplete_search'
end
resources :org_document_comments do
member do
end
collection do
end
end
end
resources :org_member do
member do
end
collection do
get 'org_member_autocomplete'
end
end
resources :org_document_comments do
member do
post 'add_reply'
end
collection do
end
end
resources :org_projects 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
resources :no_uses
delete 'no_uses', :to => 'no_uses#delete'
@ -38,9 +88,9 @@ RedmineApp::Application.routes.draw do
resources :apply_project_masters
delete 'apply_project_masters', :to => 'apply_project_masters#delete'
resources :organization, :except => [:show] do
end
# resources :organization, :except => [:show] do
#
# end
resources :school, :except => [:show] do
collection do
@ -393,6 +443,7 @@ RedmineApp::Application.routes.draw do
post 'import_resources_to_homework'
get 'dealwith_apply_request'
get 'store_selected_resource'
get 'user_organizations'
# end
end
#resources :blogs
@ -439,7 +490,7 @@ RedmineApp::Application.routes.draw do
################# added by william
match 'users/tag_save', :via => :post, :as => 'tag'
match 'users/tag_saveEx', :via => [:get, :post]
#get 'users/:id/user_organizations', :to => 'users#user_organizations', :as => 'user_organizations'
post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
delete 'watchers/watch', :to => 'watchers#unwatch'
get 'watchers/new', :to => 'watchers#new'
@ -477,6 +528,7 @@ RedmineApp::Application.routes.draw do
post 'unarchive'
post 'close'
post 'reopen'
get 'search_public_orgs_not_in_project'
match 'copy', :via => [:get, :post]
end

View File

@ -1,14 +1,11 @@
class CreateOrgMembers < ActiveRecord::Migration
def up
def change
create_table :org_members do |t|
t.integer :user_id
t.integer :organization_id
t.string :role
t.timestamps
end
end
def down
drop_table :org_members
end
end

View File

@ -0,0 +1,13 @@
class CreateOrgDocumentComments < ActiveRecord::Migration
def change
create_table :org_document_comments do |t|
t.string :title
t.text :content
t.integer :organization_id
t.integer :creator_id
t.integer :parent_id
t.integer :reply_id
t.timestamps
end
end
end

View File

@ -0,0 +1,6 @@
class AddLockedAndStickyColumnToEntityOrgDocumentComments < ActiveRecord::Migration
def change
add_column :org_document_comments,:locked,:boolean,:default => false
add_column :org_document_comments,:sticky,:integer,:default => 0
end
end

View File

@ -0,0 +1,16 @@
class CreateOrgActivity < ActiveRecord::Migration
def up
create_table :org_activities do |t|
t.integer :user_id
t.integer :act_id
t.string :act_type
t.integer :container_id
t.string :container_type
t.timestamps
end
end
def down
end
end

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