Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

Conflicts:
	db/schema.rb
This commit is contained in:
Tim 2016-01-14 15:59:50 +08:00
commit 8feea07825
77 changed files with 7435 additions and 4274 deletions

View File

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

View File

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

View File

@ -53,6 +53,7 @@ class AtController < ApplicationController
end
def find_project(id)
return [] if id<0
at_persons = Project.find(id).users
at_persons.delete_if { |u| u.id == User.current.id }
end

View File

@ -172,6 +172,7 @@ class FilesController < ApplicationController
# #render 'stores'
# redirect_to search_course_files_url
end
@page = params[:page] || 1
end
def find_course_attache keywords,course,sort = ""
@ -380,6 +381,7 @@ class FilesController < ApplicationController
@organization = Organization.find(@containers.first.organization_id)
show_attachments @containers
@tag_list = attachment_tag_list @all_attachments
@page = params[:page] || 1
render :layout => 'base_org'
# @subfield = params[:org_subfield_id]
end
@ -454,7 +456,9 @@ class FilesController < ApplicationController
end
end
# 更新资源总数, 根据上传的附件数累加
@project.update_attribute(:attachments_count, @project.attachments_count + attachments[:files].count)
unless @project.project_score.nil?
@project.project_score.update_attribute(:attach_num, @project.project_score.attach_num + attachments[:files].count)
end
# end
# TODO: 临时用 nyan
sort_init 'created_on', 'desc'

View File

@ -20,7 +20,12 @@ class OrgDocumentCommentsController < ApplicationController
flash.keep[:notice] = l(:notice_successful_create)
EditorOfDocument.create(:editor_id => User.current.id, :org_document_comment_id => @org_document_comment.id, :created_at => @org_document_comment.updated_at)
if params[:field_id]
redirect_to organization_path(@organization, :org_subfield_id => params[:field_id])
@org_subfield = OrgSubfield.find(params[:field_id])
if @org_subfield.subfield_subdomain_dir.nil?
redirect_to organization_path(@organization, :org_subfield_id => params[:field_id])
else
redirect_to show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => @org_subfield.subfield_subdomain_dir.name)
end
else
redirect_to organization_org_document_comments_path(@organization)
end

View File

@ -1,22 +1,90 @@
class OrgSubfieldsController < ApplicationController
helper :attachments
layout 'base_org'
def create
@subfield = OrgSubfield.create(:name => params[:name])
@organization = Organization.find(params[:organization_id])
@organization.org_subfields << @subfield
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
if OrgSubfield.where("organization_id=#{params[:organization_id]} and name=?",params[:name]).count == 0
@res = true
@subfield = OrgSubfield.create(:name => params[:name])
@organization = Organization.find(params[:organization_id])
@organization.org_subfields << @subfield
if !params[:sub_dir].blank?
sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+
"and org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir]}'"
if SubfieldSubdomainDir.find_by_sql(sql).count == 0
SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir])
end
end
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
else
@res = false
end
end
def show
@org_subfield = OrgSubfield.find(params[:id])
@organization = @org_subfield.organization.id
@messages = []
@messages << @org_subfield.org_document_comments
@messages << @org_subfield.messages
@messages.sort{|a, b| b.updated_at <=> a.updated_at}
respond_to do |format|
format.html{render :layout => 'base_org'}
@flag = params[:flag] || false
sort = ""
@sort = ""
@order = ""
@is_remote = false
@organization = Organization.find(params[:id])
@org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+
"subfield_subdomain_dirs where org_subfields.id = subfield_subdomain_dirs.org_subfield_id and "+
" org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir_name]}'").first
if @org_subfield.field_type == 'Post'
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
@org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
#redirect_to organization_path(@organization, :org_subfield_id => @org_subfield.id)
else
if params[:sort]
params[:sort].split(",").each do |sort_type|
order_by = sort_type.split(":")
case order_by[0]
when "filename"
attribute = "filename"
when "size"
attribute = "filesize"
when "attach_type"
attribute = "attachtype"
when "content_type"
attribute = "created_on"
when "field_file_dense"
attribute = "is_public"
when "downloads"
attribute = "downloads"
when "created_on"
attribute = "created_on"
when "quotes"
attribute = "quotes"
else
attribute = "created_on"
end
@sort = order_by[0]
@order = order_by[1]
if order_by.count == 1 && attribute
sort += "#{Attachment.table_name}.#{attribute} asc "
if sort_type != params[:sort].split(",").last
sort += ","
end
elsif order_by.count == 2 && order_by[1]
sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} "
if sort_type != params[:sort].split(",").last
sort += ","
end
end
end
else
sort = "#{Attachment.table_name}.created_on desc"
end
@container_type = 2
@containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)]
@organization = Organization.find(@containers.first.organization_id)
show_attachments @containers
@tag_list = attachment_tag_list @all_attachments
end
@page = params[:page] || 1
#render :layout => 'base_org'
end
def destroy
@subfield = OrgSubfield.find(params[:id])
@organization = Organization.find(@subfield.organization_id)
@ -29,4 +97,43 @@ class OrgSubfieldsController < ApplicationController
@subfield.update_attributes(:name => params[:name])
end
def update_sub_dir
@org_subfield = OrgSubfield.find(params[:id])
sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+
"and org_subfields.organization_id=#{@org_subfield.organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir_name]}'"
if SubfieldSubdomainDir.find_by_sql(sql).count == 0
if @org_subfield.subfield_subdomain_dir
@sub_dir = @org_subfield.subfield_subdomain_dir
@sub_dir.update_attribute(:name, params[:sub_dir_name])
else
@sub_dir = SubfieldSubdomainDir.create(:org_subfield_id => @org_subfield.id, :name => params[:sub_dir_name])
end
@exist = false
else
@exist = true
end
end
def show_attachments obj
@attachments = []
obj.each do |container|
@attachments += container.attachments
end
@all_attachments = User.current.admin? ? @attachments : visable_attachemnts(@attachments)
@limit = 10
@feedback_count = @all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@obj_attachments = paginateHelper @all_attachments,10
end
#获取指定资源列表的TAG的集合以及每个TAG的数量降序排序
def attachment_tag_list attachments
tag_list = Hash.new
attachments.each do |attachment|
attachment.tag_list.map{|tag| tag_list.has_key?(tag) ? tag_list[tag] = tag_list[tag] + 1 : tag_list[tag] = 1}
end
tag_list.sort {|a,b| b[1]<=>a[1]}
end
end

View File

@ -114,7 +114,7 @@ class OrganizationsController < ApplicationController
@organization = Organization.find(params[:id])
@organization.name = params[:organization][:name]
@organization.description = params[:organization][:description]
@organization.domain = params[:organization][:domain]
# @organization.domain = params[:organization][:domain]
@organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0
#@organization.name = params[:organization][:name]
@organization.save

View File

@ -203,6 +203,8 @@ class ProjectsController < ApplicationController
end
end
# 注意修改该方法的时候注意同步修改forked方法
# forked方法也会创建项目
def create
unless User.current.login?
redirect_to signin_url
@ -222,6 +224,11 @@ class ProjectsController < ApplicationController
#unless User.current.admin?
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r])
# project's score
if ProjectScore.where("project_id=?", @project.id).first.nil?
ProjectScore.create(:project_id => @project.id, :score => false)
end
# end
project_info = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
user_grades = UserGrade.create(:user_id => User.current.id, :project_id => @project.id)
Rails.logger.debug "UserGrade created: #{user_grades.to_json}"
@ -512,6 +519,14 @@ class ProjectsController < ApplicationController
def edit
end
def set_public_or_private
@project = Project.find(params[:id])
if @project.is_public?
@project.update_attribute(:is_public, 0)
else
@project.update_attribute(:is_public, 1)
end
end
# by young
# include CoursesHelper
def member

View File

@ -122,6 +122,9 @@ class RepositoriesController < ApplicationController
if project.save
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r])
if ProjectScore.where("project_id=?", @project.id).first.nil?
ProjectScore.create(:project_id => @project.id, :score => false)
end
project_info = ProjectInfo.new(:user_id => User.current.id, :project_id => project.id)
user_grades = UserGrade.create(:user_id => User.current.id, :project_id => project.id)
Rails.logger.debug "UserGrade created: #{user_grades.to_json}"
@ -349,7 +352,10 @@ update
# @changesets_count = @repository.latest_changesets(@path, @rev).count
@changesets_all_count = @project.gpid.nil? ? 0 : g.project(@project.gpid).commit_count
# 访问该页面的是会后则刷新
if @changesets_all_count != @project.commits_count && @changesets_all_count != 0
if @project.project_score.nil?
ProjectScore.create(:project_id => @project.id, :score => false)
end
if @changesets_all_count != @project.project_score.changeset_num && @changesets_all_count != 0
update_commits_count(@project, @changesets_all_count)
end
# end
@ -580,7 +586,7 @@ update
private
# 更新项目统计数
def update_commits_count project, count
project.update_attribute(:commits_count, count)
project.project_score.update_attribute(:changeset_num, count)
end
def find_repository

View File

@ -0,0 +1,10 @@
class SubfieldSubdomainDirsController < ApplicationController
def update
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
if @org_subfield.subfield_subdomain_dir
@org_subfield.subfield_subdomain_dir.update_attribute(:name, :params[:sub_dir_name])
else
SubfieldSubdomainDir.create(:org_subfield_id => @org_subfield.id, :name => params[:sub_dir_name])
end
end
end

View File

@ -52,7 +52,7 @@ module ApplicationHelper
# 获取项目/课程总分
# 发布缺陷 4分 回复缺陷 1分 提交一次 4分 讨论帖子 2分 回复帖子 1分 发布新闻 1分
def static_project_score obj
score = obj.issues_count * 4 + obj.journals_count + obj.commits_count * 4 + obj.boards_count * 2 + obj.boards_reply_count + obj.news_count + obj.attachments_count * 5
score = obj.issue_num * 4 + obj.issue_journal_num + obj.changeset_num * 4 + obj.board_num * 2 + obj.board_message_num + obj.news_num + obj.attach_num * 5
end
# 获取组织成员中文名字

View File

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

View File

@ -1,6 +1,7 @@
require 'elasticsearch/model'
class Course < ActiveRecord::Base
include Redmine::SafeAttributes
include ApplicationHelper
STATUS_ACTIVE = 1
STATUS_CLOSED = 5

View File

@ -20,8 +20,8 @@ class ForgeActivity < ActiveRecord::Base
validates :forge_act_id,presence: true
validates :forge_act_type, presence: true
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
after_save :add_user_activity, :add_org_activity, :add_acts_count
before_destroy :destroy_user_activity, :destroy_org_activity, :decrease_acts_count
after_save :add_user_activity, :add_org_activity
before_destroy :destroy_user_activity, :destroy_org_activity
#在个人动态里面增加当前动态
def add_user_activity
@ -45,21 +45,6 @@ class ForgeActivity < ActiveRecord::Base
end
end
# 更新动态数
def add_acts_count
if self.project
count = self.project.acts_count + 1
self.project.update_attribute(:acts_count, count)
end
end
def decrease_acts_count
if self.project
count = self.project.acts_count - 1
self.project.update_attribute(:acts_count, count)
end
end
def add_org_activity
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
if org_activity

View File

@ -19,6 +19,7 @@ class Issue < ActiveRecord::Base
include Redmine::SafeAttributes
include Redmine::Utils::DateCalculation
include UserScoreHelper
include ApplicationHelper
belongs_to :project,:touch=> true
belongs_to :tracker
belongs_to :status, :class_name => 'IssueStatus', :foreign_key => 'status_id'
@ -173,14 +174,18 @@ class Issue < ActiveRecord::Base
# 创建issue的时候issues_count加1
def add_issues_count
issue_count = self.project.issues_count + 1
self.project.update_attribute(:issues_count, issue_count)
unless self.project.project_score.nil?
issue_count = self.project.project_score.issue_num + 1
self.project.project_score.update_attribute(:issue_num, issue_count)
end
end
# 删除issue的时候issues_count减1
def decrease_issues_count
issue_count = self.project.issues_count - 1
self.project.update_attribute(:issues_count, issue_count)
unless self.project.project_score.nil?
issue_count = self.project.project_score.issue_num - 1
self.project.project_score.update_attribute(:issue_num, issue_count)
end
end
# 更新缺陷

View File

@ -225,9 +225,9 @@ class Journal < ActiveRecord::Base
# issue留言总数更新
def add_journals_count
unless self.issue.project.nil? && self.journalized_type == "Issue"
if !self.issue.project.nil? && self.journalized_type == "Issue" && self.issue.project.project_score.nil?
project = self.issue.project
project.update_attribute(:journals_count, project.journals_count + 1)
project.project_score.update_attribute(:issue_journal_num, project.project_score.journals_count + 1)
end
end
end

View File

@ -36,7 +36,6 @@ class Message < ActiveRecord::Base
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
# 课程动态
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy
has_many :user_acts, :class_name => 'UserActivity',:as =>:user_act ,:dependent => :destroy
# end
# 课程/项目 消息
@ -129,14 +128,32 @@ class Message < ActiveRecord::Base
# 发帖精辟更新发帖总数
def add_boards_count
if self.project
# 讨论区
if self.parent_id.nil?
count = self.project.boards_count + 1
self.project.update_attribute(:boards_count, count)
else # 回复
count = self.project.boards_reply_count + 1
self.project.update_attribute(:boards_reply_count, count)
unless self.project.project_score.nil?
if self.project
# 讨论区
if self.parent_id.nil?
count = self.project.project_score.board_num + 1
self.project.project_score.update_attribute(:board_num, count)
else # 回复
count = self.project.project_score.board_message_num + 1
self.project.project_score.update_attribute(:board_message_num, count)
end
end
end
end
# 删除帖子的时候更新帖子总数, 删除回复的时候总数不减少
def decrease_boards_count
unless self.project.project_score.nil?
if self.project && self.parent_id.nil?
# 讨论区
if self.parent_id.nil?
count = self.project.project_score.board_num - 1
self.project.project_score.update_attribute(:board_num, count)
else # 回复
count = self.project.project_score.board_message_num - 1
self.project.project_score.update_attribute(:board_message_num, count)
end
end
end
end
@ -326,20 +343,6 @@ class Message < ActiveRecord::Base
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::MESSAGE
end
# 删除帖子的时候更新帖子总数, 删除回复的时候总数不减少
def decrease_boards_count
if self.project && self.parent_id.nil?
# 讨论区
if self.parent_id.nil?
count = self.project.boards_count - 1
self.project.update_attribute(:boards_count, count)
else # 回复
count = self.project.boards_reply_count - 1
self.project.update_attribute(:boards_reply_count, count)
end
end
end
# 课程成员得分(英雄榜)
def act_as_student_score
if self.course

View File

@ -116,9 +116,16 @@ class News < ActiveRecord::Base
private
def add_news_count
if self.project
count = self.project.news_count + 1
self.project.update_attribute(:news_count, count)
if self.project && !self.project.project_score.nil?
count = self.project.project_score.news_num + 1
self.project.project_score.update_attribute(:news_num, count)
end
end
def decrease_news_count
if self.project && !self.project.project_score.nil?
count = self.project.project_score.news_num - 1
self.project.project_score.update_attribute(:news_num, count)
end
end
@ -176,13 +183,6 @@ class News < ActiveRecord::Base
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::NEWS
end
def decrease_news_count
if self.project
count = self.project.news_count - 1
self.project.update_attribute(:news_count, count)
end
end
def send_mail
Mailer.run.news_added(self) if Setting.notified_events.include?('news_added')
end

