迁移文件
|
@ -1,9 +1,51 @@
|
|||
class BlogsController < ApplicationController
|
||||
before_filter :find_blog,:except => [:index,:create,:new,:set_homepage, :cancel_homepage]
|
||||
before_filter :find_user
|
||||
include PraiseTreadHelper
|
||||
|
||||
def index
|
||||
@article = BlogComment.new
|
||||
|
||||
@order, @b_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
|
||||
|
||||
#确定 sort_type 1升序 2 降序
|
||||
if @order.to_i == @type.to_i
|
||||
@b_sort = @b_sort.to_i == 1 ? 2 : 1
|
||||
else
|
||||
@b_sort = 2
|
||||
end
|
||||
|
||||
sort_name = "updated_at"
|
||||
|
||||
sort_type = @b_sort == 1 ? "asc" : "desc"
|
||||
|
||||
@topics = @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.#{sort_name} #{sort_type}")
|
||||
|
||||
#根据 赞+回复数排序
|
||||
if @order.to_i == 2
|
||||
@type = 2
|
||||
|
||||
@topics.each do |topic|
|
||||
topic[:infocount] = get_praise_num(topic) + (topic.parent ? topic.parent.children.count : topic.children.count)
|
||||
end
|
||||
|
||||
@b_sort == 1 ? @topics = @topics.sort{|x,y| x[:infocount] <=> y[:infocount] } : @topics = @topics.sort{|x,y| y[:infocount] <=> x[:infocount] }
|
||||
|
||||
@topics = sort_by_sticky @topics
|
||||
else
|
||||
@type = 1
|
||||
end
|
||||
|
||||
#分页
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@atta_count = @topics.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@topics = paginateHelper @topics,@limit
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout=>'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,6 +28,7 @@ class BoardsController < ApplicationController
|
|||
helper :watchers
|
||||
helper :project_score
|
||||
helper :attachments
|
||||
include PraiseTreadHelper
|
||||
def index
|
||||
#modify by nwb
|
||||
@flag = params[:flag] || false
|
||||
|
@ -62,13 +63,24 @@ class BoardsController < ApplicationController
|
|||
else
|
||||
render_403
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
# 讨论区消息状态更新(已读和未读)
|
||||
@order, @b_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
|
||||
|
||||
#确定 sort_type 1升序 2 降序
|
||||
if @order.to_i == @type.to_i
|
||||
@b_sort = @b_sort.to_i == 1 ? 2 : 1
|
||||
else
|
||||
@b_sort = 2
|
||||
end
|
||||
|
||||
sort_name = "updated_at"
|
||||
|
||||
sort_type = @b_sort == 1 ? "asc" : "desc"
|
||||
|
||||
if @project
|
||||
ForgeMessage.where("user_id =? and project_id =? and viewed =?", User.current.id, @project.id, 0).update_all(:viewed => true)
|
||||
# 更新@消息为已读
|
||||
|
@ -82,63 +94,84 @@ class BoardsController < ApplicationController
|
|||
CourseMessage.where("user_id =? and course_id =? and viewed =?", User.current.id, @course.id, 0).update_all(:viewed => true)
|
||||
end
|
||||
|
||||
sort_init 'updated_on', 'desc'
|
||||
sort_update 'created_on' => "#{Message.table_name}.created_on",
|
||||
'replies' => "#{Message.table_name}.replies_count",
|
||||
'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
|
||||
# sort_init 'updated_on', 'desc'
|
||||
# sort_update 'created_on' => "#{Message.table_name}.created_on",
|
||||
# 'replies' => "#{Message.table_name}.replies_count",
|
||||
# 'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
|
||||
|
||||
@is_new = params[:is_new]
|
||||
@topic_count = @board ? @board.topics.count : 0
|
||||
if @project
|
||||
if @board
|
||||
limit = 10;
|
||||
@topic_count = @board.topics.count();
|
||||
@topic_pages = (params[:page] ? params[:page].to_i + 1 : 0) *10
|
||||
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on) desc").
|
||||
limit(limit).offset(@topic_pages).includes(:last_reply).
|
||||
@topic_pages = 0#(params[:page] ? params[:page].to_i + 1 : 0) *10
|
||||
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on) #{sort_type}").
|
||||
offset(@topic_pages).includes(:last_reply).
|
||||
preload(:author, {:last_reply => :author}).all();
|
||||
else
|
||||
@topics = [];
|
||||
end
|
||||
elsif @course
|
||||
if (@board)
|
||||
limit = 10;
|
||||
@topic_count = @board.topics.count();
|
||||
@topic_pages = (params[:page] ? params[:page].to_i + 1 : 0) *10
|
||||
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on) desc").
|
||||
limit(limit).offset(@topic_pages).includes(:last_reply).
|
||||
preload(:author, {:last_reply => :author}).all();
|
||||
@topic_pages = 0 #(params[:page] ? params[:page].to_i + 1 : 0) *10
|
||||
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on) #{sort_type}").offset(@topic_pages).includes(:last_reply).preload(:author, {:last_reply => :author}).all();
|
||||
else
|
||||
@topics = [];
|
||||
end
|
||||
end
|
||||
|
||||
#根据 赞+回复数排序
|
||||
if @order.to_i == 2
|
||||
@type = 2
|
||||
@topics.each do |topic|
|
||||
topic[:infocount] = get_praise_num(topic) + (topic.parent ? x.parent.children.count : topic.children.count)
|
||||
end
|
||||
@b_sort == 1 ? @topics = @topics.sort{|x,y| x[:infocount] <=> y[:infocount] } : @topics = @topics.sort{|x,y| y[:infocount] <=> x[:infocount] }
|
||||
@topics = sort_by_sticky @topics
|
||||
else
|
||||
@type = 1
|
||||
end
|
||||
|
||||
#分页
|
||||
@limit = 15
|
||||
@is_remote = true
|
||||
@atta_count = @topics.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@topics = paginateHelper @topics,@limit
|
||||
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@message = Message.new(:board => @board)
|
||||
#modify by nwb
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {
|
||||
if @project
|
||||
render :action => 'show', :layout => 'base_projects'
|
||||
elsif @course
|
||||
@params=params
|
||||
render :action => 'show', :layout => 'base_courses'
|
||||
end
|
||||
}
|
||||
format.atom {
|
||||
@messages = @board.messages.
|
||||
reorder('created_on DESC').
|
||||
includes(:author, :board).
|
||||
limit(Setting.feeds_limit.to_i).
|
||||
all
|
||||
if @project
|
||||
render_feed(@messages, :title => "#{@project}: #{@board}")
|
||||
elsif @course
|
||||
render_feed(@messages, :title => "#{@course}: #{@board}")
|
||||
end
|
||||
|
||||
}
|
||||
if (params[:page] || params[:order])
|
||||
respond_to do |format|
|
||||
format.js{render "show.js.erb"}
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {
|
||||
if @project
|
||||
render :action => 'show', :layout => 'base_projects'
|
||||
elsif @course
|
||||
@params=params
|
||||
render :action => 'show', :layout => 'base_courses'
|
||||
end
|
||||
}
|
||||
format.atom {
|
||||
@messages = @board.messages.
|
||||
reorder('created_on DESC').
|
||||
includes(:author, :board).
|
||||
limit(Setting.feeds_limit.to_i).
|
||||
all
|
||||
if @project
|
||||
render_feed(@messages, :title => "#{@project}: #{@board}")
|
||||
elsif @course
|
||||
render_feed(@messages, :title => "#{@course}: #{@board}")
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -70,25 +70,59 @@ class NewsController < ApplicationController
|
|||
end
|
||||
elsif @course
|
||||
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
||||
@order, @b_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
|
||||
|
||||
#确定 sort_type 1升序 2 降序
|
||||
if @order.to_i == @type.to_i
|
||||
@b_sort = @b_sort.to_i == 1 ? 2 : 1
|
||||
else
|
||||
@b_sort = 2
|
||||
end
|
||||
|
||||
sort_name = "created_on"
|
||||
|
||||
sort_type = @b_sort == 1 ? "asc" : "desc"
|
||||
|
||||
scope = @course ? @course.news.course_visible : News.course_visible
|
||||
news_arr = scope.map{|news| news.id}
|
||||
|
||||
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
news_page = @page *10
|
||||
news_page = 0 #@page *10
|
||||
@news_count = scope.count
|
||||
@is_new = params[:is_new]
|
||||
@q = params[:subject]
|
||||
if params[:subject].nil? || params[:subject].blank?
|
||||
scope_order = scope.reorder("#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC").limit(10).offset(news_page).includes(:author,:course).all()
|
||||
scope_order = scope.reorder("#{News.table_name}.sticky DESC, #{News.table_name}.#{sort_name} #{sort_type}").offset(news_page).includes(:author,:course).all()
|
||||
#all(:include => [:author, :course],
|
||||
#:order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC").limit(10).offset(news_page)
|
||||
else
|
||||
scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").reorder("#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC").limit(10).offset(news_page).includes(:author,:course).all()
|
||||
scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").reorder("#{News.table_name}.sticky DESC, #{News.table_name}.#{sort_name} #{sort_type}").offset(news_page).includes(:author,:course).all()
|
||||
#.all(:include => [:author, :course],:order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC")
|
||||
end
|
||||
|
||||
#根据 赞+回复数排序
|
||||
if @order.to_i == 2
|
||||
@type = 2
|
||||
scope_order.each do |topic|
|
||||
topic[:infocount] = get_praise_num(topic) + topic.comments.count
|
||||
end
|
||||
@b_sort == 1 ? scope_order = scope_order.sort{|x,y| x[:infocount] <=> y[:infocount] } : scope_order = scope_order.sort{|x,y| y[:infocount] <=> x[:infocount] }
|
||||
scope_order = sort_by_sticky scope_order
|
||||
else
|
||||
@type = 1
|
||||
end
|
||||
|
||||
@newss = scope_order
|
||||
|
||||
#分页
|
||||
@limit = 15
|
||||
@is_remote = true
|
||||
@atta_count = @newss.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@newss = paginateHelper @newss,@limit
|
||||
|
||||
#@newss = paginateHelper scope_order,10
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
|
|
|
@ -32,6 +32,10 @@ class SettingsController < ApplicationController
|
|||
hidden_non_project = Setting.find_by_name("hidden_non_project")
|
||||
@text = (hidden_non_project && hidden_non_project.value == "0") ? l(:label_show_non_project) : l(:label_hidden_non_project)
|
||||
|
||||
#1隐藏了课程信息 0显示了课程信息
|
||||
hidden_courses = Setting.find_by_name("hidden_courses")
|
||||
@text_1 = (hidden_courses && hidden_courses.value == "1") ? l(:label_show_courses) : l(:label_hidden_courses)
|
||||
|
||||
@notifiables = Redmine::Notifiable.all
|
||||
if request.post? && params[:settings] && params[:settings].is_a?(Hash)
|
||||
settings = (params[:settings] || {}).dup.symbolize_keys
|
||||
|
@ -89,4 +93,22 @@ class SettingsController < ApplicationController
|
|||
|
||||
redirect_to settings_url
|
||||
end
|
||||
|
||||
#隐藏/显示课程信息
|
||||
def hidden_courses
|
||||
@notifiable = Setting.find_by_name("hidden_courses")
|
||||
if @notifiable
|
||||
@notifiable.value == "1" ? @notifiable.value = 0 : @notifiable.value = 1
|
||||
@notifiable.save
|
||||
else
|
||||
@notifiable = Setting.new()
|
||||
@notifiable.name = "hidden_courses"
|
||||
@notifiable.value = 1
|
||||
@notifiable.save
|
||||
end
|
||||
|
||||
redirect_to settings_url
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ class StudentWorkController < ApplicationController
|
|||
include ApplicationHelper
|
||||
require 'bigdecimal'
|
||||
require "base64"
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,:code_repeattest,:work_canrepeat,:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,:search_course_students]
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,:search_course_students]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
|
||||
before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work]
|
||||
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
||||
|
@ -81,8 +81,6 @@ class StudentWorkController < ApplicationController
|
|||
#根据传入的tIndex确定是第几次测试
|
||||
#之后如果觉得很卡 可以改成将结果传回JS再以参数形式传回来
|
||||
def program_test_ex
|
||||
tStarttime = Time.now
|
||||
|
||||
is_test = params[:is_test] == 'true'
|
||||
resultObj = {status: 0, results: [], error_msg: '', time: Time.now.strftime('%Y-%m-%d %T'),tseq:1,tcount:1,testid:1} #保存每测试一次返回的结果
|
||||
|
||||
|
@ -100,17 +98,8 @@ class StudentWorkController < ApplicationController
|
|||
test = @homework.homework_tests[index - 1]
|
||||
|
||||
#请求测试
|
||||
begin
|
||||
result = test_realtime_ex(test, params[:src])
|
||||
rescue Timeout::Error
|
||||
tEndtime = Time.now
|
||||
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
|
||||
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
|
||||
result = test_realtime_ex(test, params[:src])
|
||||
|
||||
#status 0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
||||
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>-3,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
|
||||
|
||||
end
|
||||
if result["status"].to_i != -2
|
||||
#result["results"].first['output'] = result["results"].first['output'].gsub(" ","□")
|
||||
#result["results"].first['result'] = result["results"].first['result'].gsub(" ","□")
|
||||
|
@ -125,19 +114,11 @@ class StudentWorkController < ApplicationController
|
|||
resultObj[:results] = result["results"].first #本次测试结果
|
||||
resultObj[:error_msg] = result["error_msg"] #编译错误时的信息
|
||||
|
||||
#该状态用于存入CodeTests
|
||||
tmpstatus = -1
|
||||
if result["status"].to_i == -2 #编译错误
|
||||
resultObj[:results] = result["error_msg"]
|
||||
resultObj[:status] = -2
|
||||
tmpstatus = -2
|
||||
elsif result["results"][0]["status"].to_i == 2
|
||||
resultObj[:status] = 2
|
||||
tmpstatus = 2
|
||||
end
|
||||
|
||||
if result["status"] == 0
|
||||
tmpstatus = 0
|
||||
end
|
||||
|
||||
unless student_work.save
|
||||
|
@ -153,14 +134,6 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
#每次从数据库取出上次的结果加上本次的结果再存入数据库
|
||||
if result["status"].to_i != -2
|
||||
result["results"].first['user_wait'] = tUsedtime
|
||||
|
||||
if result["results"][0]["status"].to_i == 2
|
||||
result["status"] = 2
|
||||
end
|
||||
end
|
||||
|
||||
status = result["status"]
|
||||
if index == 1
|
||||
student_work_test = student_work.student_work_tests.build(status: status,
|
||||
|
@ -189,19 +162,6 @@ class StudentWorkController < ApplicationController
|
|||
resultObj[:index] = student_work.student_work_tests.count
|
||||
end
|
||||
|
||||
#将每次用户等待时间都存起来以便管理界面显示用
|
||||
tEndtime = Time.now
|
||||
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
|
||||
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
|
||||
|
||||
time_used = 0
|
||||
if result["status"].to_i != -2
|
||||
#至少一毫秒
|
||||
time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used']
|
||||
end
|
||||
#0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
||||
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
|
||||
|
||||
#渲染返回结果
|
||||
render :json => resultObj
|
||||
end
|
||||
|
@ -209,114 +169,6 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#找出该作业的所有提交作业
|
||||
def find_all_student_work_by_homeid()
|
||||
all_studentwork = StudentWork.where("homework_common_id =#{@homework.id} and is_test = 0 ")
|
||||
|
||||
all_studentwork
|
||||
end
|
||||
|
||||
def request_code_repeattest(src)
|
||||
url = "#{Redmine::Configuration['jplag_server']}api/realtime_test.json"
|
||||
|
||||
factor = []
|
||||
src.each do |test|
|
||||
factor << {work_id: test.id, des: test.description,created_at:test.created_at.to_i}
|
||||
end
|
||||
|
||||
solutions = {
|
||||
homeid:@homework.id,
|
||||
language:@homework.homework_detail_programing.language,
|
||||
factor: factor
|
||||
}
|
||||
uri = URI(url)
|
||||
body = solutions.to_json
|
||||
|
||||
logger.debug "send body"
|
||||
logger.debug body
|
||||
|
||||
res = Net::HTTP.new(uri.host, uri.port).start do |client|
|
||||
request = Net::HTTP::Post.new(uri.path)
|
||||
request.body = body
|
||||
request["Content-Type"] = "application/json"
|
||||
client.request(request)
|
||||
end
|
||||
|
||||
JSON.parse(res.body)
|
||||
end
|
||||
|
||||
#点击代码查重按钮
|
||||
def work_canrepeat
|
||||
@homework_id = params[:homework]
|
||||
@course_id = params[:course_id]
|
||||
|
||||
all_studentwork = find_all_student_work_by_homeid()
|
||||
|
||||
@work_count = all_studentwork.count
|
||||
end
|
||||
|
||||
#代码查重 status: 0完成 -2不需要查重 -1查重失败不支持该语言
|
||||
def code_repeattest
|
||||
tStarttime = Time.now
|
||||
logger.debug "code_repeattest start is #{tStarttime}}"
|
||||
resultObj = {status: -2}
|
||||
|
||||
@homework = HomeworkCommon.find params[:homework]
|
||||
|
||||
all_studentwork = find_all_student_work_by_homeid()
|
||||
|
||||
if all_studentwork == nil
|
||||
resultObj[:status] = -2
|
||||
elsif all_studentwork.count <= 1
|
||||
resultObj[:status] = -2
|
||||
else
|
||||
|
||||
#@homework.homework_detail_programing.language、id、description
|
||||
logger.debug "time1 is #{Time.now.usec} "
|
||||
result = request_code_repeattest(all_studentwork)
|
||||
logger.debug "time2 is #{Time.now.usec} "
|
||||
|
||||
resultObj[:status] = result['status'].to_i
|
||||
# resultObj[:results] = result['results']
|
||||
|
||||
#Time.now, simi_id = simiworkid , simi_value = simivalue
|
||||
if resultObj[:status] == 0
|
||||
@homework.simi_time = Time.now
|
||||
resultObj[:comparetime] = @homework.simi_time
|
||||
@homework.update_column('simi_time', @homework.simi_time)
|
||||
|
||||
logger.debug "time3 is #{Time.now.usec} "
|
||||
result['results'].each do |key,value|
|
||||
@student_work = StudentWork.where("id =?", key.to_i).first
|
||||
@student_work.update_column('simi_id', value['simiworkid'].to_i)
|
||||
@student_work.update_column('simi_value', value['simivalue'].to_i)
|
||||
# sqlstr = "update student_works set simi_id=#{value['simiworkid']},simi_value=#{value['simivalue']} where id=#{key.to_i} "
|
||||
# dbh.execute(sqlstr)
|
||||
end
|
||||
logger.debug "time4 is #{Time.now.usec} "
|
||||
end
|
||||
end
|
||||
tEndtime = Time.now
|
||||
logger.debug "code_repeattest end is #{tEndtime}}"
|
||||
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000000+(tEndtime.usec - tStarttime.usec)
|
||||
logger.debug "code_repeattest userd utime is #{tUsedtime}"
|
||||
render :json => resultObj
|
||||
end
|
||||
|
||||
#上次代码查重时间
|
||||
def last_codecomparetime
|
||||
resultObj = {status: 0}
|
||||
@homework = HomeworkCommon.find params[:homework]
|
||||
|
||||
#转换一下
|
||||
if @homework.simi_time != nil
|
||||
resultObj[:comparetime] = Time.parse(@homework.simi_time.to_s).strftime("%Y-%m-%d %H:%M:%S")
|
||||
else
|
||||
resultObj[:comparetime] = 0
|
||||
end
|
||||
|
||||
render :json => resultObj
|
||||
end
|
||||
|
||||
def index
|
||||
# 作业消息状态更新
|
||||
|
@ -499,8 +351,8 @@ class StudentWorkController < ApplicationController
|
|||
render_403
|
||||
return
|
||||
end
|
||||
@student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name).count end
|
||||
|
||||
end
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
@is_focus = params[:is_focus] ? params[:is_focus].to_i : 0
|
||||
# 消息传过来的ID
|
||||
|
|
|
@ -41,7 +41,7 @@ class UsersController < ApplicationController
|
|||
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
|
||||
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
|
||||
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course]
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist]
|
||||
before_filter :auth_user_extension, only: :show
|
||||
#before_filter :rest_user_score, only: :show
|
||||
#before_filter :select_entry, only: :user_projects
|
||||
|
@ -288,6 +288,27 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#处理引用作业的请求
|
||||
#status 1 同意 2 拒绝
|
||||
def dealwith_apply_homework
|
||||
@msg = CourseMessage.find(params[:msg_id])
|
||||
case params[:agree]
|
||||
when 'Y'
|
||||
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?",@msg.apply_user_id, @msg.course_message_id)
|
||||
unless ah.empty?
|
||||
ah.first.update_column('status', 2)
|
||||
CourseMessage.create(:user_id => @msg.apply_user_id, :course_id => @msg.course_id, :viewed => false,:content=> @msg.content,:course_message_id=>@msg.course_message_id,:content=>@msg.content,:course_message_type=>'HomeworkCommon',:status=>5,:apply_result=>1)
|
||||
@msg.update_attributes(:apply_result=>1,:viewed=>1)
|
||||
end
|
||||
when 'N'
|
||||
CourseMessage.create(:user_id => @msg.apply_user_id, :course_id => @msg.course_id, :viewed => false,:content=> @msg.content,:course_message_id=>@msg.course_message_id,:content=>@msg.content,:course_message_type=>'HomeworkCommon',:status=>5,:apply_result=>2)
|
||||
@msg.update_attributes(:apply_result=>2,:viewed=>1)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# added by bai
|
||||
def show_score
|
||||
|
||||
|
@ -372,13 +393,38 @@ class UsersController < ApplicationController
|
|||
end
|
||||
# end
|
||||
|
||||
#申请引用非公开作业
|
||||
def apply_for_homework
|
||||
if User.current.logged?
|
||||
homework = HomeworkCommon.find params[:homework_id]
|
||||
unless homework.nil?
|
||||
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:homework_id].to_i)
|
||||
if ah.empty?
|
||||
ApplyHomework.create(:user_id => params[:id].to_i, :homework_common_id => params[:homework_id].to_i, :status => 1)
|
||||
Mailer.run.apply_for_homework_request(homework, User.current)
|
||||
CourseMessage.create(:user_id => homework.user_id, :course_id => homework.course.id, :viewed => false,:course_message_id=>params[:homework_id].to_i,:course_message_type=>'HomeworkCommon',:status=>5,:apply_user_id=>params[:id].to_i)
|
||||
@state = 2
|
||||
@ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", params[:id].to_i, params[:homework_id].to_i).first
|
||||
@homework = homework
|
||||
else
|
||||
@state = 3
|
||||
end
|
||||
end
|
||||
else
|
||||
@state = 1
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#用户作业列表
|
||||
def user_homeworks
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@user = User.current
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
if(params[:type].blank? || params[:type] == "1") #公共题库
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
if(params[:type].blank? || params[:type] == "1") #题库
|
||||
visible_course = Course.where("is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #我的题库
|
||||
|
@ -424,6 +470,14 @@ class UsersController < ApplicationController
|
|||
|
||||
def choose_user_course
|
||||
homework = HomeworkCommon.find params[:send_id].to_i
|
||||
if homework.course.is_public == 0 && homework.user_id != User.current.id
|
||||
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i)
|
||||
if ah.empty?
|
||||
@status = 2
|
||||
elsif ah.first.status == 1
|
||||
@status = 1
|
||||
end
|
||||
end
|
||||
if !params[:search].nil?
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||
|
@ -528,12 +582,18 @@ class UsersController < ApplicationController
|
|||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
if(params[:type].blank? || params[:type] == "1") #公共题库
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
if(params[:type].blank? || params[:type] == "1") #题库
|
||||
visible_course = Course.where("is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #我的题库
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "3" #申请题库
|
||||
#apply_homeworks = ApplyHomework.where("user_id = ?",@user.id)
|
||||
#homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
|
||||
#@homeworks = HomeworkCommon.where("id in #{homework_ids}")
|
||||
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN apply_homeworks as ah ON homework_commons.id = ah.homework_common_id where ah.user_id = #{@user.id} order by ah.created_at desc"
|
||||
@homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
end
|
||||
if params[:property] && params[:property] == "1"
|
||||
@homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}")
|
||||
|
@ -571,8 +631,8 @@ class UsersController < ApplicationController
|
|||
@user = User.current
|
||||
search = params[:name].to_s.strip.downcase
|
||||
type_ids = params[:property]=="" || params[:property].nil? ? "(1, 2, 3)" : "(" + params[:property] + ")"
|
||||
if(params[:type].blank? || params[:type] == "1") #全部
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
if(params[:type].blank? || params[:type] == "1") #全部
|
||||
visible_course = Course.where("is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
all_homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'")
|
||||
all_user_ids = all_homeworks.map{|hw| hw.user_id}
|
||||
|
@ -586,7 +646,7 @@ class UsersController < ApplicationController
|
|||
else
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and homework_type in #{type_ids} and (name like '%#{search}%' or user_id in #{user_ids})").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
elsif params[:type] == "2" #课程资源
|
||||
elsif params[:type] == "2" #我的题库
|
||||
if @order == "course_name"
|
||||
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
|
||||
@homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
|
@ -595,6 +655,17 @@ class UsersController < ApplicationController
|
|||
else
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
elsif params[:type] == "3" #申请题库
|
||||
apply_homeworks = ApplyHomework.where("user_id = ?",@user.id)
|
||||
homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
|
||||
if @order == "course_name"
|
||||
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.id in #{homework_ids} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
|
||||
@homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
elsif @order == "user_name"
|
||||
@homeworks = HomeworkCommon.where("homework_commons.id in #{homework_ids} and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
|
||||
else
|
||||
@homeworks = HomeworkCommon.where("id in #{homework_ids} and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
end
|
||||
=begin
|
||||
if params[:property] && params[:property] == "1"
|
||||
|
@ -2857,6 +2928,97 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def user_courselist
|
||||
@order, @c_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
|
||||
|
||||
#确定 sort_type
|
||||
if @order.to_i == @type.to_i
|
||||
@c_sort = @c_sort.to_i == 1 ? 2 : 1 #1升序 2降序
|
||||
else
|
||||
@c_sort = 2
|
||||
end
|
||||
|
||||
sort_name = "created_at"
|
||||
sort_type = @c_sort == 1 ? "asc" : "desc"
|
||||
|
||||
if @user.courses.visible.count > 0
|
||||
course_order_ids = "(" + CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM(SELECT ca.course_id, MAX(ca.updated_at) AS updated_at FROM course_activities ca WHERE ca.course_id IN (" + @user.courses.visible.select('courses.id').map{|c| c.id}.join(',') + ") GROUP BY ca.course_id) AS c ").map {|c| c.course_id}.join(",") + ")"
|
||||
@courses = Course.where("id in #{course_order_ids}").order("#{sort_name} #{sort_type}")
|
||||
else
|
||||
@courses = []
|
||||
end
|
||||
|
||||
#根据 作业+资源数排序
|
||||
if @order.to_i == 2
|
||||
@type = 2
|
||||
@courses.each do |course|
|
||||
course[:infocount] = (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) ? (course.homework_commons.count + visable_attachemnts_incourse(course).count) : (course.homework_commons.where("publish_time <= '#{Date.today}'").count + visable_attachemnts_incourse(course).count)
|
||||
end
|
||||
@c_sort == 1 ? (@courses = @courses.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@courses = @courses.sort{|x,y| y[:infocount] <=> x[:infocount]})
|
||||
else
|
||||
@type = 1
|
||||
end
|
||||
|
||||
#分页
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@atta_count = @courses.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@courses = paginateHelper @courses,@limit
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
||||
def user_projectlist
|
||||
@order, @c_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
|
||||
|
||||
#确定 sort_type
|
||||
if @order.to_i == @type.to_i
|
||||
@c_sort = @c_sort.to_i == 1 ? 2 : 1 #1升序 2降序
|
||||
else
|
||||
@c_sort = 2
|
||||
end
|
||||
|
||||
sort_name = "created_on"
|
||||
sort_type = @c_sort == 1 ? "asc" : "desc"
|
||||
|
||||
if @user.projects.visible.count > 0
|
||||
project_order_ids = "(" +ForgeActivity.find_by_sql("SELECT p.project_id, p.created_at FROM (SELECT fa.project_id, MAX(fa.created_at) AS created_at FROM forge_activities fa WHERE fa.project_id IN (" + @user.projects.visible.select('projects.id').map{|p| p.id}.join(',') + ") GROUP BY fa.project_id) AS p ").map {|p| p.project_id}.join(",") + ")"
|
||||
@projects = Project.where("projects.id in #{project_order_ids}").order("#{sort_name} #{sort_type}")
|
||||
else
|
||||
@projects = []
|
||||
end
|
||||
|
||||
#根据 问题+资源数排序 @project.project_score.issue_num @project.project_score.attach_num
|
||||
if @order.to_i == 2
|
||||
@type = 2
|
||||
@projects.each do |project|
|
||||
project[:infocount] = project.project_score.issue_num+project.project_score.attach_num
|
||||
end
|
||||
|
||||
@c_sort == 1 ? (@projects = @projects.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@projects = @projects.sort{|x,y| y[:infocount] <=> x[:infocount] })
|
||||
else
|
||||
@type = 1
|
||||
end
|
||||
|
||||
#分页
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@atta_count = @projects.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@projects = paginateHelper @projects,@limit
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_user
|
||||
|
|
|
@ -3065,7 +3065,27 @@ def host_with_protocol
|
|||
return Setting.protocol + "://" + Setting.host_name
|
||||
end
|
||||
|
||||
def strip_html(text,len=0,endss="...")
|
||||
#将有置顶属性的提到数组前面 #infocount 相同的按时间降序排列
|
||||
def sort_by_sticky topics
|
||||
tmpTopics = []
|
||||
tmpIndex = 0
|
||||
topics.each do |topic|
|
||||
if topic.sticky == 1
|
||||
tmpTopics[tmpIndex] = topic
|
||||
tmpIndex = tmpIndex + 1
|
||||
end
|
||||
end
|
||||
|
||||
topics.each do |topic|
|
||||
if topic.sticky == 0
|
||||
tmpTopics[tmpIndex] = topic
|
||||
tmpIndex = tmpIndex + 1
|
||||
end
|
||||
end
|
||||
|
||||
topics = tmpTopics
|
||||
return topics
|
||||
enddef strip_html(text,len=0,endss="...")
|
||||
ss = ""
|
||||
if text.length>0
|
||||
ss=text.gsub(/<\/?.*?>/, '').strip
|
||||
|
@ -3078,5 +3098,4 @@ def strip_html(text,len=0,endss="...")
|
|||
end
|
||||
end
|
||||
return ss
|
||||
end
|
||||
|
||||
end
|
|
@ -5,17 +5,17 @@ module OrganizationsHelper
|
|||
|
||||
|
||||
def find_user_not_in_current_org_by_name org
|
||||
if params[:q] && params[:q].lstrip.rstrip != ""
|
||||
scope = Principal.active.sorted.not_member_of_org(org).like(params[:q])
|
||||
else
|
||||
scope = []
|
||||
end
|
||||
principals = paginateHelper scope,10
|
||||
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
|
||||
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
|
||||
link_to text, org_member_autocomplete_org_member_index_path( parameters.merge(:q => params[:q],:flag => true,:org=>org, :format => 'js')), :remote => true
|
||||
}
|
||||
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
|
||||
if params[:q] && params[:q].lstrip.rstrip != ""
|
||||
scope = Principal.active.sorted.not_member_of_org(org).like(params[:q])
|
||||
else
|
||||
scope = []
|
||||
end
|
||||
principals = paginateHelper scope,10
|
||||
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
|
||||
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
|
||||
link_to text, org_member_autocomplete_org_member_index_path( parameters.merge(:q => params[:q],:flag => true,:org=>org, :format => 'js')), :remote => true
|
||||
}
|
||||
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
|
||||
end
|
||||
|
||||
def get_default_name field
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
class ApplyHomework < ActiveRecord::Base
|
||||
#status:1. 待审核 2.审核通过
|
||||
belongs_to :user
|
||||
belongs_to :homework_common
|
||||
attr_accessible :status, :user_id, :homework_common_id
|
||||
end
|
|
@ -1,8 +1,9 @@
|
|||
class CourseMessage < ActiveRecord::Base
|
||||
# status说明: status在课程不同的类型,区分不同的功能 status = 9 作品的提交记录
|
||||
# HomeworkCommon:status:
|
||||
# nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败
|
||||
attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed, :content, :status
|
||||
# nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败; 5:申请引用作业
|
||||
# apply_user_id: 申请者的用户id
|
||||
attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed, :content, :status, :apply_user_id, :apply_result
|
||||
|
||||
# 多态 虚拟关联
|
||||
belongs_to :course_message ,:polymorphic => true
|
||||
|
|
|
@ -1041,7 +1041,13 @@ class Mailer < ActionMailer::Base
|
|||
:subject => @subject
|
||||
end
|
||||
|
||||
|
||||
def apply_for_homework_request(homework, user)
|
||||
@receive = User.find(homework.user_id)
|
||||
@user = user
|
||||
@subject = "#{@user.show_name} #{l(:label_apply_for_homework)} #{homework.name} "
|
||||
mail :to => @receive.mail,
|
||||
:subject => @subject
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -1,226 +1,78 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" >
|
||||
<div class="homepagePostBrief" onmouseover="$('#message_setting_<%=activity.id%>').show();" onmouseout="$('#message_setting_<%= activity.id%>').hide();">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<% if activity.author.id == User.current.id || User.current.admin? %>
|
||||
<div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
|
||||
:class => 'postOptionLink'
|
||||
) if User.current.admin? || User.current.id == activity.author.id %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'blog_comments',:action => 'destroy',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
|
||||
:method => :delete,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if User.current.admin? || User.current.id == activity.author.id %>
|
||||
</li>
|
||||
<li>
|
||||
<% if activity.id == activity.blog.homepage_id %>
|
||||
<%= link_to(
|
||||
l(:button_cancel_homepage),
|
||||
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
|
||||
:method => :post,
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == activity.blog.author_id %>
|
||||
<% else %>
|
||||
<%= link_to(
|
||||
l(:button_set_homepage),
|
||||
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
|
||||
:method => :post,
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == activity.blog.author_id %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
<div class = "cl"> </div>
|
||||
<div id="blog-list">
|
||||
<div class="listbox mt10" >
|
||||
<h2 class="list-h2">博客列表</h2>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'blogs', :action => 'index', :id =>@user, :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'blogs', :action => 'index', :id =>@user, :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'blogs', :action => 'index', :id =>@user, :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'blogs', :action => 'index', :id =>@user, :type => @type, :sort => @b_sort, :order => 2 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bloglistbox">
|
||||
<% topics.each do |activity| %>
|
||||
<ul class="list-file">
|
||||
<li><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%>
|
||||
<% end %>
|
||||
<% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
|
||||
<span class="c_red ml10 fr">[已设为首页]</span>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(activity.updated_on) %></span>
|
||||
<p class="list-info fr grayTxt">
|
||||
<span><%= count>0 ? "#{count}" :"0" %></span>
|
||||
<span>回复</span>
|
||||
<span>|</span>
|
||||
<span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" :"0" %></span>
|
||||
<span>赞</span>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%end%>
|
||||
<div class="homepagePostTo mt-4 fl">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.blog.name+" | 博客", user_blogs_path(:user_id=>activity.author_id,:host=>Setting.host_user), :class => "newsBlue ml15 mr5"%>
|
||||
<% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
|
||||
<span class="red_homework_btn_cir ml5">已设为首页</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostTitle hidden m_w530 fl">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey" %>
|
||||
<% else %>
|
||||
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if activity.sticky == 1%>
|
||||
<span class="sticky_btn_cir ml10">置顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked%>
|
||||
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostDate fl">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(activity.updated_on) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content= activity.content%>
|
||||
<% else %>
|
||||
<% content= activity.parent.content%>
|
||||
<% end %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<!--<div class=" fl" style="width: 600px">
|
||||
<%# if activity.attachments.any?%>
|
||||
<%# options = {:author => true, :deletable => false } %>
|
||||
<%#= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %>
|
||||
<%# end %>
|
||||
</div>
|
||||
<div class="cl"></div>-->
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
<%if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% activity= activity.parent ? activity.parent : activity%>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply|%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= reply.id %>">
|
||||
<%= reply.content.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if !activity.locked? %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'blog_comments',:action => 'reply', :id => activity.id, :blog_id => activity.blog.id, :user_id => activity.author_id},:method => "post",:remote=>true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="blog_comment[sticky]" value="0">
|
||||
<input type="hidden" name="blog_comment[locked]" value="0">
|
||||
<input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$("#moreProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#relatePWrap_<%=user_activity_id %>").css("height","auto");
|
||||
$(this).hide();
|
||||
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function() {
|
||||
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 10;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight) {
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".listbox").height() + diffHeight;
|
||||
$(".listbox").css("height", tmpHeight);
|
||||
}
|
||||
});
|
||||
$("#hideProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#moreProject_<%=user_activity_id %>").show();
|
||||
});
|
||||
</script>
|
||||
</script>
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
<div class="homepageRight mt0">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">
|
||||
<div class="f16 fl fontGrey3">
|
||||
<%= @user.name%>的博客
|
||||
</div>
|
||||
</div>
|
||||
|
@ -51,44 +51,9 @@
|
|||
<% end %>
|
||||
|
||||
<% if topics%>
|
||||
<% topics.each do |topic| %>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
sd_create_editor_from_data(<%= topic.id%>, null, "100%", "<%=topic.class.to_s%>");
|
||||
});
|
||||
</script>
|
||||
<% if topic %>
|
||||
<%= render :partial => 'blogs/article', :locals => {:activity => topic, :user_activity_id => topic.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%# if topics.count == 10 %>
|
||||
<!--<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%#= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>-->
|
||||
<%# end %>
|
||||
<%= render :partial => 'blogs/article', :locals => {:topics => topics} %>
|
||||
<% end%>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#show_more_course_topic").mouseover(function () {
|
||||
$("#more_topic_link").click();
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
|
||||
|
||||
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.updated_on desc"), :page => 0, :user => @user} %>
|
||||
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @topics, :page => 0, :user => @user} %>
|
||||
|
||||
|
||||
<script type="text/javascript">//侧导航
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#blog-list").replaceWith('<%= escape_javascript( render :partial => 'blogs/article', :locals => {:topics => @topics} ) %>');
|
|
@ -2,41 +2,7 @@
|
|||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
<%= javascript_include_tag "create_kindeditor" %>
|
||||
<% end %>
|
||||
<% if topics %>
|
||||
<% topics.each do |topic| %>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
sd_create_editor_from_data(<%= topic.id%>, null, "100%", "<%=topic.class.to_s%>");
|
||||
});
|
||||
</script>
|
||||
<% if topic %>
|
||||
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id, :is_course => 1, :is_board=>1} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if topics.count == 10 %>
|
||||
<%= link_to "点击展开更多",boards_topic_path(@board, :course_id => @board.course.id ,:page => page),:id => "show_more_course_topic",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<% if @topics || topics %>
|
||||
<%= render :partial => 'users/course_boardlist', :locals => {:topics => @topics ? @topics: topics , :is_course => 1, :is_board=>1} %>
|
||||
<% end %>
|
|
@ -2,60 +2,7 @@
|
|||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
<%= javascript_include_tag "create_kindeditor" %>
|
||||
<% end %>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
/*.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}*/
|
||||
/*.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-outline {border: none;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-inline-block {display: none;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-container {float: left;}*/
|
||||
</style>
|
||||
<% if topics%>
|
||||
<% topics.each do |topic| %>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
sd_create_editor_from_data(<%= topic.id%>, null, "100%");
|
||||
});
|
||||
</script>
|
||||
<% if topic %>
|
||||
<%= render :partial => 'users/project_message', :locals => {:activity => topic, :user_activity_id => topic.id,:is_course=>1,:is_board=>1} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if topics.count == 10 %>
|
||||
<!--<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%#= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>-->
|
||||
<%= link_to "点击展开更多", boards_topic_path(@board, :project_id => @board.project.id ,:page => page), :id => "show_more_project_topic",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript">
|
||||
$("#show_more_course_topic").mouseover(function () {
|
||||
$("#more_topic_link").click();
|
||||
});
|
||||
</script>-->
|
||||
<%if @topics || topics %>
|
||||
<%= render :partial => 'users/project_boardlist', :locals => {:topics => @topics ? @topics: topics , :is_course => 1, :is_board=>1} %>
|
||||
<% end %>
|
|
@ -1,5 +1,5 @@
|
|||
<% if @course %>
|
||||
$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show_detail',:locals => {:topics => @topics, :page => @page} )%>");
|
||||
$("#course-boardlist").replaceWith('<%= escape_javascript( render :partial => 'users/course_boardlist', :locals => {:topics => @topics, :is_course => 1, :is_board=>1}) %>');
|
||||
<% else %>
|
||||
$("#show_more_project_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/project_show_detail',:locals => {:topics => @topics, :page => @page} )%>");
|
||||
$("#project-boardlist").replaceWith('<%= escape_javascript( render :partial => 'users/project_boardlist', :locals => {:topics => @topics, :is_course => 1, :is_board=>1}) %>');
|
||||
<% end %>
|
|
@ -7,7 +7,15 @@
|
|||
<%= link_to image_tag(url_to_avatar(topic.author), :width => 50,:height => 50,:alt => '贴吧图片'), user_path(topic.author) if topic.author%>
|
||||
</div>
|
||||
<div class="postDetailWrap">
|
||||
<div class="postDetailTitle"><a href="<%= forum_memo_path(topic.forum, topic) %>" class="f14 linkGrey4 fb"><%=topic.subject%></a></div>
|
||||
<div class="postDetailTitle fl">
|
||||
<a href="<%= forum_memo_path(topic.forum, topic) %>" class="f14 linkGrey4 fb"><%=topic.subject%></a>
|
||||
</div>
|
||||
<div class="postDetailReply fr">
|
||||
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
|
||||
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10 mt20" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
|
||||
</div>
|
||||
|
||||
<div class="postDetailDes"><%= topic.content.html_safe%>
|
||||
<!--<a href="javascript:void(0);" class="linkBlue2 underline ml8">显示全部</a>-->
|
||||
</div>
|
||||
|
@ -16,12 +24,7 @@
|
|||
<div class="postDetailCreater">最后回复:<a href="<%= user_path(author) %>" class="linkBlue2" target="_blank"><%= author.name%></a></div>
|
||||
<div class="postDetailDate"><%= format_date(topic.last_reply.created_at)%></div>
|
||||
<% end%>
|
||||
<span class=" fr" style="color: #888888; font-size: 12px;">更新时间:<%= format_date(topic.updated_at)%></span>
|
||||
</div>
|
||||
<div class="postDetailReply">
|
||||
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
|
||||
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10 mt20" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
|
||||
<span class=" fr " style="color: #888888; font-size: 12px;">更新时间:<%= format_date(topic.updated_at)%></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -81,4 +81,14 @@
|
|||
<input type="hidden" value="<%= page%>" id="course_page_num">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_course('<%= user_courses4show_user_path(user.id)%>');"></a>
|
||||
</li>
|
||||
<% end%>
|
||||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var coursecount = <%= @user.courses.visible.count%>;
|
||||
var courseshowcount = document.getElementsByClassName("coursesLineGrey").length;
|
||||
|
||||
if((coursecount == courseshowcount)&&(coursecount > 5) ){
|
||||
$("#user_show_more_course").hide();
|
||||
$('#user_hide_course').show();
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% projects.each do |project|%>
|
||||
<li class="homepageLeftMenuCoursesLine pr">
|
||||
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "projectsLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
<li>
|
||||
<ul class="subNavMenu boxShadow">
|
||||
|
@ -61,4 +61,14 @@
|
|||
<input type="hidden" value="<%= page%>" id="project_page_num">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_project('<%= user_projects4show_user_path(user.id)%>');"></a>
|
||||
</li>
|
||||
<% end%>
|
||||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var projectcount = <%= @user.projects.visible.count%>;
|
||||
var projectshowcount = document.getElementsByClassName("projectsLineGrey").length;
|
||||
|
||||
if((projectcount == projectshowcount)&&(projectcount > 5)){
|
||||
$("#user_show_more_project").hide();
|
||||
$('#user_hide_project').show();
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -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>
|
||||
|
|
@ -105,13 +105,13 @@
|
|||
<div class="homepagePortraitImage fl" id="homepage_portrait_image">
|
||||
<%= image_tag(url_to_avatar(@user),width:"78", height: "78", :id=>'nh_user_tx') %>
|
||||
<% if User.current.logged?%>
|
||||
<% if is_current_user%>
|
||||
<div id="edit_user_file_btn" class="none">
|
||||
<div class="homepageEditProfile">
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if is_current_user%>
|
||||
<div id="edit_user_file_btn" class="none">
|
||||
<div class="homepageEditProfile">
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="fl ml10">
|
||||
|
@ -185,81 +185,91 @@
|
|||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
||||
<% if is_current_user%>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<div class="courseMenu" id="courseMenu">
|
||||
<ul>
|
||||
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
|
||||
<ul class="topnav_course_menu" id="topnav_course_menu">
|
||||
<li>
|
||||
<%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
|
||||
</li>
|
||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||
<li>
|
||||
<%= link_to "加入课程",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
|
||||
<% hidden_courses = Setting.find_by_name("hidden_courses") %>
|
||||
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
|
||||
<% if !unvisiable %>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :class => "homepageMenuText" %>
|
||||
|
||||
<% if is_current_user%>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<div class="courseMenu" id="courseMenu">
|
||||
<ul>
|
||||
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
|
||||
<ul class="topnav_course_menu" id="topnav_course_menu">
|
||||
<li>
|
||||
<%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
|
||||
</li>
|
||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||
<li>
|
||||
<%= link_to "加入课程",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% else%>
|
||||
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入课程"%>
|
||||
</div>
|
||||
<% else%>
|
||||
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入课程"%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%# if @user.courses.visible.count > 0
|
||||
course_order_ids = "(" +
|
||||
CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM
|
||||
course_order_ids = "(" +
|
||||
CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM
|
||||
(SELECT ca.course_id, MAX(ca.updated_at) AS updated_at FROM course_activities ca WHERE ca.course_id IN (" + @user.courses.visible.select('courses.id').map{|c| c.id}.join(',') + ")
|
||||
GROUP BY ca.course_id) AS c
|
||||
ORDER BY c.updated_at DESC limit 5").map {|c| c.course_id}.join(",") + ")"
|
||||
courses = Course.where("id in #{course_order_ids}")
|
||||
else
|
||||
courses = Course.where("id in #{course_order_ids}")
|
||||
else
|
||||
courses = []
|
||||
|
||||
end
|
||||
end
|
||||
%>
|
||||
<% if @user.courses.visible.count > 0
|
||||
courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)
|
||||
else
|
||||
courses = []
|
||||
end %>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
|
||||
<ul id="user_layout_courses">
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||
</ul>
|
||||
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
|
||||
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" >
|
||||
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !courses.empty? %>
|
||||
<div class="homepageLeftMenuMore" id="user_hide_course">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuHideIcon" id="hide_show_courseicon" onclick="leftCourseslistChange();"></a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
|
||||
|
||||
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => "homepageMenuText" %>
|
||||
<% if is_current_user%>
|
||||
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<%# if @user.projects.visible.count > 0
|
||||
project_order_ids = "(" +
|
||||
ForgeActivity.find_by_sql("SELECT p.project_id, p.updated_at FROM
|
||||
(SELECT fa.project_id, MAX(fa.updated_at) AS updated_at FROM forge_activities fa WHERE fa.project_id IN (" + @user.projects.visible.select('projects.id').map{|p| p.id}.join(',') + ")
|
||||
project_order_ids = "(" +
|
||||
ForgeActivity.find_by_sql("SELECT p.project_id, p.created_at FROM
|
||||
(SELECT fa.project_id, MAX(fa.created_at) AS created_at FROM forge_activities fa WHERE fa.project_id IN (" + @user.projects.visible.select('projects.id').map{|p| p.id}.join(',') + ")
|
||||
GROUP BY fa.project_id) AS p
|
||||
ORDER BY p.updated_at DESC limit 5").map {|p| p.project_id}.join(",") + ")"
|
||||
projects = Project.where("projects.id in #{project_order_ids}")
|
||||
else
|
||||
projects = []
|
||||
end
|
||||
%>
|
||||
|
||||
<% if @user.projects.visible.count > 0
|
||||
projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)
|
||||
ORDER BY p.created_at DESC limit 5").map {|p| p.project_id}.join(",") + ")"
|
||||
projects = Project.where("projects.id in #{project_order_ids}")
|
||||
else
|
||||
projects = []
|
||||
end
|
||||
%>
|
||||
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" id="homepageLeftMenuForge">
|
||||
<ul id="user_layout_projects">
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
|
||||
</ul>
|
||||
|
||||
<% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" >
|
||||
<div class = "leftProjecsList" id="homepageLeftMenuForge">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !projects.empty? %>
|
||||
<div class="homepageLeftMenuMore" id="user_hide_project">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuHideIcon" id="hide_show_projecticon" onclick="leftProjectslistChange();"></a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText">留言</a>-->
|
||||
|
@ -343,6 +353,22 @@
|
|||
$("#courseMenu").mouseleave(function(){
|
||||
$("#topnav_course_menu").hide();
|
||||
});
|
||||
|
||||
$('#user_hide_course').hide();
|
||||
function leftCourseslistChange(){
|
||||
$('#homepageLeftMenuCourses').slideToggle();
|
||||
$('#hide_show_courseicon').toggleClass("homepageLeftMenuHideIcon");
|
||||
$('#hide_show_courseicon').toggleClass("homepageLeftMenuMoreIcon");
|
||||
|
||||
}
|
||||
|
||||
$('#user_hide_project').hide();
|
||||
function leftProjectslistChange(){
|
||||
$('#homepageLeftMenuForge').slideToggle();
|
||||
$('#hide_show_projecticon').toggleClass("homepageLeftMenuHideIcon");
|
||||
$('#hide_show_projecticon').toggleClass("homepageLeftMenuMoreIcon");
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -4,41 +4,6 @@
|
|||
<% end %>
|
||||
|
||||
<% if newss%>
|
||||
<% newss.each do |news| %>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
sd_create_editor_from_data(<%= news.id%>, null, "100%");
|
||||
showNormalImage('activity_description_<%= news.id %>');
|
||||
});
|
||||
</script>
|
||||
<% if news %>
|
||||
<%= render :partial => 'users/course_news', :locals => {:activity => news, :user_activity_id => news.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if newss.count == 10 %>
|
||||
<%= link_to "点击展开更多",news_index_path(:course_id => @course.id ,:page => page),:id => "show_more_course_news",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end %>
|
||||
<%= render :partial => 'users/course_newslist', :locals => {:topics => newss} %>
|
||||
<% end%>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% if @project %>
|
||||
$("#show_more_project_news").replaceWith("<%= escape_javascript(render :partial => 'project_news_detail', :locals=>{ :all_news=>@newss,:page => @page})%>");
|
||||
<% else %>
|
||||
$("#show_more_course_news").replaceWith("<%= escape_javascript( render :partial => 'course_news_detail', :locals =>{:newss => @newss, :page => @page} )%>");
|
||||
$("#course-newslist").replaceWith('<%= escape_javascript( render :partial => 'users/course_newslist', :locals => {:topics => @newss}) %>');
|
||||
<% end %>
|
|
@ -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>
|
|
@ -24,7 +24,7 @@
|
|||
<li class="orgListStatus">默认</li>
|
||||
<li class="orgListStatusList">
|
||||
<% if field.name == "activity" %>
|
||||
默认
|
||||
默认
|
||||
<% 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>
|
||||
|
@ -60,18 +60,18 @@
|
|||
<li class="orgListStatus">新增</li>
|
||||
<li class="orgListStatusList">
|
||||
<% if field.field_type == "Resource" %>
|
||||
列表
|
||||
列表
|
||||
<% 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>
|
||||
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
|
||||
</div>
|
||||
<%= select( :name,:group_id, subfield_status_option,
|
||||
{ :include_blank => false,:selected => field.status},
|
||||
{:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %>
|
||||
<% end %>
|
||||
<%= 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>
|
||||
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
|
||||
</div>
|
||||
<%= select( :name,:group_id, subfield_status_option,
|
||||
{ :include_blank => false,:selected => field.status},
|
||||
{:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
|
||||
<li class="orgListUser hidden">
|
||||
|
@ -158,9 +158,9 @@
|
|||
$(edit_id).toggle();
|
||||
$(edit_id).find('input').focus();
|
||||
$(edit_id).find('input').on('keypress', function(e){
|
||||
if (e.keyCode == 13){
|
||||
this.blur();
|
||||
}
|
||||
if (e.keyCode == 13){
|
||||
this.blur();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -1,5 +1,6 @@
|
|||
<h3 style="float: left;"><%=l(:label_settings)%></h3>
|
||||
<%= link_to @text,settings_hidden_non_project_path,:id => "hidden_non_project",:style => "float: right;margin-right: 60px;margin-top: 9px;"%>
|
||||
<!--<%= link_to @text_1,settings_hidden_courses_path,:id => "hidden_courses",:style => "float: right;margin-right: 60px;margin-top: 9px;"%>-->
|
||||
<div class="clear"></div>
|
||||
|
||||
<%= render_tabs administration_settings_tabs %>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<% if @notifiable.value == "0"%>
|
||||
$("#hidden_courses").replaceWith("<%= escape_javascript(link_to '隐藏课程信息',settings_hidden_courses_path,:id => 'hidden_courses',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
|
||||
<% else%>
|
||||
$("#hidden_courses").replaceWith("<%= escape_javascript(link_to '显示课程信息',settings_hidden_courses_path,:id => 'hidden_courses',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
|
||||
<% end%>
|
|
@ -0,0 +1,80 @@
|
|||
<div class = "cl"> </div>
|
||||
<div id="course-boardlist">
|
||||
<div class="listbox mt10" >
|
||||
<h2 class="list-h2">问答区列表</h2>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bloglistbox">
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54} %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function(){
|
||||
var leftHeight = $("#LSide").height()-$(".fontGrey5").height()-20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight){
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".listbox").height()+diffHeight;
|
||||
$(".listbox").css("height",tmpHeight);
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -89,7 +89,7 @@
|
|||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">?</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
|
@ -174,5 +174,4 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,64 @@
|
|||
<div class = "cl"> </div>
|
||||
<div id="course-newslist">
|
||||
<div class="listbox mt10" >
|
||||
<h2 class="list-h2">通知列表</h2>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bloglistbox">
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<%= link_to activity.title.to_s, news_path(activity), :class => "list-title fl" %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54} %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发布时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% count=activity.comments.count %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function(){
|
||||
var leftHeight = $("#LSide").height()-$(".fontGrey5").height()-20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight){
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".listbox").height()+diffHeight;
|
||||
$(".listbox").css("height",tmpHeight);
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -19,7 +19,9 @@
|
|||
<input type="radio" name="checkMenu" class="mr5 subject-name-middle" value="<%= homework.id%>"/>
|
||||
<span title="<%= homework.name%>" class="subject-name-middle subject-name-hidden"><%= homework.name%></span>
|
||||
</label>
|
||||
<img src="/images/locked.png" width="16" height="16" alt="私有" title="私有" class="subject-name-middle" />
|
||||
<% if homework.course.is_public == 0 %>
|
||||
<img src="/images/locked.png" width="16" height="16" alt="私有" title="私有" class="subject-name-middle" />
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="subject-list-from fl hidden"><span title="<%=homework.course.name %>(<%=current_time_and_term(homework.course) %>)"><%=homework.course.name %>(<%=current_time_and_term_short(homework.course) %>)</span></li>
|
||||
<li class="subject-list-type fl">
|
||||
|
@ -35,7 +37,20 @@
|
|||
<li class="subject-list-publisher fl hidden"><%= homework.user.show_name %></li>
|
||||
<li class="subject-list-count fl" id="subject_count_homework_<%=homework.id %>"><%= homework.quotes %></li>
|
||||
<li class="fl subject-list-date"><%=format_date homework.publish_time %></li>
|
||||
<li class="fl subject-list-option"><a href="javascript:void(0);">提交申请</a></li>
|
||||
<% if homework.course.is_public == 0 && homework.user_id != User.current.id %>
|
||||
<li class="fl subject-list-option" id="homework_apply_status_<%=homework.id %>">
|
||||
<% ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, homework.id).first %>
|
||||
<% if ah.nil? %>
|
||||
<%= link_to("提交申请", apply_for_homework_user_path(User.current.id,:homework_id => homework.id), :remote => true) %>
|
||||
<% elsif ah.status == 1 %>
|
||||
待审核
|
||||
<% elsif ah.status == 2 %>
|
||||
可引用
|
||||
<% end %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="fl subject-list-option" id="homework_apply_status_<%=homework.id %>"><a href="javascript:void(0);">--</a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<div class="homepagePostIntro break_word upload_img list_style table_maxWidth lh18" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= content.to_s.html_safe%>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$("#intro_content_<%= user_activity_id%>").hide();
|
||||
$(function() {
|
||||
var heightType = <%= maxheight %>;
|
||||
|
||||
if (heightType > 0) {
|
||||
$("#activity_description_<%= user_activity_id%>").css("max-height", heightType + "px");
|
||||
}
|
||||
|
||||
description_showwords_ellipsis(<%=user_activity_id %>);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,80 @@
|
|||
<div class = "cl"> </div>
|
||||
<div id="project-boardlist">
|
||||
<div class="listbox mt10" >
|
||||
<h2 class="list-h2">讨论区列表</h2>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bloglistbox">
|
||||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54 } %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %></span>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function() {
|
||||
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight) {
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".listbox").height() + diffHeight;
|
||||
$(".listbox").css("height", tmpHeight);
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -65,7 +65,11 @@
|
|||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%# cache (act) do %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:course_activity => 0} %>
|
||||
<% hidden_courses = Setting.find_by_name("hidden_courses") %>
|
||||
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
|
||||
<% if !unvisiable %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:course_activity => 0} %>
|
||||
<% end %>
|
||||
<%# end %>
|
||||
<% when 'News' %>
|
||||
<%# cache [act, act.comments.count] do %>
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
<div class="listbox" id="course-list">
|
||||
<h2 class="list-h2">课程列表</h2>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="bloglistbox">
|
||||
<% @courses.each do |course|%>
|
||||
<ul class="list-file">
|
||||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% teacher = User.where("id=?",course.tea_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
||||
</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">
|
||||
创建时间:<%= format_time(course.created_at) %>
|
||||
</span>
|
||||
<span class="grayTxt">
|
||||
开课学期: <span><%= current_time_and_term course %></span>
|
||||
</span>
|
||||
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<% homework_num = course.homework_commons.count %>
|
||||
<% else %>
|
||||
<% homework_num = course.homework_commons.where("publish_time <= '#{Date.today}'").count %>
|
||||
<% end %>
|
||||
<p class="list-info fr grayTxt"><span><%= homework_num %></span><span>作业</span><span>|</span><span> <%= visable_attachemnts_incourse(course).count %></span><span>资源</span></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function() {
|
||||
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight) {
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".listbox").height() + diffHeight;
|
||||
$(".listbox").css("height", tmpHeight);
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -229,7 +229,36 @@
|
|||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的引用作业申请:</span>
|
||||
</li>
|
||||
<li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<span title="<%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"" %>" class ='#{ma.viewed==0 ? "newsBlack" : "newsGrey"}'><%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"" %></span>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="homepageHomeworkContentWarn fl">
|
||||
<span id="deal_info_<%=ma.id%>">
|
||||
<% if ma.apply_result == 0 || ma.apply_result.nil?%>
|
||||
<%= link_to '同意',dealwith_apply_homework_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true'%>
|
||||
|
|
||||
<%= link_to '拒绝',dealwith_apply_homework_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true'%>
|
||||
<% elsif ma.apply_result == 1%> <!-- 同意 -->
|
||||
您已经同意了该申请
|
||||
<% elsif ma.apply_result == 2%> <!-- 拒绝 -->
|
||||
您已经拒绝了该申请
|
||||
<%end %>
|
||||
</span>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "Poll" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<div class="listbox" id="project-list">
|
||||
<h2 class="list-h2">项目列表</h2>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="bloglistbox">
|
||||
<% @projects.each do |project|%>
|
||||
<ul class="list-file">
|
||||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<% projectUser = User.where("id=?",project.user_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='创建者:'+(projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)) %>
|
||||
</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">创建时间:<%= format_time(project.created_on) %></span>
|
||||
<p class="list-info fr grayTxt"><span><%= project.project_score.issue_num %></span><span>问题</span><span>|</span><span> <%= project.project_score.attach_num %></span><span>资源</span></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function() {
|
||||
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight) {
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".listbox").height() + diffHeight;
|
||||
$(".listbox").css("height", tmpHeight);
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,8 @@
|
|||
<% if @state == 1 %>
|
||||
alert("您还未登录");
|
||||
<% elsif @state == 2 %>
|
||||
alert("申请成功,请等待审核");
|
||||
$("#homework_apply_status_<%=@homework.id %>").html("待审核");
|
||||
<% elsif @state == 3 %>
|
||||
alert("您已经发送过申请了,请耐心等待");
|
||||
<% end %>
|
|
@ -1,11 +1,17 @@
|
|||
<% if params[:is_observe].nil? %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
<% if @status == 1 %>
|
||||
alert("您的申请尚未通过审核,暂时不可发送至课程");
|
||||
<% elsif @status == 2 %>
|
||||
alert("该作业是私有的,请先提交申请并通过审核后再发送");
|
||||
<% else %>
|
||||
$("#send_homework_to_course_form").html("<%= escape_javascript(render :partial => 'users/send_homework_to_course_form', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>");
|
||||
<% if params[:is_observe].nil? %>
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
<% else %>
|
||||
$("#send_homework_to_course_form").html("<%= escape_javascript(render :partial => 'users/send_homework_to_course_form', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,11 @@
|
|||
$("#deal_info_<%=@msg.id%>").html(
|
||||
<% if @msg.apply_result == 0 || @msg.apply_result.nil?%>
|
||||
<%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>@msg.id),:remote=>'true'%>
|
||||
'|'
|
||||
<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>@msg.id),:remote=>'true'%>
|
||||
<% elsif @msg.apply_result == 1%>
|
||||
'您已经同意了该申请'
|
||||
<% elsif @msg.apply_result == 2%>
|
||||
'您已经拒绝了该申请'
|
||||
<%end %>
|
||||
);
|
|
@ -5,20 +5,24 @@
|
|||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="homepagePostType">
|
||||
<li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<li class="f14">课程动态</li>
|
||||
<li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
||||
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
|
||||
<li><%= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
||||
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<li><%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
|
||||
<li><%= link_to "课程留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<% hidden_courses = Setting.find_by_name("hidden_courses") %>
|
||||
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
|
||||
<% if !unvisiable %>
|
||||
<li class="f14">课程动态</li>
|
||||
<li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
||||
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
|
||||
<li><%= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
||||
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||
<li><%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
|
||||
<li><%= link_to "课程留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">项目动态</li>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<%= render :partial => 'users/user_course_list'%>
|
|
@ -0,0 +1 @@
|
|||
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_course_list') %>');
|
|
@ -36,13 +36,13 @@
|
|||
<div class="resource-wrapper">
|
||||
<ul class="resource-banner">
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">公共题库</a>
|
||||
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">题库</a>
|
||||
</li>
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 0) %>" id="user_homeworks_choose" class="resource-tab" data-remote="true">我的题库</a>
|
||||
</li>
|
||||
<li class="fl resource-switch">
|
||||
<a href="javascript:void(0);" class="resource-tab" data-remote="true">申请题库</a>
|
||||
<a href="<%= user_homework_type_user_path(@user,:type=>'3',:is_import => 0) %>" id="apply_homeworks_choose" class="resource-tab" data-remote="true">申请题库</a>
|
||||
</li>
|
||||
<li class="fl w680 border-bottom h34"> </li>
|
||||
<li class="fr resource-banner-li border-bottom h34">
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<%= render :partial => 'users/user_project_list'%>
|
|
@ -0,0 +1 @@
|
|||
$("#project-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_project_list') %>');
|
|
@ -28,6 +28,7 @@ zh:
|
|||
label_course_file: 资源库
|
||||
label_upload_files: 上传资源
|
||||
label_apply_join_course: 申请加入课程
|
||||
label_apply_for_homework: 申请引用作业
|
||||
#
|
||||
# 课程托管平台主页
|
||||
#
|
||||
|
|
|
@ -371,8 +371,8 @@ zh:
|
|||
permission_contest_attachments_download: 竞赛附件下载
|
||||
permission_upload_attachments: 资源上传
|
||||
|
||||
|
||||
|
||||
label_show_courses: 显示课程信息
|
||||
label_hidden_courses: 隐藏课程信息
|
||||
|
||||
label_user: 用户
|
||||
label_user_plural: 用户列表
|
||||
|
@ -2143,4 +2143,3 @@ zh:
|
|||
label_new_notice_template: 您的课程有新通知了
|
||||
#edit yk
|
||||
label_code_work_tests: 代码测试列表
|
||||
|
||||
|
|
|
@ -521,6 +521,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'user_project_activities', :to => 'users#user_project_activities', :via => :get
|
||||
match 'user_feedback4show', :to => 'users#user_feedback4show', :via => :get
|
||||
match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get
|
||||
match 'apply_for_homework', :to => 'users#apply_for_homework', :via => :get
|
||||
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
|
||||
match 'student_homeworks', :to => 'users#student_homeworks', :via => :get
|
||||
get 'user_import_homeworks'
|
||||
|
@ -552,6 +553,11 @@ RedmineApp::Application.routes.draw do
|
|||
match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post]
|
||||
match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post]
|
||||
match 'user_act_issue_assign_to', :to => 'users#user_act_issue_assign_to', :via => [:get, :post]
|
||||
|
||||
#addby yk
|
||||
match 'user_courselist', :to => 'users#user_courselist', :via => :get, :as => "user_courselist"
|
||||
match 'user_projectlist', :to => 'users#user_projectlist', :via => :get, :as => "user_projectlist"
|
||||
|
||||
get 'edit_brief_introduction'
|
||||
get "user_resource"
|
||||
get "import_resources"
|
||||
|
@ -578,6 +584,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'user_ref_resource_search'
|
||||
post 'import_resources_to_homework'
|
||||
get 'dealwith_apply_request'
|
||||
get 'dealwith_apply_homework'
|
||||
get 'store_selected_resource'
|
||||
get 'user_organizations'
|
||||
get 'search_user_orgs'
|
||||
|
@ -1088,6 +1095,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'settings/edit', :via => [:get, :post]
|
||||
match 'settings/plugin/:id', :to => 'settings#plugin', :via => [:get, :post], :as => 'plugin_settings'
|
||||
match 'settings/hidden_non_project', :via => [:get, :post]
|
||||
match 'settings/hidden_courses', :via => [:get, :post]
|
||||
|
||||
match 'sys/projects', :via => :get
|
||||
match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
|
||||
|
|
|
@ -267,6 +267,8 @@ please_chose:
|
|||
default: 请选择
|
||||
hidden_non_project:
|
||||
default: 1
|
||||
hidden_courses:
|
||||
default: 0
|
||||
plugin_redmine_ckeditor:
|
||||
serialized: true
|
||||
default: --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
class CreateApplyHomeworks < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :apply_homeworks do |t|
|
||||
t.integer :status
|
||||
t.references :user
|
||||
t.references :homework_common
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
add_index :apply_homeworks, :user_id
|
||||
add_index :apply_homeworks, :homework_common_id
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
class AddColumnToCourseMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :course_messages, :apply_user_id, :integer
|
||||
add_column :course_messages, :apply_result, :integer
|
||||
end
|
||||
end
|
1814
db/schema.rb
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 |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 272 KiB |
After Width: | Height: | Size: 19 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 |