diff --git a/app/assets/javascripts/subfield_subdomain_dirs.js.coffee b/app/assets/javascripts/subfield_subdomain_dirs.js.coffee
new file mode 100644
index 000000000..761567942
--- /dev/null
+++ b/app/assets/javascripts/subfield_subdomain_dirs.js.coffee
@@ -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/
diff --git a/app/assets/stylesheets/subfield_subdomain_dirs.css.scss b/app/assets/stylesheets/subfield_subdomain_dirs.css.scss
new file mode 100644
index 000000000..6843d92f8
--- /dev/null
+++ b/app/assets/stylesheets/subfield_subdomain_dirs.css.scss
@@ -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/
diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb
index 9e7309646..25e731754 100644
--- a/app/controllers/at_controller.rb
+++ b/app/controllers/at_controller.rb
@@ -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
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 70a0b76b8..c4932b1b2 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -17,8 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class FilesController < ApplicationController
-
- layout 'base_projects' #by young
+ layout 'base_projects' #by young
menu_item :files
before_filter :auth_login1, :only => [:index]
@@ -173,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 = ""
@@ -381,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,6 +455,11 @@ class FilesController < ApplicationController
end
end
end
+ # 更新资源总数, 根据上传的附件数累加
+ 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'
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
@@ -482,9 +488,6 @@ class FilesController < ApplicationController
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
Mailer.run.attachments_added(attachments[:files])
end
- # 更新课程英雄榜得分
- update_contributor_score(@course, attachments[:files].first)
- # end
if params[:course_attachment_type] && params[:course_attachment_type].is_a?(Array)
params[:course_attachment_type].each do |type|
tag_name = get_tag_name_by_type_number type
@@ -506,8 +509,9 @@ class FilesController < ApplicationController
end
end
end
-
-
+ # 更新课程英雄榜得分
+ update_contributor_score(@course, attachments[:files].first)
+ # end
# TODO: 临时用 nyan
sort_init 'created_on', 'desc'
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
@@ -828,5 +832,5 @@ class FilesController < ApplicationController
def upload_files_menu
- end
+end
end
diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb
index 7685b77a8..f250b46de 100644
--- a/app/controllers/org_document_comments_controller.rb
+++ b/app/controllers/org_document_comments_controller.rb
@@ -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
diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb
index 66a236b5b..5850629f0 100644
--- a/app/controllers/org_subfields_controller.rb
+++ b/app/controllers/org_subfields_controller.rb
@@ -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
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 9f80503d8..25ee3dc48 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -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
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 31c70e92a..f2de6085f 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -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
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 1674055ac..0a9de787a 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -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}"
@@ -344,20 +347,18 @@ update
#Modified by young
# (show_error_not_found; return) unless @entries
g = Gitlab.client
-
- # count = 0
- # (0..100).each do |page|
- # if g.commits(@project.gpid,:page => page).count == 0
- # break
- # else
- # count = count + g.commits(@project.gpid,:page => page).count
- # end
- # end
-
@changesets = g.commits(@project.gpid, :ref_name => @rev)
# @changesets = @repository.latest_changesets(@path, @rev)
# @changesets_count = @repository.latest_changesets(@path, @rev).count
- @changesets_all_count = @project.gpid.nil? ? 0 : g.commits_total_count(@project.gpid).count
+ @changesets_all_count = @project.gpid.nil? ? 0 : g.project(@project.gpid).commit_count
+ # 访问该页面的是会后则刷新
+ 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
@changesets_latest_coimmit = @changesets[0]
@properties = @repository.properties(@path, @rev)
@repositories = @project.repositories
@@ -583,6 +584,10 @@ update
end
private
+ # 更新项目统计数
+ def update_commits_count project, count
+ project.project_score.update_attribute(:changeset_num, count)
+ end
def find_repository
@repository = Repository.find(params[:id])
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 2f6c4ecc7..63f152eb2 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -683,7 +683,7 @@ class StudentWorkController < ApplicationController
if !params[:name].nil?
condition = "%#{params[:name].strip}%".gsub(" ","")
end
- @project_ids = Project.where("user_id = #{User.current.id} and name like '#{condition}'")
+ @project_ids = Project.visible.where("user_id = #{User.current.id} and name like '#{condition}'")
@first = params[:first].to_i
respond_to do |format|
format.js
diff --git a/app/controllers/subfield_subdomain_dirs_controller.rb b/app/controllers/subfield_subdomain_dirs_controller.rb
new file mode 100644
index 000000000..90c6a7a92
--- /dev/null
+++ b/app/controllers/subfield_subdomain_dirs_controller.rb
@@ -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
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5b7cca7fe..be9c59992 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -49,6 +49,12 @@ module ApplicationHelper
end
end
+ # 获取项目/课程总分
+ # 发布缺陷 4分 回复缺陷 1分 提交一次 4分 讨论帖子 2分 回复帖子 1分 发布新闻 1分
+ def static_project_score obj
+ 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
+
# 获取组织成员中文名字
def get_org_member_role_name member
case member.roles[0].name
@@ -2784,8 +2790,7 @@ int main(int argc, char** argv){
#代码提交数量
def changesets_num project
g = Gitlab.client
- project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count
- # # commits_total_count(project.gpid)
+ project.gpid.nil? ? 0 : g.project(project.gpid).commit_count
# project.changesets.count
end
diff --git a/app/helpers/subfield_subdomain_dirs_helper.rb b/app/helpers/subfield_subdomain_dirs_helper.rb
new file mode 100644
index 000000000..584de578c
--- /dev/null
+++ b/app/helpers/subfield_subdomain_dirs_helper.rb
@@ -0,0 +1,2 @@
+module SubfieldSubdomainDirsHelper
+end
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index d90b0368e..3088714ee 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -90,7 +90,7 @@ class Attachment < ActiveRecord::Base
before_save :files_to_final_location,:act_as_course_activity
after_create :office_conver, :be_user_score,:act_as_forge_activity,:create_attachment_ealasticsearch_index
after_update :office_conver, :be_user_score,:update_attachment_ealasticsearch_index
- after_destroy :delete_from_disk,:down_user_score,:delete_attachment_ealasticsearch_index
+ after_destroy :delete_from_disk,:down_user_score,:delete_attachment_ealasticsearch_index#, :decrease_attchments_count
# add by nwb
# 获取所有可公开的资源文件列表
@@ -617,6 +617,7 @@ class Attachment < ActiveRecord::Base
self.__elasticsearch__.index_document
end
end
+
def update_attachment_ealasticsearch_index
if self.is_public == 1 && ( ((self.container_type == 'Project' or self.container_type == 'Version') && Project.find(self.container_id).is_public == 1) ||
( self.container_type == 'Course' && Course.find(self.container_id).is_public == 1) ||
@@ -632,12 +633,20 @@ class Attachment < ActiveRecord::Base
end
end
end
+
def delete_attachment_ealasticsearch_index
begin
self.__elasticsearch__.delete_document
rescue => e
end
end
+
+ # def decrease_attchments_count
+ # if self.container_type == "Project"
+ # count = self.container.attachments_count
+ # #self.container.update_attribute(:attachments_count, self.container.attachments_count - 1)
+ # end
+ # end
end
# Delete the previous articles index in Elasticsearch
diff --git a/app/models/course.rb b/app/models/course.rb
index 4e3b4fff0..24e955d15 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -1,6 +1,7 @@
require 'elasticsearch/model'
class Course < ActiveRecord::Base
include Redmine::SafeAttributes
+ include ApplicationHelper
STATUS_ACTIVE = 1
STATUS_CLOSED = 5
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 4dfa643fa..e1de4cd9e 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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'
@@ -83,9 +84,9 @@ class Issue < ActiveRecord::Base
attr_reader :current_journal
# fq
- after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message
+ after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message, :add_issues_count
after_update :be_user_score,:update_activity
- after_destroy :down_user_score
+ after_destroy :down_user_score, :decrease_issues_count
# after_create :be_user_score
# end
@@ -132,7 +133,7 @@ class Issue < ActiveRecord::Base
update_forge_activity(self.class, self.id)
update_org_activity(self.class, self.id)
end
-
+
# fq
def act_as_activity
self.acts << Activity.new(:user_id => self.author_id)
@@ -171,6 +172,22 @@ class Issue < ActiveRecord::Base
end
end
+ # 创建issue的时候,issues_count加1
+ def add_issues_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
+ 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
+
# 更新缺陷
#def act_as_forge_message_update
# unless self.author_id == self.assigned_to_id
diff --git a/app/models/journal.rb b/app/models/journal.rb
index e1464a703..88b71d9ff 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -48,14 +48,14 @@ class Journal < ActiveRecord::Base
:conditions => "#{Journal.table_name}.journalized_type = 'Issue' AND" +
"(#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')"}
- before_create :split_private_notes
+ before_create :split_private_notes, :add_journals_count
# fq
after_save :act_as_activity,:be_user_score, :act_as_forge_message, :act_as_at_message
# end
#after_destroy :down_user_score
#before_save :be_user_score
- after_destroy :down_user_score
+ after_destroy :down_user_score, :decrease_issues_journal_count
scope :visible, lambda {|*args|
user = args.shift || User.current
@@ -214,4 +214,20 @@ class Journal < ActiveRecord::Base
end
end
+
+ # 减少留言数量统计
+ def decrease_issues_journal_count
+ unless self.issue.project.nil?
+ project = self.issue.project
+ project.update_attribute(:journals_count, project.journals_count - 1)
+ end
+ end
+
+ # issue留言总数更新
+ def add_journals_count
+ if !self.issue.project.nil? && self.journalized_type == "Issue" && self.issue.project.project_score.nil?
+ project = self.issue.project
+ project.project_score.update_attribute(:issue_journal_num, project.project_score.journals_count + 1)
+ end
+ end
end
diff --git a/app/models/message.rb b/app/models/message.rb
index b11b2cc1d..618fb4659 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -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
# 课程/项目 消息
@@ -76,9 +75,9 @@ class Message < ActiveRecord::Base
validates_length_of :subject, :maximum => 255
validate :cannot_reply_to_locked_topic, :on => :create
- after_create :add_author_as_watcher, :reset_counters!
+ after_create :add_author_as_watcher, :reset_counters!, :add_boards_count
after_update :update_messages_board, :update_activity
- after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets
+ after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets, :decrease_boards_count
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity, :act_as_system_message, :send_mail, :act_as_student_score, :act_as_at_message
#before_save :be_user_score
@@ -127,6 +126,38 @@ class Message < ActiveRecord::Base
end
end
+ # 发帖精辟更新发帖总数
+ def add_boards_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
+
def reset_counters!
if parent && parent.id
Message.update_all({:last_reply_id => parent.children.maximum(:id)}, {:id => parent.id})
diff --git a/app/models/news.rb b/app/models/news.rb
index e00437fd8..7c44f7e8a 100644
--- a/app/models/news.rb
+++ b/app/models/news.rb
@@ -55,9 +55,9 @@ class News < ActiveRecord::Base
:author_key => :author_id
acts_as_watchable
- after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity,:act_as_system_message, :add_author_as_watcher, :send_mail
+ after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity,:act_as_system_message, :add_author_as_watcher, :send_mail, :add_news_count
after_update :update_activity
- after_destroy :delete_kindeditor_assets
+ after_destroy :delete_kindeditor_assets, :decrease_news_count
scope :visible, lambda {|*args|
includes(:project).where(Project.allowed_to_condition(args.shift || User.current, :view_news, *args))
@@ -115,10 +115,24 @@ class News < ActiveRecord::Base
end
private
+ def add_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
+
+ 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
def add_author_as_watcher
Watcher.create(:watchable => self, :user => author)
end
+
## fq
def act_as_activity
self.acts << Activity.new(:user_id => self.author_id)
diff --git a/app/models/org_document_comment.rb b/app/models/org_document_comment.rb
index 75db910c3..5aa3c1dab 100644
--- a/app/models/org_document_comment.rb
+++ b/app/models/org_document_comment.rb
@@ -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
diff --git a/app/models/org_subfield.rb b/app/models/org_subfield.rb
index 0747114ca..b109ba042 100644
--- a/app/models/org_subfield.rb
+++ b/app/models/org_subfield.rb
@@ -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
diff --git a/app/models/poll.rb b/app/models/poll.rb
index 41bfe8a72..b0499b572 100644
--- a/app/models/poll.rb
+++ b/app/models/poll.rb
@@ -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
diff --git a/app/models/project.rb b/app/models/project.rb
index cd4036810..32677143d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1223,6 +1223,7 @@ class Project < ActiveRecord::Base
self.__elasticsearch__.index_document
end
end
+
def update_project_ealasticsearch_index
if self.is_public #如果是初次更新成为公开的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性
begin
@@ -1238,11 +1239,11 @@ class Project < ActiveRecord::Base
end
end
end
+
def delete_project_ealasticsearch_index
begin
self.__elasticsearch__.delete_document
rescue => e
-
end
end
diff --git a/app/models/subfield_subdomain_dir.rb b/app/models/subfield_subdomain_dir.rb
new file mode 100644
index 000000000..9897e19ac
--- /dev/null
+++ b/app/models/subfield_subdomain_dir.rb
@@ -0,0 +1,4 @@
+class SubfieldSubdomainDir < ActiveRecord::Base
+ # attr_accessible :title, :body
+ belongs_to :org_subfield
+end
diff --git a/app/models/user.rb b/app/models/user.rb
index aa048888c..f3367db59 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -409,7 +409,7 @@ class User < Principal
def get_at_show_name
name = show_name
- name = "#{name} #{self.login}" if name != self.login
+ (name != self.login) ? "#{name} #{self.login}" : name
end
#added by nie
diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb
index b316aa406..3d07f69b2 100644
--- a/app/views/account/login.html.erb
+++ b/app/views/account/login.html.erb
@@ -205,7 +205,7 @@
-
欢迎加入Trustie高校创新实践社区!老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。 Trustie是在中国推行大规模开放在线研究模式(MOORE)的支撑平台。
+
欢迎加入Trustie创新实践社区!在这里,您的创新意识和创新潜力将得到充分发挥!目前已有超过200所高校和科研机构在平台中开展在线协同开发、协同学习和协同研究。 Trustie社区的理想是:让创新过程变的更美好!
diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb
index 0c43d0542..22df4499a 100644
--- a/app/views/blogs/_article.html.erb
+++ b/app/views/blogs/_article.html.erb
@@ -26,12 +26,21 @@
) if User.current && User.current.id == activity.author.id %>
- <%= 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 %>
diff --git a/app/views/blogs/_article_list.html.erb b/app/views/blogs/_article_list.html.erb
index 182db9dd0..ca85c0ba2 100644
--- a/app/views/blogs/_article_list.html.erb
+++ b/app/views/blogs/_article_list.html.erb
@@ -43,11 +43,6 @@
- <% 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| %>
diff --git a/app/views/blogs/_homepage.html.erb b/app/views/blogs/_homepage.html.erb
index 30e1b69a5..99835c87d 100644
--- a/app/views/blogs/_homepage.html.erb
+++ b/app/views/blogs/_homepage.html.erb
@@ -36,7 +36,7 @@
<%end%>
-
+
<%= 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;' %>
diff --git a/app/views/boards/_course_show_detail.html.erb b/app/views/boards/_course_show_detail.html.erb
index 804f6543e..1898fce02 100644
--- a/app/views/boards/_course_show_detail.html.erb
+++ b/app/views/boards/_course_show_detail.html.erb
@@ -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%>");
});
<% if topic %>
diff --git a/app/views/courses/private_or_public.js.erb b/app/views/courses/private_or_public.js.erb
index 71315e910..2f222fdfb 100644
--- a/app/views/courses/private_or_public.js.erb
+++ b/app/views/courses/private_or_public.js.erb
@@ -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 %>
-}
\ No newline at end of file
+<% end %>
\ No newline at end of file
diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb
index ad90550d4..86f007e82 100644
--- a/app/views/files/_org_subfield_list.html.erb
+++ b/app/views/files/_org_subfield_list.html.erb
@@ -1,59 +1,77 @@
<% delete_allowed = User.current.admin? %>
-
-
共有 <%= all_attachments.count%> 个资源
-
- <% if order == "asc" %>
- 按 <%= 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"} %> /
- <%= 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"} %> /
- <%= 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"} %> 排序
- <% else %>
- 按 <%= 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"} %> /
- <%= 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"} %> /
- <%= 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"} %> 排序
- <% end %>
-
-
-
-
- <%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
-
-
-
- <% org_subfield_attachments.each do |file| %>
- <% if 1 %>
-
-
- <%= 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| %>
+
+
+
+ <%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
+
+
+
+ <%= 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') %>
+
+ <% if file.is_public? == false%>
+ 私有
+ <%end %>
+
+
+
+
上传时间:<%= format_date(file.created_on)%>
+ <% if file.tag_list.length > 0%>
+
上传类型:<%= file.tag_list[0] %>
+ <% end %>
+
文件大小:<%= number_to_human_size(file.filesize) %>
+
下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %>
+
+
+
+ <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
+ <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
+
+
+
+
<% 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" %>
+
+ <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
+ <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
+
+
+ <%= 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 %>
+
+
+
+ <%= 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 %>
+
+
+ <%else%>
+
+ <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %>
+
<% end %>
- <%= file_preview_tag(file, class: 'f_l re_open', style:'text-align: center;') %>
<% end %>
-
-
-
-
文件大小:<%= number_to_human_size(file.filesize) %>
- <%= 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"%>
-
<%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %>
-
-
-
- <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
- <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
-
-
-
- <% end %>
- <% end %>
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
-
-
+
+
+
+
+
+
+
+
+
+<% 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 %>
+
+ <%=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%>
+
diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb
index 09f74d3cd..7332f4892 100644
--- a/app/views/files/_subfield_files.html.erb
+++ b/app/views/files/_subfield_files.html.erb
@@ -1,4 +1,4 @@
-<%= stylesheet_link_tag 'courses' %>
+<%= stylesheet_link_tag 'courses'%>
-
-
-
- <%= 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()" %>
+
-<% html_title(l(:label_attachment_plural)) -%>
\ No newline at end of file
+<% html_title(l(:label_attachment_plural)) -%>
+
\ No newline at end of file
diff --git a/app/views/files/_upload_subfield_file.html.erb b/app/views/files/_upload_subfield_file.html.erb
index 20c29f238..3f8f1359a 100644
--- a/app/views/files/_upload_subfield_file.html.erb
+++ b/app/views/files/_upload_subfield_file.html.erb
@@ -7,16 +7,12 @@
<%= l(:label_file_upload_error_messages)%>
<%= 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] %>
-
- 软件 |
- 媒体 |
- 代码 |
- 其他
-
- <% else %>
-
- <% end %>
+
+ 软件 |
+ 媒体 |
+ 代码 |
+ 其他
+
<%= render :partial => 'files/org_subfield_upload_attachment_list', :locals => {:container => org_subfield}%>
diff --git a/app/views/files/index.js.erb b/app/views/files/index.js.erb
index fe24c9be0..49e7ac714 100644
--- a/app/views/files/index.js.erb
+++ b/app/views/files/index.js.erb
@@ -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 %>
\ No newline at end of file
diff --git a/app/views/files/search_files_in_subfield.js.erb b/app/views/files/search_files_in_subfield.js.erb
index deed2d5d3..77c364817 100644
--- a/app/views/files/search_files_in_subfield.js.erb
+++ b/app/views/files/search_files_in_subfield.js.erb
@@ -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})%>");
\ No newline at end of file
+<% 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 %>
\ No newline at end of file
diff --git a/app/views/layouts/_org_courses.html.erb b/app/views/layouts/_org_courses.html.erb
index b2bd8e428..4085cce22 100644
--- a/app/views/layouts/_org_courses.html.erb
+++ b/app/views/layouts/_org_courses.html.erb
@@ -2,25 +2,25 @@
<%# pro = Project.find course.course_id %>
<% end %>
<% if courses.size == 5%>
diff --git a/app/views/layouts/_org_projects.html.erb b/app/views/layouts/_org_projects.html.erb
index 00c5db642..7df93e40b 100644
--- a/app/views/layouts/_org_projects.html.erb
+++ b/app/views/layouts/_org_projects.html.erb
@@ -2,24 +2,24 @@
<%# pro = Project.find project.project_id %>
<% end %>
<% if projects.size == 5%>
diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb
index 51758ea4c..60fc6f96d 100644
--- a/app/views/layouts/_project_info.html.erb
+++ b/app/views/layouts/_project_info.html.erb
@@ -1,92 +1,99 @@
-<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
-<% teacher_num = searchTeacherAndAssistant(@course).count %>
-<% student_num = studentCount(@course) %>
-<% course_file_num = visable_attachemnts_incourse(@course).count%>
-
-
-<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
-
-
<%= @course.is_public == 0 ? "私有课程" : "公开课程" %>
-
-ID:<%= @course.id%>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <%= @course.name %>
-
- <%# if @course.is_public == 0%>
-
-
- <%# end %>
-
- <%if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %>
-
- <% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0%>
-
- <% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0%>
-
- <% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0%>
-
- <%else%>
- <%end %>
-
-
-
-
-
-
-<% if is_teacher %>
-
-
-
-
- <%= link_to "课程配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %>
- <%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %>
- <%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %>
-
-
-
-
-<% end %>
+<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
+<% teacher_num = searchTeacherAndAssistant(@course).count %>
+<% student_num = studentCount(@course) %>
+<% course_file_num = visable_attachemnts_incourse(@course).count%>
+
+ <% if @course.id == 370 %>
+
+ <% end %>
+
+<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
+
+
<%= @course.is_public == 0 ? "私有课程" : "公开课程" %>
+ <% if @course.id == 370 %>
+
+ <% end %>
+
+
+ID:<%= @course.id%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%= @course.name %>
+
+ <%# if @course.is_public == 0%>
+
+
+ <%# end %>
+
+ <%if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %>
+
+ <% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0%>
+
+ <% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0%>
+
+ <% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0%>
+
+ <%else%>
+ <%end %>
+
+
+
+
+
+
+<% if is_teacher %>
+
+
+
+
+ <%= link_to "课程配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %>
+ <%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %>
+ <%= link_to "复制学期", copy_course_course_path(@course.id),:remote=>true, :class => "postOptionLink" %>
+
+
+
+
+<% end %>
diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb
index 1becb1a33..cc07950e3 100644
--- a/app/views/layouts/_user_courses.html.erb
+++ b/app/views/layouts/_user_courses.html.erb
@@ -1,25 +1,69 @@
<% courses.each do |course|%>
<% end %>
diff --git a/app/views/layouts/_user_projects.html.erb b/app/views/layouts/_user_projects.html.erb
index 88be91d70..b103118ba 100644
--- a/app/views/layouts/_user_projects.html.erb
+++ b/app/views/layouts/_user_projects.html.erb
@@ -1,24 +1,51 @@
<% projects.each do |project|%>
<% end %>
<% if projects.size == 5%>
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 545b29073..58289b352 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -76,12 +76,13 @@
<% if @project.project_type == 0 %>
- <% unless project_scores(@project) == 0 %>
+ <% unless static_project_score(@project.project_score) == 0 %>
<%= l(:label_project_score)%> :
- <%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
- :action => 'show_projects_score',
- :remote => true,
- :id => @project.id}, :class => "c_orange f14" ) %>
+ <%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
+ {:controller => 'projects',
+ :action => 'show_projects_score',
+ :remote => true,
+ :id => @project.id}, :class => "c_orange f14" ) %>
<% end %>
<% end %>
@@ -91,12 +92,11 @@
<%= l(:label_member) %>(<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'info_foot_num c_blue', :id => 'project_members_number' %>)
|
<%= l(:label_user_watcher) %>(<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'info_foot_num c_blue' %>)
- <% attaments_num = @project.attachments.count %>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
|
<%= l(:project_module_attachments) %>(
- <% attaments_num %>
- <%= link_to "#{attaments_num}", project_files_path(@project), :class => 'info_foot_num c_blue', :id=>'project_files_count_info' %>)
+ <% @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' %>)
<% end %>
@@ -120,11 +120,11 @@
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
- <%= render :partial => 'projects/development_group', :locals => {:project => @project, :attaments_num => attaments_num} %>
+ <%= render :partial => 'projects/development_group', :locals => {:project => @project} %>
<% elsif @project.project_new_type == 2 %>
- <%= render :partial => 'projects/research_team', :locals => {:project => @project, :attaments_num => attaments_num} %>
+ <%= render :partial => 'projects/research_team', :locals => {:project => @project} %>
<% else %>
- <%= render :partial => 'projects/friend_group', :locals => {:project => @project, :attaments_num => attaments_num} %>
+ <%= render :partial => 'projects/friend_group', :locals => {:project => @project} %>
<% end %>
@@ -213,19 +213,19 @@
if(data == 1)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team), 1))%>");
- $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/development_group', :locals => {:project => @project, :attaments_num => attaments_num})) %>');
+ $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/development_group', :locals => {:project => @project})) %>');
$("#close_light").attr("onClick","close_window('development_group');");
}
else if(data == 2)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group), 2))%>");
- $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/research_team', :locals => {:project => @project, :attaments_num => attaments_num})) %>');
+ $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/research_team', :locals => {:project => @project})) %>');
$("#close_light").attr("onClick","close_window('research_group');");
}
else if(data == 3)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization), 3))%>");
- $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/friend_group', :locals => {:project => @project, :attaments_num => attaments_num})) %>');
+ $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/friend_group', :locals => {:project => @project})) %>');
$("#close_light").attr("onClick","close_window('friend_organization');");
}
else
diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb
index 52af845ed..de898a733 100644
--- a/app/views/layouts/new_base_user.html.erb
+++ b/app/views/layouts/new_base_user.html.erb
@@ -52,15 +52,25 @@
})
$(".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");
- })
+ });
+
+ //侧导航栏配置设置
+ $(".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");
+ });
})
@@ -94,7 +104,7 @@
<% end%>
-
+
<%= @user.realname.blank? ? @user.login : @user.realname %>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
@@ -165,7 +175,7 @@
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<% else%>
- <%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true, :title => "加入课程"%>
+ <%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入课程"%>
<% end%>
<% end%>
@@ -193,7 +203,7 @@
<% if is_current_user%>
- <%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :title => "新建项目"%>
+ <%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%>
<% end%>
<% 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)%>
diff --git a/app/views/org_subfields/_show_details.html.erb b/app/views/org_subfields/_show_details.html.erb
new file mode 100644
index 000000000..7d83efaa1
--- /dev/null
+++ b/app/views/org_subfields/_show_details.html.erb
@@ -0,0 +1,80 @@
+
+<% unless org_activities.nil? %>
+ <% org_activities.each do |act| %>
+
+ <% 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%>
+
diff --git a/app/views/org_subfields/_show_post_type.html.erb b/app/views/org_subfields/_show_post_type.html.erb
new file mode 100644
index 000000000..defbbce1e
--- /dev/null
+++ b/app/views/org_subfields/_show_post_type.html.erb
@@ -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 %>
+
+
+
+
+
+<% 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 %>
+
+
+
+
+
diff --git a/app/views/org_subfields/create.js.erb b/app/views/org_subfields/create.js.erb
index 345c8f60f..61ac95f71 100644
--- a/app/views/org_subfields/create.js.erb
+++ b/app/views/org_subfields/create.js.erb
@@ -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("");
\ No newline at end of file
+<% 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 %>
\ No newline at end of file
diff --git a/app/views/org_subfields/show.html.erb b/app/views/org_subfields/show.html.erb
index e69de29bb..cf214e038 100644
--- a/app/views/org_subfields/show.html.erb
+++ b/app/views/org_subfields/show.html.erb
@@ -0,0 +1,525 @@
+<% if @org_subfield.field_type == 'Resource' %>
+
+ <%= render :partial => 'files/subfield_files', locals: {org_subfield: @org_subfield} %>
+
+<% else %>
+ <%= render :partial => 'org_subfields/show_post_type'%>
+<% end %>
+
+
+
+
+
diff --git a/app/views/org_subfields/show.js.erb b/app/views/org_subfields/show.js.erb
new file mode 100644
index 000000000..5fdb27cd0
--- /dev/null
+++ b/app/views/org_subfields/show.js.erb
@@ -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} )%>");
\ No newline at end of file
diff --git a/app/views/org_subfields/update_sub_dir.js.erb b/app/views/org_subfields/update_sub_dir.js.erb
new file mode 100644
index 000000000..6794633d2
--- /dev/null
+++ b/app/views/org_subfields/update_sub_dir.js.erb
@@ -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 %>
\ No newline at end of file
diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb
index 4f2a7b662..4245be9eb 100644
--- a/app/views/organizations/_org_course_homework.html.erb
+++ b/app/views/organizations/_org_course_homework.html.erb
@@ -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 %>
<%=(User.find project.user_id).show_name %> (组长)
-
<%=time_from_now time %>
+
<%=time_from_now time %> <%= project.commits_count %>提交
项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb
index 31d6925db..7956af6d1 100644
--- a/app/views/organizations/_org_left_subfield_list.html.erb
+++ b/app/views/organizations/_org_left_subfield_list.html.erb
@@ -70,12 +70,20 @@
<% organization.org_subfields.where("field_type != 'default'").each do |field| %>
- 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
+ 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='ProjectCreateInfo' and forge_act_id =#{project.id}").first.updated_at) %>
diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb
index de837c66f..6b47844bb 100644
--- a/app/views/organizations/_subfield_list.html.erb
+++ b/app/views/organizations/_subfield_list.html.erb
@@ -2,6 +2,7 @@
已有栏目
状态
类型
+
域名目录
@@ -26,6 +27,12 @@
新增
<%= field.field_type == "Post" ? "帖子" : "资源" %>
+
+ <%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
+
+
+
+
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
<%= field.hide==0?"设为隐藏":"设为可见" %>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>
@@ -59,6 +66,28 @@
// $(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({
@@ -71,4 +100,4 @@
type: "post"
});
}
-
\ No newline at end of file
+
diff --git a/app/views/organizations/reject_apply_subdomain.js.erb b/app/views/organizations/reject_apply_subdomain.js.erb
new file mode 100644
index 000000000..e69de29bb
diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb
index 2e9058c40..59e2f2ad9 100644
--- a/app/views/organizations/setting.html.erb
+++ b/app/views/organizations/setting.html.erb
@@ -111,23 +111,33 @@
:subfields => @organization.org_subfields.where("field_type != 'default'") } %>
-
+
新增栏目
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %>
-
-
-
-
确定
+
+
+
域名目录 (用户自定义url,可选)
+ <% if @organization.domain %>
+
<%= @organization.domain %>.trustie.net/
+ <% else %>
+
您还没有子域名,请先在左侧信息栏申请子域名
+ <% end %>
+
+
+
+
+
确定
<% end %>
diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb
index 83b65fe90..4f13278cd 100644
--- a/app/views/projects/_development_group.html.erb
+++ b/app/views/projects/_development_group.html.erb
@@ -6,9 +6,9 @@
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
- <%= link_to l(:label_issue_tracking), project_issues_path(@project), :class => "f14 c_blue02" %>
- <% if (issue_count = @project.issues.count) > 0 %>
-
(<%= issue_count %>)
+ <%= link_to l(:label_issue_tracking), project_issues_path(@project, :remote => true), :class => "f14 c_blue02" %>
+ <% if @project.project_score.issue_num > 0 %>
+
(<%= @project.project_score.issue_num %>)
<% end %>
<% if User.current.member_of?(@project) %>
@@ -19,8 +19,8 @@
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
- <% unless @project.boards.first.topics.count == 0 %>
-
(<%= @project.boards.first.topics.count %>)
+ <% unless @project.project_score.board_num == 0 %>
+
(<%= @project.project_score.board_num %>)
<% 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" %>
@@ -30,8 +30,8 @@
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
- <% unless attaments_num == 0 %>
- <%= link_to "(#{attaments_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
+ <% 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" %>
diff --git a/app/views/projects/_friend_group.html.erb b/app/views/projects/_friend_group.html.erb
index bce920780..0e3db7bae 100644
--- a/app/views/projects/_friend_group.html.erb
+++ b/app/views/projects/_friend_group.html.erb
@@ -7,8 +7,8 @@
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
- <% unless @project.boards.first.topics.count == 0 %>
-
(<%= @project.boards.first.topics.count %>)
+ <% unless @project.project_score.board_num == 0 %>
+
(<%= @project.project_score.board_num %>)
<% 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" %>
@@ -18,8 +18,8 @@
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
- <% unless attaments_num == 0 %>
- <%= link_to "(#{attaments_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
+ <% 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" %>
diff --git a/app/views/projects/_project_create.html.erb b/app/views/projects/_project_create.html.erb
index d966d8e18..f647f1a38 100644
--- a/app/views/projects/_project_create.html.erb
+++ b/app/views/projects/_project_create.html.erb
@@ -18,9 +18,13 @@
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
-
+
创建时间:<%= format_time(project.created_on) %>
+
+ 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='ProjectCreateInfo' and forge_act_id =#{project.id}").first.updated_at) %>
+
+
diff --git a/app/views/projects/_project_score_index.html.erb b/app/views/projects/_project_score_index.html.erb
index f10c6b3e7..aefac603e 100644
--- a/app/views/projects/_project_score_index.html.erb
+++ b/app/views/projects/_project_score_index.html.erb
@@ -1,10 +1,9 @@
-
-
<%= l(:label_projects_score) %>
- = <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> +
- <%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %>
- = <%= format("%.2f" , issue_score(project)).to_i %> + <%= format("%.2f" , news_score(project)).to_i %> +
- <%= format("%.2f" , documents_score(project)).to_i %> + <%= format("%.2f" , changesets_score(project)).to_i %> +
- <%= format("%.2f" , board_message_score(project)).to_i %>
- = <%= format("%.2f" , project_scores(project)).to_i %>
-
\ No newline at end of file
+ = <%= l(:label_code_submit_score) %> + <%= l(:label_issue_score) %> + <%= l(:label_file_attachment_score) %> + <%= l(:label_topic_score) %> + <%= l(:label_news_score) %>
+ = <%= @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 %>
+
+ = <%= static_project_score(@project.project_score) %>
diff --git a/app/views/projects/_research_team.html.erb b/app/views/projects/_research_team.html.erb
index 128d5e827..86b617e31 100644
--- a/app/views/projects/_research_team.html.erb
+++ b/app/views/projects/_research_team.html.erb
@@ -7,8 +7,8 @@
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :class => "f14 c_blue02" %>
- <% if (issue_count = @project.issues.count) > 0 %>
-
(<%= issue_count %>)
+ <% if @project.project_score.issue_num > 0 %>
+
(<%= @project.project_score.issue_num %>)
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
@@ -18,8 +18,8 @@
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
- <% unless @project.boards.first.topics.count == 0 %>
-
(<%= @project.boards.first.topics.count %>)
+ <% unless @project.project_score.board_num == 0 %>
+
(<%= @project.project_score.board_num %>)
<% 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" %>
@@ -29,8 +29,8 @@
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
- <% unless attaments_num == 0 %>
- <%= link_to "(#{attaments_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
+ <% 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" %>
diff --git a/app/views/projects/_show_projects_score.html.erb b/app/views/projects/_show_projects_score.html.erb
index 68ba2f12a..c18060257 100644
--- a/app/views/projects/_show_projects_score.html.erb
+++ b/app/views/projects/_show_projects_score.html.erb
@@ -1,5 +1,3 @@
-
-
<%= l(:label_projects_score) %>
@@ -14,72 +12,35 @@
<%= l(:label_projects_score) %>
- <%= format("%.2f" , project_scores(@project) ).to_i %>
+ <%= static_project_score(@project.project_score) %>
-
-
- <%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> :
- <%= format("%.2f" , project_scores(@project) ).to_i %>
+ <%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> : <%= static_project_score(@project.project_score) %>
+
+ <%= link_to l(:label_code_submit_score), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> : <%= @project.project_score.changeset_num * 4 %>
+
- <%= link_to l(:label_issue_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> :
- <%= format("%.2f" , issue_score(@project)).to_i %>
+ <%= 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 %>
-
- <%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> :
- <%= format("%.2f" , news_score(@project)).to_i %>
+
+ <%= link_to l(:label_file_attachment_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> : <%= @project.project_score.attach_num * 5 %>
+
+ <%= 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 %>
+
- <%= link_to l(:label_file_score), "javascript:void(0)", :onclick => "show_div('file_score_index')"%> :
- <%= format("%.2f" , documents_score(@project)).to_i %>
-
-
- <%= link_to l(:label_code_submit_score), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> :
- <%= format("%.2f" , changesets_score(@project)).to_i %>
-
-
- <%= link_to l(:label_topic_score), "javascript:void(0)", :onclick => "show_div('projects_topic_score_index')"%> :
- <%= format("%.2f" , board_message_score(@project)).to_i %>
+ <%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> : <%= @project.project_score.news_num %>
<%= render :partial => 'projects/project_score_index', :locals => {:project => @project } %>
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/views/projects/set_public_or_private.js.erb b/app/views/projects/set_public_or_private.js.erb
new file mode 100644
index 000000000..ca6c63f0b
--- /dev/null
+++ b/app/views/projects/set_public_or_private.js.erb
@@ -0,0 +1,5 @@
+<% if @project.is_public? %>
+ $("#set_project_public_<%= @project.id %>").text("设为私有");
+<% else %>
+ $("#set_project_public_<%= @project.id %>").text("设为公开");
+<% end %>
\ No newline at end of file
diff --git a/app/views/subfield_subdomain_dirs/update.js.erb b/app/views/subfield_subdomain_dirs/update.js.erb
new file mode 100644
index 000000000..97d8a6dee
--- /dev/null
+++ b/app/views/subfield_subdomain_dirs/update.js.erb
@@ -0,0 +1 @@
+$("#sub_dir_show_<%= @org_subfield.id %>").html("<%= @org_subfield.subfield_subdomain_dir.name %>");
\ No newline at end of file
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 7c6959935..2c1af1b83 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -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 %>
<%=(User.find project.user_id).show_name %> (组长)
-
<%=time_from_now time %>
+
<%=time_from_now time %> <%= project.commits_count %>提交
项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
diff --git a/app/views/users/_project_create.html.erb b/app/views/users/_project_create.html.erb
index 6214833f1..ae25312f3 100644
--- a/app/views/users/_project_create.html.erb
+++ b/app/views/users/_project_create.html.erb
@@ -23,7 +23,7 @@
创建时间:<%= format_time(project.created_on) %>
- 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
+ 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='ProjectCreateInfo' and forge_act_id =#{project.id}").first.updated_at) %>
diff --git a/app/views/users/_resource_share_for_orgs.html.erb b/app/views/users/_resource_share_for_orgs.html.erb
index 9da439c8e..37fb3442e 100644
--- a/app/views/users/_resource_share_for_orgs.html.erb
+++ b/app/views/users/_resource_share_for_orgs.html.erb
@@ -22,7 +22,7 @@
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
-
+
<% unless @orgs.empty? %>
<% @orgs.each do |org|%>
diff --git a/app/views/users/_resource_share_for_project_popup.html.erb b/app/views/users/_resource_share_for_project_popup.html.erb
index 2dba25e56..f15c29e90 100644
--- a/app/views/users/_resource_share_for_project_popup.html.erb
+++ b/app/views/users/_resource_share_for_project_popup.html.erb
@@ -1,10 +1,8 @@
-
-
发送到
-
+
课程
项目
组织
@@ -20,13 +18,13 @@
<%= hidden_field_tag(:send_ids, send_ids) %>
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
<% end %>
- <%= form_tag add_exist_file_to_project_user_path(user),:remote=>true,:id=>'projects_list_form' %>
+ <%= form_tag add_exist_file_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %>
<%= hidden_field_tag(:send_id, send_id) %>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
index 85e426e92..802723936 100644
--- a/app/views/users/_user_homework_detail.html.erb
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -174,7 +174,7 @@
<% time=project.updated_on %>
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<%=(User.find project.user_id).show_name %> (组长)
-
<%=time_from_now time %>
+
<%=time_from_now time %> <%= project.commits_count %>提交
项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb
index 0632ebb98..5218c22ab 100644
--- a/app/views/users/search_user_project.js.erb
+++ b/app/views/users/search_user_project.js.erb
@@ -1,11 +1,4 @@
-
-//var popupHeight = $(".resourceSharePopup").outerHeight(true);
-//$(".resourceSharePopup").css("marginTop",-popupHeight/2);
-//
-//$("#upload_box").css('left','').css('top','');
-//$("#upload_box").html('<%#= escape_javascript( render :partial => "resource_share_for_project_popup" ,:locals => {:projects=>@projects,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
-//$("#upload_box").css('display','block');
-$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup' ,:locals => {:projects=>@projects,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
+$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("
");
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 2805c4379..a56ca7b48 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -40,4 +40,10 @@
+
+<% 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} %>
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index 3f86b4b60..fe89e64e3 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -432,6 +432,8 @@ zh:
label_file_score: 文档得分
label_file_number: 文档的数量
+
+ label_file_attachment_score: 资源得分
label_code_submit_score: 代码提交得分
label_code_submit_number: 代码提交频率
diff --git a/config/routes.rb b/config/routes.rb
index 133203a8b..7c3511895 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -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
diff --git a/db/migrate/20160108093752_add_status_to_org_messages.rb b/db/migrate/20160108093752_add_status_to_org_messages.rb
new file mode 100644
index 000000000..4fbe41fe1
--- /dev/null
+++ b/db/migrate/20160108093752_add_status_to_org_messages.rb
@@ -0,0 +1,5 @@
+class AddStatusToOrgMessages < ActiveRecord::Migration
+ def change
+ add_column :org_messages, :status, :integer, :default => 0
+ end
+end
diff --git a/db/migrate/20160111064927_add_issues_count_to_project.rb b/db/migrate/20160111064927_add_issues_count_to_project.rb
new file mode 100644
index 000000000..dcb90b32c
--- /dev/null
+++ b/db/migrate/20160111064927_add_issues_count_to_project.rb
@@ -0,0 +1,5 @@
+class AddIssuesCountToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :issues_count, :integer, :default => false
+ end
+end
diff --git a/db/migrate/20160111065137_add_attachments_count_to_project.rb b/db/migrate/20160111065137_add_attachments_count_to_project.rb
new file mode 100644
index 000000000..aecacfcb6
--- /dev/null
+++ b/db/migrate/20160111065137_add_attachments_count_to_project.rb
@@ -0,0 +1,5 @@
+class AddAttachmentsCountToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :attachments_count, :integer, :default => false
+ end
+end
diff --git a/db/migrate/20160111065215_add_boards_count_to_project.rb b/db/migrate/20160111065215_add_boards_count_to_project.rb
new file mode 100644
index 000000000..efc4b3f3c
--- /dev/null
+++ b/db/migrate/20160111065215_add_boards_count_to_project.rb
@@ -0,0 +1,5 @@
+class AddBoardsCountToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :boards_count, :integer, :default => false
+ end
+end
diff --git a/db/migrate/20160111065530_add_news_count_to_project.rb b/db/migrate/20160111065530_add_news_count_to_project.rb
new file mode 100644
index 000000000..63278e2eb
--- /dev/null
+++ b/db/migrate/20160111065530_add_news_count_to_project.rb
@@ -0,0 +1,5 @@
+class AddNewsCountToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :news_count, :integer, :default => false
+ end
+end
diff --git a/db/migrate/20160111071348_static_project_boards.rb b/db/migrate/20160111071348_static_project_boards.rb
new file mode 100644
index 000000000..4b82be23c
--- /dev/null
+++ b/db/migrate/20160111071348_static_project_boards.rb
@@ -0,0 +1,14 @@
+class StaticProjectBoards < ActiveRecord::Migration
+ def up
+ Project.all.each do |project|
+ puts project.id
+ unless project.boards.first.nil?
+ boards_count = project.boards.first.topics.count
+ project.update_attribute(:boards_count, boards_count)
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160111071411_static_project_issues.rb b/db/migrate/20160111071411_static_project_issues.rb
new file mode 100644
index 000000000..96c6d7acb
--- /dev/null
+++ b/db/migrate/20160111071411_static_project_issues.rb
@@ -0,0 +1,13 @@
+class StaticProjectIssues < ActiveRecord::Migration
+ def up
+ Project.all.each do |project|
+ unless project.issues.nil?
+ issues_count = project.issues.count
+ project.update_attribute(:issues_count, issues_count)
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160111071529_static_project_news.rb b/db/migrate/20160111071529_static_project_news.rb
new file mode 100644
index 000000000..f013a929d
--- /dev/null
+++ b/db/migrate/20160111071529_static_project_news.rb
@@ -0,0 +1,13 @@
+class StaticProjectNews < ActiveRecord::Migration
+ def up
+ Project.all.each do |project|
+ unless project.news.nil?
+ news_count = project.news.count
+ project.update_attribute(:news_count, news_count)
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160111071558_static_project_attachments.rb b/db/migrate/20160111071558_static_project_attachments.rb
new file mode 100644
index 000000000..692ca68eb
--- /dev/null
+++ b/db/migrate/20160111071558_static_project_attachments.rb
@@ -0,0 +1,13 @@
+class StaticProjectAttachments < ActiveRecord::Migration
+ def up
+ Project.all.each do |project|
+ unless project.attachments.nil?
+ attachments_count = project.attachments.count
+ project.update_attribute(:attachments_count, attachments_count)
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160111080833_add_acts_count_to_project.rb b/db/migrate/20160111080833_add_acts_count_to_project.rb
new file mode 100644
index 000000000..a990302bc
--- /dev/null
+++ b/db/migrate/20160111080833_add_acts_count_to_project.rb
@@ -0,0 +1,5 @@
+class AddActsCountToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :acts_count, :integer, :default => false
+ end
+end
diff --git a/db/migrate/20160111080914_static_project_acts.rb b/db/migrate/20160111080914_static_project_acts.rb
new file mode 100644
index 000000000..3f07cbb03
--- /dev/null
+++ b/db/migrate/20160111080914_static_project_acts.rb
@@ -0,0 +1,16 @@
+class StaticProjectActs < ActiveRecord::Migration
+ def up
+ Project.all.each do |project|
+ acts = ForgeActivity.where("project_id = ?", project.id)
+ unless acts.blank?
+ count = acts.count
+ puts project.id
+ puts "acts_count is #{count}"
+ project.update_attribute(:acts_count, count)
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160112085834_create_subfield_subdomain_dirs.rb b/db/migrate/20160112085834_create_subfield_subdomain_dirs.rb
new file mode 100644
index 000000000..0ef66a94c
--- /dev/null
+++ b/db/migrate/20160112085834_create_subfield_subdomain_dirs.rb
@@ -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
diff --git a/db/migrate/20160113023045_add_journals_count_to_project.rb b/db/migrate/20160113023045_add_journals_count_to_project.rb
new file mode 100644
index 000000000..9548f49c4
--- /dev/null
+++ b/db/migrate/20160113023045_add_journals_count_to_project.rb
@@ -0,0 +1,5 @@
+class AddJournalsCountToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :journals_count, :integer, :default => false
+ end
+end
diff --git a/db/migrate/20160113023137_statics_issue_journal.rb b/db/migrate/20160113023137_statics_issue_journal.rb
new file mode 100644
index 000000000..ef54c04be
--- /dev/null
+++ b/db/migrate/20160113023137_statics_issue_journal.rb
@@ -0,0 +1,12 @@
+class StaticsIssueJournal < ActiveRecord::Migration
+ def up
+ Project.all.each do |project|
+ if !project.project_score.nil? && !project.project_score.issue_journal_num.nil?
+ project.update_attribute(:journals_count, project.project_score.issue_journal_num)
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160113024927_statics_repository_commits.rb b/db/migrate/20160113024927_statics_repository_commits.rb
new file mode 100644
index 000000000..66fa896af
--- /dev/null
+++ b/db/migrate/20160113024927_statics_repository_commits.rb
@@ -0,0 +1,19 @@
+class StaticsRepositoryCommits < ActiveRecord::Migration
+ def up
+ g = Gitlab.client
+ Project.all.each do |project|
+ unless project.gpid.nil?
+ begin
+ puts project.id
+ count = g.project(project.gpid).commit_count
+ rescue
+ logger.error("The project's rep is not exit!")
+ end
+ project.update_attribute(:commits_count, count)
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160113063514_add_messages_count_to_project.rb b/db/migrate/20160113063514_add_messages_count_to_project.rb
new file mode 100644
index 000000000..218ac3cc4
--- /dev/null
+++ b/db/migrate/20160113063514_add_messages_count_to_project.rb
@@ -0,0 +1,5 @@
+class AddMessagesCountToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :boards_reply_count, :integer, :default => false
+ end
+end
diff --git a/db/migrate/20160113064153_statics_boards_reply.rb b/db/migrate/20160113064153_statics_boards_reply.rb
new file mode 100644
index 000000000..baf427b10
--- /dev/null
+++ b/db/migrate/20160113064153_statics_boards_reply.rb
@@ -0,0 +1,14 @@
+class StaticsBoardsReply < ActiveRecord::Migration
+ def up
+ Project.all.each do |project|
+ puts project.id
+ unless project.boards.first.nil?
+ messages_count = Message.where("board_id =? and parent_id is not ?", project.boards.first.id, nil).count
+ project.update_attribute(:boards_reply_count, messages_count)
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160113090435_update_forge_and_user_activity.rb b/db/migrate/20160113090435_update_forge_and_user_activity.rb
new file mode 100644
index 000000000..01cedded0
--- /dev/null
+++ b/db/migrate/20160113090435_update_forge_and_user_activity.rb
@@ -0,0 +1,42 @@
+class UpdateForgeAndUserActivity < ActiveRecord::Migration
+ def up
+ user_count = UserActivity.all.count / 30 + 2
+ transaction do
+ for i in 1 ... user_count do i
+ UserActivity.page(i).per(30).each do |user_act|
+ if user_act.act_type == 'Issue'
+ if user_act.act
+ if user_act.act.journals.count > 0
+ user_act.updated_at = user_act.act.journals.maximum("created_on")
+ user_act.save
+ end
+ else
+ user_act.destroy
+ end
+ end
+ end
+ end
+ end
+
+ for_count = ForgeActivity.all.count / 30 + 2
+ transaction do
+ for i in 1 ... for_count do i
+ ForgeActivity.page(i).per(30).each do |for_act|
+ if for_act.forge_act_type == 'Issue'
+ if for_act.forge_act
+ if for_act.forge_act.journals.count > 0
+ for_act.updated_at = for_act.forge_act.journals.maximum("created_on")
+ for_act.save
+ end
+ else
+ for_act.destroy
+ end
+ end
+ end
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160114022833_add_board_num_to_project_score.rb b/db/migrate/20160114022833_add_board_num_to_project_score.rb
new file mode 100644
index 000000000..4ee56a56b
--- /dev/null
+++ b/db/migrate/20160114022833_add_board_num_to_project_score.rb
@@ -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
diff --git a/db/migrate/20160114022928_update_project_score.rb b/db/migrate/20160114022928_update_project_score.rb
new file mode 100644
index 000000000..8a632c2bc
--- /dev/null
+++ b/db/migrate/20160114022928_update_project_score.rb
@@ -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
diff --git a/db/schema.rb b/db/schema.rb
index 7f6fe7351..105a28280 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20160108024752) do
+ActiveRecord::Schema.define(:version => 20160112085834) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -1226,8 +1226,9 @@ ActiveRecord::Schema.define(:version => 20160108024752) do
t.integer "message_id"
t.integer "viewed"
t.string "content"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "status", :default => 0
end
create_table "org_projects", :force => true do |t|
@@ -1365,6 +1366,8 @@ ActiveRecord::Schema.define(:version => 20160108024752) do
t.integer "documents_num", :default => 0
t.integer "changeset_num", :default => 0
t.integer "board_message_num", :default => 0
+ t.integer "board_num", :default => 0
+ t.integer "attach_num", :default => 0
end
create_table "project_statuses", :force => true do |t|
@@ -1656,6 +1659,13 @@ ActiveRecord::Schema.define(:version => 20160108024752) do
add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id"
add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id"
+ create_table "subfield_subdomain_dirs", :force => true do |t|
+ t.integer "org_subfield_id"
+ t.string "name"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "system_messages", :force => true do |t|
t.integer "user_id"
t.string "content"
@@ -1693,6 +1703,10 @@ ActiveRecord::Schema.define(:version => 20160108024752) do
t.string "extra"
end
+ create_table "temp", :id => false, :force => true do |t|
+ t.integer "id", :default => 0, :null => false
+ end
+
create_table "time_entries", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false
diff --git a/lib/trustie/gitlab/manage_member.rb b/lib/trustie/gitlab/manage_member.rb
index 433b101f5..5c75d9d6e 100644
--- a/lib/trustie/gitlab/manage_member.rb
+++ b/lib/trustie/gitlab/manage_member.rb
@@ -5,6 +5,8 @@ module Trustie
module Gitlab
module ManageMember
+ attr :g
+ include Helper
def self.included(base)
base.class_eval {
before_create :add_gitlab_member
diff --git a/public/assets/kindeditor/at/config.js b/public/assets/kindeditor/at/config.js
index 651f33464..72aeacb39 100644
--- a/public/assets/kindeditor/at/config.js
+++ b/public/assets/kindeditor/at/config.js
@@ -23,7 +23,7 @@ var enableAt = function(_editor) {
}
if('undefined' != (typeof id)){
- names = '/at/' + id + '?type='+type;
+ 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","你好","你你你", "가"];
diff --git a/public/javascripts/org.js b/public/javascripts/org.js
index 1e1951006..636b84baa 100644
--- a/public/javascripts/org.js
+++ b/public/javascripts/org.js
@@ -50,4 +50,28 @@ function show_more_org_course(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) {
+
+ }
+ );
+ }
+
}
\ No newline at end of file
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index eb3724bf1..ac9b50d0f 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -581,7 +581,7 @@ a.homepageImageNumber:hover {color:#269ac9;}
.homepageLeftMenuCourses {font-size:13px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#269ac9;}
-a.coursesLineGrey {padding-left:25px; color:#808080; display:block;}
+a.coursesLineGrey {padding-left:25px; padding-right:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#269ac9;}
diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css
index 2279f0fe5..2ebdcf654 100644
--- a/public/stylesheets/org.css
+++ b/public/stylesheets/org.css
@@ -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;}
\ No newline at end of file
+.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;}
\ No newline at end of file
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index b90758914..4918ee74f 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -519,7 +519,7 @@ a.homepageImageNumber:hover {color:#15bccf;}
.homepageLeftMenuCourses {font-size:14px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#b3e0ee;}
-a.coursesLineGrey {padding-left:25px; color:#15bccf; display:block;}
+a.coursesLineGrey {padding-left:25px; padding-right:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#b3e0ee;}
@@ -1003,4 +1003,4 @@ a:hover.userCancel{border:1px solid #888888; }
.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;}
-.resourceCopy {padding:0px; margin:0px; width:12px; height:12px; display:inline-block;}
\ No newline at end of file
+.resourceCopy {padding:0px; margin:0px; width:12px; height:12px; display:inline-block;}
diff --git a/public/stylesheets/scm.css b/public/stylesheets/scm.css
index 054b0bf99..b8b624154 100644
--- a/public/stylesheets/scm.css
+++ b/public/stylesheets/scm.css
@@ -52,6 +52,7 @@ table.filecontent th.line-num {
-ms-user-select: none;
-webkit-user-select: none;
font-weight:normal;
+ white-space: nowrap;
}
table.filecontent th.line-num a {
text-decoration: none;
diff --git a/public/stylesheets/share.css b/public/stylesheets/share.css
index ea45a8b41..8a4b38b65 100644
--- a/public/stylesheets/share.css
+++ b/public/stylesheets/share.css
@@ -18,6 +18,20 @@ a:hover.userCancel{border:1px solid #888888; }
.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;}
@@ -27,4 +41,13 @@ a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; backg
.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;}
\ No newline at end of file
+.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;}
\ No newline at end of file
diff --git a/spec/controllers/subfield_subdomain_dirs_controller_spec.rb b/spec/controllers/subfield_subdomain_dirs_controller_spec.rb
new file mode 100644
index 000000000..70160c0f0
--- /dev/null
+++ b/spec/controllers/subfield_subdomain_dirs_controller_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe SubfieldSubdomainDirsController, :type => :controller do
+
+end
diff --git a/spec/factories/subfield_subdomain_dirs.rb b/spec/factories/subfield_subdomain_dirs.rb
new file mode 100644
index 000000000..3a9878a82
--- /dev/null
+++ b/spec/factories/subfield_subdomain_dirs.rb
@@ -0,0 +1,6 @@
+FactoryGirl.define do
+ factory :subfield_subdomain_dir do
+
+ end
+
+end
diff --git a/spec/models/subfield_subdomain_dir_spec.rb b/spec/models/subfield_subdomain_dir_spec.rb
new file mode 100644
index 000000000..330a35c54
--- /dev/null
+++ b/spec/models/subfield_subdomain_dir_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe SubfieldSubdomainDir, :type => :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end