View File

@ -1,6 +1,7 @@
class OrgDocumentComment < ActiveRecord::Base
attr_accessible :content, :creator_id, :organization_id, :parent_id, :reply_id, :title,:sticky,:locked
include Redmine::SafeAttributes
include ApplicationHelper
belongs_to :organization
belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id'
has_many :editor_of_documents, :dependent => :destroy

View File

@ -1,5 +1,6 @@
class OrgSubfield < ActiveRecord::Base
belongs_to :organization, :foreign_key => :organization_id
has_one :subfield_subdomain_dir,:dependent => :destroy
has_many :org_document_comments, :dependent => :destroy
has_many :files
has_many :org_subfield_messages, :dependent => :destroy

View File

@ -1,7 +1,8 @@
class Poll < ActiveRecord::Base
#attr_accessible :closed_at, :polls_group_id, :polls_name, :polls_status, :polls_type, :published_at, :user_id
include Redmine::SafeAttributes
include ApplicationHelper
belongs_to :user
has_many :poll_questions, :dependent => :destroy,:order => "#{PollQuestion.table_name}.question_number"
has_many :poll_users, :dependent => :destroy

View File

@ -155,7 +155,7 @@ class Project < ActiveRecord::Base
# 创建project之后默认创建一个board之后的board去掉了board的概念
after_create :create_board_sync,:acts_as_forge_activities,:create_project_ealasticsearch_index
before_destroy :delete_all_members,:delete_project_ealasticsearch_index
# after_update :update_project_ealasticsearch_index
after_update :update_project_ealasticsearch_index
def remove_references_before_destroy
return if self.id.nil?
Watcher.delete_all ['watchable_id = ?', id]
@ -1223,26 +1223,27 @@ class Project < ActiveRecord::Base
self.__elasticsearch__.index_document
end
end
# def update_project_ealasticsearch_index
# if self.is_public #如果是初次更新成为公开的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性
# begin
# self.__elasticsearch__.update_document
# rescue => e
# self.__elasticsearch__.index_document
# end
# else #如果是更新成为私有的,那么索引就要被删除
# begin
# self.__elasticsearch__.delete_document
# rescue => e
#
# end
# end
# end
def update_project_ealasticsearch_index
if self.is_public #如果是初次更新成为公开的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性
begin
self.__elasticsearch__.update_document
rescue => e
self.__elasticsearch__.index_document
end
else #如果是更新成为私有的,那么索引就要被删除
begin
self.__elasticsearch__.delete_document
rescue => e
end
end
end
def delete_project_ealasticsearch_index
begin
self.__elasticsearch__.delete_document
rescue => e
end
end

View File

@ -0,0 +1,4 @@
class SubfieldSubdomainDir < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :org_subfield
end

View File

@ -205,7 +205,7 @@
<div class="loginContent">
<div class="loginLeft">
<div class="loginLogo"><img src="images/trustie_big_log.png" width="100" height="88" alt="Trustie Logo" /></div>
<div class="loginInro">&nbsp;&nbsp;欢迎加入Trustie高校创新实践社区!老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。<br/><br/>&nbsp;&nbsp;Trustie是在中国推行大规模开放在线研究模式MOORE的支撑平台。</div>
<div class="loginInro">&nbsp;&nbsp;欢迎加入Trustie创新实践社区在这里您的创新意识和创新潜力将得到充分发挥目前已有超过200所高校和科研机构在平台中开展在线协同开发、协同学习和协同研究。<br/><br/>&nbsp;&nbsp;Trustie社区的理想是让创新过程变的更美好</div>
</div>
<div class="loginRight">
<div id="loginInBox">

View File

@ -26,12 +26,21 @@
) if User.current && User.current.id == activity.author.id %>
</li>
<li>
<%= link_to(
l(:button_set_homepage),
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
:method => :post,
:class => 'postOptionLink'
) if User.current && User.current.id == activity.blog.author_id %>
<% if activity.id == activity.blog.homepage_id %>
<%= link_to(
l(:button_cancel_homepage),
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
:method => :post,
:class => 'postOptionLink'
) if User.current && User.current.id == activity.blog.author_id %>
<% else %>
<%= link_to(
l(:button_set_homepage),
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
:method => :post,
:class => 'postOptionLink'
) if User.current && User.current.id == activity.blog.author_id %>
<% end %>
</li>
</ul>
</li>

View File

@ -43,11 +43,6 @@
</div>
</div>
<% if blog.homepage_id and BlogComment.where("id=?", blog.homepage_id).count > 0 %>
<% homepage = BlogComment.find(blog.homepage_id) %>
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<% end %>
<% if User.current.logged? && User.current.id == @user.id %>
<%= labelled_form_for @article, :url =>{:controller=>'blog_comments',:action => 'create',:user_id=>user.id , :blog_id => blog.id},
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>

View File

@ -36,7 +36,7 @@
</div>
<%end%>
<div class="cl"></div>
<div class="homepagePostTitle hidden m_w530 fl">
<div class="homepagePostTitle hidden m_w530">
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id,
:blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey", :style => 'text-align:center;' %>
</div>

View File

@ -40,7 +40,7 @@
}
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>");
});
</script>
<% if topic %>

View File

@ -1,8 +1,16 @@
$("#project_info_<%=@course.id %>").html('<%=escape_javascript(render :partial=>'layouts/project_info') %>');
if(document.getElementById("course_is_public")) {
<% if @course.is_public == 0%>
$("#course_is_public").attr("checked",false);
<% elsif @course.is_public == 1 %>
$("#course_is_public").attr("checked",true);
<% if params[:user_page].nil? %>
$("#project_info_<%=@course.id %>").html('<%=escape_javascript(render :partial=>'layouts/project_info') %>');
if(document.getElementById("course_is_public")) {
<% if @course.is_public == 0%>
$("#course_is_public").attr("checked",false);
<% elsif @course.is_public == 1 %>
$("#course_is_public").attr("checked",true);
<% end %>
}
<% else %>
<% if @course.is_public? %>
$("#set_course_public_<%= @course.id %>").text("设为私有");
<% else %>
$("#set_course_public_<%= @course.id %>").text("设为公开");
<% end %>
}
<% end %>

View File

@ -1,59 +1,77 @@
<% delete_allowed = User.current.admin? %>
<div class="re_con_top">
<p class="f_l c_blue f_b f_14">共有&nbsp;<%= all_attachments.count%>&nbsp;个资源</p>
<p class="f_r" style="color: #808080">
<% if order == "asc" %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序
<% else %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp; /&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序
<% end %>
</p>
</div>
<div class="cl"></div>
<div class="files_tag" id="files_tag">
<%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
</div>
<div class="cl"></div>
<div class="for_img_thumbnails">
<% org_subfield_attachments.each do |file| %>
<% if 1 %>
<div class="re_con_box" id="container_files_<%= file.id %>">
<div class="">
<%= link_to truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% org_subfield_attachments.each do |file| %>
<div class="resources mt10" id="container_files_<%= file.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTitle break_word mt-4">
<%= link_to truncate(file.filename,length: 35, omission: '...'),
download_named_attachment_path(file.id, file.filename),
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<%= file_preview_eye(file, class: 'preview') %>
<span id="image_private_<%= file.id%>">
<% if file.is_public? == false%>
<span class="img_private ml5">私有</span>
<%end %>
</span>
</div>
<div class="mt5">
<span class="fontGrey2 mr15 fl">上传时间:<%= format_date(file.created_on)%></span>
<% if file.tag_list.length > 0%>
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
<% end %>
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
<p class="fl ml15 fontGrey2">下载<%= file.downloads%>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div>
<div class="cl"></div>
<div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
</div>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<% if User.current.logged? %>
<% if !@org_subfield.attachments.all.include?file %>
<%= link_to("选入栏目",quote_resource_show_org_subfield_org_subfield_file_path(:org_subfield_id => @org_subfield.id, :id => file.id),:class => "f_l re_select c_lorange",:remote => true) %>
<% elsif @org_subfield.organization.org_subfields.where("field_type='Resource'").count > 1 %>
<%= link_to("选入组织其他栏目",quote_resource_show_org_subfield_org_subfield_file_path(:org_subfield_id => @org_subfield.id, :id => file.id),:class => "f_l re_select c_lorange",:remote => true) %>
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
<ul class="homepagePostSettiongText">
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %></li>
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
<li>
<span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
</span>
</li>
<li>
<%= link_to( '删除资源', attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" && file.destroyable %>
</li>
</ul>
<%else%>
<ul class="resourceSendO">
<li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %></li>
</ul>
<% end %>
<%= file_preview_tag(file, class: 'f_l re_open', style:'text-align: center;') %>
<% end %>
</div>
<div class="cl"></div>
<div class="mt5">
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
<%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @org_subfield.id && file.container_type == "OrgSubfield"%>
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div>
<div class="cl"></div>
<div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
</div>
<div class="cl"></div>
</div><!---re_con_box end-->
<% end %>
<% end %>
</div>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
<div class="cl"></div>
</li>
</ul>
</div>
</div>
<div class="cl"></div>
</div>
</div><!---re_con_box end-->
<% end %>
<% if org_subfield_attachments.count == 10 %>
<% if params[:action] == 'search_files_in_subfield' %>
<%=link_to "点击展开更多", search_files_in_subfield_org_subfield_files_path(:org_subfield_id => org_subfield.id,:page => @page.to_i + 1, :name => params[:name],:insite => params[:insite]),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<% else %>
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
<%=link_to "点击展开更多", org_subfield_files_path(:org_subfield_id => org_subfield.id, :page => @page.nil? ? 2 :(@page + 1)), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<%end%>
<% end%>

View File

@ -1,4 +1,4 @@
<%= stylesheet_link_tag 'courses' %>
<%= stylesheet_link_tag 'courses'%>
<script>
function searchone4reload(fileid){
var url = "<%= searchone4reload_org_subfield_files_path(@org_subfield)%>";
@ -11,87 +11,75 @@
}
});
}
function show_upload(obj)
{
switch(obj)
{
// case 1:
// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
// break;
case 2:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 2}) %>');
break;
case 3:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 3}) %>');
break;
case 4:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 4}) %>');
break;
// case 6:
// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 6}) %>');
// break;
default:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 5}) %>');
}
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("popbox_polls");
}
function closeModal()
{
hideModal($("#popbox_upload"));
}
function presscss(id)
{
if(id == "inorg_subfield")
{
$('#inorg_subfield').attr("class", "re_schbtn b_dblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
else
{
$('#inorg_subfield').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_dblue");
}
}
function buttoncss()
{
$('#inorg_subfield').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
</script>
<div class="container">
<div class="resources"><!--资源库内容开始--->
<div class="re_top" style="width:710px;">
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
<%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<div class="homepageRight mt0 ml0">
<div class="homepageRightBanner">
<div class="NewsBannerName"><%= org_subfield.name %></div>
<ul class="resourcesSelect">
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType">
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','','<%= @q%>','<%= org_subfield.id%>');" class="resourcesTypeAll resourcesGrey">全部</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','软件','<%= @q%>','<%= org_subfield.id%>');" class="softwareIcon postTypeGrey">软件</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','媒体','<%= @q%>','<%= org_subfield.id%>');" class="mediaIcon resourcesGrey">媒体</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','代码','<%= @q%>','<%= org_subfield.id%>');" class="codeIcon resourcesGrey">代码</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield,:other=>true)%>','其他','<%= @q%>','<%= org_subfield.id%>');" class="othersIcon resourcesGrey">其它</a></li>
</ul>
</li>
</ul>
</ul>
</div>
<div class="resources mt10" style="padding-bottom:5px;">
<div class="reTop mb5">
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
<%= submit_tag "栏目内搜索", :class => "blueBtn mr5 fl",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
<%= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<input class="blueBtn fr mr5" value="上传资源" onclick="org_upload_files(<%= org_subfield.id %>);">
<%#= link_to "上传资源",subfield_upload_file_org_subfield_files_path(@org_subfield.id, :in_org => 1),:method => "post",:class=>"blueBtn fr mr5",:remote => true %>
<% end %>
<%# if is_org_subfield_teacher(User.current,@org_subfield) || (@org_subfield.publish_resource==1 && User.current.member_of_org_subfield?(@org_subfield) ) %> <!-- show_window('light','fade','20%','35%')-->
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
<p class="c_grey fr mt10 mr5">
上传:
<!--<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(1);">课件</a>&nbsp;|&nbsp;-->
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(2);">软件</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(3);">媒体</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(4);">代码</a>&nbsp;|&nbsp;
<!--<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(6);">论文</a>&nbsp;|&nbsp;-->
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(5);">其他</a>
</p>
<%# end %>
</div><!---re_top end-->
<div class="cl"></div>
<div class="reCon" id="org_subfield_list">
<%= render :partial => 'org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
</div><!---re_con end-->
<div>
<div class="re_con_top">
<div class="files_tag" id="files_tag">
<%#= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
</div>
<div class="cl"></div>
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count %></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080">
<% if @order == "asc" %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>&nbsp;/&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %>&nbsp;排序
<% else %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>&nbsp; /&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %>&nbsp;排序
<% end %>
</p>
</div>
<div class="cl"></div>
</div>
</div>
<div id="org_subfield_list">
<%= render :partial => 'files/org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
</div><!---re_con end-->
</div>
<% html_title(l(:label_attachment_plural)) -%>
<% html_title(l(:label_attachment_plural)) -%>
<script>
function org_upload_files(org_subfield_id){
$.ajax({
url :"/org_subfields/" + org_subfield_id + "/files/subfield_upload_file",
type :'post'
});
}
</script>

View File

@ -7,16 +7,12 @@
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
<%= form_tag(org_subfield_files_path(org_subfield, :in_org => params[:in_org]), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<% if params[:in_org] %>
<div class="c_dark">
<input name="org_subfield_attachment_type[]" type="checkbox" value="2" checked class="c_dblue">软件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="3" class="c_dblue">媒体</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="4" class="c_dblue">代码</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>
</div>
<% else %>
<input type="hidden" name="org_subfield_attachment_type" value="<%= org_subfield_attachment_type %>">
<% end %>
<div class="c_dark">
<input name="org_subfield_attachment_type[]" type="checkbox" value="2" checked class="c_dblue">软件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="3" class="c_dblue">媒体</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="4" class="c_dblue">代码</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>
</div>
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
<%= render :partial => 'files/org_subfield_upload_attachment_list', :locals => {:container => org_subfield}%>
<div class="cl"></div>

View File

@ -2,4 +2,6 @@
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/course_list',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
<% elsif @project %>
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/project_list', :locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments})%>");
<% elsif @org_subfield %>
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/org_subfield_list', :locals => {org_subfield:@org_subfield, all_attachments:@all_attachments, sort:@sort, order:@order, org_subfield_attachments:@obj_attachments})%>");
<%end %>

View File

@ -1,2 +1,8 @@
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
<% if (@obj_pages &&( @obj_pages.page > 1)) || (@feedback_pages && (@feedback_pages.page > 1)) %>
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/org_subfield_list',
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach} )%>");
<% else %>
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
$("#attachment_count").html("<%= @result.count %>");
<% end %>

