Merge branch 'hjq_beidou' into yuanke_1
Conflicts: db/schema.rb public/stylesheets/project.css
|
@ -84,9 +84,6 @@ class OrganizationsController < ApplicationController
|
|||
|
||||
@subfield_content = @organization.org_subfields.order("priority")
|
||||
@organization = Organization.find(params[:id])
|
||||
# 统计访问量
|
||||
@organization.update_column(:visits, @organization.visits.to_i + 1)
|
||||
|
||||
# @org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
# @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
# @org_acts = 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)
|
||||
|
@ -116,15 +113,13 @@ class OrganizationsController < ApplicationController
|
|||
#@project_acts_issues = get_project_activities_org @organization
|
||||
#@course_acts = get_course_activities_org @organization
|
||||
|
||||
render :layout => 'base_org_newstyle'
|
||||
render :layout => 'base_org2'
|
||||
else
|
||||
render_403
|
||||
end
|
||||
else
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@organization = Organization.find(params[:id])
|
||||
# 统计访问量
|
||||
@organization.update_column(:visits, @organization.visits.to_i + 1)
|
||||
if params[:org_subfield_id]
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
|
|
|
@ -319,9 +319,25 @@ class ProjectsController < ApplicationController
|
|||
else
|
||||
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10);
|
||||
end
|
||||
g = Gitlab.client
|
||||
unless @project.gpid.nil?
|
||||
@static_total_per_user = g.rep_stats(@project.gpid)
|
||||
# g = Gitlab.client
|
||||
unless @project.gpid.nil? || @project.project_score.changeset_num == 0
|
||||
# rep_statics_commit = @project.rep_statics.order("commits_num desc")
|
||||
rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10")
|
||||
rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10")
|
||||
# rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse
|
||||
@a_uname = rep_statics_commit.map {|s| s.uname }
|
||||
@a_uname_code = rep_statics_code.map {|s| s.uname }
|
||||
@a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i }
|
||||
@a_commits_add = rep_statics_code.map {|s| s.add.to_i }
|
||||
@a_commits_del = rep_statics_code.map {|s| s.del.to_i }
|
||||
@a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i }
|
||||
g = Gitlab.client
|
||||
begin
|
||||
g_branch = g.project(@project.gpid).default_branch.to_s
|
||||
rescue
|
||||
logger.error("get gitlab project failed!")
|
||||
end
|
||||
@rev = g_branch.nil? ? "master" : g_branch
|
||||
end
|
||||
# 根据对应的请求,返回对应的数据
|
||||
respond_to do |format|
|
||||
|
|
|
@ -325,31 +325,17 @@ update
|
|||
end
|
||||
end
|
||||
|
||||
# unless @repository.gitlab?
|
||||
# # redirect_to to_gitlab_project_repository_path(@project, @repository)
|
||||
# render :to_gitlab
|
||||
# return
|
||||
# end
|
||||
|
||||
#if( !User.current.member_of?(@project) || @project.hidden_repo)
|
||||
# @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
|
||||
|
||||
# :name, :path, :kind, :size, :lastrev, :changeset
|
||||
@entries = @repository.entries(@path, @rev)
|
||||
# @trees = g.trees(project, @path)
|
||||
@changeset = @repository.find_changeset_by_name(@rev)
|
||||
#@project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
||||
#@ip = RepositoriesHelper::REPO_IP_ADDRESS
|
||||
|
||||
if request.xhr?
|
||||
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
|
||||
else
|
||||
#Modified by young
|
||||
# (show_error_not_found; return) unless @entries
|
||||
g = Gitlab.client
|
||||
@changesets = g.commits(@project.gpid, :ref_name => @rev)
|
||||
g_project = g.project(@project.gpid)
|
||||
# 总的提交数
|
||||
@changesets_all_count = @project.gpid.nil? ? 0 : g.project(@project.gpid).commit_count
|
||||
@changesets_all_count = @project.gpid.nil? ? 0 : g_project.commit_count
|
||||
@g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch
|
||||
# 访问该页面的是会后则刷新
|
||||
if @project.project_score.nil?
|
||||
ProjectScore.create(:project_id => @project.id, :score => false)
|
||||
|
@ -358,17 +344,16 @@ update
|
|||
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]
|
||||
unless @changesets[0].blank?
|
||||
update_commits_date(@project, @changesets_latest_coimmit)
|
||||
end
|
||||
@creator = User.where("id =?", @project.user_id).first.try(:login)
|
||||
@properties = @repository.properties(@path, @rev)
|
||||
@repositories = @project.repositories
|
||||
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
||||
ip = RepositoriesHelper::REPO_IP_ADDRESS
|
||||
# @properties = @repository.properties(@path, @rev)
|
||||
# @repositories = @project.repositories
|
||||
# project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
||||
# ip = RepositoriesHelper::REPO_IP_ADDRESS
|
||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
||||
if @repository.type.to_s == "Repository::Gitlab"
|
||||
@repos_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git"
|
||||
|
@ -573,9 +558,17 @@ update
|
|||
g = Gitlab.client
|
||||
begin
|
||||
@static_total_per_user = g.rep_stats(project_id, :rev => rev)
|
||||
@static_total_per_user
|
||||
# @static_month__per_user = g.rep_stats(project_id, :rev => rev, :creator => creator, :period => 2)
|
||||
# @static_week_per_user = g.rep_stats(project_id, :rev => rev, :creator => creator, :period => 3)
|
||||
# 更新rep_statics统计数
|
||||
@static_total_per_user.each do |static|
|
||||
rep_static = RepStatics.where("project_id =? and email =?", @project.id, static.email.to_s).first
|
||||
if rep_static.nil?
|
||||
RepStatics.create(:project_id => @project.id, :uname => static.uname, :commits_num => static.commits_num, :email => static.email, :add => static.add, :del => static.del, :changeset => static.changes)
|
||||
else
|
||||
if @rev == params[:default_branch]
|
||||
rep_static.update_attributes(:uname => static.uname, :commits_num => static.commits_num, :email => static.email, :add => static.add, :del => static.del, :changeset => static.changes)
|
||||
end
|
||||
end
|
||||
end
|
||||
rescue
|
||||
render_404
|
||||
return
|
||||
|
|
|
@ -120,60 +120,53 @@ module ApplicationHelper
|
|||
case type
|
||||
when "HomeworkCommon"
|
||||
if course_contributor_score.nil?
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0,
|
||||
:news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0, :homework_journal_num => 1)
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :homework_journal_num => 1)
|
||||
else
|
||||
score = course_contributor_score.homework_journal_num + 1
|
||||
course_contributor_score.update_attributes(:homework_journal_num => score)
|
||||
score = course_contributor_score.homework_journal_num.to_i + 1
|
||||
course_contributor_score.update_column(:homework_journal_num, score)
|
||||
end
|
||||
# 课程留言
|
||||
when "Course"
|
||||
if course_contributor_score.nil?
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0,
|
||||
:news_reply_num => 0, :resource_num => 0, :journal_num => 1, :journal_reply_num => 0)
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :journal_num => 1)
|
||||
else
|
||||
score = course_contributor_score.journal_num + 1
|
||||
course_contributor_score.update_attributes(:journal_num => score)
|
||||
score = course_contributor_score.journal_num.to_i + 1
|
||||
course_contributor_score.update_column(:journal_num, score)
|
||||
end
|
||||
when "Message"
|
||||
if course_contributor_score.nil?
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 1, :message_reply_num => 0,
|
||||
:news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0)
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 1)
|
||||
else
|
||||
score = course_contributor_score.message_num + 1
|
||||
course_contributor_score.update_attributes(:message_num => score)
|
||||
score = course_contributor_score.message_num.to_i + 1
|
||||
course_contributor_score.update_column(:message_num, score)
|
||||
end
|
||||
when "MessageReply"
|
||||
if course_contributor_score.nil?
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 1,
|
||||
:news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0)
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_reply_num => 1)
|
||||
else
|
||||
score = course_contributor_score.message_reply_num + 1
|
||||
course_contributor_score.update_attributes(:message_reply_num => score)
|
||||
score = course_contributor_score.message_reply_num.to_i + 1
|
||||
course_contributor_score.update_column(:message_reply_num, score)
|
||||
end
|
||||
when "NewReply"
|
||||
if course_contributor_score.nil?
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0,
|
||||
:news_reply_num => 1, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0)
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :news_reply_num => 1)
|
||||
else
|
||||
score = course_contributor_score.news_reply_num + 1
|
||||
course_contributor_score.update_attributes(:news_reply_num => score)
|
||||
score = course_contributor_score.news_reply_num.to_i + 1
|
||||
course_contributor_score.update_column(:news_reply_num, score)
|
||||
end
|
||||
when "News"
|
||||
if course_contributor_score.nil?
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0,
|
||||
:news_reply_num => 0, :news_num => 1, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0)
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :news_num => 1)
|
||||
else
|
||||
score = course_contributor_score.news_num + 1
|
||||
course_contributor_score.update_attributes(:news_num => score)
|
||||
score = course_contributor_score.news_num.to_i + 1
|
||||
course_contributor_score.update_column(:news_num, score)
|
||||
end
|
||||
when "Attachment"
|
||||
if course_contributor_score.nil?
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0,
|
||||
:news_reply_num => 0, :news_num => 0, :resource_num => 1, :journal_num => 0, :journal_reply_num => 0)
|
||||
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :resource_num => 1)
|
||||
else
|
||||
score = course_contributor_score.resource_num + 1
|
||||
course_contributor_score.update_attributes(:resource_num => score)
|
||||
score = course_contributor_score.resource_num.to_i + 1
|
||||
course_contributor_score.update_column(:resource_num, score)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -184,39 +177,39 @@ module ApplicationHelper
|
|||
case type
|
||||
when "HomeworkCommon"
|
||||
unless course_contributor_score.nil?
|
||||
score = course_contributor_score.homework_journal_num - 1
|
||||
course_contributor_score.update_attribute(:homework_journal_num, score < 0 ? 0 : score)
|
||||
score = course_contributor_score.homework_journal_num.to_i - 1
|
||||
course_contributor_score.update_column(:homework_journal_num, score < 0 ? 0 : score)
|
||||
end
|
||||
# 课程留言
|
||||
when "Course"
|
||||
unless course_contributor_score.nil?
|
||||
score = course_contributor_score.journal_num - 1
|
||||
course_contributor_score.update_attribute(:journal_num, score < 0 ? 0 : score)
|
||||
score = course_contributor_score.journal_num.to_i - 1
|
||||
course_contributor_score.update_column(:journal_num, score < 0 ? 0 : score)
|
||||
end
|
||||
when "Message"
|
||||
unless course_contributor_score.nil?
|
||||
score = course_contributor_score.message_num - 1
|
||||
course_contributor_score.update_attribute(:message_num, score < 0 ? 0 : score)
|
||||
score = course_contributor_score.message_num.to_i - 1
|
||||
course_contributor_score.update_column(:message_num, score < 0 ? 0 : score)
|
||||
end
|
||||
when "MessageReply"
|
||||
unless course_contributor_score.nil?
|
||||
score = course_contributor_score.message_reply_num - 1
|
||||
course_contributor_score.update_attribute(:message_reply_num, score < 0 ? 0 : score)
|
||||
score = course_contributor_score.message_reply_num.to_i - 1
|
||||
course_contributor_score.update_column(:message_reply_num, score < 0 ? 0 : score)
|
||||
end
|
||||
when "NewReply"
|
||||
unless course_contributor_score.nil?
|
||||
score = course_contributor_score.news_reply_num - 1
|
||||
course_contributor_score.update_attribute(:news_reply_num, score < 0 ? 0 : score)
|
||||
score = course_contributor_score.news_reply_num.to_i - 1
|
||||
course_contributor_score.update_column(:news_reply_num, score < 0 ? 0 : score)
|
||||
end
|
||||
when "News"
|
||||
unless course_contributor_score.nil?
|
||||
score = course_contributor_score.news_num - 1
|
||||
course_contributor_score.update_attribute(:news_num, score < 0 ? 0 : score)
|
||||
score = course_contributor_score.news_num.to_i - 1
|
||||
course_contributor_score.update_column(:news_num, score < 0 ? 0 : score)
|
||||
end
|
||||
when "Attachment"
|
||||
unless course_contributor_score.nil?
|
||||
score = course_contributor_score.resource_num - 1
|
||||
course_contributor_score.update_attribute(:resource_num, score < 0 ? 0 : score)
|
||||
score = course_contributor_score.resource_num.to_i - 1
|
||||
course_contributor_score.update_column(:resource_num, score < 0 ? 0 : score)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -63,14 +63,67 @@ module OrganizationsHelper
|
|||
def subfield_status_option
|
||||
type = []
|
||||
option1 = []
|
||||
option1 << "列表"
|
||||
option1 << "左上"
|
||||
option1 << "1"
|
||||
type << option1
|
||||
option2 = []
|
||||
option2 << "图片"
|
||||
option2 << "0"
|
||||
option2 << "中一"
|
||||
option2 << "2"
|
||||
type << option2
|
||||
option3 = []
|
||||
option3 << "中二"
|
||||
option3 << "3"
|
||||
type << option3
|
||||
option4 = []
|
||||
option4 << "中下"
|
||||
option4 << "4"
|
||||
type << option4
|
||||
option5 = []
|
||||
option5 << "左下"
|
||||
option5 << "5"
|
||||
type << option5
|
||||
option6 = []
|
||||
option6 << "右上"
|
||||
option6 << "6"
|
||||
type << option6
|
||||
option7 = []
|
||||
option7 << "右中"
|
||||
option7 << "7"
|
||||
type << option7
|
||||
option8 = []
|
||||
option8 << "右下"
|
||||
option8 << "8"
|
||||
type << option8
|
||||
type
|
||||
end
|
||||
|
||||
def subfield_list_type subfield
|
||||
case subfield.to_i
|
||||
when 1
|
||||
resulet = "左上"
|
||||
when 2
|
||||
resulet = "中一"
|
||||
when 3
|
||||
resulet = "中二"
|
||||
when 4
|
||||
resulet = "中下"
|
||||
when 5
|
||||
resulet = "左下"
|
||||
when 6
|
||||
resulet = "右上"
|
||||
when 7
|
||||
resulet = "右中"
|
||||
when 8
|
||||
resulet = "右下"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_subfield_acts field
|
||||
org_subfield = OrgSubfield.find(field.id)
|
||||
org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0
|
||||
org_acts = 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')
|
||||
org_acts
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -41,6 +41,23 @@ module RepositoriesHelper
|
|||
identifiers.include?(iden) ? false :true
|
||||
end
|
||||
|
||||
# 获取文件目录的最新动态
|
||||
def get_trees_last_changes(project_id, rev, ent_name)
|
||||
g = Gitlab.client
|
||||
begin
|
||||
tree_changes = g.rep_last_changes(project_id, :rev => rev, :path => ent_name)
|
||||
tree_changes
|
||||
rescue
|
||||
logger.error("faile to get tress activities!")
|
||||
end
|
||||
end
|
||||
|
||||
def translate_time time
|
||||
case time
|
||||
when time.include("")
|
||||
end
|
||||
end
|
||||
|
||||
# 获取diff内容行号
|
||||
def diff_line_num content
|
||||
content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i
|
||||
|
|
|
@ -77,12 +77,10 @@ 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!, :add_boards_count
|
||||
# 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, :decrease_boards_count, :down_course_score
|
||||
|
||||
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(:content, :author_id)
|
||||
after_create :act_as_course_activity, :act_as_forge_activity, :act_as_system_message, :send_mail, :act_as_student_score, act_as_at_message(:content, :author_id), :add_author_as_watcher, :reset_counters!, :add_boards_count
|
||||
#before_save :be_user_score
|
||||
|
||||
scope :visible, lambda {|*args|
|
||||
|
@ -134,11 +132,11 @@ class Message < ActiveRecord::Base
|
|||
if self.project && !project.project_score.nil?
|
||||
# 讨论区
|
||||
if self.parent_id.nil?
|
||||
count = self.project.project_score.board_num + 1
|
||||
self.project.project_score.update_attribute(:board_num, count)
|
||||
count = self.project.project_score.board_num.to_i + 1
|
||||
self.project.project_score.update_column(:board_num, count)
|
||||
else # 回复
|
||||
count = self.project.project_score.board_message_num + 1
|
||||
self.project.project_score.update_attribute(:board_message_num, count)
|
||||
count = self.project.project_score.board_message_num.to_i + 1
|
||||
self.project.project_score.update_column(:board_message_num, count)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -259,13 +257,13 @@ class Message < ActiveRecord::Base
|
|||
def act_as_system_message
|
||||
if self.course
|
||||
if self.parent_id.nil? # 主贴
|
||||
self.course.members.each do |m|
|
||||
self.course.members.includes(:user).each do |m|
|
||||
if self.author.allowed_to?(:as_teacher, self.course) && m.user_id != self.author_id # 老师 自己的帖子不给自己发送消息
|
||||
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.course_id, :viewed => false)
|
||||
end
|
||||
end
|
||||
else # 回帖
|
||||
self.course.members.each do |m|
|
||||
self.course.members.includes(:user).each do |m|
|
||||
if m.user_id == Message.find(self.parent_id).author_id && m.user_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息
|
||||
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.course_id, :viewed => false)
|
||||
end
|
||||
|
@ -273,13 +271,13 @@ class Message < ActiveRecord::Base
|
|||
end
|
||||
elsif self.project # 项目相关
|
||||
if self.parent_id.nil? # 主贴
|
||||
self.project.members.each do |m|
|
||||
self.project.members.includes(:user).each do |m|
|
||||
if m.user_id != self.author_id
|
||||
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.board.project_id, :viewed => false)
|
||||
end
|
||||
end
|
||||
else # 回帖
|
||||
self.project.members.each do |m|
|
||||
self.project.members.includes(:user).each do |m|
|
||||
if m.user_id == Message.find(self.parent_id).author_id && m.user_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息
|
||||
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.board.project_id, :viewed => false)
|
||||
end
|
||||
|
|
|
@ -115,6 +115,7 @@ class Project < ActiveRecord::Base
|
|||
|
||||
has_many :org_projects,:dependent => :destroy
|
||||
has_many :organization,:through => :org_projects
|
||||
has_many :rep_statics, :class_name => 'RepStatics'
|
||||
|
||||
# has_many :journals
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
class RepStatics < ActiveRecord::Base
|
||||
belongs_to :project
|
||||
attr_accessible :add, :commits_num, :del, :email, :project_id, :uname, :changeset
|
||||
end
|
|
@ -44,7 +44,7 @@ class Repository < ActiveRecord::Base
|
|||
# validates_uniqueness_of :identifier, :allow_blank => true
|
||||
validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph)
|
||||
# donwcase letters, digits, dashes, underscores but not digits only
|
||||
validates_format_of :identifier, :with => /^[a-z0-9_\-]+$/, :allow_blank => true
|
||||
validates_format_of :identifier, :with => /^[a-zA-Z0-9_\-]*[a-zA-Z_\-]+[a-zA-Z0-9_\-]*$/, :allow_blank => true
|
||||
# Checks if the SCM is enabled when creating a repository
|
||||
validate :repo_create_validation, :on => :create
|
||||
|
||||
|
|
|
@ -5,17 +5,18 @@
|
|||
<div class="fl">
|
||||
<ul>
|
||||
<li class="navHomepageMenu fl">
|
||||
<%= link_to "首页",user_activities_path(User.current.id), :class => "c_white f16 db p10", :title => "回到个人首页"%>
|
||||
<%= link_to "首页",user_activities_path(User.current), :class => "c_white f16 db p10", :title => "回到个人首页"%>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_resource', :id => User.current.id, :type => 6) %>" class="c_white f16 db p10">资源库</a></li>
|
||||
<%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %>
|
||||
</li>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<li class="navHomepageMenu fl">
|
||||
<%= link_to "题库", user_homeworks_user_path(User.current.id), :class => "c_white f16 db p10"%>
|
||||
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="navHomepageMenu fl">
|
||||
<%= link_to "我的作业", student_homeworks_user_path(User.current.id), :class => "c_white f16 db p10"%>
|
||||
<%= link_to "我的作业", student_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="navHomepageMenu fl mr30">
|
||||
|
|
|
@ -113,6 +113,9 @@
|
|||
<!--<span class="img_private"><%#= l(:label_private)%></span>-->
|
||||
<!--<%# end %>-->
|
||||
<!--</div>-->
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @organization %>
|
||||
<%# over %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="f12 fontGrey3">
|
||||
|
|
|
@ -0,0 +1,192 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><%= h html_title %></title>
|
||||
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'org2','jquery/jquery-ui-1.9.2' %>
|
||||
<%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<%#= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%#= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="/javascripts/jquery-1.8.3.min.js"></script><!--焦点图-->
|
||||
<script type="text/javascript" src="/javascripts/koala.min.1.5.js"></script><!--焦点图-->
|
||||
|
||||
<script src="/javascripts/scrollPic.js"></script><!--滚动-->
|
||||
<script>
|
||||
window.onload = function(){
|
||||
scrollPic();
|
||||
}
|
||||
function scrollPic() {
|
||||
var scrollPic = new ScrollPic();
|
||||
scrollPic.scrollContId = "scrollPic"; //内容容器ID
|
||||
scrollPic.arrLeftId = "LeftArr";//左箭头ID
|
||||
scrollPic.arrRightId = "RightArr"; //右箭头ID
|
||||
|
||||
scrollPic.frameWidth = 760;//显示框宽度
|
||||
scrollPic.pageWidth = 760; //翻页宽度
|
||||
|
||||
scrollPic.speed = 10; //移动速度(单位毫秒,越小越快)
|
||||
scrollPic.space = 10; //每次移动像素(单位px,越大越快)
|
||||
scrollPic.autoPlay = true; //自动播放
|
||||
scrollPic.autoPlayTime = 3; //自动播放间隔时间(秒)
|
||||
|
||||
scrollPic.initialize(); //初始化
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<!--add by huang-->
|
||||
<script type="text/javascript">
|
||||
function org_new_files_upload()
|
||||
{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files',:locals => {:org => @organization, :org_attachment_type => 0}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function org_new_files_banner_upload()
|
||||
{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files_banner',:locals => {:org => @organization, :org_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
</script>
|
||||
<body onload="prettyPrint();">
|
||||
<!--内容开始-->
|
||||
<header>
|
||||
<div class="sn-header">
|
||||
<%= render :partial => 'organizations/org_logined_header' %>
|
||||
<div class="sn-row sn-bg-white">
|
||||
<div class="sn-logo"> <img src="/images/sn_logo.jpg" width="367" height="63" alt="logo" class="sn-mt13" /> <a href="javascript:void(0);" class="sn-search-button sn-mt28"></a>
|
||||
<input type="text" class="sn-search-input sn-mt28" placeholder="搜索" />
|
||||
</div>
|
||||
</div>
|
||||
<!--导航-->
|
||||
<div class="sn-row sn-bg-blue">
|
||||
<ul class="sn-nav">
|
||||
<% @subfield_content.each do |field| %>
|
||||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'activity' %>
|
||||
<li class="nav-element">
|
||||
<%= link_to "首页", organization_path(@organization), :class => "sn-link-white" %>
|
||||
</li>
|
||||
<% when 'course' %>
|
||||
<li class="nav-element">
|
||||
<a href="#course_<%= field.id %>" class="sn-link-white"> 课程动态</a>
|
||||
</li>
|
||||
<% when 'project' %>
|
||||
<li class="nav-element">
|
||||
<a href="#project_<%= field.id %>" class="sn-link-white">项目动态</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" && field.hide == 0 %>
|
||||
<li class="nav-element">
|
||||
<a href="#message_<%= field.id %>" class="sn-link-white"><%= field.name %></a>
|
||||
</li>
|
||||
<% elsif field.field_type == "Resource" && field.hide == 0 %>
|
||||
<li class="nav-element">
|
||||
<a href="#resource_<%= field.id %>" class="sn-link-white"><%= field.name %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if User.current.admin_of_org?(@organization) %>
|
||||
<li class="nav-element">
|
||||
<a href="<%= setting_organization_path(@organization) %>" class="sn-link-white">配置</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @organization %>
|
||||
<%# over %>
|
||||
<!--内容开始-->
|
||||
<div class="sn-content">
|
||||
<div class="sn-content-left fl sn-mt15">
|
||||
<% @subfield_content.each do |field| %>
|
||||
<% if field.status.to_i == 1 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftT', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 2 %>
|
||||
<%#= render :partial => 'organizations/org_subfield_leftM', :locals => {:field => field} %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<%= render :partial => 'organizations/org_subfield_leftM1', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 3 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM2', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% elsif field.status.to_i == 4 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 5 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftD', :locals => {:field => field} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--右侧-->
|
||||
<div class="sn-content-right fr sn-mt15">
|
||||
<% @subfield_content.each do |field| %>
|
||||
<% if field.status.to_i == 6 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightT', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 7 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightM', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 8 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightD', :locals => {:field => field} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--内容结束-->
|
||||
<footer>
|
||||
<!--footer-->
|
||||
<div class="sn-row sn-bg-grey2">
|
||||
<div class="sn-footer">
|
||||
<ul class="sn-footer-link">
|
||||
<li class="sn-mr50"><a href="<%= about_us_path %>" class="sn-link-white sn-f18">关于我们</a></li>
|
||||
<li class="sn-mr50"><a href="<%= agreement_path %>" class="sn-link-white sn-f18">服务协议</a></li>
|
||||
<li class="sn-mr50"><a href="http://forge.trustie.net/forums/1/memos/1168" class="sn-link-white sn-f18">帮助中心</a></li>
|
||||
<li><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="sn-link-white sn-f18">在线报名</a></li>
|
||||
</ul>
|
||||
<div class="sn-contact">联系人:魏小姐 | 电 话:0731-84761282 | 传 真:0731-84761268 | 邮 箱:office@gnssopenlab.org</div>
|
||||
<div class="sn-address">地 址:湖南省长沙市开福区东风路89号观园大厦23层<br />
|
||||
卫星导航仿真与测试开放实验室</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<%#= call_hook :view_layouts_base_body_bottom %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -62,9 +62,9 @@
|
|||
|
||||
<!--add by huang-->
|
||||
<script type="text/javascript">
|
||||
function orge_new_files_upload()
|
||||
function org_new_files_upload()
|
||||
{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files',:locals => {:org => @organization, :org_attachment_type => 1}) %>');
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files',:locals => {:org => @organization, :org_attachment_type => 0}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
|
@ -72,7 +72,7 @@
|
|||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function orge_new_files_banner_upload()
|
||||
function org_new_files_banner_upload()
|
||||
{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files_banner',:locals => {:org => @organization, :org_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
|
@ -89,12 +89,20 @@
|
|||
<div class="header-con">
|
||||
<% if User.current.admin_of_org?(@organization) %>
|
||||
<div class="logo fl">
|
||||
<a class="logo-img"><img src="/images/org_new_style/logo.jpg" alt=""/></a>
|
||||
<a href="" class="logo-add" title="点击替换LOGO" onclick="orge_new_files_upload();"></a>
|
||||
<% if @org_logo_attchment.blank? %>
|
||||
<a class="logo-img"><img src="/images/org_new_style/logo.jpg" alt=""/></a>
|
||||
<% else %>
|
||||
<img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" class="logo-img">
|
||||
<% end %>
|
||||
<a href="#" class="logo-add" title="点击替换LOGO" onclick="org_new_files_upload();"></a>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="logo fl">
|
||||
<a class="logo-img"><img src="/images/org_new_style/logo.jpg" alt=""/></a>
|
||||
<% if @org_logo_attchment.blank? %>
|
||||
<a class="logo-img"><img src="/images/org_new_style/logo.jpg" alt=""/></a>
|
||||
<% else %>
|
||||
<img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" class="logo-img">
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render :partial => 'organizations/org_logined_header' %>
|
||||
|
@ -140,7 +148,7 @@
|
|||
<% else %>
|
||||
<img src="/attachments/<%= @org_banner_attchment.id %>/<%= @org_banner_attchment.filename %>" class="banner-img">
|
||||
<% end %>
|
||||
<a href="#" class="banner-add" title="点击替换图片" onclick="orge_new_files_banner_upload();"></a>
|
||||
<a href="#" class="banner-add" title="点击替换图片" onclick="org_new_files_banner_upload();"></a>
|
||||
<div class="banner-txt">
|
||||
<p ><%= @organization.name %></p>
|
||||
</div>
|
||||
|
@ -389,6 +397,9 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @organization %>
|
||||
<%# over %>
|
||||
|
||||
<div class="footer">
|
||||
<div class="footer-con">
|
||||
|
|
|
@ -1,48 +1,54 @@
|
|||
<% if User.current.logged? %>
|
||||
<div class="navHomepageProfile" id="navHomepageProfile">
|
||||
<ul>
|
||||
<li class="homepageProfileMenuIcon fr" id="homepageProfileMenuIcon">
|
||||
<%= link_to "<div class='mt5 mb8 user-img' id='user_avatar'>#{image_tag(url_to_avatar(User.current), :class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe, user_activities_path(User.current.id) %>
|
||||
<%#= link_to image_tag(url_to_avatar(User.current)), user_url_in_org(User.current.id), :alt => '用户头像', :target => '_blank', :class => "fr user-img" %>
|
||||
<ul class="topnav_login_list none" id="topnav_login_list">
|
||||
<li>
|
||||
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
||||
</li>
|
||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||
<li>
|
||||
<%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="login fr" >
|
||||
<a href="<%= signin_url_without_domain %>" class=" " >登录 | </a>
|
||||
<a href="<%= register_url_without_domain %>" class=" " >退出</a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#navHomepageProfile").mouseenter(function(){
|
||||
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
||||
$("#topnav_login_list").show();
|
||||
});
|
||||
$("#navHomepageProfile").mouseleave(function(){
|
||||
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
||||
$("#topnav_login_list").hide();
|
||||
});
|
||||
|
||||
function signout(){
|
||||
$.post(
|
||||
'<%= signout_path%>',
|
||||
{}
|
||||
);
|
||||
}
|
||||
<% if User.current.logged? %>
|
||||
<div class="sn-row sn-bg-grey">
|
||||
<div class="sn-login2">
|
||||
<div class="navHomepageProfile sn-mt4" id="navHomepageProfile">
|
||||
<ul>
|
||||
<li class="homepageProfileMenuIcon fr" id="homepageProfileMenuIcon">
|
||||
<%= link_to "<div class='mt5 mb8 user-img' id='user_avatar'>#{image_tag(url_to_avatar(User.current), :class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe, user_activities_path(User.current.id) %>
|
||||
<%#= link_to image_tag(url_to_avatar(User.current)), user_url_in_org(User.current.id), :alt => '用户头像', :target => '_blank', :class => "fr user-img" %>
|
||||
<ul class="topnav_login_list none sn-f12" id="topnav_login_list" style="text-align:left;">
|
||||
<li>
|
||||
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
||||
</li>
|
||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||
<li>
|
||||
<%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="sn-row sn-bg-grey">
|
||||
<div class="sn-login">
|
||||
<a href="<%= signin_url_without_domain %>" class="sn-link-blue">登录</a> |
|
||||
<a href="<%= register_url_without_domain %>" class="sn-link-blue">注册</a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#navHomepageProfile").mouseenter(function(){
|
||||
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
||||
$("#topnav_login_list").show();
|
||||
});
|
||||
$("#navHomepageProfile").mouseleave(function(){
|
||||
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
||||
$("#topnav_login_list").hide();
|
||||
});
|
||||
|
||||
function signout(){
|
||||
$.post(
|
||||
'<%= signout_path%>',
|
||||
{}
|
||||
);
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,117 @@
|
|||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">合作伙伴<a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||
<div class="sn-index-partnerbox " >
|
||||
<ul id="scrollPic" >
|
||||
<li>
|
||||
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-dhyq.jpg" width="363" height="43" alt=""/></a>
|
||||
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-qhdx.jpg" width="363" height="43" alt=""/></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-jzdz.jpg" width="363" height="43" alt=""/></a>
|
||||
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-zgdz.jpg" width="363" height="43" alt=""/></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div class="partner-btnbox">
|
||||
<div class="partner-prev partner-btn fl " id="LeftArr"><</div>
|
||||
<div class="partner-next partner-btn fl" id="RightArr">></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'course' %>
|
||||
<p>暂无内容!</p>
|
||||
<% when 'project' %>
|
||||
<p>暂无内容!</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
||||
<% org_acts = get_subfield_acts field %>
|
||||
<% unless org_acts.blank? %>
|
||||
<% org_acts.each do |activity| %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">合作伙伴<a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% elsif activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">合作伙伴<a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||
<div class="sn-index-partnerbox " >
|
||||
<ul id="scrollPic" >
|
||||
<li>
|
||||
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-dhyq.jpg" width="363" height="43" alt=""/></a>
|
||||
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-qhdx.jpg" width="363" height="43" alt=""/></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-jzdz.jpg" width="363" height="43" alt=""/></a>
|
||||
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-zgdz.jpg" width="363" height="43" alt=""/></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div class="partner-btnbox">
|
||||
<div class="partner-prev partner-btn fl " id="LeftArr"><</div>
|
||||
<div class="partner-next partner-btn fl" id="RightArr">></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% elsif field.field_type == "Resource" %>
|
||||
<% org_attachs = get_attach_org2(field) %>
|
||||
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<% if !field.subfield_subdomain_dir.nil? %>
|
||||
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,256 @@
|
|||
<h2 class="h2-title"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||
<div class="cl"></div>
|
||||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'course' %>
|
||||
<% if @course_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM1_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% @course_acts.first(1).each do |act| %>
|
||||
<% if act.org_act_type == "HomeworkCommon" %>
|
||||
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date activity.updated_at %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= activity.description.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date activity.updated_on %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= activity.content.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date activity.created_on %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= activity.description.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Poll" %>
|
||||
<% activity = Poll.find(act.org_act_id) %>
|
||||
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||
<% if ( activity.polls_status==2) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h3-title" %>
|
||||
<% else %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h3-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date activity.published_at %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= activity.polls_description.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'project' %>
|
||||
<% if @project_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM1_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% @project_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "Issue" %>
|
||||
<% activity = Issue.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date activity.updated_on %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= activity.description.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date activity.updated_on %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= activity.content.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey">2016-04-08</span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= activity.description.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %>
|
||||
<% org_acts = get_subfield_acts field %>
|
||||
<% if org_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM1_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% org_acts.first(4).each do |activity| %>
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "h3-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date document.created_at %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= document.content.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% else activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.parent_id.nil? %>
|
||||
<% content = message.content%>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date message.created_on %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= content.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "h3-title" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "h3-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date message.created_on %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= content.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<div class="sn-news-bigbox fl">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "h3-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey"><%= format_date news.created_on %></span>
|
||||
<div class="sn-news-txt">
|
||||
<p><%= news.description.to_s.html_safe %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<div class="sn-news-bigbox fl">
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-news-bigimg"><img src="/images/news/img-news-big.jpg" width="380" height="165" alt=""/></a>
|
||||
<h3><a href="javascript:void(0);" target="_blank" class="h3-title"></a></h3>
|
||||
<span class="txt-grey"></span>
|
||||
<div class="sn-news-txt">
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,233 @@
|
|||
<div class="sn-news-smallbox fl" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'course' %>
|
||||
<% if @course_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM2_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% @course_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "HomeworkCommon" %>
|
||||
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/right_top.jpg", :width => "85", :height => "85"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date activity.updated_at %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date activity.updated_on %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date activity.created_on %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Poll" %>
|
||||
<% activity = Poll.find(act.org_act_id) %>
|
||||
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||
<% if ( activity.polls_status==2) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% else %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date activity.published_at %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'project' %>
|
||||
<% if @project_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM2_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% @project_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "Issue" %>
|
||||
<% activity = Issue.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date activity.updated_on %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date activity.updated_on %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date activity.created_on %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %>
|
||||
<% org_acts = get_subfield_acts field %>
|
||||
<% if org_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM2_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% org_acts.first(4).each do |activity| %>
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date document.created_at %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.parent_id.nil? %>
|
||||
<% content = message.content%>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date message.created_on %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date message.created_on %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<div class="sn-news-small mb18">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), news_path(news), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), news_path(news), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||
</h3>
|
||||
<span class="txt-grey fl "><%= format_date news.created_on %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -0,0 +1,26 @@
|
|||
<div class="sn-news-smallbox fl">
|
||||
<div class="sn-news-small mb18">
|
||||
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small01.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||
<span class="txt-grey fl">2016-04-08</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sn-news-small mb18">
|
||||
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small02.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||
<span class="txt-grey fl">2016-04-08</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sn-news-small mb18">
|
||||
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||
<span class="txt-grey fl">2016-04-08</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sn-news-small ">
|
||||
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small04.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||
<span class="txt-grey fl">2016-04-08</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,258 @@
|
|||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||
<div class="sn-index-resourcescon">
|
||||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'course' %>
|
||||
<% if @course_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% @course_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "HomeworkCommon" %>
|
||||
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-title" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to activity.description.to_s.html_safe, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Poll" %>
|
||||
<% activity = Poll.find(act.org_act_id) %>
|
||||
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||
<% if ( activity.polls_status==2) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title" %>
|
||||
<% else %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to activity.polls_description.to_s.html_safe, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'project' %>
|
||||
<% if @project_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% @project_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "Issue" %>
|
||||
<% activity = Issue.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-title" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to activity.description.to_s.html_safe, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to activity.content.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %>
|
||||
<% org_acts = get_subfield_acts field %>
|
||||
<% if org_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% org_acts.first(4).each do |activity| %>
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-title" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to document.content.to_s.html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% else activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.parent_id.nil? %>
|
||||
<% content = message.content%>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "resources-title" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "resources-title" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,11 @@
|
|||
<div class="sn-index-resourcesbox">
|
||||
<a href="javascript:void()" target="_blank" class="sn-resourcesimg"><img src="/images/default_blank/files-default.jpg" width="185" height="125" alt=""/></a>
|
||||
<h3><a href="javascript:void()" target="_blank" class="resources-title">仪器资源</a></h3>
|
||||
<div class="resources-tagbox">
|
||||
<a href="javascript:void()" target="_blank" class="resources-tag">测试服务</a>
|
||||
<a href="javascript:void()" target="_blank" class="resources-tag">开放日</a>
|
||||
<a href="javascript:void()" target="_blank" class="resources-tag">仪器共享</a>
|
||||
<a href="javascript:void()" target="_blank" class="resources-tag">定制测试</a>
|
||||
</div>
|
||||
<a href="javascript:void()" target="_blank" class="more-btn">更多</a>
|
||||
</div>
|
|
@ -0,0 +1,276 @@
|
|||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'course' %>
|
||||
<% if @course_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<!-- 代码 开始 -->
|
||||
<div id="fsD1" class="focus">
|
||||
<div id="D1pic1" class="fPic">
|
||||
<% @course_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "HomeworkCommon" %>
|
||||
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), student_work_index_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), student_work_index_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow"><%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank' %></span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow">
|
||||
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
|
||||
</span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Poll" %>
|
||||
<% activity = Poll.find(act.org_act_id) %>
|
||||
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||
<% if ( activity.polls_status==2) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow">
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank' %>
|
||||
<% else %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s, :target => '_blank' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="fbg">
|
||||
<div class="D1fBt" id="D1fBt">
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<span class="prev"></span>
|
||||
<span class="next"></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% when 'project' %>
|
||||
<% if @project_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<!-- 代码 开始 -->
|
||||
<div id="fsD1" class="focus">
|
||||
<div id="D1pic1" class="fPic">
|
||||
<% @project_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "Issue" %>
|
||||
<% activity = Issue.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), issue_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), issue_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow"><%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank' %></span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow">
|
||||
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="fbg">
|
||||
<div class="D1fBt" id="D1fBt">
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<span class="prev"></span>
|
||||
<span class="next"></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %>
|
||||
<% org_acts = get_subfield_acts field %>
|
||||
<% if org_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<!-- 代码 开始 -->
|
||||
<div id="fsD1" class="focus">
|
||||
<div id="D1pic1" class="fPic">
|
||||
<% org_acts.first(4).each do |activity| %>
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank' %></span>
|
||||
</div>
|
||||
<% elsif activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<% if message.parent_id.nil? %>
|
||||
<% content = message.content%>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow">
|
||||
<% if message.parent_id.nil? %>
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank' %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank'%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% else %>
|
||||
<% if message.parent_id.nil? %>
|
||||
<% content = message.content%>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_path(message.board,activity), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_path(message.board,activity), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow">
|
||||
<% if message.parent_id.nil? %>
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :class=> "postGrey" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :class=> "postGrey" %>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<div class="fcon" style="display: none;">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_path(news), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_path(news), :target => "_blank", :style =>"opacity: 1; " %>
|
||||
<% end %>
|
||||
<span class="shadow"><%= link_to news.title.to_s, news_path(news), :target => '_blank' %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="fbg">
|
||||
<div class="D1fBt" id="D1fBt">
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
|
||||
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<span class="prev"></span>
|
||||
<span class="next"></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
Qfast.add('widgets', { path: "/javascripts/terminator2.2.min.js", type: "js", requires: ['fx'] });
|
||||
Qfast(false, 'widgets', function () {
|
||||
K.tabs({
|
||||
id: 'fsD1', //焦点图包裹id
|
||||
conId: "D1pic1", //** 大图域包裹id
|
||||
tabId:"D1fBt",
|
||||
tabTn:"a",
|
||||
conCn: '.fcon', //** 大图域配置class
|
||||
auto: 1, //自动播放 1或0
|
||||
effect: 'fade', //效果配置
|
||||
eType: 'click', //** 鼠标事件
|
||||
pageBt:true, //是否有按钮切换页码
|
||||
bns: ['.prev', '.next'],//** 前后按钮配置class
|
||||
interval: 3000 //** 停顿时间
|
||||
})
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,10 @@
|
|||
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<!-- 代码 开始 -->
|
||||
<div id="fsD1" class="focus">
|
||||
<div class="fPic">
|
||||
<div class="fcon-default">
|
||||
<a target="_blank" href="javascript:void(0);"><img src="/images/default_blank/banner-default.jpg" alt="" ></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,73 @@
|
|||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'course' %>
|
||||
<p>暂无内容!</p>
|
||||
<% when 'project' %>
|
||||
<p>暂无内容!</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
||||
<% org_acts = get_subfield_acts field %>
|
||||
<% unless org_acts.blank? %>
|
||||
<% activity = org_acts.first %>
|
||||
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% elsif activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<a href="javascript:void(0);" target="_blank" ><img src="/images/default_blank/ad-default.jpg" width="369" height="169" alt=""/></a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% elsif field.field_type == "Resource" %>
|
||||
<% org_attachs = get_attach_org2(field) %>
|
||||
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<% if !field.subfield_subdomain_dir.nil? %>
|
||||
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,98 @@
|
|||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'course' %>
|
||||
<p>暂无内容!</p>
|
||||
<% when 'project' %>
|
||||
<p>暂无内容!</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
||||
<% org_acts = get_subfield_acts field %>
|
||||
<% unless org_acts.blank? %>
|
||||
<% activity = org_acts.first %>
|
||||
<div class="sn-index-wxbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<h2 class="h2-title "><%= field.name %></h2>
|
||||
<div class="sn-index-wx">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||
<% end %>
|
||||
<p class="fl sn-index-txt sn-w229"><%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||
<h2 class="h2-title "><%= field.name %></h2>
|
||||
<div class="sn-index-wx">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||
<% end %>
|
||||
<p class="fl sn-index-txt"><%=link_to message.content.to_s.html_safe, board_message_url_in_org(message.board.id, message.id), :target => "_blank" %></p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||
<h2 class="h2-title "><%= field.name %></h2>
|
||||
<div class="sn-index-wx">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||
<% end %>
|
||||
<p class="fl sn-index-txt"><%=link_to message.content.to_s.html_safe, board_message_path(message.board, activity), :target => "_blank" %></p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<h2 class="h2-title "><%= field.name %></h2>
|
||||
<div class="sn-index-wx">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||
<% end %>
|
||||
<p class="fl sn-index-txt"><%=link_to news.description.to_s.html_safe, news_path(news), :target => "_blank" %></p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="sn-index-wxbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title "><%= field.name %></h2>
|
||||
<div class="sn-index-wx">
|
||||
<img class="fl sn-index-wximg" src="/images/wx.gif" width="104" height="104" alt=""/>
|
||||
<p class="fl sn-index-txt">暂无内容!</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% elsif field.field_type == "Resource" %>
|
||||
<% org_attachs = get_attach_org2(field) %>
|
||||
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<% if !field.subfield_subdomain_dir.nil? %>
|
||||
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,223 @@
|
|||
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title mb18"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'course' %>
|
||||
<% if @course_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightT_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% @course_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "HomeworkCommon" %>
|
||||
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/right_top.jpg", :width => "330", :height => "210"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "active-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date activity.updated_at %></span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "active-title" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "active-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date activity.updated_on %></span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "active-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date activity.created_on %></span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Poll" %>
|
||||
<% activity = Poll.find(act.org_act_id) %>
|
||||
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||
<% if ( activity.polls_status==2) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "active-title" %>
|
||||
<% else %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "active-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date activity.published_at %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'project' %>
|
||||
<% if @project_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% @project_acts.first(4).each do |act| %>
|
||||
<% if act.org_act_type == "Issue" %>
|
||||
<% activity = Issue.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "active-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date activity.updated_on %></span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "Message" %>
|
||||
<% activity = Message.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "active-title" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "active-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date activity.updated_on %></span>
|
||||
</div>
|
||||
<% elsif act.org_act_type == "News" %>
|
||||
<% activity = News.find(act.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "active-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date activity.created_on %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %>
|
||||
<% org_acts = get_subfield_acts field %>
|
||||
<% if org_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<% else %>
|
||||
<% org_acts.first(4).each do |activity| %>
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "active-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date document.created_at %></span>
|
||||
</div>
|
||||
<% else activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.parent_id.nil? %>
|
||||
<% content = message.content%>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "active-title" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "active-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date message.created_on %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "active-title" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "active-title" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date message.created_on %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<div class="sn-index-active">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), news_path(news), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), news_path(news), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% end %>
|
||||
<h3>
|
||||
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "active-title" %>
|
||||
</h3>
|
||||
<span class="txt-grey "><%= format_date news.created_on %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -27,7 +27,7 @@
|
|||
默认
|
||||
<% else %>
|
||||
<%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>
|
||||
<div class="update_status_class"><span class="hidden"><%=field.status== 1 ? "列表" : "图片" %></span>
|
||||
<div class="update_status_class"><span class="hidden"><%= subfield_list_type(field.status) %></span>
|
||||
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
|
||||
</div>
|
||||
<%= select( :name,:group_id, subfield_status_option,
|
||||
|
@ -63,7 +63,7 @@
|
|||
列表
|
||||
<% else %>
|
||||
<%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>
|
||||
<div class="update_status_class"><span class="hidden"><%=field.status== 1 ? "列表" : "图片" %></span>
|
||||
<div class="update_status_class"><span class="hidden"><%= subfield_list_type(field.status) %></span>
|
||||
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
|
||||
</div>
|
||||
<%= select( :name,:group_id, subfield_status_option,
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<div class="sn-index-active">
|
||||
<div class="sn-index-active">
|
||||
<a href="javascript:void()" target="_blank" class="sn-activeimg"><img src="images/active/img-active01.jpg" width="330" height="210" alt=""/></a>
|
||||
<h3><a href="javascript:void()" target="_blank" class="active-title"></a></h3>
|
||||
<span class="txt-grey "></span>
|
||||
</div>
|
||||
</div>
|
|
@ -10,14 +10,18 @@
|
|||
type: 'line'
|
||||
},
|
||||
title: {
|
||||
text: '版本库代码提交量'
|
||||
text: '版本库代码提交行数',
|
||||
style:{
|
||||
fontSize: '14px'
|
||||
}
|
||||
|
||||
},
|
||||
subtitle: {
|
||||
// text: 'Source: WorldClimate.com'
|
||||
},
|
||||
xAxis: {
|
||||
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
categories: <%= raw(@static_total_per_user.map{|c| c.uname}) %>
|
||||
categories: <%= raw(@a_uname_code) %>
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
|
@ -34,6 +38,12 @@
|
|||
}
|
||||
},
|
||||
plotOptions: {
|
||||
series: {
|
||||
marker: {
|
||||
radius: 3, //曲线点半径,默认是4
|
||||
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
|
||||
}
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
|
@ -41,21 +51,55 @@
|
|||
enableMouseTracking: false
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: '改动或增加',
|
||||
color: '#fd9e04',
|
||||
|
||||
// data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
|
||||
data: <%= @static_total_per_user.map{|c| c.add.to_i} %>
|
||||
series: [
|
||||
{
|
||||
name: '<b style="font-weight:normal ">总变更</b>',
|
||||
color: '#d05d5a',
|
||||
fontWeight: 'normal',
|
||||
data: <%= @a_commits_changeset %>,
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
style: {
|
||||
fontSize: '13px',
|
||||
color: '#aaa',
|
||||
fontFamily: 'Arial',
|
||||
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
lineWidth: 1.5
|
||||
},
|
||||
{
|
||||
name: '<b style="font-weight:normal ">改动或增加</b>',
|
||||
color: '#5b6b76',
|
||||
data: <%= @a_commits_add %>,
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
style: {
|
||||
fontSize: '13px',
|
||||
color: '#aaa',
|
||||
fontFamily: 'Arial',
|
||||
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
lineWidth: 1.5
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
color: '#46baed ',
|
||||
data: <%= @static_total_per_user.map{|c| c.del.to_i} %>
|
||||
},{
|
||||
name: '总变更',
|
||||
color: '#d397d5',
|
||||
data: <%= @static_total_per_user.map{|c| c.changes.to_i} %>
|
||||
name: '<b style="font-weight:normal ">删除</b>',
|
||||
color: '#84b5bb',
|
||||
data: <%= @a_commits_del %>,
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
style: {
|
||||
fontSize: '13px',
|
||||
color: '#aaa',
|
||||
fontFamily: 'Arial',
|
||||
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
lineWidth: 1.5
|
||||
}]
|
||||
});
|
||||
|
||||
|
@ -68,14 +112,18 @@
|
|||
enabled: false
|
||||
},
|
||||
title: {
|
||||
text: '版本库代码提交次数'
|
||||
text: '版本库代码提交次数',
|
||||
style:{
|
||||
fontSize: '14px'
|
||||
}
|
||||
|
||||
},
|
||||
subtitle: {
|
||||
// text: 'Source: WorldClimate.com'
|
||||
},
|
||||
xAxis: {
|
||||
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
categories: <%= raw(@static_total_per_user.map{|c| c.uname}) %>
|
||||
categories: <%= raw(@a_uname) %>
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
|
@ -89,6 +137,12 @@
|
|||
}
|
||||
},
|
||||
plotOptions: {
|
||||
series: {
|
||||
marker: {
|
||||
radius: 3, //曲线点半径,默认是4
|
||||
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
|
||||
}
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
|
@ -97,9 +151,24 @@
|
|||
}
|
||||
},
|
||||
series: [{
|
||||
name: '提交次数',
|
||||
name: '<b style="font-weight:normal ">提交次数</b>',
|
||||
fontWeight: 'normal',
|
||||
color: '#d05d5a',
|
||||
// data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
|
||||
data: <%= @static_total_per_user.map{|c| c.commits_num.to_i} %>
|
||||
data: <%= @a_commits_num %>,
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
|
||||
style: {
|
||||
fontSize: '13px',
|
||||
color: '#aaa',
|
||||
fontFamily: 'Arial',
|
||||
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
lineWidth: 1.5
|
||||
|
||||
}
|
||||
// {
|
||||
// name: 'London',
|
||||
|
@ -108,4 +177,5 @@
|
|||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
<div class="button-rep">当前分支:<%= @rev %></div>
|
|
@ -29,12 +29,14 @@
|
|||
<!--CONTENT LIST-->
|
||||
|
||||
</div>
|
||||
<% unless @project.gpid.nil? || @project.project_score.changeset_num == 0 || @project.rep_statics.blank? %>
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<%= render :partial => "rep_static" %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
|
||||
</div>
|
|
@ -1,5 +1,5 @@
|
|||
<div class="autoscroll">
|
||||
<table class="list entries" id="browser">
|
||||
<table class="list entries" id="browser" style="table-layout: fixed;">
|
||||
|
||||
<tbody>
|
||||
<%= render :partial => 'dir_list_content' %>
|
||||
|
|
|
@ -1,33 +1,55 @@
|
|||
<% @entries.each do |entry| %>
|
||||
<% tr_id = Digest::MD5.hexdigest(entry.path)
|
||||
depth = params[:depth].to_i %>
|
||||
<% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(entry.path) %>
|
||||
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
|
||||
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
|
||||
<td style="padding-left: <%=18 * depth%>px;" class="<%=
|
||||
@repository.report_last_commit ? "filename" : "filename_no_report" %>">
|
||||
<% if entry.is_dir? %>
|
||||
<% tr_id = Digest::MD5.hexdigest(entry.path)
|
||||
depth = params[:depth].to_i %>
|
||||
<% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %>
|
||||
<% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path) %>
|
||||
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
|
||||
<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path) %>
|
||||
|
||||
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
|
||||
<td style="padding-left: <%=18 * depth%>px;" class="filename_no_report hidden">
|
||||
<% if entry.is_dir? %>
|
||||
<%# 展开文件目录 %>
|
||||
<span class="expander" onclick="scmEntryClick('<%= tr_id %>', '<%= escape_javascript(url_for(
|
||||
<span class="expander" onclick="scmEntryClick('<%= tr_id %>', '<%= escape_javascript(url_for(
|
||||
:action => 'show',
|
||||
:id => @project,
|
||||
:repository_id => @repository.identifier_param,
|
||||
:path => to_path_param(ent_path),
|
||||
:rev => @rev,
|
||||
:latest_changes => latest_changes,
|
||||
:depth => (depth + 1),
|
||||
:parent_id => tr_id)) %>');"> </span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<!--<a class="<%#= (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}") %>">-->
|
||||
<!--<%#= h(ent_name) %>-->
|
||||
<!--</a>-->
|
||||
<%#= h(ent_name), :class => "(entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
|
||||
<%= link_to h(ent_name),
|
||||
{:action => (entry.is_dir? ? 'show' : 'entry'), :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
|
||||
:class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
|
||||
</td>
|
||||
<!--<td class="size"><%#= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>-->
|
||||
<!--<td class="size"><%#= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>-->
|
||||
<% if @repository.report_last_commit %>
|
||||
<td class="revision"><%= link_to_revision(entry.changeset, @repository) if entry.changeset %></td>
|
||||
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
|
||||
<td class="author"><%= entry.author %></td>
|
||||
<td class="comments"><%=h truncate(entry.changeset.comments, :length => 50) if entry.changeset %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
:class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
|
||||
</td>
|
||||
<!--<td class="size"><%#= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>-->
|
||||
<!--<td class="size"><%#= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>-->
|
||||
<%# if @repository.report_last_commit %>
|
||||
<div id="children_tree">
|
||||
<td class="tree-comments c_grey hidden">
|
||||
<div class="hidden" title="<%= (latest_changes.message) if latest_changes && latest_changes.message %>">
|
||||
<%= (latest_changes.message) if latest_changes && latest_changes.message %>
|
||||
</div>
|
||||
</td>
|
||||
<td class="tree-author c_grey">
|
||||
<div class="hidden" title="<%= (latest_changes.author) if latest_changes && latest_changes.author %>">
|
||||
<%= (latest_changes.author) if latest_changes && latest_changes.author %>
|
||||
</div>
|
||||
</td>
|
||||
<td class="tree-age c_grey">
|
||||
<div class="hidden" title="<%= distance_of_time_in_words(latest_changes.time, Time.now + 8.hours) if latest_changes && latest_changes.time %>">
|
||||
<%# 为了转换UTC时间,时差8小时 %>
|
||||
<%= distance_of_time_in_words(latest_changes.time, Time.now + 8.hours) if latest_changes && latest_changes.time %>
|
||||
<%#= latest_changes.time if latest_changes && latest_changes.time %>
|
||||
</div>
|
||||
</td>
|
||||
</div>
|
||||
<%# end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
|
||||
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
|
||||
<div class="fl mt5 ml15">
|
||||
<%=link_to "统计", stats_repository_project_path(:id => @project, :repository_id => @repository.identifier_param, :rev => @rev, :creator => @creator ), :class => "fl vl_zip" %>
|
||||
<%=link_to "代码统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :creator => @creator, :default_branch => @g_default_branch ), :class => "fl vl_zip" %>
|
||||
</div>
|
||||
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %>
|
||||
<% if User.current.id != @project.user_id %>
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
</div>
|
||||
<div id = "container_code" class="mt30">
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$('#container_code').highcharts({
|
||||
|
@ -21,7 +22,11 @@
|
|||
type: 'line'
|
||||
},
|
||||
title: {
|
||||
text: '代码提交量'
|
||||
text: '版本库代码提交行数',
|
||||
style:{
|
||||
fontSize: '14px'
|
||||
}
|
||||
|
||||
},
|
||||
subtitle: {
|
||||
// text: 'Source: WorldClimate.com'
|
||||
|
@ -45,6 +50,12 @@
|
|||
}
|
||||
},
|
||||
plotOptions: {
|
||||
series: {
|
||||
marker: {
|
||||
radius: 3, //曲线点半径,默认是4
|
||||
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
|
||||
}
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
|
@ -52,18 +63,55 @@
|
|||
enableMouseTracking: false
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: '改动或增加',
|
||||
|
||||
// data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
|
||||
data: <%= @static_total_per_user.map{|c| c.add.to_i} %>
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
data: <%= @static_total_per_user.map{|c| c.del.to_i} %>
|
||||
},{
|
||||
name: '总变更',
|
||||
data: <%= @static_total_per_user.map{|c| c.changes.to_i} %>
|
||||
series: [
|
||||
{
|
||||
name: '<b style="font-weight:normal ">总变更</b>',
|
||||
color: '#d05d5a',
|
||||
fontWeight: 'normal',
|
||||
data: <%= @static_total_per_user.map{|c| c.changes.to_i} %>,
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
fontSize: '13px',
|
||||
color: '#aaa',
|
||||
fontFamily: 'Arial',
|
||||
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
lineWidth: 1.5
|
||||
},
|
||||
{
|
||||
name: '<b style="font-weight:normal ">改动或增加</b>',
|
||||
color: '#5b6b76',
|
||||
data: <%= @static_total_per_user.map{|c| c.add.to_i} %>,
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
fontSize: '13px',
|
||||
color: '#aaa',
|
||||
fontFamily: 'Arial',
|
||||
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
lineWidth: 1.5
|
||||
},
|
||||
{
|
||||
name: '<b style="font-weight:normal ">删除</b>',
|
||||
color: '#84b5bb',
|
||||
data: <%= @static_total_per_user.map{|c| c.del.to_i} %>,
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
fontSize: '13px',
|
||||
color: '#aaa',
|
||||
fontFamily: 'Arial',
|
||||
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
lineWidth: 1.5
|
||||
}]
|
||||
});
|
||||
|
||||
|
@ -76,14 +124,18 @@
|
|||
enabled: false
|
||||
},
|
||||
title: {
|
||||
text: '代码提交次数'
|
||||
text: '版本库代码提交次数',
|
||||
style:{
|
||||
fontSize: '14px'
|
||||
}
|
||||
|
||||
},
|
||||
subtitle: {
|
||||
// text: 'Source: WorldClimate.com'
|
||||
},
|
||||
xAxis: {
|
||||
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
categories: <%= raw(@static_total_per_user.map{|c| c.uname}) %>
|
||||
categories: <%= raw(@static_total_per_user.map{|c| c.uname}) %>
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
|
@ -97,6 +149,12 @@
|
|||
}
|
||||
},
|
||||
plotOptions: {
|
||||
series: {
|
||||
marker: {
|
||||
radius: 3, //曲线点半径,默认是4
|
||||
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
|
||||
}
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
|
@ -105,9 +163,23 @@
|
|||
}
|
||||
},
|
||||
series: [{
|
||||
name: '提交次数',
|
||||
name: '<b style="font-weight:normal ">提交次数</b>',
|
||||
fontWeight: 'normal',
|
||||
color: '#d05d5a',
|
||||
// data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
|
||||
data: <%= @static_total_per_user.map{|c| c.commits_num.to_i} %>
|
||||
data: <%= @static_total_per_user.map{|c| c.commits_num.to_i} %>,
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
fontSize: '13px',
|
||||
color: '#aaa',
|
||||
fontFamily: 'Arial',
|
||||
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
lineWidth: 1.5
|
||||
|
||||
}
|
||||
// {
|
||||
// name: 'London',
|
||||
|
|
|
@ -1,35 +1,39 @@
|
|||
class UpdateOneStudentScore < ActiveRecord::Migration
|
||||
def up
|
||||
student_work_score = StudentWorksScore.where("user_id = 11688 AND student_work_id = 34414").first
|
||||
student_work_score.score = 100
|
||||
student_work_score.save
|
||||
student_works = StudentWork.where("user_id = 6456")
|
||||
student_works.each do |work|
|
||||
unless work.student_works_scores.empty?
|
||||
if work.student_works_scores.where(:reviewer_role => 2).empty?
|
||||
work.teaching_asistant_score = nil
|
||||
else
|
||||
work.teaching_asistant_score = work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f
|
||||
begin
|
||||
student_work_score = StudentWorksScore.where("user_id = 11688 AND student_work_id = 34414").first
|
||||
student_work_score.score = 100
|
||||
student_work_score.save
|
||||
student_works = StudentWork.where("user_id = 6456")
|
||||
student_works.each do |work|
|
||||
unless work.student_works_scores.empty?
|
||||
if work.student_works_scores.where(:reviewer_role => 2).empty?
|
||||
work.teaching_asistant_score = nil
|
||||
else
|
||||
work.teaching_asistant_score = work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f
|
||||
end
|
||||
if work.student_works_scores.where(:reviewer_role => 3).empty?
|
||||
work.student_score = nil
|
||||
else
|
||||
work.student_score = work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f
|
||||
end
|
||||
end
|
||||
if work.student_works_scores.where(:reviewer_role => 3).empty?
|
||||
work.student_score = nil
|
||||
if work.teaching_asistant_score.nil?
|
||||
work.final_score = work.student_score
|
||||
elsif work.student_score.nil?
|
||||
work.final_score = work.teaching_asistant_score
|
||||
else
|
||||
work.student_score = work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f
|
||||
homework = HomeworkCommon.find work.homework_common_id
|
||||
ta_proportion = homework.homework_detail_manual.ta_proportion
|
||||
final_ta_score = BigDecimal.new("#{work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
work.save
|
||||
end
|
||||
if work.teaching_asistant_score.nil?
|
||||
work.final_score = work.student_score
|
||||
elsif work.student_score.nil?
|
||||
work.final_score = work.teaching_asistant_score
|
||||
else
|
||||
homework = HomeworkCommon.find work.homework_common_id
|
||||
ta_proportion = homework.homework_detail_manual.ta_proportion
|
||||
final_ta_score = BigDecimal.new("#{work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
work.save
|
||||
rescue => e
|
||||
logger.error "[Errno::ENOENT] ===> #{e}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
class UpdateOneStudentTeacherScore < ActiveRecord::Migration
|
||||
def up
|
||||
work = StudentWork.find 49774
|
||||
score = StudentWorksScore.new
|
||||
score.score = 100
|
||||
score.user_id = 7318
|
||||
score.student_work_id = work.id
|
||||
score.reviewer_role = 1
|
||||
if score.save
|
||||
work.teacher_score = score.score
|
||||
begin
|
||||
work = StudentWork.find 49774
|
||||
score = StudentWorksScore.new
|
||||
score.score = 100
|
||||
score.user_id = 7318
|
||||
score.student_work_id = work.id
|
||||
score.reviewer_role = 1
|
||||
if score.save
|
||||
work.teacher_score = score.score
|
||||
end
|
||||
work.save
|
||||
rescue => e
|
||||
logger.error "[Errno::ENOENT] ===> #{e}"
|
||||
end
|
||||
work.save
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
class CreateRepStatics < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :rep_statics do |t|
|
||||
t.integer :project_id
|
||||
t.integer :commits_num
|
||||
t.string :uname
|
||||
t.string :email
|
||||
t.integer :add
|
||||
t.integer :del
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddChangesetToRepStatics < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :rep_statics, :changeset, :integer
|
||||
end
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
class SyncRepStatics < ActiveRecord::Migration
|
||||
def up
|
||||
g = Gitlab.client
|
||||
# projects = Project.find_by_sql("SELECT p.* FROM projects p, project_scores ps where p.id = ps.project_id and p.gpid is not null and ps.changeset_num > 0")
|
||||
projects = Project.where("gpid is not null")
|
||||
count = projects.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
projects.page(i).per(30).each do |project|
|
||||
begin
|
||||
puts project.id
|
||||
g.rep_stats(project.gpid).each do |static|
|
||||
puts static.uname
|
||||
RepStatics.create(:project_id => project.id, :uname => static.uname, :commits_num => static.commits_num, :email => static.email, :add => static.add, :del => static.del, :changeset => static.changes)
|
||||
end
|
||||
rescue
|
||||
logger.error("Sync rep failed!")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -9,8 +9,9 @@
|
|||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20160421011543) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
|
|
|
@ -106,6 +106,23 @@ class Gitlab::Client
|
|||
end
|
||||
alias_method :repo_rep_stats, :rep_stats
|
||||
|
||||
# Gets a tree activities of project repository.
|
||||
#
|
||||
# @example
|
||||
# Gitlab.commits('viking')
|
||||
# Gitlab.repo_commits('gitlab', :ref_name => 'api')
|
||||
#
|
||||
# @param [Integer] project The ID of a project.
|
||||
# @param [Hash] options A customizable set of options.
|
||||
# @option options [String] :ref_name The branch or tag name of a project repository.
|
||||
# @option options [String] :creator The user name of a project repository.
|
||||
# @option options [Integer] :period Statistics over time. 1:total 2:one month 3:one week
|
||||
# @return [Array<Gitlab::ObjectifiedHash>]
|
||||
def rep_last_changes(project, options={})
|
||||
get("/projects/#{project}/repository/rep_last_changes", :query => options)
|
||||
end
|
||||
alias_method :repo_rep_stats, :rep_stats
|
||||
|
||||
# Get the diff of a commit in a project.
|
||||
#
|
||||
# @example
|
||||
|
|
|
@ -11,6 +11,21 @@ namespace :gitlab do
|
|||
end
|
||||
end
|
||||
|
||||
task :members => :environment do
|
||||
projects = Project.where("gpid is not null")
|
||||
s = Trustie::Gitlab::Sync.new
|
||||
g = Gitlab.client
|
||||
projects.each do |project|
|
||||
begin
|
||||
if project.members.count != g.team_members(project.gpid).count
|
||||
s.only_members(project)
|
||||
end
|
||||
rescue => e
|
||||
puts e
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "update user password"
|
||||
task :password => :environment do
|
||||
s = Trustie::Gitlab::Sync.new
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
require 'trustie/gitlab/sync'
|
||||
|
||||
namespace :trustie do
|
||||
namespace :files do
|
||||
desc "sync course'file"
|
||||
task :course => :environment do
|
||||
# Course.all.each do |course|
|
||||
# unless course.attachments.count.to_i == 0
|
||||
# attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and container_type ='Course'").count
|
||||
# project_score = ProjectScore.where("project_id=?", project.id).first
|
||||
# if project_score.nil?
|
||||
# ProjectScore.create(:project_id => project.id, :attach_num => 0)
|
||||
# else
|
||||
# project_score.attach_num = attachment_count
|
||||
# project_score.save
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
desc "sync project'file"
|
||||
task :project => :environment do
|
||||
Project.all.each do |project|
|
||||
unless project.attachments.count.to_i == 0
|
||||
attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{project.id} and container_type ='Project'").count
|
||||
project_score = ProjectScore.where("project_id=?", project.id).first
|
||||
if project_score.nil?
|
||||
ProjectScore.create(:project_id => project.id, :attach_num => 0)
|
||||
else
|
||||
project_score.attach_num = attachment_count
|
||||
project_score.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -122,7 +122,7 @@ module Trustie
|
|||
project.members.each do |m|
|
||||
begin
|
||||
gid = m.user.gid
|
||||
unless gid
|
||||
if gid.nil?
|
||||
gid = sync_user(m.user).id
|
||||
end
|
||||
self.g.add_team_member(project.gpid, gid, get_gitlab_role(m))
|
||||
|
|
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 220 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 272 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 233 B |
|
@ -0,0 +1,292 @@
|
|||
var sina = {
|
||||
$ : function (objName) {
|
||||
if (document.getElementById) {
|
||||
return eval('document.getElementById("' + objName + '")')
|
||||
} else {
|
||||
return eval('document.all.' + objName)
|
||||
}
|
||||
},
|
||||
isIE : navigator.appVersion.indexOf("MSIE") != -1 ? true : false,
|
||||
addEvent : function (l, i, I) {
|
||||
if (l.attachEvent) {
|
||||
l.attachEvent("on" + i, I)
|
||||
} else {
|
||||
l.addEventListener(i, I, false)
|
||||
}
|
||||
},
|
||||
delEvent : function (l, i, I) {
|
||||
if (l.detachEvent) {
|
||||
l.detachEvent("on" + i, I)
|
||||
} else {
|
||||
l.removeEventListener(i, I, false)
|
||||
}
|
||||
},
|
||||
readCookie : function (O) {
|
||||
var o = "",
|
||||
l = O + "=";
|
||||
if (document.cookie.length > 0) {
|
||||
var i = document.cookie.indexOf(l);
|
||||
if (i != -1) {
|
||||
i += l.length;
|
||||
var I = document.cookie.indexOf(";", i);
|
||||
if (I == -1)
|
||||
I = document.cookie.length;
|
||||
o = unescape(document.cookie.substring(i, I))
|
||||
}
|
||||
};
|
||||
return o
|
||||
},
|
||||
writeCookie : function (i, l, o, c) {
|
||||
var O = "",
|
||||
I = "";
|
||||
if (o != null) {
|
||||
O = new Date((new Date).getTime() + o * 3600000);
|
||||
O = "; expires=" + O.toGMTString()
|
||||
};
|
||||
if (c != null) {
|
||||
I = ";domain=" + c
|
||||
};
|
||||
document.cookie = i + "=" + escape(l) + O + I
|
||||
},
|
||||
readStyle : function (I, l) {
|
||||
if (I.style[l]) {
|
||||
return I.style[l]
|
||||
} else if (I.currentStyle) {
|
||||
return I.currentStyle[l]
|
||||
} else if (document.defaultView && document.defaultView.getComputedStyle) {
|
||||
var i = document.defaultView.getComputedStyle(I, null);
|
||||
return i.getPropertyValue(l)
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//滚动图片构造函数
|
||||
//UI&UE Dept. mengjia
|
||||
//080623
|
||||
function ScrollPic(scrollContId, arrLeftId, arrRightId, dotListId) {
|
||||
this.scrollContId = scrollContId;
|
||||
this.arrLeftId = arrLeftId;
|
||||
this.arrRightId = arrRightId;
|
||||
this.dotListId = dotListId;
|
||||
this.dotClassName = "dotItem";
|
||||
this.dotOnClassName = "dotItemOn";
|
||||
this.dotObjArr = [];
|
||||
this.pageWidth = 0;
|
||||
this.frameWidth = 0;
|
||||
this.speed = 10;
|
||||
this.space = 10;
|
||||
this.pageIndex = 0;
|
||||
this.autoPlay = true;
|
||||
this.autoPlayTime = 5;
|
||||
var _autoTimeObj,
|
||||
_scrollTimeObj,
|
||||
_state = "ready";
|
||||
this.stripDiv = document.createElement("DIV");
|
||||
this.listDiv01 = document.createElement("DIV");
|
||||
this.listDiv02 = document.createElement("DIV");
|
||||
if (!ScrollPic.childs) {
|
||||
ScrollPic.childs = []
|
||||
};
|
||||
this.ID = ScrollPic.childs.length;
|
||||
ScrollPic.childs.push(this);
|
||||
this.initialize = function () {
|
||||
if (!this.scrollContId) {
|
||||
throw new Error("必须指定scrollContId.");
|
||||
return
|
||||
};
|
||||
this.scrollContDiv = sina.$(this.scrollContId);
|
||||
if (!this.scrollContDiv) {
|
||||
throw new Error("scrollContId不是正确的对象.(scrollContId = \"" + this.scrollContId + "\")");
|
||||
return
|
||||
};
|
||||
this.scrollContDiv.style.width = this.frameWidth + "px";
|
||||
this.scrollContDiv.style.overflow = "hidden";
|
||||
this.listDiv01.innerHTML = this.listDiv02.innerHTML = this.scrollContDiv.innerHTML;
|
||||
this.scrollContDiv.innerHTML = "";
|
||||
this.scrollContDiv.appendChild(this.stripDiv);
|
||||
this.stripDiv.appendChild(this.listDiv01);
|
||||
this.stripDiv.appendChild(this.listDiv02);
|
||||
this.stripDiv.style.overflow = "hidden";
|
||||
this.stripDiv.style.zoom = "1";
|
||||
this.stripDiv.style.width = "32766px";
|
||||
if(-[1,]){
|
||||
this.listDiv01.style.cssFloat = "left";
|
||||
this.listDiv02.style.cssFloat = "left";
|
||||
}else{
|
||||
this.listDiv01.style.styleFloat = "left";
|
||||
this.listDiv02.style.styleFloat = "left";
|
||||
}
|
||||
sina.addEvent(this.scrollContDiv, "mouseover", Function("ScrollPic.childs[" + this.ID + "].stop()"));
|
||||
sina.addEvent(this.scrollContDiv, "mouseout", Function("ScrollPic.childs[" + this.ID + "].play()"));
|
||||
if (this.arrLeftId) {
|
||||
this.arrLeftObj = sina.$(this.arrLeftId);
|
||||
if (this.arrLeftObj) {
|
||||
sina.addEvent(this.arrLeftObj, "mousedown", Function("ScrollPic.childs[" + this.ID + "].rightMouseDown()"));
|
||||
sina.addEvent(this.arrLeftObj, "mouseup", Function("ScrollPic.childs[" + this.ID + "].rightEnd()"));
|
||||
sina.addEvent(this.arrLeftObj, "mouseout", Function("ScrollPic.childs[" + this.ID + "].rightEnd()"))
|
||||
}
|
||||
};
|
||||
if (this.arrRightId) {
|
||||
this.arrRightObj = sina.$(this.arrRightId);
|
||||
if (this.arrRightObj) {
|
||||
sina.addEvent(this.arrRightObj, "mousedown", Function("ScrollPic.childs[" + this.ID + "].leftMouseDown()"));
|
||||
sina.addEvent(this.arrRightObj, "mouseup", Function("ScrollPic.childs[" + this.ID + "].leftEnd()"));
|
||||
sina.addEvent(this.arrRightObj, "mouseout", Function("ScrollPic.childs[" + this.ID + "].leftEnd()"))
|
||||
}
|
||||
};
|
||||
if (this.dotListId) {
|
||||
this.dotListObj = sina.$(this.dotListId);
|
||||
if (this.dotListObj) {
|
||||
var pages = Math.round(this.listDiv01.offsetWidth / this.frameWidth + 0.4),
|
||||
i,
|
||||
tempObj;
|
||||
for (i = 0; i < pages; i++) {
|
||||
tempObj = document.createElement("span");
|
||||
this.dotListObj.appendChild(tempObj);
|
||||
this.dotObjArr.push(tempObj);
|
||||
if (i == this.pageIndex) {
|
||||
tempObj.className = this.dotClassName
|
||||
} else {
|
||||
tempObj.className = this.dotOnClassName
|
||||
};
|
||||
tempObj.title = "第" + (i + 1) + "页";
|
||||
sina.addEvent(tempObj, "click", Function("ScrollPic.childs[" + this.ID + "].pageTo(" + i + ")"))
|
||||
}
|
||||
}
|
||||
};
|
||||
if (this.autoPlay) {
|
||||
this.play()
|
||||
}
|
||||
};
|
||||
this.leftMouseDown = function () {
|
||||
if (_state != "ready") {
|
||||
return
|
||||
};
|
||||
_state = "floating";
|
||||
_scrollTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].moveLeft()", this.speed)
|
||||
};
|
||||
this.rightMouseDown = function () {
|
||||
if (_state != "ready") {
|
||||
return
|
||||
};
|
||||
_state = "floating";
|
||||
_scrollTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].moveRight()", this.speed)
|
||||
};
|
||||
this.moveLeft = function () {
|
||||
if (this.scrollContDiv.scrollLeft + this.space >= this.listDiv01.scrollWidth) {
|
||||
this.scrollContDiv.scrollLeft = this.scrollContDiv.scrollLeft + this.space - this.listDiv01.scrollWidth
|
||||
} else {
|
||||
this.scrollContDiv.scrollLeft += this.space
|
||||
};
|
||||
this.accountPageIndex()
|
||||
};
|
||||
this.moveRight = function () {
|
||||
if (this.scrollContDiv.scrollLeft - this.space <= 0) {
|
||||
this.scrollContDiv.scrollLeft = this.listDiv01.scrollWidth + this.scrollContDiv.scrollLeft - this.space
|
||||
} else {
|
||||
this.scrollContDiv.scrollLeft -= this.space
|
||||
};
|
||||
this.accountPageIndex()
|
||||
};
|
||||
this.leftEnd = function () {
|
||||
if (_state != "floating") {
|
||||
return
|
||||
};
|
||||
_state = "stoping";
|
||||
clearInterval(_scrollTimeObj);
|
||||
var fill = this.pageWidth - this.scrollContDiv.scrollLeft % this.pageWidth;
|
||||
this.move(fill)
|
||||
};
|
||||
this.rightEnd = function () {
|
||||
if (_state != "floating") {
|
||||
return
|
||||
};
|
||||
_state = "stoping";
|
||||
clearInterval(_scrollTimeObj);
|
||||
var fill = -this.scrollContDiv.scrollLeft % this.pageWidth;
|
||||
this.move(fill)
|
||||
};
|
||||
this.move = function (num, quick) {
|
||||
var thisMove = num / 5;
|
||||
if (!quick) {
|
||||
if (thisMove > this.space) {
|
||||
thisMove = this.space
|
||||
};
|
||||
if (thisMove < -this.space) {
|
||||
thisMove = -this.space
|
||||
}
|
||||
};
|
||||
if (Math.abs(thisMove) < 1 && thisMove != 0) {
|
||||
thisMove = thisMove >= 0 ? 1 : -1
|
||||
} else {
|
||||
thisMove = Math.round(thisMove)
|
||||
};
|
||||
var temp = this.scrollContDiv.scrollLeft + thisMove;
|
||||
if (thisMove > 0) {
|
||||
if (this.scrollContDiv.scrollLeft + thisMove >= this.listDiv01.scrollWidth) {
|
||||
this.scrollContDiv.scrollLeft = this.scrollContDiv.scrollLeft + thisMove - this.listDiv01.scrollWidth
|
||||
} else {
|
||||
this.scrollContDiv.scrollLeft += thisMove
|
||||
}
|
||||
} else {
|
||||
if (this.scrollContDiv.scrollLeft - thisMove <= 0) {
|
||||
this.scrollContDiv.scrollLeft = this.listDiv01.scrollWidth + this.scrollContDiv.scrollLeft - thisMove
|
||||
} else {
|
||||
this.scrollContDiv.scrollLeft += thisMove
|
||||
}
|
||||
};
|
||||
num -= thisMove;
|
||||
if (Math.abs(num) == 0) {
|
||||
_state = "ready";
|
||||
if (this.autoPlay) {
|
||||
this.play()
|
||||
};
|
||||
this.accountPageIndex();
|
||||
return
|
||||
} else {
|
||||
this.accountPageIndex();
|
||||
setTimeout("ScrollPic.childs[" + this.ID + "].move(" + num + "," + quick + ")", this.speed)
|
||||
}
|
||||
};
|
||||
this.next = function () {
|
||||
if (_state != "ready") {
|
||||
return
|
||||
};
|
||||
_state = "stoping";
|
||||
this.move(this.pageWidth, true)
|
||||
};
|
||||
this.play = function () {
|
||||
if (!this.autoPlay) {
|
||||
return
|
||||
};
|
||||
clearInterval(_autoTimeObj);
|
||||
_autoTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].next()", this.autoPlayTime * 1000)
|
||||
};
|
||||
this.stop = function () {
|
||||
clearInterval(_autoTimeObj)
|
||||
};
|
||||
this.pageTo = function (num) {
|
||||
if (_state != "ready") {
|
||||
return
|
||||
};
|
||||
_state = "stoping";
|
||||
var fill = num * this.frameWidth - this.scrollContDiv.scrollLeft;
|
||||
this.move(fill, true)
|
||||
};
|
||||
this.accountPageIndex = function () {
|
||||
this.pageIndex = Math.round(this.scrollContDiv.scrollLeft / this.frameWidth);
|
||||
if (this.pageIndex > Math.round(this.listDiv01.offsetWidth / this.frameWidth + 0.4) - 1) {
|
||||
this.pageIndex = 0
|
||||
};
|
||||
var i;
|
||||
for (i = 0; i < this.dotObjArr.length; i++) {
|
||||
if (i == this.pageIndex) {
|
||||
this.dotObjArr[i].className = this.dotClassName
|
||||
} else {
|
||||
this.dotObjArr[i].className = this.dotOnClassName
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,220 @@
|
|||
/* CSS Document */
|
||||
/* 样式重置 */
|
||||
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
|
||||
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.9; background:#f2f2f2;}
|
||||
div,img,tr,td,table{ border:0;}
|
||||
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
|
||||
ol,ul,li{ list-style-type:none}
|
||||
a:link,a:visited{color:#000;text-decoration:none;}
|
||||
a:hover,a:active{color:#24366e;}
|
||||
|
||||
.sn-fl {float:left;}
|
||||
.sn-fr {float:right;}
|
||||
.sn-cl {clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
|
||||
.sn-container {width:100%; background-color:#fff;}
|
||||
.sn-p-absolute {position:absolute;}
|
||||
.sn-grey-opacity {background:rgba(230, 230, 230, 0.9)!important; filter:Alpha(opacity=90); background:#e6e6e6;}
|
||||
.sn-border {border-top:1px solid #dfdfdf; border-bottom:1px solid #dfdfdf;}
|
||||
/* 公共 */
|
||||
.cl {clear:both;}
|
||||
.fl {float:left;}
|
||||
.fr {float:right;}
|
||||
.mb18 {margin-bottom:18px;}
|
||||
.mt10 {margin-top:10px;}
|
||||
.mr20 {margin-right:20px;}
|
||||
.mr10 {margin-right:10px;}
|
||||
|
||||
/*字体,链接颜色*/
|
||||
.sn-font-black {color:#000;}
|
||||
.sn-font-grey {color:#b4bbbf;}
|
||||
.sn-font-grey2 {color:#5e5e5e;}
|
||||
.sn-font-grey3 {color:#999;}
|
||||
a.sn-link-blue {color:#24366e;}
|
||||
a.sn-link-white {color:#fff;}
|
||||
a.sn-link-grey {color:#999;}
|
||||
a.sn-link-grey:hover {color:#24366e;}
|
||||
a.sn-link-grey2 {color:#888;}
|
||||
a.sn-link-select {color:#809df9;}
|
||||
/*字体大小*/
|
||||
.sn-f12 {font-size:12px;}
|
||||
.sn-f14 {font-size:14px;}
|
||||
.sn-f18 {font-size:18px;}
|
||||
/*padding&margin&width*/
|
||||
.sn-mt-10 {margin-left:-10px;}
|
||||
.sn-mt4 {margin-top:4px;}
|
||||
.sn-mt10 {margin-top:10px;}
|
||||
.sn-mt13 {margin-top:13px;}
|
||||
.sn-mt15 {margin-top:15px;}
|
||||
.sn-mt28 {margin-top:28px;}
|
||||
.sn-mb40 {margin-bottom:40px;}
|
||||
.sn-ml15 {margin-left:15px;}
|
||||
.sn-ml55 {margin-left:55px;}
|
||||
.sn-mr0 {margin-right:0px !important;}
|
||||
.sn-mr50 {margin-right:50px;}
|
||||
.sn-w229 {width:229px;}
|
||||
/*头部样式*/
|
||||
.sn-header {}
|
||||
.sn-row {width:100%;}
|
||||
.sn-bg-grey {background-color:#f4f4f4;}
|
||||
.sn-bg-grey2 {background-color:#a5a5a5;}
|
||||
.sn-bg-white {background-color:#fff;}
|
||||
.sn-bg-blue {background-color:#24366e;}
|
||||
.sn-login {width:1200px; height:45px; line-height:45px; margin:0 auto; font-size:14px; color:#24366e; vertical-align:middle; text-align:right;}
|
||||
.sn-login2 {width:1200px; height:54px; line-height:54px; margin:0 auto; font-size:14px; color:#24366e; vertical-align:middle; text-align:right;}
|
||||
.sn-logo {width:1200px; height:90px; line-height:90px; margin:0 auto; vertical-align:middle;}
|
||||
.sn-search-input {width:328px; height:40px; font-size:16px; color:#ccc; padding-left:10px; border:1px solid #ccc; border-right:none; float:right; background-color:#fff; outline:none;}
|
||||
a.sn-search-button {width:53px; height:40px; border:1px solid #ccc; border-left:none; float:right; outline:none; background:url(../images/sn_search_icon.jpg) 0 3px no-repeat;}
|
||||
.sn-nav {width:1200px; height:55px; margin:0 auto; font-size:16px; position:relative; line-height:1;}
|
||||
.sn-nav li {float:left; padding-top:11px; padding-bottom:12px; margin-right:50px;}
|
||||
.sn-nav li a {display:inline-block; padding:8px 6px; border-radius:5px;}
|
||||
.sn-nav li a:hover {background-color:#809df9;}
|
||||
.sn-sub-nav {width:1200px; margin:0 auto; font-size:14px; position:relative; line-height:1;}
|
||||
.sn-sub-nav li {color:#999; float:left;}
|
||||
.sn-sub-nav li a {height:40px; line-height:40px; vertical-align:middle; margin:0 5px; padding:0 5px; display:inline-block;}
|
||||
.sn-sub-nav li a:hover {border-bottom:3px solid #ffbd18; height:37px;}
|
||||
.sn-subnav-slice {margin:12px 5px;}
|
||||
.sn-banner {width:1200px; height:210px; margin:0 auto;}
|
||||
.sn-content-position {width:1200px; height:50px; line-height:50px; vertical-align:middle; font-size:14px; color:#888; margin:0 auto;}
|
||||
/*footer样式*/
|
||||
.sn-footer {width:1200px; height:220px; margin:0 auto; text-align:center; font-size:14px; color:#fff; line-height:normal;}
|
||||
.sn-footer-link {padding:40px 0 30px 0;}
|
||||
.sn-footer-link li {display:inline-block;}
|
||||
.sn-contact {margin-bottom:30px;}
|
||||
/* 首页内容 */
|
||||
.sn-content{ width:1200px; margin:0 auto;}
|
||||
.sn-content-left{ width:820px; margin-right:12px; margin-bottom:100px;}
|
||||
.sn-content-right{ width:368px; margin-bottom:74px; }
|
||||
/* index-banner */
|
||||
.sn-index-banner{ width:820px; height:435px; margin-bottom:20px;}
|
||||
.focus{ position:relative; width:820px; height:435px; background-color: #000; float: left;}
|
||||
.focus img{ width:820px; height:435px;}
|
||||
.focus .shadow .title{width: 260px; height: 65px;padding-left: 30px;padding-top: 20px;}
|
||||
.focus .shadow .title a{ text-decoration:none; color:#fff; font-size:14px; font-weight:bolder; overflow:hidden; }
|
||||
.focus .btn{ position:absolute; bottom:34px; left:510px; overflow:hidden; zoom:1;}
|
||||
.focus .btn a{position:relative; display:inline; width:13px; height:13px; border-radius:7px; margin:0 5px;color:#B0B0B0; text-decoration:none; text-align:center; outline:0; float:left; background:#D9D9D9; }
|
||||
.focus .btn a:hover,.focus .btn a.current{ cursor:pointer;background:#fc114a;}
|
||||
.focus .fPic{ position:absolute; left:0px; top:0px; }
|
||||
.focus .D1fBt{ overflow:hidden; zoom:1; height:16px; z-index:10; }
|
||||
.focus .shadow{ width:100%; position:absolute; bottom:0; left:0px; z-index:10; height:80px; line-height: 80px; background:rgba(0,0,0,0.6);
|
||||
filter:progid:DXImageTransform.Microsoft.gradient( GradientType = 0,startColorstr = '#80000000',endColorstr = '#80000000')\9; display:block; text-align:left; }
|
||||
.focus .shadow a{ text-decoration:none; color:#fff; font-size:20px; overflow:hidden; margin-left:10px; }
|
||||
.focus .fcon{ position:relative; width:100%; float:left; display:none; background:#000 }
|
||||
.focus .fcon-default{ position:relative; width:100%; float:left; background:#fff }
|
||||
.focus .fcon img{ display:block; }
|
||||
.focus .fbg{bottom:25px; right:40px; position:absolute; height:21px; text-align:center; z-index: 200; }
|
||||
.focus .fbg div{margin:4px auto 0;overflow:hidden;zoom:1;height:14px}
|
||||
.focus .D1fBt a{position:relative; display:inline; width:12px; height:12px; border-radius:7px; margin:0 5px;color:#B0B0B0; text-decoration:none; text-align:center; outline:0; float:left; background:#D9D9D9; }
|
||||
.focus .D1fBt .current,.focus .D1fBt a:hover{background:#fc114a;}
|
||||
.focus .D1fBt img{display:none}
|
||||
.focus .D1fBt i{display:none; font-style:normal; }
|
||||
.focus .prev,.focus .next{position:absolute;width:40px;height:74px;background: url(../images/banner/focus_btn.png) no-repeat;}
|
||||
.focus .prev{top: 50%;margin-top: -37px; left: 0;background-position:0 -74px; cursor:pointer; }
|
||||
.focus .next{top: 50%;margin-top: -37px; right: 0; background-position:-40px -74px; cursor:pointer;}
|
||||
.focus .prev:hover{ background-position:0 0; }
|
||||
.focus .next:hover{ background-position:-40px 0;}
|
||||
/* index-news */
|
||||
.sn-index-leftbox{ width:820px; background:#fff; margin-bottom:20px;}
|
||||
.h2-title{ padding:5px 0 3px; border-bottom:1px solid #ebebeb; font-size:18px; color:#777; font-weight:normal; padding-left:17px;}
|
||||
.h2-title a.more{ font-size:12px; color:#777; float:right; margin-right:17px; line-height:2.8;}
|
||||
.h2-title a:hover.more{ color:#24366e;}
|
||||
.sn-news-bigbox{ padding:0px 26px 0px 18px; margin:18px 0 26px; border-right:1px solid #ebebeb;}
|
||||
.sn-news-bigbox a.h3-title{ font-size:18px; width:380px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
|
||||
.sn-news-bigbox .sn-news-txt{ width:380px; color:#666;}
|
||||
.sn-news-bigbox .sn-news-bigimg{ width:380px; height:165px;}
|
||||
.txt-grey{ color:#999;}
|
||||
.sn-news-smallbox{padding:0px 18px 0px 26px; margin:18px 0 26px; width:350px; }
|
||||
.sn-news-smallbox .sn-news-smallimg{ width:85px; height:85px; margin-right:10px;}
|
||||
.sn-news-smallbox a.h4-title{ font-size:14px; width:255px; float:left;}
|
||||
/* index-resources */
|
||||
.sn-index-resourcescon{ padding-top:12px;background:#f2f2f2;}
|
||||
.sn-index-resourcesbox{ padding:10px; background:#f2f2f2; width:185px; float:left;}
|
||||
.sn-index-resourcesbox:hover{ background:#fff;}
|
||||
.sn-index-resourcesbox a.resources-title{ font-size:18px; font-weight:normal; line-height:2.0;width:185px; display:block; border-bottom:1px solid #ccc; margin-bottom:5px;}
|
||||
.sn-hidden {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
|
||||
.sn-index-resourcesbox a.resources-tag{ font-size:14px; color:#999; margin-right:5px; line-height:1.5;}
|
||||
.resources-tagbox {width:185px; height: 46px; overflow:hidden;}
|
||||
.resources-tagbox img {max-width: 100%;}
|
||||
a.more-btn{ display:block; width:185px; height:30px; text-align:center; background:#ccc; color:#666; line-height:30px;}
|
||||
/* index-partner */
|
||||
.sn-index-partnerbox{ padding:25px 30px; }
|
||||
.sn-index-partnerbox{ width:775px;}
|
||||
.sn-index-partnerbox ul li{ height:55px;}
|
||||
.sn-index-partnerbox ul li a.partnerimg{ display:block; margin:0 10px 10px 0; border:1px solid #ccc; width:370px; height:43px; float:left;}
|
||||
.partner-btnbox{ width:90px; margin:0 auto;}
|
||||
.partner-btn{ width:35px; height:22px; background-color:#999; line-height:1.0; font-size:18px; color:#fff; text-align: center; margin-right:5px; cursor:pointer;}
|
||||
.partner-btn:hover{ background-color:#172b65;}
|
||||
/* index-active */
|
||||
.sn-index-activebox{ margin-bottom:20px; background:#fff; padding-bottom:10px;}
|
||||
.active-title{width:330px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
|
||||
.sn-index-active{ margin:0px 20px 5px 20px;}
|
||||
.sn-index-active a.sn-activeimg{width:330px; height:210px;}
|
||||
/* index-wx*/
|
||||
.sn-index-wxbox{margin-bottom:20px; background:#fff;}
|
||||
.sn-index-wximg{ margin:15px; margin-right:5px;}
|
||||
.sn-index-txt{ font-size:16px; line-height:2.0; margin-top:30px;}
|
||||
.sn-index-smallbanner img{ display:block; width:369px; height:169px; }
|
||||
|
||||
/* 内页新闻列表 */
|
||||
.sn-inner-body{ width:100%; background-color:#fff;}
|
||||
.sn-innner-content{ width:1200px; margin:0 auto;}
|
||||
.sn-inner-newsh2{ font-size:20px; font-weight:normal; padding-bottom:5px; border-bottom:1px dashed #eee;}
|
||||
.sn-circle{ margin:18px 5px 0 5px ;border:1px solid #24366e; width:5px; height:5px; -webkit-border-radius:50px; -moz-border-radius:50px; -o-border-radius:50px; border-radius:50px; }
|
||||
.sn-inner-newslist ul li{ line-height:42px; font-size:15px; border-bottom:1px solid #eee;}
|
||||
.sn-inner-newslist a{font-size:15px; color:#888;}
|
||||
.sn-inner-newslist a:hover{ color:#24366e;}
|
||||
a.sn-newslist-titile{ font-size:15px;width:840px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
|
||||
a:hover.sn-newslist-reply,a:hover.sn-newslist-zan{ color:#379be9;}
|
||||
.sn-inner-pages a{ display:block; font-size:12px; border:1px solid #d1d1d1; color:#999; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; }
|
||||
.sn-inner-pages a:hover{ background-color:#24366e; color:#fff;}
|
||||
a.sn-inner-pages-big{ width:50px;}
|
||||
a.sn-pages-active{ background-color:#24366e; color:#fff;}
|
||||
.sn-inner-pages{width:330px; margin:40px auto 100px;}
|
||||
/* 内页新闻展示 */
|
||||
.sn-inner-newscon{ width:1200px; padding:5px 0 50px; border-bottom:1px solid #e8e8e8; margin-bottom:30px; color:#999; font-size:14px; }
|
||||
.sn-inner-pcon{text-indent:2em;}
|
||||
.sn-inner-newscon img{ display:block; width:830px; margin:25px auto 5px;}
|
||||
.sn-inner-psmall{ color:#999; font-size:12px; margin-bottom:15px;}
|
||||
.sn-inner-imgp{ color:#000; text-align:center; margin-bottom:30px;}
|
||||
a.sn-newslist-zan{ display:block; background:url(../images/zan.gif) 0 15px no-repeat; width:54px; height:28px; padding-left:12px; color:#999; }
|
||||
a:hover.sn-newslist-zan{ background:url(../images/zan.gif) 0 -21px no-repeat; }
|
||||
/* 留言 */
|
||||
.sn-replybox{ margin-bottom:100px;}
|
||||
.sn-reply-h2{ font-size:18px; font-weight:normal; color:#24366e; margin-bottom:6px;}
|
||||
.sn-reply-form{ width:1200px;height:180px; border:1px solid #e8e8e8; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; background:#fff; margin-bottom:20px; }
|
||||
.sn-reply-text{ width:1200px; height:130px; background:#fff; border:none; resize:none;}
|
||||
.sn-reply-btnbox{border-top:1px solid #e8e8e8; height:48px;}
|
||||
a.submit-btn{ display:block; color:#fff; text-align:center; font-size:14px; line-height:27px; width:79px; height:27px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; background:#24366e; margin:8px 0 0 10px;}
|
||||
a:hover.submit-btn{ color:#16275c; color:#fff;}
|
||||
.sn-comment-h2{ color:#999; font-size:16px; font-weight:normal; border-bottom:1px solid #e8e8e8; padding-bottom:5px;}
|
||||
.sn-reply-userpic{ height:65px; margin-right:15px;}
|
||||
.sn-reply-userpic img{ width:40px; height:40px;-webkit-border-radius:50px; -moz-border-radius:50px; -o-border-radius:50px; border-radius:50px;}
|
||||
a.sn-reply-zan{ display:block; background:url(../images/zan.gif) 0 4px no-repeat; width:54px; height:16px; padding-left:12px; color:#999; }
|
||||
a:hover.sn-reply-zan{ background:url(../images/zan.gif) 0 -32px no-repeat; }
|
||||
.sn-comment-listbox{ padding:23px 0; width:1200px;border-bottom:1px solid #e8e8e8;}
|
||||
a.sn-reply-username { color:#24366e; margin-right:15px; }
|
||||
.sn-reply-usertxt{ width:1145px; font-size:14px; }
|
||||
.sn-reply-more{ width:1200px; height:25px; background:#ddd; text-align:center; line-height:25px;}
|
||||
|
||||
/*用户图像*/
|
||||
.topnav_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 1px;}
|
||||
.topnav_login_list a{color:#269ac9;}
|
||||
.topnav_login_list li{ }
|
||||
.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;}
|
||||
.homepageLeft {width:240px; float:left; margin-right:10px; margin-bottom:10px;}
|
||||
.none {display: none;}
|
||||
.user-img,.user-img img{ margin-right:10px; -moz-border-radius: 50px; -webkit-border-radius: 50px;border-radius: 50px; display:block; width:40px; height:40px;}
|
||||
.ml60{ margin-left:60px;}
|
||||
.user-img img{border:2px solid #e6473b; }
|
||||
.user-img img:hover{border:2px solid #29156f;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -593,6 +593,9 @@ img.ui-datepicker-trigger {
|
|||
.repos_files ul:hover{ background:#ffffdd;}
|
||||
.repos_t_c li{ text-align:center;}
|
||||
.pic_stats{display:block; background:url(../images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
|
||||
.tree-age{width:10%; text-align:right;}
|
||||
.tree-author{width:10%; text-align:left;}
|
||||
.tree-comments{width:40%; text-align:left;}
|
||||
|
||||
|
||||
/* 里程碑 */
|
||||
|
@ -816,7 +819,7 @@ div.changeset { border-bottom: 1px solid #ddd; }
|
|||
tr.entry { border: 1px solid #DDD; }
|
||||
tr.entry td { white-space: nowrap; }
|
||||
tr.entry td.filename { width: 30%; }
|
||||
tr.entry td.filename_no_report { width: 70%; }
|
||||
tr.entry td.filename_no_report { width: 40%; }
|
||||
tr.entry td.size { text-align: right; font-size: 90%; }
|
||||
tr.entry td.revision, tr.entry td.author { text-align: center; }
|
||||
tr.entry td.age { text-align: right; }
|
||||
|
@ -1200,6 +1203,7 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
|
|||
.popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;}
|
||||
.subjectType {width:70px; text-align:center;}
|
||||
.subjectCount {width:65px; text-align:center;}
|
||||
.button-rep { color: #888;display: inline-block;background: #eee;padding: 2px 5px;}
|
||||
|
||||
/*博客列表界面样式*/
|
||||
a{text-decoration:none}
|
||||
|
@ -1226,5 +1230,4 @@ a.pages-big{ width:50px;}
|
|||
.pages .active{ background-color:#269ac9; color:#fff;}
|
||||
.pages{width:330px; margin:20px auto 10px;}
|
||||
|
||||
.red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
|
@ -0,0 +1,11 @@
|
|||
FactoryGirl.define do
|
||||
factory :rep_static, :class => 'RepStatics' do
|
||||
project_id 1
|
||||
commits_num 1
|
||||
uname "MyString"
|
||||
email "MyString"
|
||||
add 1
|
||||
del 1
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RepStatics, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|