View File

@ -1,31 +1,31 @@
<% courses.each do |course|%>
<%# pro = Project.find course.course_id %>
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%>
<div class="homepagePostSetting mt5 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>
<li><%= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>
<li><%= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
</li>
</ul>
</li>
</ul>
</div>
</li>
<% end %>
<% if courses.size == 5%>
<li class="homepageLeftMenuMore" id="show_more_org_course">
<input type="hidden" value="<%= page%>" id="org_course_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_course('<%= more_org_courses_organization_path(org_id)%>');"></a>
</li>
<% courses.each do |course|%>
<%# pro = Project.find course.course_id %>
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%>
<!--<div class="homepagePostSetting mt5 mr10">-->
<!--<ul>-->
<!--<li class="menuSetting">-->
<!--<ul class="homepagePostSettiongText boxShadow">-->
<!--<li><%#= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>-->
<!--<li><%#= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>-->
<!--<li><%#= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>-->
<!--<li><%#= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>-->
<!--<li>-->
<!--<%# if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>-->
<!--<%#= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>-->
<!--<%# else %>-->
<!--<#%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'delete',:class => 'postOptionLink',:remote => true %>-->
<!--<%# end %>-->
<!--</li>-->
<!--</ul>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
</li>
<% end %>
<% if courses.size == 5%>
<li class="homepageLeftMenuMore" id="show_more_org_course">
<input type="hidden" value="<%= page%>" id="org_course_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_course('<%= more_org_courses_organization_path(org_id)%>');"></a>
</li>
<% end%>

View File

@ -1,30 +1,30 @@
<% projects.each do |project|%>
<%# pro = Project.find project.project_id %>
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
<div class="homepagePostSetting mt5 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>
<li><%=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
</li>
</ul>
</li>
</ul>
</div>
</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>
<% projects.each do |project|%>
<%# pro = Project.find project.project_id %>
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
<!--<div class="homepagePostSetting mt5 mr10">-->
<!--<ul>-->
<!--<li class="menuSetting">-->
<!--<ul class="homepagePostSettiongText boxShadow">-->
<!--<li><%#=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>-->
<!--<li><%#=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>-->
<!--<li><%#= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>-->
<!--<li>-->
<!--<%# if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>-->
<!--<#%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>-->
<!--<%# else %>-->
<!--<%#= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>-->
<!--<%# end %>-->
<!--</li>-->
<!--</ul>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
</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

@ -1,31 +1,75 @@
<% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine pr">
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", :title => course.name+""+course.time.to_s+course.term+""%>
<div class="homepagePostSetting mt8 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>
<li><%= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>
<li><%= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
</li>
</ul>
</li>
</ul>
</div>
</li>
<% end %>
<% if courses.size == 5%>
<li class="homepageLeftMenuMore" id="user_show_more_course">
<input type="hidden" value="<%= page%>" id="course_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_course('<%= user_courses4show_user_path(user.id)%>');"></a>
</li>
<% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine pr">
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
:title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+""+course.time.to_s+course.term+""%>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">
<% if is_teacher %>
<li class="subNavRow">
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'fl fontGrey2 w48', :target => '_blank' %>
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'fr fb', :title => '发布作业',:target => '_blank' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%= link_to "通知", course_news_index_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+", new_course_news_path(course,:is_new=>1), :class => 'fr fb', :title => '发布通知',:target => '_blank' %>
<div class="cl"></div>
</li>
<% else %>
<li class="subNavRow">
<%= link_to "作业",homework_common_index_path(:course => course.id), :target => '_blank' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%= link_to "通知", course_news_index_path(course),:target => '_blank' %>
<div class="cl"></div>
</li>
<% end %>
<% if is_teacher || (course.publish_resource == 1 && User.current.member_of_course?(course)) %>
<li class="subNavRow">
<%= link_to "资源",course_files_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'fr fb',:remote => true, :title => '上传资源' %>
<div class="cl"></div>
</li>
<% else %>
<li class="subNavRow">
<%= link_to "资源",course_files_path(course),:target => '_blank' %>
<div class="cl"></div>
</li>
<% end %>
<li class="subNavRow">
<%= link_to "论坛",course_boards_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'fr fb', :title => '发布帖子',:target => '_blank' %>
<div class="cl"></div>
</li>
<% if User.current == @user %>
<li class="subNavRow">
<% if count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete' %>
<% end %>
</li>
<% end %>
<% if User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<li class="subNavRow">
<%= link_to course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => course,:user_page => true},
:id => "set_course_public_#{course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
<div class="cl"></div>
</li>
<% end %>
</ul>
</li>
</ul>
</li>
<% end %>
<% if courses.size == 5%>
<li class="homepageLeftMenuMore" id="user_show_more_course">
<input type="hidden" value="<%= page%>" id="course_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_course('<%= user_courses4show_user_path(user.id)%>');"></a>
</li>
<% end%>

View File

@ -1,29 +1,56 @@
<% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine pr">
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
<div class="homepagePostSetting mt8 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>
<li><%=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
</li>
</ul>
</li>
</ul>
</div>
</li>
<% end %>
<% if projects.size == 5%>
<li class="homepageLeftMenuMore" id="user_show_more_project">
<input type="hidden" value="<%= page%>" id="project_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_project('<%= user_projects4show_user_path(user.id)%>');"></a>
</li>
<% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine pr">
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">
<li class="subNavRow">
<%=link_to "问题跟踪", project_issues_path(project), :class => 'fl fontGrey2', :target => '_blank',:style => "width:48px;" %>
<%=link_to "+", new_project_issue_path(project), :class => 'fr fb', :target => '_blank',:style => "width:48px;", :title => '发布问题',:style =>'width:10px;' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%=link_to "资源", project_files_path(project),:class => 'fl fontGrey2 w48' %>
<%=link_to "+", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'fr fb',:title => '上传资源'%>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%=link_to "论坛", project_boards_path(project),:class => 'fl fontGrey2 w48', :target => '_blank'%>
<%=link_to "+", project_boards_path(project, :flag => true),:class => 'fr fb', :target => '_blank',:title => '发布帖子'%>
<div class="cl"></div>
</li>
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, project)) && rep_is_gitlab?(project) %>
<li class="subNavRow">
<%= link_to '版本库', url_for(:controller => 'projects', :action => 'settings', :id => project.id, :tab=>'repositories') , :target => '_blank',:class => "fl w48",:title => '版本库' %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current == @user %>
<li class="subNavRow">
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true %>
<% end %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current.logged? && (User.current.admin? || is_project_manager?(User.current,project)) %>
<li class="subNavRow">
<%= link_to project.is_public? ? "设为私有" : "设为公开", {:controller => 'projects', :action => 'set_public_or_private', :id => project.id,:user_page => true},
:id => 'set_project_public_'+ project.id.to_s,:method => 'post',:remote=>true,:confirm=>"您确定要设置为"+(project.is_public? ? "私有" : "公开")+"吗"%>
<div class="cl"></div>
</li>
<% end %>
</ul>
</li>
</ul>
</li>
<% end %>
<% if projects.size == 5%>
<li class="homepageLeftMenuMore" id="user_show_more_project">
<input type="hidden" value="<%= page%>" id="project_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_project('<%= user_projects4show_user_path(user.id)%>');"></a>
</li>
<% end%>

View File

@ -76,9 +76,9 @@
<div class="cl"></div>
<div>
<% if @project.project_type == 0 %>
<% unless static_project_score(@project) == 0 %>
<% unless static_project_score(@project.project_score) == 0 %>
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
<%= link_to(format("%.2f" ,static_project_score(@project) ).to_i,
<%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
{:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
@ -95,8 +95,8 @@
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<span>|&nbsp;</span>
<%= l(:project_module_attachments) %>
<% @project.attachments_count %>
<%= link_to "#{@project.attachments_count}", project_files_path(@project), :class => 'info_foot_num c_blue', :id=>'project_files_count_info' %></span>
<% @project.project_score.attach_num %>
<%= link_to "#{@project.project_score.attach_num }", project_files_path(@project), :class => 'info_foot_num c_blue', :id=>'project_files_count_info' %></span>
<% end %>
</div>
<div class="cl"></div>

View File

@ -1,287 +1,297 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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 %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'share','new_user', 'user_leftside','prettify','users',:media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 在生成的公式图片上去掉Math定义的右键菜单$$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script>
$(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block");
})
$("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none");
})
$(".homepagePostPortrait").mouseover(function(){
$(this).children(".userCard").css("display","block");
})
$(".homepagePostPortrait").mouseout(function(){
$(this).children(".userCard").css("display","none");
})
$(".userCard").mouseover(function(){
$(this).css("display","block");
})
$(".userCard").mouseout(function(){
$(this).css("display","none");
})
$(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff");
})
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
})
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999");
})
$(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080");
$(this).css("z-index", "1");
})
})
</script>
</head>
<body onload="prettyPrint();">
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%>
<% 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="homepageRightBannerImg"></div-->
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft" id="LSide">
<div class="homepagePortraitContainer">
<div class="homepagePortraitImage fl" id="homepage_portrait_image">
<%= image_tag(url_to_avatar(@user),width:"78", height: "78", :id=>'nh_user_tx') %>
<% if User.current.logged?%>
<% if is_current_user%>
<div id="edit_user_file_btn" class="none">
<div class="homepageEditProfile">
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
</div>
</div>
<% end %>
<% end%>
</div>
<div class="fl ml10">
<p class="homepageImageName hidden db mb5">
<%= @user.realname.blank? ? @user.login : @user.realname %>
</p>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></span>
<% end %>
<div class="cl"></div>
<% if @user.user_extensions && @user.user_extensions.identity %>
<p class="mb8 c_dark f14">
<%= get_user_roll @user %>
</p>
<% end%>
<div id="watch_user_btn_div">
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
</div>
<div class="cl"></div>
<div>
<div class="homepageSignature break_word">
<p id="user_brief_introduction_show">
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</p>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
</div>
<div>
<div class="homepageImageBlock">
<div>
<%= link_to(@user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count,
{:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
</div>
<div class="homepageImageText">
<%= link_to('博客',
{:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div id="watch_user_number_div">
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
</div>
<div class="homepageImageText">
<%= link_to '关注', {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div id="fans_user_number_div">
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
</div>
<div class="homepageImageText">
<%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock">
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
</div>
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
<% if is_current_user%>
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<div class="courseMenu" id="courseMenu">
<ul>
<li class="courseMenuIcon" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_course_menu">
<li>
<%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
</li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li>
<%= link_to "加入课程",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
</li>
</ul>
</li>
</ul>
</div>
<% else%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true, :title => "加入课程"%>
<% end%>
<% end%>
</div>
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
<ul>
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
</ul>
</div>
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
<% if is_current_user%>
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :title => "新建项目"%>
<% end%>
</div>
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" id="homepageLeftMenuForge">
<ul>
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
</ul>
</div>
<div class="homepageLeftMenuBlock">
<!--<a href="javascript:void(0);" class="homepageMenuText">留言</a>-->
<%= link_to '留言',feedback_path(@user, :host=> Setting.host_user),:class=>'homepageMenuText'%>
</div>
</div>
<div class="homepageLeftLabelContainer">
<div class="project_Label_New">
<span class="homepageLabelText">标签</span>
<div class="tag_h ml10" >
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="homepageRight">
<%= yield %>
</div>
</div>
<%= render :partial => 'layouts/new_feedback' %>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
<input type="button" class="uppic_btn" onclick="$('#upload_user_image').click();" value="浏览.."/>
<%= file_field_tag 'avatar[image]',
:id => "upload_user_image",
:style => 'display:none;',#added by young
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
: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 => @user.class.to_s,
:source_id => @user.id.to_s
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10 f14">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->
</div>
<script type="text/javascript">
$("#courseMenu").mouseenter(function(){
$("#topnav_course_menu").show();
});
$("#courseMenu").mouseleave(function(){
$("#topnav_course_menu").hide();
});
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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 %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'share','new_user', 'user_leftside','prettify','users',:media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 在生成的公式图片上去掉Math定义的右键菜单$$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script>
$(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block");
})
$("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none");
})
$(".homepagePostPortrait").mouseover(function(){
$(this).children(".userCard").css("display","block");
})
$(".homepagePostPortrait").mouseout(function(){
$(this).children(".userCard").css("display","none");
})
$(".userCard").mouseover(function(){
$(this).css("display","block");
})
$(".userCard").mouseout(function(){
$(this).css("display","none");
})
$(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff");
})
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
});
//侧导航栏配置设置
$(".homepageLeftMenuCoursesLine").mouseover(function(){
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -82px -399px no-repeat");
$(this).children().css("color","#ffffff");
});
$(".homepageLeftMenuCoursesLine").mouseout(function(){
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -6px -354px no-repeat");
$(this).children().css("color","#808080");
});
$(".subNavRow").mouseover(function(){
$(this).css("background-color","#269ac9");
$(this).children().css("color","#ffffff");
});
$(".subNavRow").mouseout(function(){
$(this).css("background-color","#ffffff");
$(this).children().css("color","#888888");
});
})
</script>
</head>
<body onload="prettyPrint();">
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%>
<% 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="homepageRightBannerImg"></div-->
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft" id="LSide">
<div class="homepagePortraitContainer">
<div class="homepagePortraitImage fl" id="homepage_portrait_image">
<%= image_tag(url_to_avatar(@user),width:"78", height: "78", :id=>'nh_user_tx') %>
<% if User.current.logged?%>
<% if is_current_user%>
<div id="edit_user_file_btn" class="none">
<div class="homepageEditProfile">
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
</div>
</div>
<% end %>
<% end%>
</div>
<div class="fl ml10">
<p class="homepageImageName hidden db mb5" style="margin-left:0px;margin-right:0px;">
<%= @user.realname.blank? ? @user.login : @user.realname %>
</p>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></span>
<% end %>
<div class="cl"></div>
<% if @user.user_extensions && @user.user_extensions.identity %>
<p class="mb8 c_dark f14">
<%= get_user_roll @user %>
</p>
<% end%>
<div id="watch_user_btn_div">
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
</div>
<div class="cl"></div>
<div>
<div class="homepageSignature break_word">
<p id="user_brief_introduction_show">
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</p>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
</div>
<div>
<div class="homepageImageBlock">
<div>
<%= link_to(@user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count,
{:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
</div>
<div class="homepageImageText">
<%= link_to('博客',
{:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div id="watch_user_number_div">
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
</div>
<div class="homepageImageText">
<%= link_to '关注', {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div id="fans_user_number_div">
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
</div>
<div class="homepageImageText">
<%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock">
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
</div>
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
<% if is_current_user%>
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<div class="courseMenu" id="courseMenu">
<ul>
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_course_menu">
<li>
<%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
</li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li>
<%= link_to "加入课程",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
</li>
</ul>
</li>
</ul>
</div>
<% else%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入课程"%>
<% end%>
<% end%>
</div>
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
<ul>
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
</ul>
</div>
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
<% if is_current_user%>
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%>
<% end%>
</div>
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" id="homepageLeftMenuForge">
<ul>
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
</ul>
</div>
<div class="homepageLeftMenuBlock">
<!--<a href="javascript:void(0);" class="homepageMenuText">留言</a>-->
<%= link_to '留言',feedback_path(@user, :host=> Setting.host_user),:class=>'homepageMenuText'%>
</div>
</div>
<div class="homepageLeftLabelContainer">
<div class="project_Label_New">
<span class="homepageLabelText">标签</span>
<div class="tag_h ml10" >
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="homepageRight">
<%= yield %>
</div>
</div>
<%= render :partial => 'layouts/new_feedback' %>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
<input type="button" class="uppic_btn" onclick="$('#upload_user_image').click();" value="浏览.."/>
<%= file_field_tag 'avatar[image]',
:id => "upload_user_image",
:style => 'display:none;',#added by young
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
: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 => @user.class.to_s,
:source_id => @user.id.to_s
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10 f14">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->
</div>
<script type="text/javascript">
$("#courseMenu").mouseenter(function(){
$("#topnav_course_menu").show();
});
$("#courseMenu").mouseleave(function(){
$("#topnav_course_menu").hide();
});
</script>
</body>
</html>

View File

@ -0,0 +1,80 @@
<script>
$(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block");
})
$("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none");
})
$(".homepagePostPortrait").mouseover(function(){
$(this).children(".userCard").css("display","block");
})
$(".homepagePostPortrait").mouseout(function(){
$(this).children(".userCard").css("display","none");
})
$(".userCard").mouseover(function(){
$(this).css("display","block");
})
$(".userCard").mouseout(function(){
$(this).css("display","none");
})
$(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff");
})
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
})
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999");
})
$(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080");
$(this).css("z-index", "1");
})
})
</script>
<% unless org_activities.nil? %>
<% org_activities.each do |act| %>
<script>
$(function() {
init_activity_KindEditor_data(<%= act.id%>, null, "87%", "<%=act.class.to_s%>");
});
</script>
<% if act.container_type == 'Organization' %>
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
<%= render :partial => 'organizations/show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
<% end %>
<% end %>
<% if act.container_type == 'Project' %>
<% case act.org_act_type.to_s %>
<% when 'Message' %>
<%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
<% end %>
<% end %>
<% if act.container_type == 'Course' %>
<% case act.org_act_type.to_s %>
<% when 'Message'%>
<%= render :partial => 'organizations/org_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
<% end %>
<% end %>
<% if act.container_type == 'OrgSubfield' %>
<% if act.org_act_type == 'Message' and act.org_act_id and Message.where("id=#{act.org_act_id}").count > 0 %>
<% message = Message.find(act.org_act_id) %>
<% if !message.board.course_id.nil? %>
<%= render :partial => 'organizations/org_course_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
<% elsif message.board.project_id != -1 %>
<%= render :partial => 'organizations/project_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
<% elsif message.board.org_subfield_id %>
<%= render :partial => 'organizations/org_subfield_message', :locals => {:activity => message, :user_activity_id => act.id} %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if org_act_count == 10 %>
<%= link_to "点击展开更多",show_org_subfield_organization_path(:id => @organization.id,:page => @page.to_i + 1,:sub_dir_name => params[:sub_dir_name]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end%>

View File

@ -0,0 +1,35 @@
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<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"><%= @org_subfield.name %></div>
</div>
<% if @org_activities %>
<%= render :partial => 'org_subfields/show_details',
:locals => {:org_activities => @org_activities,
:page=> @page,
:org => @organization,
:org_act_count=> @org_activities.count} %>
<% end %>

View File

@ -1,7 +1,11 @@
$("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#subfield_name").val("");
<% if @res %>
$("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#subfield_name").val("");
<% else %>
$("#subfield_name").val("");
<% end %>

View File

@ -0,0 +1,525 @@
<% if @org_subfield.field_type == 'Resource' %>
<div id="resource_list">
<%= render :partial => 'files/subfield_files', locals: {org_subfield: @org_subfield} %>
</div>
<% else %>
<%= render :partial => 'org_subfields/show_post_type'%>
<% end %>
<script type='text/javascript'>
var slideHeight = 29;
function readmore(aNode) {
// console.log(aNode)
// var $td_tags_area = $(aNode).parent().parent();
var $td_tags_area = $(aNode).parent().parent().parent().parent();
var $tags_area = $td_tags_area.find('.tags_area')
var $tags_gradint = $td_tags_area.find('.tags_gradint')
var $read_more = $td_tags_area.find('.read-more')
var $read_more_a = $td_tags_area.find('.read-more a')
var $tags = $td_tags_area.find('#tags')
var $icona = $td_tags_area.find('.tags_icona')
var slideHeight = 13; //px
var defHeight = $tags.height();
var curHeight = $tags_area.height();
if (curHeight == slideHeight) {
$tags_area.animate({
height: defHeight
}, 'normal');
$read_more_a.html('隐藏');
$icona.html('<%=image_tag "/images/sidebar/minus.png"%>')
$tags_gradint.fadeOut();
} else {
$tags_area.animate({
height: slideHeight
}, 'normal');
$read_more_a.html('更多');
$icona.html('<%=image_tag "/images/sidebar/add.png"%>')
$tags_gradint.fadeIn();
}
;
}
$(function () {
var slideHeight = 20; //px
var defHeight = $('.tags_area').height();
if (defHeight >= slideHeight) {
$('.tags_area').css('height', slideHeight + 'px');
}
;
});
function eval_ajax(xhr, textStatus) {
if (textStatus == 'success') {
eval(xhr.responseText);
} else if (textStatus == 'error') {
alert('error');
}
}
function attachment_contenttypes_searchex(value) {
<% if @project%>
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function attachtype_edit(value) {
<% if @project%>
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function attachmenttypes_change(id, type) {
<% if @project%>
$.ajax({
url: '<%=updateType_attachments_path%>',
type: "POST",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: $('#attach_sufix_browse').val()
}
}).error(function () {
alert('error');
});
} else if (textStatus == 'error') {
alert('An error has occurred');
}
});
<%end%>
}
function org_id_click(){
var sendText = $("input[name='org_id']:checked").next().text();
var orgDirection = "目标地址:"
$(".orgDirection").text(orgDirection + sendText);
}
function subfield_click(){
var sendText = $("input[name='org_id']:checked").next().text();
var orgDirection = "目标地址:"
var sendColumn = $("input[name='subfield']:checked").next().text();
$(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
}
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({
url: '<%=updateType_attachments_path%>',
type: "POST",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: $('#attach_sufix_browse').val()
}
}).error(function () {
alert('error');
});
} else if (textStatus == 'error') {
alert('An error has occurred');
}
});
<%end%>
}
// 编辑文件密级
function file_dense_edit(id, type) {
$.ajax({
url: '<%=updateFileDense_attachments_path%>',
type: "POST",
remote:"true",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
});
}
function observeSearchfieldOnInput(fieldId, url,send_id,send_ids) {
$('#'+fieldId).each(function() {
var $this = $(this);
$this.addClass('autocomplete');
$this.attr('data-value-was', $this.val());
var check = function() {
var val = $this.val();
if ($this.attr('data-value-was') != val){
$this.attr('data-value-was', val);
$.ajax({
url: url,
type: 'get',
data: {search: $this.val(),send_id:send_id,send_ids:send_ids},
success: function(data){ },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
}
};
var reset = function() {
if (timer) {
clearInterval(timer);
timer = setInterval(check, 300);
}
};
var timer = setInterval(check, 300);
$this.bind('keyup click mousemove', reset);
});
}
function check_des(event){
if($(".sectionContent").find('input[type="radio"]:checked').length <= 0){
event.preventDefault();
$(".orgDirection").text('目标地址组织不能为空')
return false;
}else if($(".columnContent").find('input[type="radio"]:checked').length <= 0){
event.preventDefault();
$(".orgDirection").text('目标地址栏目不能为空')
return false;
}else{
return true;
}
}
<% if User.current.logged? %>
var sendType = '1';
var lastSendType ;//初始为发送到我的课程
function show_send(id){
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current)%>' + '?send_id=' + id
});
}else if(lastSendType == '1'){
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + id
});
}else if( lastSendType == '3'){//组织
$.ajax({
type: 'get',
url: '<%= search_user_org_user_path(User.current)%>' + '?send_id=' + id
});
}else{
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + id
});
}
}
//id 发送的id
//发送的id数组
function chooseSendType(res_id,res_ids){
sendType = $(".resourcesSendType").val();
if (sendType === lastSendType) {
return;
} else if(lastSendType != null) { //不是第一次点击的时候
if (sendType == '1') {
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + res_id
});
} else if(sendType == '2') {
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current)%>' + '?send_id=' + res_id
});
}else if(sendType == '3'){
$.ajax({
type: 'get',
url: '<%= search_user_org_user_path(User.current)%>' + '?send_id=' + res_id
});
}
}
lastSendType = sendType;
}
<% end %>
<% if @course %>
var tagNameHtml; //当前双击的链接的父节点的html
var tagName; //标签的值
var parentCssBorder; //当前双击的链接的父节点
var ele; //当前双击的链接
var tagId; //标签的id
var taggableType; //被标签的类型
//这里renameTag有两种情况一种是改变某个资源的tag名称。如果其他资源也有这个tag。则新增一个改变后的tag名
//第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
//目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id就是第一种情况。如果没有id。就是第二种情况
function rename_tag(domEle,name,id,type){
if(String(id) != '' || '<%=User.current.allowed_to?(:as_teacher,@course)%>' == 'true' ) { //如果有id 或者是老师就都能编辑否则没有id不是老师就不能编辑
isdb = true; //这是双击
//clearTimeout(clickFunction);
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
return;
}
tagNameHtml = domEle.parent().html()
tagName = name;
parentCssBorder = domEle.parent().css("border");
ele = domEle;
tagId = id;
taggableType = type;
width = parseInt(domEle.css('width').replace('px', '')) >= 100 ? parseInt(domEle.css('width').replace('px', '')) : 100
domEle.html('<input name="" id="renameTagName" maxlength="120" minlength="1" style="width:' + width + 'px;" value="' + name + '"/>');
domEle.parent().css("border", "1px solid #ffffff");
$("#renameTagName").focus();
}
}
//监听所有的单击事件
$(function(){
$("#renameTagName").live("blur",function(){
updateTagName();
}).live("keypress",function(e){
if (e.keyCode == '13') {
updateTagName();
}
});
});
//执行修改TAGName方法
function updateTagName(){
if(isdb){
isdb = false;
if($("#renameTagName").val() == tagName){ //如果值一样,则恢复原来的状态
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
}
else{
$.post(
'<%= update_tag_name_path %>',
{"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>}
);
}
}
}
// $(document.body).click(function(e){
// isdb = false; //这是单击
// node = document.elementFromPoint(e.clientX, e.clientY);
// if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了
// isdb = true; //为了防止在编辑的时候又去单击其他tag去过滤。导致tag过滤不可用
// return;
// }
// if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
// if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
// ele.parent().css("border","");
// ele.parent().html(tagNameHtml);
//
// }else{ //否则就要更新tag名称了
//// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ 去掉询问
// $.post(
// '<%#= update_tag_name_path %>',
// {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%#= @course.id%>}
// )
//// }else{
//// ele.parent().css("border","");
//// ele.parent().html(tagNameHtml);
//// }
// }
// }
// });
<%end %>
<% if @project %>
var tagNameHtml; //当前双击的链接的父节点的html
var tagName; //标签的值
var parentCssBorder; //当前双击的链接的父节点
var ele; //当前双击的链接
var tagId; //标签的id
var taggableType; //被标签的类型
//这里renameTag有两种情况一种是改变某个资源的tag名称。如果其他资源也有这个tag。则新增一个改变后的tag名
//第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
//目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id就是第一种情况。如果没有id。就是第二种情况
function rename_tag(domEle,name,id,type){
if(String(id) != '' || '<%=is_project_manager?(User.current.id, @project.id)%>' == 'true' ) { //如果有id 或者是老师就都能编辑否则没有id不是老师就不能编辑
isdb = true; //这是双击
//clearTimeout(clickFunction);
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
return;
}
tagNameHtml = domEle.parent().html()
tagName = name;
parentCssBorder = domEle.parent().css("border");
ele = domEle;
tagId = id;
taggableType = type;
width = parseInt(domEle.css('width').replace('px', '')) >= 100 ? parseInt(domEle.css('width').replace('px', '')) : 100
domEle.html('<input name="" id="renameTagName" maxlength="120" minlength="1" style="width:' + width + 'px;" value="' + name + '"/>');
domEle.parent().css("border", "1px solid #ffffff");
$("#renameTagName").focus();
}
}
//监听所有的单击事件
$(function(){
$("#renameTagName").live("blur",function(){
updateTagName();
}).live("keypress",function(e){
if (e.keyCode == '13') {
updateTagName();
}
});
});
//执行修改TAGName方法
function updateTagName(){
if(isdb){
isdb = false;
if($("#renameTagName").val() == tagName){ //如果值一样,则恢复原来的状态
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
}
else{
$.post(
'<%= update_project_tag_name_path %>',
{"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"projectId":<%= @project.id %>}
);
}
}
}
<%end %>
<% if @org_subfield %>
var tagNameHtml; //当前双击的链接的父节点的html
var tagName; //标签的值
var parentCssBorder; //当前双击的链接的父节点
var ele; //当前双击的链接
var tagId; //标签的id
var taggableType; //被标签的类型
//这里renameTag有两种情况一种是改变某个资源的tag名称。如果其他资源也有这个tag。则新增一个改变后的tag名
//第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
//目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id就是第一种情况。如果没有id。就是第二种情况
function rename_tag(domEle,name,id,type){
if(1) {
isdb = true; //这是双击
//clearTimeout(clickFunction);
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
return;
}
tagNameHtml = domEle.parent().html()
tagName = name;
parentCssBorder = domEle.parent().css("border");
ele = domEle;
tagId = id;
taggableType = type;
width = parseInt(domEle.css('width').replace('px', '')) >= 100 ? parseInt(domEle.css('width').replace('px', '')) : 100
domEle.html('<input name="" id="renameTagName" maxlength="120" minlength="1" style="width:' + width + 'px;" value="' + name + '"/>');
domEle.parent().css("border", "1px solid #ffffff");
$("#renameTagName").focus();
}
}
//监听所有的单击事件
$(function(){
$("#renameTagName").live("blur",function(){
updateTagName();
}).live("keypress",function(e){
if (e.keyCode == '13') {
updateTagName();
}
});
});
//执行修改TAGName方法
function updateTagName(){
if(isdb){
isdb = false;
if($("#renameTagName").val() == tagName){ //如果值一样,则恢复原来的状态
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
}
else{
$.post(
'<%= tags_update_org_subfield_tag_name_path %>',
{"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"org_subfield_id":<%= @org_subfield.id %>}
);
}
}
}
<%end %>
function show_attachments_history(){
}
//更新文件版本 表单提交确认,原则是只能有一个更新文件
function upload_attachment_version(event){
if($("#upload_form").find('.upload_filename').length > 1){
$("#upload_file_count").html('(只能上传一个更新文件)')
event.preventDefault();
return false;
}else if($("#upload_form").find('.upload_filename').length == 0){
$("#upload_file_count").html('(请上传一个更新文件)')
event.preventDefault();
return false;
}else{
$("#upload_form").submit();
}
}
</script>
<script type='text/javascript'>
function tagAddClick(divid, objId, objTag) {
alert("OK");
$.ajax({
type: "POST",
url: '/users/tag_saveEx',
data: {
tagname: $('tag_name').value,
obj_id: encodeURIComponent(objId),
obj_flag: encodeURIComponent(objTag)
},
success: function (data, textStatus) {
alert("OK");
$(divid).empty();
$(divid).html('123');
$("#" + divid + " #name").val("");
}
})
}
</script>

View File

@ -0,0 +1,5 @@
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'org_subfields/show_details',
:locals => {:org_activities =>@org_activities,
:page=>@page,
:org => @organization,
:org_act_count=>@org_activities.count} )%>");

View File

@ -0,0 +1,11 @@
<% if @exist == false %>
$('#sub_dir_show_<%= @org_subfield.id %>').html('<%= @sub_dir.name %>');
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @sub_dir.name %>');
// $('#sub_dir_show_<%= @org_subfield.id %>').show();
// $('#sub_dir_edit_<%= @org_subfield.id %>').hide();
<% else %>
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @org_subfield.subfield_subdomain_dir.nil? ? '': @org_subfield.subfield_subdomain_dir.name %>');
// alert("该目录已存在,请重新输入");
// $('#sub_dir_edit_<%#= @org_subfield.id %>').find('input').val('<%#= @org_subfield.subfield_subdomain_dir.nil? ? "未设置":@org_subfield.subfield_subdomain_dir.name %>');
// $('#sub_dir_edit_<%#= @org_subfield.id %>').focus();
<% end %>

View File

@ -1,297 +1,297 @@
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4">
<% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)" -->
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"-->
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
</div>
<% if activity.homework_detail_manual%>
<% if activity.homework_detail_manual.comment_status == 1%>
<% if activity.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<% if Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
<span class="green_homework_btn_cir ml5">作品提交中</span>
<% elsif Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
<span class="red_homework_btn_cir ml5">作品补交中</span>
<% end %>
<% elsif activity.homework_detail_manual.comment_status == 2%>
<% if activity.anonymous_comment == 0%>
<span class="green_homework_btn_cir ml5">匿评中</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
<% elsif activity.homework_detail_manual.comment_status == 3%>
<% if activity.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
<% end%>
<% end%>
<div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %>
<div class="homepagePostSubmitContainer">
<% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%>
<% projects = cur_user_projects_for_homework activity %>
<% works = cur_user_works_for_homework activity %>
<% if works.nil? && projects.nil? %>
<div class="homepagePostSubmit">
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
</div>
<% elsif works.nil? %>
<div class="homepagePostSubmit">
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
</div>
<% end %>
<% end %>
<div class="homepagePostSubmit">
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
<%= user_for_homework_common activity,is_teacher %>
</div>
<% if activity.homework_type == 2 && is_teacher%>
<div class="homepagePostSubmit">
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
</div>
<% end %>
<% if activity.homework_type == 2%>
<div class="homepagePostDeadline mr15">
语言:
<%= activity.language_name%>
</div>
<% end %>
<% if activity.homework_type == 3 && activity.homework_detail_group%>
<div class="homepagePostDeadline mr15">
分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人
</div>
<% end %>
<% if activity.homework_detail_manual && activity.homework_detail_manual.comment_status < 2 %>
<div class="homepagePostDeadline">提交截止时间:<%= activity.end_time.to_s %>&nbsp;23:59</div>
<% elsif activity.homework_detail_manual && activity.homework_detail_manual.comment_status >= 2 %>
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %>&nbsp;23:59</div>
<% end %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.description.html_safe %>
</div>
</div>
<div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= activity.late_penalty%>分
</div>
<% if activity.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=user_activity_id %>">
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%>&nbsp;00:00
</div>
<% end %>
</div>
<div class="cl"></div>
<div>
<div class="homepagePostDeadline">
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
</div>
<% if activity.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>">
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%>&nbsp;23:59
</div>
<% end %>
</div>
<div class="cl"></div>
<% if activity.student_works.count != 0 %>
<% sw = activity.student_works.reorder("created_at desc").first %>
<div class="mt10 homepagePostDeadline">
<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
</div>
<% end %>
<div class="cl"></div>
<% if activity.student_works.count != 0 %>
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
<% unless student_work_scores.empty? %>
<% last_score = student_work_scores.first %>
<div class="mt5 homepagePostDeadline">
<%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品
</div>
<% end %>
<% end %>
<div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<div class="mt10">
<% projects = activity.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div>
<div class="cl"></div>
<% projects.each do |pro| %>
<% project = Project.find pro.project_id %>
<script type="text/javascript">
$(document).ready(function(){
$("#project_img_<%=project.id %>_<%=activity.id %>").mouseover(function(){
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","block");
}).mouseout(function(){
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","none");
});
});
</script>
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
<% end %>
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%= project.commits_count %>提交</p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
更新时间:<%=time_from_now time %>
</div>
</div>
<% end %>
</div>
<% end %>
<div class="cl"></div>
<% if is_teacher%>
<% comment_status = activity.homework_detail_manual.comment_status %>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%>
</li>
<li>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
</li>
<li>
<%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => 0),:class => "postOptionLink", :remote => true) %>
</li>
<% if activity.anonymous_comment == 0 %>
<li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
</li>
<li>
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
</li>
<% end %>
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
<li>
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
<% end%>
</div>
<div class="cl"></div>
</div>
<% count=activity.journals_for_messages.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount">
回复(<%= count %>
</div>
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.journals_for_messages.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%>
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word mt-4">
<% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<% end %> TO <!--+"(课程名称)" -->
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"-->
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
</div>
<% if activity.homework_detail_manual%>
<% if activity.homework_detail_manual.comment_status == 1%>
<% if activity.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<% if Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
<span class="green_homework_btn_cir ml5">作品提交中</span>
<% elsif Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
<span class="red_homework_btn_cir ml5">作品补交中</span>
<% end %>
<% elsif activity.homework_detail_manual.comment_status == 2%>
<% if activity.anonymous_comment == 0%>
<span class="green_homework_btn_cir ml5">匿评中</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
<% elsif activity.homework_detail_manual.comment_status == 3%>
<% if activity.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
<% end%>
<% end%>
<div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %>
<div class="homepagePostSubmitContainer">
<% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%>
<% projects = cur_user_projects_for_homework activity %>
<% works = cur_user_works_for_homework activity %>
<% if works.nil? && projects.nil? %>
<div class="homepagePostSubmit">
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
</div>
<% elsif works.nil? %>
<div class="homepagePostSubmit">
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
</div>
<% end %>
<% end %>
<div class="homepagePostSubmit">
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
<%= user_for_homework_common activity,is_teacher %>
</div>
<% if activity.homework_type == 2 && is_teacher%>
<div class="homepagePostSubmit">
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
</div>
<% end %>
<% if activity.homework_type == 2%>
<div class="homepagePostDeadline mr15">
语言:
<%= activity.language_name%>
</div>
<% end %>
<% if activity.homework_type == 3 && activity.homework_detail_group%>
<div class="homepagePostDeadline mr15">
分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人
</div>
<% end %>
<% if activity.homework_detail_manual && activity.homework_detail_manual.comment_status < 2 %>
<div class="homepagePostDeadline">提交截止时间:<%= activity.end_time.to_s %>&nbsp;23:59</div>
<% elsif activity.homework_detail_manual && activity.homework_detail_manual.comment_status >= 2 %>
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %>&nbsp;23:59</div>
<% end %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<%= activity.description.html_safe %>
</div>
</div>
<div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= activity.late_penalty%>分
</div>
<% if activity.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=user_activity_id %>">
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%>&nbsp;00:00
</div>
<% end %>
</div>
<div class="cl"></div>
<div>
<div class="homepagePostDeadline">
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
</div>
<% if activity.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>">
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%>&nbsp;23:59
</div>
<% end %>
</div>
<div class="cl"></div>
<% if activity.student_works.count != 0 %>
<% sw = activity.student_works.reorder("created_at desc").first %>
<div class="mt10 homepagePostDeadline">
<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
</div>
<% end %>
<div class="cl"></div>
<% if activity.student_works.count != 0 %>
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
<% unless student_work_scores.empty? %>
<% last_score = student_work_scores.first %>
<div class="mt5 homepagePostDeadline">
<%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品
</div>
<% end %>
<% end %>
<div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<div class="mt10">
<% projects = activity.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div>
<div class="cl"></div>
<% projects.each do |pro| %>
<% project = Project.find pro.project_id %>
<script type="text/javascript">
$(document).ready(function(){
$("#project_img_<%=project.id %>_<%=activity.id %>").mouseover(function(){
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","block");
}).mouseout(function(){
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","none");
});
});
</script>
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
<% end %>
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%= project.project_score.changeset_num %>提交</p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
更新时间:<%=time_from_now time %>
</div>
</div>
<% end %>
</div>
<% end %>
<div class="cl"></div>
<% if is_teacher%>
<% comment_status = activity.homework_detail_manual.comment_status %>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%>
</li>
<li>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
</li>
<li>
<%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => 0),:class => "postOptionLink", :remote => true) %>
</li>
<% if activity.anonymous_comment == 0 %>
<li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
</li>
<li>
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
</li>
<% end %>
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
<li>
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
<% end%>
</div>
<div class="cl"></div>
</div>
<% count=activity.journals_for_messages.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount">
回复(<%= count %>
</div>
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.journals_for_messages.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%>
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -70,12 +70,20 @@
<% organization.org_subfields.where("field_type != 'default'").each do |field| %>
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
<% if field.field_type == "Post" %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
<% if !field.subfield_subdomain_dir.nil? %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
<% end %>
<% if User.current.member_of_org?organization %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
<% end %>
<% else %>
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
<% if !field.subfield_subdomain_dir.nil? %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% else %>
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
<% end %>
<% if User.current.member_of_org?organization %>
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->

View File

@ -1,74 +1,103 @@
<ul class="orgListRow">
<li class="orgListUser fb">已有栏目</li>
<li class="orgListStatus fb">状态</li>
<li class="orgListStatus fb">类型</li>
<div class="cl"></div>
</ul>
<% default_fields.each do |field| %>
<% name = get_default_name(field) %>
<ul class="orgListRow">
<li class="orgListUser"><%= name %></li>
<li class="orgListStatus">默认</li>
<li class="orgListStatus">默认</li>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<div class="cl"></div>
</ul>
<% end %>
<% subfields.each do |field| %>
<ul class="orgListRow">
<li class="orgListUser">
<div id="subfield_show_<%= field.id %>"><%= field.name %></div>
<div id="subfield_edit_<%= field.id %>" style="display:none;">
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;"/>
</div>
</li>
<li class="orgListStatus">新增</li>
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
<div class="cl"></div>
</ul>
<% end %>
<script>
function edit(show_id, edit_id) {
$(show_id).toggle();
$(edit_id).toggle();
$(edit_id).find('input').focus();
$(edit_id).find('input').on('keypress', function (e) {
if (e.keyCode == 13) {
this.blur();
}
})
}
function update_subfield(show_id, edit_id, field_id, input_value) {
if ($(show_id).html().trim() != input_value.trim()) {
if (confirm('确定修改为' + input_value + "?"))
$.ajax({
url: "/org_subfields/" + field_id + "?name=" + input_value,
type: 'put'
});
}
$(show_id).show();
$(edit_id).hide();
// $(edit_id).focus();
}
function hide(content, id){
if (content.text() == '设为隐藏')
$.ajax({
url: "/organizations/hide_org_subfield?org_subfield_id=" + id,
type: "post"
});
else
$.ajax({
url: "/organizations/show_org_subfield?org_subfield_id=" + id,
type: "post"
});
}
</script>
<ul class="orgListRow">
<li class="orgListUser fb">已有栏目</li>
<li class="orgListStatus fb">状态</li>
<li class="orgListStatus fb">类型</li>
<li class="orgListUser fb">域名目录</li>
<div class="cl"></div>
</ul>
<% default_fields.each do |field| %>
<% name = get_default_name(field) %>
<ul class="orgListRow">
<li class="orgListUser"><%= name %></li>
<li class="orgListStatus">默认</li>
<li class="orgListStatus">默认</li>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<div class="cl"></div>
</ul>
<% end %>
<% subfields.each do |field| %>
<ul class="orgListRow">
<li class="orgListUser">
<div id="subfield_show_<%= field.id %>"><%= field.name %></div>
<div id="subfield_edit_<%= field.id %>" style="display:none;">
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;"/>
</div>
</li>
<li class="orgListStatus">新增</li>
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
<li class="orgListUser hidden">
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');"><%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %></div>
<div id="sub_dir_edit_<%= field.id %>" style="display:none;">
<input type="text" name="name" onblur="update_sub_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.subfield_subdomain_dir.nil? ? '': field.subfield_subdomain_dir.name %>" style="width:70px;"/>
</div>
</li>
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
<div class="cl"></div>
</ul>
<% end %>
<script>
function edit(show_id, edit_id) {
$(show_id).toggle();
$(edit_id).toggle();
$(edit_id).find('input').focus();
$(edit_id).find('input').on('keypress', function (e) {
if (e.keyCode == 13) {
this.blur();
}
})
}
function update_subfield(show_id, edit_id, field_id, input_value) {
if ($(show_id).html().trim() != input_value.trim()) {
if (confirm('确定修改为' + input_value + "?"))
$.ajax({
url: "/org_subfields/" + field_id + "?name=" + input_value,
type: 'put'
});
}
$(show_id).show();
$(edit_id).hide();
// $(edit_id).focus();
}
function edit_dir(show_id, edit_id){
$(show_id).toggle();
$(edit_id).toggle();
$(edit_id).find('input').focus();
$(edit_id).find('input').on('keypress', function(e){
if (e.keyCode == 13){
this.blur();
}
});
}
function update_sub_dir(show_id, edit_id, field_id, input_value) {
if ($(show_id).html().trim() != input_value.trim() && input_value.trim() != '') {
if (confirm('确定修改为' + input_value + "?"))
$.ajax({
url: "/org_subfields/" + field_id + "/update_sub_dir?sub_dir_name=" + input_value,
type: 'put'
});
}
$(show_id).show();
$(edit_id).hide();
}
function hide(content, id){
if (content.text() == '设为隐藏')
$.ajax({
url: "/organizations/hide_org_subfield?org_subfield_id=" + id,
type: "post"
});
else
$.ajax({
url: "/organizations/show_org_subfield?org_subfield_id=" + id,
type: "post"
});
}
</script>

View File

@ -1,161 +1,171 @@
<script>
function g(o){return document.getElementById(o);}
function HoverLi(n){
//如果有N个标签,就将i<=N;
for(var i=1;i<=3;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="orgSettingOp" id="orgSetting_3" onclick="HoverLi(3);">栏目</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">http//
<input type="text" name="organization[domain]" id="domain" value="<%= @organization.domain%>" class="orgUrlInput" />
.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%= @organization.id %>,$('#domain').val());">申请</a>
<p class="c_green f12" id="apply_hint" ></p></div>
<!--class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 -->
</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 class="undis ml15 mr15" id="orgContent_3">
<div class="orgMemberList" id="org_subfield_list">
<%= render :partial => 'organizations/subfield_list', :locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
:subfields => @organization.org_subfields.where("field_type != 'default'") } %>
</div>
<div class="fr orgMemContainer">
<div class="orgMemberAdd">
<p class="fontBlue fb mb5">新增栏目</p>
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb20" />
<ul class="orgAddRole">
<li class="fontGrey3 fb mb10">栏目类型</li>
<li>
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
<label for="orgMng">帖子</label>
</li>
<li>
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="saveBtn db fl mt10" onclick="add_org_subfield();">确定</a>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<script>
function add_org_subfield(){
if ($("#subfield_name").val().trim() != "")
$("#add_subfield_form").submit();
}
function apply_subdomain(id, domain){
var reg = new RegExp("^[a-zA-Z0-9_]{1,}$");
if (reg.exec(domain)){
$.ajax({
url:"<%= apply_subdomain_organization_path %>",
type:'post',
data:{
id:id,
domain:domain
},
success:function(){
$("#apply_hint").text("您的申请已提交,系统会以消息的形式通知您结果");
}
});
}
else{
$("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入");
}
}
<script>
function g(o){return document.getElementById(o);}
function HoverLi(n){
//如果有N个标签,就将i<=N;
for(var i=1;i<=3;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="orgSettingOp" id="orgSetting_3" onclick="HoverLi(3);">栏目</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">http//
<input type="text" name="organization[domain]" id="domain" value="<%= @organization.domain%>" class="orgUrlInput" />
.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%= @organization.id %>,$('#domain').val());">申请</a>
<p class="c_green f12" id="apply_hint" ></p></div>
<!--class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 -->
</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 class="undis ml15 mr15" id="orgContent_3">
<div class="orgMemberList" id="org_subfield_list">
<%= render :partial => 'organizations/subfield_list', :locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
:subfields => @organization.org_subfields.where("field_type != 'default'") } %>
</div>
<div class="fr orgMemContainer">
<div class="fr">
<p class="fontBlue fb mb5">新增栏目</p>
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
<div class="mb5">
<p class="fontGrey3"><span class="fb">域名目录</span>用户自定义url可选</p>
<% if @organization.domain %>
<span class="fl"><%= @organization.domain %>.trustie.net/</span><input class="fl personalUrl ml3" type="text" name="sub_dir">
<% else %>
<span class="fl">您还没有子域名,请先在左侧信息栏申请子域名</span>
<% end %>
<div class="cl"></div>
</div>
<ul class="orgAddRole">
<li class="fontGrey3 fb mb10">栏目类型</li>
<li class="fl mr15">
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
<label for="orgMng">帖子</label>
</li>
<li class="fl">
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
<li class="cl"></li>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="saveBtn db fl mt10" onclick="add_org_subfield();">确定</a>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<script>
function add_org_subfield(){
if ($("#subfield_name").val().trim() != "")
$("#add_subfield_form").submit();
}
function apply_subdomain(id, domain){
var reg = new RegExp("^[a-zA-Z0-9_]{1,}$");
if (reg.exec(domain)){
$.ajax({
url:"<%= apply_subdomain_organization_path %>",
type:'post',
data:{
id:id,
domain:domain
},
success:function(){
$("#apply_hint").text("您的申请已提交,系统会以消息的形式通知您结果");
}
});
}
else{
$("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入");
}
}
</script>

View File

@ -1,60 +1,60 @@
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless @project.acts_count == 0 %>
<a class="subnav_num">(<%= @project.acts_count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project, :remote => true), :class => "f14 c_blue02" %>
<% if @project.issues_count > 0 %>
<a class="subnav_num">(<%= @project.issues_count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards_count == 0 %>
<a class="subnav_num">(<%= @project.boards_count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.attachments_count == 0 %>
<%= link_to "(#{@project.attachments_count})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %>
<% if User.current.member_of?(@project) %>
<%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<a class="subnav_green m195" href="javascript:void(0);" onclick="project_files_upload();">+上传资源</a>
<% end %>
</div>
<% end %>
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% if visible_repository?(@project) %>
<div class="subNav">
<% if rep_is_gitlab?(@project) %>
<%= link_to l(:project_module_repository), {:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories'}, :class => "f14 c_blue02" %>
<% else %>
<%= link_to l(:project_module_repository),({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "f14 c_blue02" %>
<% end %>
<!--<a class="subnav_num">(<%= @project.repositories.count %>)</a>-->
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) && rep_is_gitlab?(@project) %>
<%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<!-- more -->
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookie" data-id="expand_tool_more" data-target="#navContent" data-val="retract"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContent">
<%= render 'projects/tools_expand' %>
</ul>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project, :remote => true), :class => "f14 c_blue02" %>
<% if @project.project_score.issue_num > 0 %>
<a class="subnav_num">(<%= @project.project_score.issue_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.board_num == 0 %>
<a class="subnav_num">(<%= @project.project_score.board_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.attach_num == 0 %>
<%= link_to "(#{@project.project_score.attach_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %>
<% if User.current.member_of?(@project) %>
<%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<a class="subnav_green m195" href="javascript:void(0);" onclick="project_files_upload();">+上传资源</a>
<% end %>
</div>
<% end %>
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% if visible_repository?(@project) %>
<div class="subNav">
<% if rep_is_gitlab?(@project) %>
<%= link_to l(:project_module_repository), {:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories'}, :class => "f14 c_blue02" %>
<% else %>
<%= link_to l(:project_module_repository),({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "f14 c_blue02" %>
<% end %>
<!--<a class="subnav_num">(<%= @project.repositories.count %>)</a>-->
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) && rep_is_gitlab?(@project) %>
<%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<!-- more -->
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookie" data-id="expand_tool_more" data-target="#navContent" data-val="retract"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContent">
<%= render 'projects/tools_expand' %>
</ul>

View File

@ -1,28 +1,28 @@
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless @project.acts_count == 0 %>
<a class="subnav_num">(<%= @project.acts_count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards_count == 0 %>
<a class="subnav_num">(<%= @project.boards_count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.attachments_count == 0 %>
<%= link_to "(#{@project.attachments_count})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.board_num == 0 %>
<a class="subnav_num">(<%= @project.project_score.board_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.attach_num == 0 %>
<%= link_to "(#{@project.project_score.attach_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end %>

View File

@ -1,9 +1,9 @@
<div style="color: #64BDD9;font-size: 14px;font-weight: bold"><%= l(:label_projects_score) %></div>
<div> = <%= l(:label_code_submit_score) %> + <%= l(:label_issue_score) %> + <%= l(:label_file_attachment_score) %> + <%= l(:label_topic_score) %> + <%= l(:label_news_score) %></div>
<div> = <%= @project.commits_count * 4 %> +
<%= @project.issues_count * 4 + @project.journals_count %> +
<%= @project.attachments_count * 5 %> +
<%= @project.boards_count * 2 + @project.boards_reply_count %> +
<%= @project.news_count %>
<div> = <%= @project.project_score.changeset_num * 4 %> +
<%= @project.project_score.issue_num * 4 + @project.project_score.issue_journal_num %> +
<%= @project.project_score.attach_num * 5 %> +
<%= @project.project_score.board_num * 2 + @project.project_score.board_message_num %> +
<%= @project.project_score.news_num %>
</div>
<div> = <%= static_project_score(@project) %></div>
<div> = <%= static_project_score(@project.project_score) %></div>

View File

@ -1,39 +1,39 @@
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless @project.acts_count == 0 %>
<a class="subnav_num">(<%= @project.acts_count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :class => "f14 c_blue02" %>
<% if @project.issues_count > 0 %>
<a class="subnav_num">(<%= @project.issues_count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards_count == 0 %>
<a class="subnav_num">(<%= @project.boards_count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.attachments_count == 0 %>
<%= link_to "(#{@project.attachments_count})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end%>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :class => "f14 c_blue02" %>
<% if @project.project_score.issue_num > 0 %>
<a class="subnav_num">(<%= @project.project_score.issue_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.board_num == 0 %>
<a class="subnav_num">(<%= @project.project_score.board_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless @project.project_score.attach_num == 0 %>
<%= link_to "(#{@project.project_score.attach_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end%>

View File

@ -12,7 +12,7 @@
<td width="35%">
<table>
<tr class="info_font" style="color: #64BDD9;font-size: 14px;font-weight: bold"><td><%= l(:label_projects_score) %></td></tr>
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= static_project_score(@project) %></span></td></tr>
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= static_project_score(@project.project_score) %></span></td></tr>
</table>
</td>
</tr>
@ -22,22 +22,22 @@
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> : <%= static_project_score(@project) %>
<%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> : <%= static_project_score(@project.project_score) %>
</li>
<li>
<%= link_to l(:label_code_submit_score), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> : <%= @project.commits_count * 4 %>
<%= link_to l(:label_code_submit_score), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> : <%= @project.project_score.changeset_num * 4 %>
</li>
<li>
<%= link_to l(:label_issue_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.issues_count * 4 + @project.journals_count %>
<%= link_to l(:label_issue_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.project_score.issue_num * 4 + @project.project_score.issue_journal_num %>
</li>
<li>
<%= link_to l(:label_file_attachment_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.attachments_count * 5 %>
<%= link_to l(:label_file_attachment_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.project_score.attach_num * 5 %>
</li>
<li>
<%= link_to l(:label_topic_score), "javascript:void(0)", :onclick => "show_div('projects_topic_score_index')"%> : <%= @project.boards_count * 2 + @project.boards_reply_count %>
<%= link_to l(:label_topic_score), "javascript:void(0)", :onclick => "show_div('projects_topic_score_index')"%> : <%= @project.project_score.board_num * 2 + @project.project_score.board_message_num %>
</li>
<li>
<%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> : <%= @project.news_count %>
<%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> : <%= @project.project_score.news_num %>
</li>
</ul>
</div>

View File

@ -0,0 +1,5 @@
<% if @project.is_public? %>
$("#set_project_public_<%= @project.id %>").text("设为私有");
<% else %>
$("#set_project_public_<%= @project.id %>").text("设为公开");
<% end %>

View File

@ -0,0 +1 @@
$("#sub_dir_show_<%= @org_subfield.id %>").html("<%= @org_subfield.subfield_subdomain_dir.name %>");

View File

@ -173,7 +173,7 @@
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%= project.commits_count %>提交</p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%= project.project_score.changeset_num %>提交</p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />

View File

@ -1,58 +1,58 @@
<div >
<div class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>');">
<option value="1">课程</option>
<option value="2">项目</option>
<option value="3" selected>组织</option>
</select>
</div>
<%= form_tag search_user_org_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" name="serach" id="search_org_input" value="<%=@search %>" placeholder="输入名称搜索" class="orgSendSearch mt15" />
<script>
observeSearchfieldOnInput('search_org_input','<%= search_user_org_user_path(user)%>','<%= send_id %>','<%= send_ids%>')
</script>
<% end %>
<div class="cl"></div>
</div>
<%= form_tag add_exist_file_to_org_user_path(user),:remote=>true,:id=>'orgs_list_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<div class="sectionWrap fl mr15">
<ul class="fontGrey3 sectionContent">
<% unless @orgs.empty? %>
<% @orgs.each do |org|%>
<li>
<label>
<input type="radio" name="org_id" value="<%= org.id%>" onchange="change_org_subfield('<%= org_resources_subfield_organization_path(:id=>org.id)%>')" class="mt3 fl mr5" />
<span><%= org.name%></span></label>
</li>
<%end%>
<%end%>
</ul>
</div>
<div class="columnWrap">
<ul class="columnContent">
<!--<span class="fontBlue pl10">请在左侧选择要转发的位置</span>-->
<!--<li style="background-color:#f1f1f1; color:#555555; padding-top:2px; padding-bottom:2px;">请选择栏目:</li>-->
<%= render :partial => 'users/org_resources_subfield',:locals => {:subfield=>nil}%>
<!--<li>-->
<!--<label>-->
<!--<input type="radio" name="sendColumn" class="mt3 fl mr5" />-->
<!--<span>动态</span></label>-->
<!--</li>-->
</ul>
</div>
<div class="cl"></div>
<div class="orgDirection mb10 break_word" style="white-space: nowrap;-o-text-overflow:ellipsis;text-overflow: ellipsis;overflow: hidden">目标地址:</div>
<div class="courseSendSubmit mr15">
<%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();',:onclick=>"check_des(event);" %>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" onclick="hideModal();" class="sendSourceText">取消</a>
</div>
<div class="cl"></div>
<div >
<div class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>');">
<option value="1">课程</option>
<option value="2">项目</option>
<option value="3" selected>组织</option>
</select>
</div>
<%= form_tag search_user_org_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" name="serach" id="search_org_input" value="<%=@search %>" placeholder="输入名称搜索" class="orgSendSearch mt15" />
<script>
observeSearchfieldOnInput('search_org_input','<%= search_user_org_user_path(user)%>','<%= send_id %>','<%= send_ids%>')
</script>
<% end %>
<div class="cl"></div>
</div>
<%= form_tag add_exist_file_to_org_user_path(user),:remote=>true,:id=>'orgs_list_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<div class="sectionWrap fl mr15">
<ul class="fontGrey3">
<% unless @orgs.empty? %>
<% @orgs.each do |org|%>
<li>
<label>
<input type="radio" name="org_id" value="<%= org.id%>" onchange="change_org_subfield('<%= org_resources_subfield_organization_path(:id=>org.id)%>')" class="mt3 fl mr5" />
<span><%= org.name%></span></label>
</li>
<%end%>
<%end%>
</ul>
</div>
<div class="columnWrap">
<ul class="columnContent">
<!--<span class="fontBlue pl10">请在左侧选择要转发的位置</span>-->
<!--<li style="background-color:#f1f1f1; color:#555555; padding-top:2px; padding-bottom:2px;">请选择栏目:</li>-->
<%= render :partial => 'users/org_resources_subfield',:locals => {:subfield=>nil}%>
<!--<li>-->
<!--<label>-->
<!--<input type="radio" name="sendColumn" class="mt3 fl mr5" />-->
<!--<span>动态</span></label>-->
<!--</li>-->
</ul>
</div>
<div class="cl"></div>
<div class="orgDirection mb10 break_word" style="white-space: nowrap;-o-text-overflow:ellipsis;text-overflow: ellipsis;overflow: hidden">目标地址:</div>
<div class="courseSendSubmit mr15">
<%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();',:onclick=>"check_des(event);" %>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" onclick="hideModal();" class="sendSourceText">取消</a>
</div>
<div class="cl"></div>
<%end %>

View File

@ -1,306 +1,306 @@
<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
<div class="HomeWork mb10" id="homework_common_<%= homework_common.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo mt-4">
<%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
TO
<%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
</div>
<span class="homepagePostTitle hidden fl m_w505">
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
</span>
<% if homework_common.homework_detail_manual%>
<% if homework_common.homework_detail_manual.comment_status == 0 %>
<span class="grey_homework_btn_cir ml5">未发布</span>
<% elsif homework_common.homework_detail_manual.comment_status == 1%>
<% if homework_common.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<% if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
<span class="green_homework_btn_cir ml5">作品提交中</span>
<% elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
<span class="red_homework_btn_cir ml5">作品补交中</span>
<% end %>
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
<% if homework_common.anonymous_comment == 0%>
<span class="green_homework_btn_cir ml5">匿评中</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
<% elsif homework_common.homework_detail_manual.comment_status == 3%>
<% if homework_common.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
<% end%>
<% end%>
<div class="cl"></div>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %>
<div class="homepagePostSubmitContainer">
<% if homework_common.homework_type == 3 && !is_teacher && homework_common.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(homework_common.course) %>
<% projects = cur_user_projects_for_homework homework_common %>
<% works = cur_user_works_for_homework homework_common %>
<% if works.nil? && projects.nil? %>
<div class="homepagePostSubmit">
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => homework_common.id,:is_in_course=>is_in_course,:user_activity_id=>-1,:course_activity=>-1),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
</div>
<% elsif works.nil? %>
<div class="homepagePostSubmit">
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => homework_common.id,:is_in_course=>is_in_course,:user_activity_id=>-1,:course_activity=>-1), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
</div>
<% end %>
<% end %>
<div class="homepagePostSubmit">
<%= user_for_homework_common homework_common,is_teacher %>
</div>
<% if homework_common.homework_type == 2 && is_teacher%>
<div class="homepagePostSubmit">
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: homework_common.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
</div>
<% end %>
<% if homework_common.homework_type == 2%>
<div class="homepagePostDeadline mr15">
语言:
<%= homework_common.language_name%>
</div>
<% end %>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group%>
<div class="homepagePostDeadline mr15">
分组人数:<%=homework_common.homework_detail_group.min_num %>-<%=homework_common.homework_detail_group.max_num %> 人
</div>
<% end %>
<% if homework_common.homework_detail_manual && homework_common.homework_detail_manual.comment_status < 2 %>
<div class="homepagePostDeadline">提交截止时间:<%= homework_common.end_time.to_s %>&nbsp;23:59</div>
<% elsif homework_common.homework_detail_manual && homework_common.homework_detail_manual.comment_status >= 2 %>
<div class="homepagePostDeadline">匿评截止时间:<%= homework_common.homework_detail_manual.evaluation_end.to_s %>&nbsp;23:59</div>
<% end %>
<% if homework_common.homework_detail_manual.comment_status == 0 %>
<div class="homepagePostDeadline ml15">
<%= l(:label_publish_time)%><%= homework_common.publish_time%>&nbsp;00:00
</div>
<% end %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="homework_description_<%= homework_common.id%>">
<div id="intro_content_<%= homework_common.id%>">
<%= homework_common.description.html_safe %>
</div>
</div>
<div class="cl"></div>
<div id="intro_content_show_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= homework_common.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;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => homework_common} %>
</div>
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= homework_common.late_penalty%>分
</div>
<% if homework_common.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=homework_common.id %>">
匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%>&nbsp;00:00
</div>
<% end %>
</div>
<div class="cl"></div>
<div>
<div class="homepagePostDeadline">
缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
</div>
<% if homework_common.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=homework_common.id %>">
匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%>&nbsp;23:59
</div>
<% end %>
</div>
<div class="cl"></div>
<% if homework_common.student_works.count != 0 %>
<% sw = homework_common.student_works.reorder("created_at desc").first %>
<div class="mt10 homepagePostDeadline">
<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
</div>
<% end %>
<div class="cl"></div>
<% if homework_common.student_works.count != 0 %>
<% sw_id = "("+homework_common.student_works.map{|sw| sw.id}.join(",")+")" %>
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
<% unless student_work_scores.empty? %>
<% last_score = student_work_scores.first %>
<div class="mt5 homepagePostDeadline">
<%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品
</div>
<% end %>
<% end %>
<div class="cl"></div>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
<div class="mt10">
<% projects = homework_common.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div>
<div class="cl"></div>
<% projects.each do |pro| %>
<% project = Project.find pro.project_id %>
<script type="text/javascript">
$(document).ready(function(){
$("#project_img_<%=project.id %>_<%=homework_common.id %>").mouseover(function(){
$("#relatePInfo_<%=project.id %>_<%=homework_common.id %>").css("display","block");
}).mouseout(function(){
$("#relatePInfo_<%=project.id %>_<%=homework_common.id %>").css("display","none");
});
});
</script>
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %>
<% end %>
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%= project.commits_count %>提交</p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
更新时间:<%=time_from_now time %>
</div>
</div>
<% end %>
</div>
<% end %>
<div class="cl"></div>
<% if is_teacher%>
<% comment_status = homework_common.homework_detail_manual.comment_status%>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => is_in_course,:course_activity=>-1), :class => "postOptionLink"%>
</li>
<li>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course,:course_activity=>-1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
</li>
<li>
<%= link_to("评分设置", score_rule_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true) %>
</li>
<% if homework_common.anonymous_comment == 0 &&(comment_status == 0 || comment_status == 1)%>
<li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true)%>
</li>
<% end %>
<% if homework_common.anonymous_comment == 0%>
<li>
<%= homework_anonymous_comment(homework_common, is_in_course) %>
</li>
<% end %>
<% if homework_common.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
<li>
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(homework_common,:is_in_course => is_in_course),:class => "postOptionLink", :remote => true)%>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
<% end%>
</div>
<div class="cl"></div>
</div>
<% count=homework_common.journals_for_messages.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount">
回复(<%= count %>
</div>
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=homework_common.id%>" onclick="expand_reply('#reply_div_<%= homework_common.id %> li','#reply_btn_<%=homework_common.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_<%= homework_common.id %>">
<ul>
<% homework_common.journals_for_messages.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_edit_<%= comment.id%>').show();" onmouseout="$('#message_edit_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<div class="fr" id="message_edit_<%=comment.id %>" style="display: none">
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course,:course_activity=>-1},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
<% end %>
</div>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= homework_common.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= homework_common.id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => homework_common.id},:method => "post", :remote => true) do |f|%>
<%= hidden_field_tag 'homework_common_id',params[:homework_common_id],:value =>homework_common.id %>
<%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= homework_common.id%>' name="homework_message"></textarea>
<div nhname='toolbar_container_<%= homework_common.id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
<a id="new_message_submit_btn_<%= homework_common.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= homework_common.id%>'></p>
<% end%>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
</div><!----HomeWork end-->
<script type="text/javascript">
$(homework_description_show_hide(<%=homework_common.id %>));
<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
<div class="HomeWork mb10" id="homework_common_<%= homework_common.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo mt-4">
<%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
TO
<%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
</div>
<span class="homepagePostTitle hidden fl m_w505">
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
</span>
<% if homework_common.homework_detail_manual%>
<% if homework_common.homework_detail_manual.comment_status == 0 %>
<span class="grey_homework_btn_cir ml5">未发布</span>
<% elsif homework_common.homework_detail_manual.comment_status == 1%>
<% if homework_common.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<% if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
<span class="green_homework_btn_cir ml5">作品提交中</span>
<% elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
<span class="red_homework_btn_cir ml5">作品补交中</span>
<% end %>
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
<% if homework_common.anonymous_comment == 0%>
<span class="green_homework_btn_cir ml5">匿评中</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
<% elsif homework_common.homework_detail_manual.comment_status == 3%>
<% if homework_common.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
<% end%>
<% end%>
<div class="cl"></div>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %>
<div class="homepagePostSubmitContainer">
<% if homework_common.homework_type == 3 && !is_teacher && homework_common.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(homework_common.course) %>
<% projects = cur_user_projects_for_homework homework_common %>
<% works = cur_user_works_for_homework homework_common %>
<% if works.nil? && projects.nil? %>
<div class="homepagePostSubmit">
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => homework_common.id,:is_in_course=>is_in_course,:user_activity_id=>-1,:course_activity=>-1),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
</div>
<% elsif works.nil? %>
<div class="homepagePostSubmit">
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => homework_common.id,:is_in_course=>is_in_course,:user_activity_id=>-1,:course_activity=>-1), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
</div>
<% end %>
<% end %>
<div class="homepagePostSubmit">
<%= user_for_homework_common homework_common,is_teacher %>
</div>
<% if homework_common.homework_type == 2 && is_teacher%>
<div class="homepagePostSubmit">
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: homework_common.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
</div>
<% end %>
<% if homework_common.homework_type == 2%>
<div class="homepagePostDeadline mr15">
语言:
<%= homework_common.language_name%>
</div>
<% end %>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group%>
<div class="homepagePostDeadline mr15">
分组人数:<%=homework_common.homework_detail_group.min_num %>-<%=homework_common.homework_detail_group.max_num %> 人
</div>
<% end %>
<% if homework_common.homework_detail_manual && homework_common.homework_detail_manual.comment_status < 2 %>
<div class="homepagePostDeadline">提交截止时间:<%= homework_common.end_time.to_s %>&nbsp;23:59</div>
<% elsif homework_common.homework_detail_manual && homework_common.homework_detail_manual.comment_status >= 2 %>
<div class="homepagePostDeadline">匿评截止时间:<%= homework_common.homework_detail_manual.evaluation_end.to_s %>&nbsp;23:59</div>
<% end %>
<% if homework_common.homework_detail_manual.comment_status == 0 %>
<div class="homepagePostDeadline ml15">
<%= l(:label_publish_time)%><%= homework_common.publish_time%>&nbsp;00:00
</div>
<% end %>
</div>
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="homework_description_<%= homework_common.id%>">
<div id="intro_content_<%= homework_common.id%>">
<%= homework_common.description.html_safe %>
</div>
</div>
<div class="cl"></div>
<div id="intro_content_show_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= homework_common.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;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => homework_common} %>
</div>
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= homework_common.late_penalty%>分
</div>
<% if homework_common.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=homework_common.id %>">
匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%>&nbsp;00:00
</div>
<% end %>
</div>
<div class="cl"></div>
<div>
<div class="homepagePostDeadline">
缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
</div>
<% if homework_common.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=homework_common.id %>">
匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%>&nbsp;23:59
</div>
<% end %>
</div>
<div class="cl"></div>
<% if homework_common.student_works.count != 0 %>
<% sw = homework_common.student_works.reorder("created_at desc").first %>
<div class="mt10 homepagePostDeadline">
<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
</div>
<% end %>
<div class="cl"></div>
<% if homework_common.student_works.count != 0 %>
<% sw_id = "("+homework_common.student_works.map{|sw| sw.id}.join(",")+")" %>
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
<% unless student_work_scores.empty? %>
<% last_score = student_work_scores.first %>
<div class="mt5 homepagePostDeadline">
<%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品
</div>
<% end %>
<% end %>
<div class="cl"></div>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
<div class="mt10">
<% projects = homework_common.student_work_projects.where("is_leader = 1") %>
<div class="fl mr20 fontGrey3">
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
</div>
<div class="cl"></div>
<% projects.each do |pro| %>
<% project = Project.find pro.project_id %>
<script type="text/javascript">
$(document).ready(function(){
$("#project_img_<%=project.id %>_<%=homework_common.id %>").mouseover(function(){
$("#relatePInfo_<%=project.id %>_<%=homework_common.id %>").css("display","block");
}).mouseout(function(){
$("#relatePInfo_<%=project.id %>_<%=homework_common.id %>").css("display","none");
});
});
</script>
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %>
<% end %>
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
<p><%=time_from_now time %>&nbsp;&nbsp;<%= project.project_score.changeset_num %>提交</p>
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
项目名称:<%=project.name %><br />
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
更新时间:<%=time_from_now time %>
</div>
</div>
<% end %>
</div>
<% end %>
<div class="cl"></div>
<% if is_teacher%>
<% comment_status = homework_common.homework_detail_manual.comment_status%>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => is_in_course,:course_activity=>-1), :class => "postOptionLink"%>
</li>
<li>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course,:course_activity=>-1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
</li>
<li>
<%= link_to("评分设置", score_rule_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true) %>
</li>
<% if homework_common.anonymous_comment == 0 &&(comment_status == 0 || comment_status == 1)%>
<li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true)%>
</li>
<% end %>
<% if homework_common.anonymous_comment == 0%>
<li>
<%= homework_anonymous_comment(homework_common, is_in_course) %>
</li>
<% end %>
<% if homework_common.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
<li>
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(homework_common,:is_in_course => is_in_course),:class => "postOptionLink", :remote => true)%>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
<% end%>
</div>
<div class="cl"></div>
</div>
<% count=homework_common.journals_for_messages.count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
<div class="homepagePostReplyBannerCount">
回复(<%= count %>
</div>
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=homework_common.id%>" onclick="expand_reply('#reply_div_<%= homework_common.id %> li','#reply_btn_<%=homework_common.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_<%= homework_common.id %>">
<ul>
<% homework_common.journals_for_messages.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_edit_<%= comment.id%>').show();" onmouseout="$('#message_edit_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<div class="fr" id="message_edit_<%=comment.id %>" style="display: none">
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course,:course_activity=>-1},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
<% end %>
</div>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= homework_common.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= homework_common.id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => homework_common.id},:method => "post", :remote => true) do |f|%>
<%= hidden_field_tag 'homework_common_id',params[:homework_common_id],:value =>homework_common.id %>
<%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= homework_common.id%>' name="homework_message"></textarea>
<div nhname='toolbar_container_<%= homework_common.id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
<a id="new_message_submit_btn_<%= homework_common.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= homework_common.id%>'></p>
<% end%>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
</div><!----HomeWork end-->
<script type="text/javascript">
$(homework_description_show_hide(<%=homework_common.id %>));
</script>

View File

@ -40,4 +40,10 @@
</ul>
</div>
<!--显示个人主页-->
<% if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<% homepage = BlogComment.find(@user.blog.homepage_id) %>
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<% end %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>

View File

@ -54,6 +54,7 @@ RedmineApp::Application.routes.draw do
post 'logout'
post 'apply_subdomain'
get 'org_resources_subfield'
get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_org_subfield'
end
collection do
get 'check_uniq'
@ -73,7 +74,10 @@ RedmineApp::Application.routes.draw do
end
Organization.where("domain is not null").each do |org|
get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: {subdomain: org.domain}
org_domains = []
org_domains << org.domain
#get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: {subdomain: org.domain}
get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: lambda{ |request| org_domains.include?(request.remote_ip) }
end
get '/', to: 'organizations#show', defaults: { id: 5 }, constraints: {subdomain: 'micros'}
get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'}
@ -101,6 +105,9 @@ RedmineApp::Application.routes.draw do
match "quote_resource_show_org_subfield", :via => [:get]
end
end
member do
match 'update_sub_dir', :via => [:put]
end
resource :boards
end
@ -630,6 +637,7 @@ RedmineApp::Application.routes.draw do
post 'reopen'
get 'search_public_orgs_not_in_project'
match 'copy', :via => [:get, :post]
match 'set_public_or_private', :via => [:post]
end
collection do

View File

@ -0,0 +1,5 @@
class AddStatusToOrgMessages < ActiveRecord::Migration
def change
add_column :org_messages, :status, :integer, :default => 0
end
end

View File

@ -0,0 +1,9 @@
class CreateSubfieldSubdomainDirs < ActiveRecord::Migration
def change
create_table :subfield_subdomain_dirs do |t|
t.integer :org_subfield_id
t.string :name
t.timestamps
end
end
end

View File

@ -0,0 +1,6 @@
class AddBoardNumToProjectScore < ActiveRecord::Migration
def change
add_column :project_scores, :board_num, :integer, :default => false
add_column :project_scores, :attach_num, :integer, :default => false
end
end

View File

@ -0,0 +1,61 @@
class UpdateProjectScore < ActiveRecord::Migration
def up
project_count = Project.all.count / 30 + 2
transaction do
for i in 1 ... project_count do i
Project.page(i).per(30).each do |project|
puts project.id
if ProjectScore.where("project_id=?", project.id).first.nil?
puts "create project ==>#{project.id}"
ProjectScore.create(:project_id => project.id, :score => false)
end
unless project.project_score.nil?
# update boards
unless project.boards.first.nil?
boards_count = project.boards.first.topics.count
project.project_score.update_attribute(:board_num, boards_count)
end
# update boards reply
unless project.boards.first.nil?
messages_count = Message.where("board_id =? and parent_id is not ?", project.boards.first.id, nil).count
project.project_score.update_attribute(:board_message_num, messages_count)
end
# update issues
unless project.issues.nil?
issues_count = project.issues.count
project.project_score.update_attribute(:issue_num, issues_count)
end
# update issue's journal
# if !project.project_score.nil? && !project.project_score.issue_journal_num.nil?
# project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num)
# end
# update news
unless project.news.nil?
news_count = project.news.count
project.project_score.update_attribute(:news_num, news_count)
end
# update attach
unless project.attachments.nil?
attachments_count = project.attachments.count
project.project_score.update_attribute(:attach_num, attachments_count)
end
# update commits
unless project.gpid.nil?
g = Gitlab.client
begin
puts project.id
count = g.project(project.gpid).commit_count
rescue
logger.error("The project's rep is not exit!")
end
project.project_score.update_attribute(:changeset_num, count)
end
end
end
end
end
end
def down
end
end

File diff suppressed because it is too large Load Diff

View File

@ -1,63 +1,63 @@
var enableAt = function(_editor) {
var editor = _editor;
if(editor.edit == undefined || editor.edit.iframe == undefined){
return;
}
var id = arguments[1] ? arguments[1] : undefined;
var type = arguments[2] ? arguments[2] : 'Activity';
var ifr = editor.edit.iframe[0];
var doc = ifr.contentDocument || iframe.contentWindow.document;
var ifrBody = doc.body;
//ifrBody.contentEditable = false;
$(ifrBody).attr('enable_at', 'true');
console.log("enable at");
//$.fn.atwho.debug = true;
var names = [];
if("undefined" !== (typeof atPersonLists)){
names = atPersonLists;
}
if('undefined' != (typeof id)){
names = '/at/' + id + '?type='+type;
}
//var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", "가"];
//
//var names = $.map(names,function(value,i) {
// return {'id':i,'name':value,'email':value+"@email.com"};
//});
var at_config = {
at: "@",
data: names,
insertTpl: '<span class="at" data-user-id="${userid}"><a href="/users/${userid}">@${name}(${login})</a></span>',
displayTpl: "<li>${name} <small>${login}</small></li>",
searchKey: 'searchKey',
limit: 200
};
console.log(_editor.options);
var input = $(ifrBody);
_editor.options.enable_at = (function(){
var first = true;
return function(){
if(first){
input.atwho(at_config);
first = false;
}
}
})();
//$(ifrBody).atwho(at_config);
//$inputor.caret('pos', 47);
//$inputor.focus().atwho('run');
};
var enableAt = function(_editor) {
var editor = _editor;
if(editor.edit == undefined || editor.edit.iframe == undefined){
return;
}
var id = arguments[1] ? arguments[1] : undefined;
var type = arguments[2] ? arguments[2] : 'Activity';
var ifr = editor.edit.iframe[0];
var doc = ifr.contentDocument || iframe.contentWindow.document;
var ifrBody = doc.body;
//ifrBody.contentEditable = false;
$(ifrBody).attr('enable_at', 'true');
console.log("enable at");
//$.fn.atwho.debug = true;
var names = [];
if("undefined" !== (typeof atPersonLists)){
names = atPersonLists;
}
if('undefined' != (typeof id)){
names = '/at/' + id + '.json?type='+type;
}
//var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", "가"];
//
//var names = $.map(names,function(value,i) {
// return {'id':i,'name':value,'email':value+"@email.com"};
//});
var at_config = {
at: "@",
data: names,
insertTpl: '<span class="at" data-user-id="${userid}"><a href="/users/${userid}">@${name}(${login})</a></span>',
displayTpl: "<li>${name} <small>${login}</small></li>",
searchKey: 'searchKey',
limit: 200
};
console.log(_editor.options);
var input = $(ifrBody);
_editor.options.enable_at = (function(){
var first = true;
return function(){
if(first){
input.atwho(at_config);
first = false;
}
}
})();
//$(ifrBody).atwho(at_config);
//$inputor.caret('pos', 47);
//$inputor.focus().atwho('run');
};

View File

@ -1,53 +1,77 @@
//<2F><><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><D6AF>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>
function submit_add_org_members(){
$("#org_member_add_form").submit();
}
function observeSearchfield(fieldId, targetId, url) {
$('#'+fieldId).each(function() {
var $this = $(this);
$this.addClass('autocomplete');
$this.attr('data-value-was', $this.val());
var check = function() {
var val = $this.val();
if ($this.attr('data-value-was') != val){
$this.attr('data-value-was', val);
$.ajax({
url: url,
type: 'get',
data: {q: $this.val()},
success: function(data){ if(targetId) $('#'+targetId).html(data); },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
}
};
var reset = function() {
if (timer) {
clearInterval(timer);
timer = setInterval(check, 300);
}
};
var timer = setInterval(check, 300);
$this.bind('keyup click mousemove', reset);
});
}
//显示更多的项目
function show_more_org_project(url){
$.get(
url,
{ page: $("#org_project_page_num").val() },
function (data) {
}
);
}
function show_more_org_course(url){
$.get(
url,
{page: $("#org_course_page_num").val()},
function (data){}
);
//<2F><><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><D6AF>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>
function submit_add_org_members(){
$("#org_member_add_form").submit();
}
function observeSearchfield(fieldId, targetId, url) {
$('#'+fieldId).each(function() {
var $this = $(this);
$this.addClass('autocomplete');
$this.attr('data-value-was', $this.val());
var check = function() {
var val = $this.val();
if ($this.attr('data-value-was') != val){
$this.attr('data-value-was', val);
$.ajax({
url: url,
type: 'get',
data: {q: $this.val()},
success: function(data){ if(targetId) $('#'+targetId).html(data); },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
}
};
var reset = function() {
if (timer) {
clearInterval(timer);
timer = setInterval(check, 300);
}
};
var timer = setInterval(check, 300);
$this.bind('keyup click mousemove', reset);
});
}
//显示更多的项目
function show_more_org_project(url){
$.get(
url,
{ page: $("#org_project_page_num").val() },
function (data) {
}
);
}
function show_more_org_course(url){
$.get(
url,
{page: $("#org_course_page_num").val()},
function (data){}
);
}
function search_tag_attachment(url,tag_name,q,course_id,sort)
{
//alert("111");
//clearTimeout(clickFunction);
clickFunction = setTimeout(function() {
search_func()
}, 500);
function search_func(){
if(isdb!= false ) return;
$.get(
url,
{
tag_name: tag_name,
q: q,
org_subfield_id:course_id
},
function (data) {
}
);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,11 @@
.orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;}
a.saveBtn {padding:3px 5px; background-color:#269ac9; color:#ffffff;}
a.saveBtn:hover {background-color:#297fb8;}
.orgMemberList {width:410px; float:left;}
.orgMemberList {width:460px; float:left;}
.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;}
.orgListUser {width:119px; float:left;}
.orgListUser {width:85px; float:left;}
.orgListRole {width:180px; float:left;}
.orgMemContainer {width:278px;}
.orgMemContainer {width:228px;}
.orgMemberAdd {float:right; width:240px;}
.orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;}
.undis {display:none;}
@ -73,6 +73,7 @@ a.linkGrey8:hover {color:#585858;}
.org_login_list a {color:#269ac9;}
.orgListStatus {width:55px; float:left;}
.personalUrl {border:1px solid #dddddd; width:75px; outline:none; white-space:nowrap; padding-left:2px;}
.reCon{ margin:5px; width:710px;}
.retop{width:710px; height:40px; background:#eaeaea; padding:5px;}
.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right}
@ -107,4 +108,10 @@ div.flash {margin-top :0px !important}
.w80{ width:80px;}
.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
.researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;}
.blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;}
.blueBtn:hover {background-color:#298fbd;}
/*文本描述展开高度*/
.maxh360 {max-height: 810px;}
.lh18 { line-height: 18px;}

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,53 @@
/*151228样式更新*/
.menuSetting {background:url(../images/hwork_icon.png) -5px -303px no-repeat; display:inline-block; width:20px; height:20px;}
.boxShadow {box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
a.greyBtn{ display:inline-block; background:#f2f3f3; padding:0px 5px; height:20px; border:1px solid #d3d3d3; color:#888888; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.greyBtn{border:1px solid #888888; }
a.blueBtn{ display:inline-block; background:#269ac9; padding:0px 5px; height:20px; border:1px solid #269ac9; color:#ffffff; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a.blueBtn:hover {background-color:#298fbd;}
a.cancelBtn{ display:inline-block; background:#c1c1c1; padding:0px 5px; height:20px; border:1px solid #d3d3d3; color:#ffffff; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a.cancelBtn:hover {background:#888888;}
a.userFollow{ display:inline-block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -9px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.userFollow{border:1px solid #888888; }
a.userCancel{ display:inline-block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -177px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.userCancel{border:1px solid #888888; }
.pAbsolute {position:absolute; z-index:999;}
.userAvatarWrap {width:50px; height:50px; position:relative; border:1px solid #cbcbcb; padding: 2px;}
.userAvatarWrap:hover {border:1px solid #269ac9;}
.mr27 {margin-right:27px;}
.userCard {width:208px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px; padding:15px; top:-176px; left:-95px; position:absolute; z-index:999; display:none;}
.userCard font {display:block; border-width:8px; position:absolute; bottom:-16px; left:110px; border-style:solid dashed dashed dashed; border-color:#FFF transparent transparent transparent; font-size:0; line-height:0;}
.userCard em {display:block; border-width:8px; position:absolute; bottom:-17px; left:110px; border-style:solid dashed dashed dashed; border-color:#eaeaea transparent transparent transparent; font-size:0; line-height:0;}
a.mesIcon {background:url(../images/mes_icon.png) -5px -73px no-repeat; padding-left:23px;}
a.personalIcon {background:url(../images/mes_icon.png) -6px -16px no-repeat; padding-left:23px;}
.mesType {background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 15px; left:-50px; font-size:12px; color:#888888; display:none; line-height:2; z-index:999; white-space:nowrap;}
a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; background-color:#cecece; padding:3px 10px;}
.PMTag {padding:0px 5px; background-color:#555555; border-radius:3px; color:#ffffff;}
.upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
.upload_box{ width:430px; margin:15px auto;}
a.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center; margin-left:10px; margin-bottom:10px; padding:2px 10px;}
a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;}
.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
/*151228样式更新*/
.menuSetting {background:url(../images/hwork_icon.png) -5px -303px no-repeat; display:inline-block; width:20px; height:20px;}
.boxShadow {box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
a.greyBtn{ display:inline-block; background:#f2f3f3; padding:0px 5px; height:20px; border:1px solid #d3d3d3; color:#888888; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.greyBtn{border:1px solid #888888; }
a.blueBtn{ display:inline-block; background:#269ac9; padding:0px 5px; height:20px; border:1px solid #269ac9; color:#ffffff; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a.blueBtn:hover {background-color:#298fbd;}
a.cancelBtn{ display:inline-block; background:#c1c1c1; padding:0px 5px; height:20px; border:1px solid #d3d3d3; color:#ffffff; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a.cancelBtn:hover {background:#888888;}
a.userFollow{ display:inline-block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -9px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.userFollow{border:1px solid #888888; }
a.userCancel{ display:inline-block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -177px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.userCancel{border:1px solid #888888; }
.pAbsolute {position:absolute; z-index:999;}
.userAvatarWrap {width:50px; height:50px; position:relative; border:1px solid #cbcbcb; padding: 2px;}
.userAvatarWrap:hover {border:1px solid #269ac9;}
.mr27 {margin-right:27px;}
.userCard {width:208px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px; padding:15px; top:-176px; left:-95px; position:absolute; z-index:999; display:none;}
.userCard font {display:block; border-width:8px; position:absolute; bottom:-16px; left:110px; border-style:solid dashed dashed dashed; border-color:#FFF transparent transparent transparent; font-size:0; line-height:0;}
.userCard em {display:block; border-width:8px; position:absolute; bottom:-17px; left:110px; border-style:solid dashed dashed dashed; border-color:#eaeaea transparent transparent transparent; font-size:0; line-height:0;}
.userCardM {width:201px; height:20px; border:1px solid #dddddd; resize:none;}
.praviteC {background:url(../images/hwork_icon.png) -79px -255px no-repeat;}
.praviteCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;}
.publicC {background:url(../images/hwork_icon.png) -79px -125px no-repeat;}
.publicCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;}
.shild {background:url(../images/hwork_icon.png) -6px -354px no-repeat;}
.shildP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;}
ul.shild:hover li ul {display:block;}
.subNavArrow {background:url(../images/hwork_icon.png) -82px -399px no-repeat; display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;}
ul.subNavArrow:hover li ul {display:block;}
.subNavMenu {line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:20px; top:-10px; padding:5px 0px; display:none; z-index:999;}
.subNavRow {padding:0px 15px; width:70px;}
.w48 {width:48px;}
a.mesIcon {background:url(../images/mes_icon.png) -5px -73px no-repeat; padding-left:23px;}
a.personalIcon {background:url(../images/mes_icon.png) -6px -16px no-repeat; padding-left:23px;}
.mesType {background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 15px; left:-50px; font-size:12px; color:#888888; display:none; line-height:2; z-index:999; white-space:nowrap;}
a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; background-color:#cecece; padding:3px 10px;}
.PMTag {padding:0px 5px; background-color:#555555; border-radius:3px; color:#ffffff;}
.upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
.upload_box{ width:430px; margin:15px auto;}
a.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center; margin-left:10px; margin-bottom:10px; padding:2px 10px;}
a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;}
.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;}
a.resourcesTypeAll {background:url(images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;}
.mediaIcon {background:url(../images/hwork_icon.png) -5px -160px no-repeat; padding-left:23px;}
.codeIcon {background:url(../images/hwork_icon.png) -78px -160px no-repeat; padding-left:23px;}
.othersIcon {background:url(../images/hwork_icon.png) -3px -210px no-repeat; padding-left:23px;}
.thesisIcon {background:url(../images/hwork_icon.png) -78px -212px no-repeat; padding-left:23px;}
.softwareIcon {background:url(../images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;}

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe SubfieldSubdomainDirsController, :type => :controller do
end

View File

@ -0,0 +1,6 @@
FactoryGirl.define do
factory :subfield_subdomain_dir do
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe SubfieldSubdomainDir, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end