Merge branch 'yuanke' into develop

Conflicts:
	app/views/layouts/new_base_user.html.erb
	config/locales/zh.yml
	db/schema.rb
This commit is contained in:
yuanke 2016-04-28 10:45:57 +08:00
commit 647e6a7f92
95 changed files with 5389 additions and 533 deletions

View File

@ -1,9 +1,45 @@
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
@b_sort == 1 ? @topics = @topics.sort{|x,y| get_praise_num(x) + (x.parent ? x.parent.children.count : x.children.count) <=> get_praise_num(y) + (y.parent ? y.parent.children.count : y.children.count) } : @topics = @topics.sort{|x,y| get_praise_num(y) + (y.parent ? y.parent.children.count : y.children.count) <=> get_praise_num(x) + (x.parent ? x.parent.children.count : x.children.count) }
@topics = @topics.sort{|x,y| y.sticky <=> x.sticky}
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

View File

@ -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,10 +94,10 @@ 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
@ -93,52 +105,71 @@ class BoardsController < ApplicationController
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
@b_sort == 1 ? @topics = @topics.sort{|x,y| get_praise_num(x) + (x.parent ? x.parent.children.count : x.children.count) <=> get_praise_num(y) + (y.parent ? y.parent.children.count : y.children.count) } : @topics = @topics.sort{|x,y| get_praise_num(y) + (y.parent ? y.parent.children.count : y.children.count) <=> get_praise_num(x) + (x.parent ? x.parent.children.count : x.children.count) }
@topics = @topics.sort{|x,y| y.sticky <=> x.sticky}
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
@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

View File

@ -113,7 +113,7 @@ class OrganizationsController < ApplicationController
#@project_acts_issues = get_project_activities_org @organization
#@course_acts = get_course_activities_org @organization
render :layout => 'base_org_newstyle'
render :layout => 'base_org2'
else
render_403
end

View File

@ -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

View File

@ -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
@ -2857,6 +2857,93 @@ 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 = "updated_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
@c_sort == 1 ? (@projects = @projects.sort{|x,y| x.project_score.issue_num+x.project_score.attach_num <=> y.project_score.issue_num+y.project_score.attach_num }) : (@projects = @projects.sort{|x,y| y.project_score.issue_num+y.project_score.attach_num <=> x.project_score.issue_num+x.project_score.attach_num })
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

View File

@ -63,14 +63,67 @@ module OrganizationsHelper
def subfield_status_option
type = []
option1 = []
option1 << "列表"
option1 << "左上"
option1 << "1"
type << option1
option2 = []
option2 << "图片"
option2 << "0"
option2 << "中一"
option2 << "2"
type << option2
option3 = []
option3 << "中二"
option3 << "3"
type << option3
option4 = []
option4 << "中下"
option4 << "4"
type << option4
option5 = []
option5 << "左下"
option5 << "5"
type << option5
option6 = []
option6 << "右上"
option6 << "6"
type << option6
option7 = []
option7 << "右中"
option7 << "7"
type << option7
option8 = []
option8 << "右下"
option8 << "8"
type << option8
type
end
def subfield_list_type subfield
case subfield.to_i
when 1
resulet = "左上"
when 2
resulet = "中一"
when 3
resulet = "中二"
when 4
resulet = "中下"
when 5
resulet = "左下"
when 6
resulet = "右上"
when 7
resulet = "右中"
when 8
resulet = "右下"
end
end
def get_subfield_acts field
org_subfield = OrgSubfield.find(field.id)
org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0
org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc')
org_acts
end
end

View File

@ -1,226 +1,76 @@
<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="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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();
});
$("#hideProject_<%=user_activity_id %>").click(function(){
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#moreProject_<%=user_activity_id %>").show();
});
</script>
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
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);
}
</script>

View File

@ -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();

View File

@ -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">//侧导航

View File

@ -0,0 +1 @@
$("#blog-list").replaceWith('<%= escape_javascript( render :partial => 'blogs/article', :locals => {:topics => @topics} ) %>');

View File

@ -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 %>

View File

@ -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 %>

View File

@ -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 %>

View File

@ -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">

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>
<%# if @user.courses.visible.count > 0
course_order_ids = "(" +
CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM
</div>
<% end %>
<% 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
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(',') + ")
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)
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.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(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" >
<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>

View File

@ -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=" " >登录&nbsp;&nbsp;|&nbsp;</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>&nbsp;&nbsp;|&nbsp;&nbsp;
<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>

View File

@ -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">&lt;</div>
<div class="partner-next partner-btn fl" id="RightArr">&gt;</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">&lt;</div>
<div class="partner-next partner-btn fl" id="RightArr">&gt;</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 %>

View File

@ -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 %>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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 %>

View File

@ -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 %>

View File

@ -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>

View File

@ -27,7 +27,7 @@
默认
<% else %>
<%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>
<div class="update_status_class"><span class="hidden"><%=field.status== 1 ? "列表" : "图片" %></span>
<div class="update_status_class"><span class="hidden"><%= subfield_list_type(field.status) %></span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
</div>
<%= select( :name,:group_id, subfield_status_option,
@ -63,7 +63,7 @@
列表
<% else %>
<%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>
<div class="update_status_class"><span class="hidden"><%=field.status== 1 ? "列表" : "图片" %></span>
<div class="update_status_class"><span class="hidden"><%= subfield_list_type(field.status) %></span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2"></a>
</div>
<%= select( :name,:group_id, subfield_status_option,

View File

@ -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>

View File

@ -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 %>

View File

@ -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%>

View File

@ -0,0 +1,78 @@
<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}" : "" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></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">
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
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>

View File

@ -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>

View File

@ -0,0 +1,24 @@
<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">
$(function(){
var heightType = <%= maxheight %>;
if (heightType > 0){
$("#activity_description_<%= user_activity_id%>").css("max-height",heightType+"px");
}
$("#intro_content_<%= user_activity_id%> p,#intro_content_<%= user_activity_id%> span,#intro_content_<%= user_activity_id%> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
description_show_hide(<%=user_activity_id %>);
});
</script>

View File

@ -0,0 +1,78 @@
<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">
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
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>

View File

@ -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 %>

View File

@ -0,0 +1,61 @@
<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 => "course-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">
开课学期:&nbsp;&nbsp;<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">
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
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>

View File

@ -0,0 +1,53 @@
<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 => "course-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">
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
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>

View File

@ -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>

View File

@ -0,0 +1 @@
<%= render :partial => 'users/user_course_list'%>

View File

@ -0,0 +1 @@
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_course_list') %>');

View File

@ -0,0 +1 @@
<%= render :partial => 'users/user_project_list'%>

View File

@ -0,0 +1 @@
$("#project-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_project_list') %>');

View File

@ -371,8 +371,8 @@ zh:
permission_contest_attachments_download: 竞赛附件下载
permission_upload_attachments: 资源上传
label_show_courses: 显示课程信息
label_hidden_courses: 隐藏课程信息
label_user: 用户
label_user_plural: 用户列表

View File

@ -552,6 +552,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"
@ -1088,6 +1093,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

View File

@ -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

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

BIN
public/images/liststyle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/images/sn_banner.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
public/images/sn_logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
public/images/wx.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
public/images/zan.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,292 @@
var sina = {
$ : function (objName) {
if (document.getElementById) {
return eval('document.getElementById("' + objName + '")')
} else {
return eval('document.all.' + objName)
}
},
isIE : navigator.appVersion.indexOf("MSIE") != -1 ? true : false,
addEvent : function (l, i, I) {
if (l.attachEvent) {
l.attachEvent("on" + i, I)
} else {
l.addEventListener(i, I, false)
}
},
delEvent : function (l, i, I) {
if (l.detachEvent) {
l.detachEvent("on" + i, I)
} else {
l.removeEventListener(i, I, false)
}
},
readCookie : function (O) {
var o = "",
l = O + "=";
if (document.cookie.length > 0) {
var i = document.cookie.indexOf(l);
if (i != -1) {
i += l.length;
var I = document.cookie.indexOf(";", i);
if (I == -1)
I = document.cookie.length;
o = unescape(document.cookie.substring(i, I))
}
};
return o
},
writeCookie : function (i, l, o, c) {
var O = "",
I = "";
if (o != null) {
O = new Date((new Date).getTime() + o * 3600000);
O = "; expires=" + O.toGMTString()
};
if (c != null) {
I = ";domain=" + c
};
document.cookie = i + "=" + escape(l) + O + I
},
readStyle : function (I, l) {
if (I.style[l]) {
return I.style[l]
} else if (I.currentStyle) {
return I.currentStyle[l]
} else if (document.defaultView && document.defaultView.getComputedStyle) {
var i = document.defaultView.getComputedStyle(I, null);
return i.getPropertyValue(l)
} else {
return null
}
}
};
//滚动图片构造函数
//UI&UE Dept. mengjia
//080623
function ScrollPic(scrollContId, arrLeftId, arrRightId, dotListId) {
this.scrollContId = scrollContId;
this.arrLeftId = arrLeftId;
this.arrRightId = arrRightId;
this.dotListId = dotListId;
this.dotClassName = "dotItem";
this.dotOnClassName = "dotItemOn";
this.dotObjArr = [];
this.pageWidth = 0;
this.frameWidth = 0;
this.speed = 10;
this.space = 10;
this.pageIndex = 0;
this.autoPlay = true;
this.autoPlayTime = 5;
var _autoTimeObj,
_scrollTimeObj,
_state = "ready";
this.stripDiv = document.createElement("DIV");
this.listDiv01 = document.createElement("DIV");
this.listDiv02 = document.createElement("DIV");
if (!ScrollPic.childs) {
ScrollPic.childs = []
};
this.ID = ScrollPic.childs.length;
ScrollPic.childs.push(this);
this.initialize = function () {
if (!this.scrollContId) {
throw new Error("必须指定scrollContId.");
return
};
this.scrollContDiv = sina.$(this.scrollContId);
if (!this.scrollContDiv) {
throw new Error("scrollContId不是正确的对象.(scrollContId = \"" + this.scrollContId + "\")");
return
};
this.scrollContDiv.style.width = this.frameWidth + "px";
this.scrollContDiv.style.overflow = "hidden";
this.listDiv01.innerHTML = this.listDiv02.innerHTML = this.scrollContDiv.innerHTML;
this.scrollContDiv.innerHTML = "";
this.scrollContDiv.appendChild(this.stripDiv);
this.stripDiv.appendChild(this.listDiv01);
this.stripDiv.appendChild(this.listDiv02);
this.stripDiv.style.overflow = "hidden";
this.stripDiv.style.zoom = "1";
this.stripDiv.style.width = "32766px";
if(-[1,]){
this.listDiv01.style.cssFloat = "left";
this.listDiv02.style.cssFloat = "left";
}else{
this.listDiv01.style.styleFloat = "left";
this.listDiv02.style.styleFloat = "left";
}
sina.addEvent(this.scrollContDiv, "mouseover", Function("ScrollPic.childs[" + this.ID + "].stop()"));
sina.addEvent(this.scrollContDiv, "mouseout", Function("ScrollPic.childs[" + this.ID + "].play()"));
if (this.arrLeftId) {
this.arrLeftObj = sina.$(this.arrLeftId);
if (this.arrLeftObj) {
sina.addEvent(this.arrLeftObj, "mousedown", Function("ScrollPic.childs[" + this.ID + "].rightMouseDown()"));
sina.addEvent(this.arrLeftObj, "mouseup", Function("ScrollPic.childs[" + this.ID + "].rightEnd()"));
sina.addEvent(this.arrLeftObj, "mouseout", Function("ScrollPic.childs[" + this.ID + "].rightEnd()"))
}
};
if (this.arrRightId) {
this.arrRightObj = sina.$(this.arrRightId);
if (this.arrRightObj) {
sina.addEvent(this.arrRightObj, "mousedown", Function("ScrollPic.childs[" + this.ID + "].leftMouseDown()"));
sina.addEvent(this.arrRightObj, "mouseup", Function("ScrollPic.childs[" + this.ID + "].leftEnd()"));
sina.addEvent(this.arrRightObj, "mouseout", Function("ScrollPic.childs[" + this.ID + "].leftEnd()"))
}
};
if (this.dotListId) {
this.dotListObj = sina.$(this.dotListId);
if (this.dotListObj) {
var pages = Math.round(this.listDiv01.offsetWidth / this.frameWidth + 0.4),
i,
tempObj;
for (i = 0; i < pages; i++) {
tempObj = document.createElement("span");
this.dotListObj.appendChild(tempObj);
this.dotObjArr.push(tempObj);
if (i == this.pageIndex) {
tempObj.className = this.dotClassName
} else {
tempObj.className = this.dotOnClassName
};
tempObj.title = "第" + (i + 1) + "页";
sina.addEvent(tempObj, "click", Function("ScrollPic.childs[" + this.ID + "].pageTo(" + i + ")"))
}
}
};
if (this.autoPlay) {
this.play()
}
};
this.leftMouseDown = function () {
if (_state != "ready") {
return
};
_state = "floating";
_scrollTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].moveLeft()", this.speed)
};
this.rightMouseDown = function () {
if (_state != "ready") {
return
};
_state = "floating";
_scrollTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].moveRight()", this.speed)
};
this.moveLeft = function () {
if (this.scrollContDiv.scrollLeft + this.space >= this.listDiv01.scrollWidth) {
this.scrollContDiv.scrollLeft = this.scrollContDiv.scrollLeft + this.space - this.listDiv01.scrollWidth
} else {
this.scrollContDiv.scrollLeft += this.space
};
this.accountPageIndex()
};
this.moveRight = function () {
if (this.scrollContDiv.scrollLeft - this.space <= 0) {
this.scrollContDiv.scrollLeft = this.listDiv01.scrollWidth + this.scrollContDiv.scrollLeft - this.space
} else {
this.scrollContDiv.scrollLeft -= this.space
};
this.accountPageIndex()
};
this.leftEnd = function () {
if (_state != "floating") {
return
};
_state = "stoping";
clearInterval(_scrollTimeObj);
var fill = this.pageWidth - this.scrollContDiv.scrollLeft % this.pageWidth;
this.move(fill)
};
this.rightEnd = function () {
if (_state != "floating") {
return
};
_state = "stoping";
clearInterval(_scrollTimeObj);
var fill = -this.scrollContDiv.scrollLeft % this.pageWidth;
this.move(fill)
};
this.move = function (num, quick) {
var thisMove = num / 5;
if (!quick) {
if (thisMove > this.space) {
thisMove = this.space
};
if (thisMove < -this.space) {
thisMove = -this.space
}
};
if (Math.abs(thisMove) < 1 && thisMove != 0) {
thisMove = thisMove >= 0 ? 1 : -1
} else {
thisMove = Math.round(thisMove)
};
var temp = this.scrollContDiv.scrollLeft + thisMove;
if (thisMove > 0) {
if (this.scrollContDiv.scrollLeft + thisMove >= this.listDiv01.scrollWidth) {
this.scrollContDiv.scrollLeft = this.scrollContDiv.scrollLeft + thisMove - this.listDiv01.scrollWidth
} else {
this.scrollContDiv.scrollLeft += thisMove
}
} else {
if (this.scrollContDiv.scrollLeft - thisMove <= 0) {
this.scrollContDiv.scrollLeft = this.listDiv01.scrollWidth + this.scrollContDiv.scrollLeft - thisMove
} else {
this.scrollContDiv.scrollLeft += thisMove
}
};
num -= thisMove;
if (Math.abs(num) == 0) {
_state = "ready";
if (this.autoPlay) {
this.play()
};
this.accountPageIndex();
return
} else {
this.accountPageIndex();
setTimeout("ScrollPic.childs[" + this.ID + "].move(" + num + "," + quick + ")", this.speed)
}
};
this.next = function () {
if (_state != "ready") {
return
};
_state = "stoping";
this.move(this.pageWidth, true)
};
this.play = function () {
if (!this.autoPlay) {
return
};
clearInterval(_autoTimeObj);
_autoTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].next()", this.autoPlayTime * 1000)
};
this.stop = function () {
clearInterval(_autoTimeObj)
};
this.pageTo = function (num) {
if (_state != "ready") {
return
};
_state = "stoping";
var fill = num * this.frameWidth - this.scrollContDiv.scrollLeft;
this.move(fill, true)
};
this.accountPageIndex = function () {
this.pageIndex = Math.round(this.scrollContDiv.scrollLeft / this.frameWidth);
if (this.pageIndex > Math.round(this.listDiv01.offsetWidth / this.frameWidth + 0.4) - 1) {
this.pageIndex = 0
};
var i;
for (i = 0; i < this.dotObjArr.length; i++) {
if (i == this.pageIndex) {
this.dotObjArr[i].className = this.dotClassName
} else {
this.dotObjArr[i].className = this.dotOnClassName
}
}
}
};

File diff suppressed because one or more lines are too long

View File

@ -1306,3 +1306,31 @@ a:hover.Blue-btn{ background:#3598db; color:#fff;}
.box-con{ width:450px; margin:0 auto; text-align:center;}
.box-con-a{ width:170px; margin:0 auto; margin-top:10px;}
/*--------------------------------------*/
/*博客列表界面样式*/
a{text-decoration:none}
.listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; }
/*.bloglistbox{ min-height:690px;}*/
.list-h2{ font-size:16px; font-weight:bold; color:#000; border-bottom:2px solid #269ac9; padding-bottom:5px;}
.category{ padding:10px 0; border-bottom:1px solid #ddd;}
.category a,.category span{ float:left; margin-right:5px;}
.grayTxt{ color:#9093a6;}
.category a.sortTxt{ color:#9093a6;}
.category .sortTxt:hover{ color:#28be6c;}
a.sortupbtn{ background: url(../images/liststyle.png) 0 3px no-repeat; width:12px; height:17px; display:block; margin-right:10px; cursor:pointer;}
a.sortdownbtn{ background: url(../images/liststyle.png) 0 -12px no-repeat; width:12px; height:17px; display:block;margin-right:10px;cursor:pointer; }
.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;}
.list-file a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:550px;}
a:hover.list-title{ color:#269ac9;}
.c_red{ font-weight:normal; font-size:12px;}
.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;}
.list-file li{ line-height:1.9;}
.list-info span{ margin-left:5px;}
.pages a{ display:block; border:1px solid #d1d1d1; color:#000; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; }
.pages a:hover{ background-color:#269ac9; color:#fff;}
a.pages-big{ width:50px;}
.pages .active{ background-color:#269ac9; color:#fff;}
.pages{width:330px; margin:20px auto 10px;}
.red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}

View File

@ -591,9 +591,12 @@ a.homepageImageNumber:hover {color:#269ac9;}
.homepageLeftMenuCoursesLine:hover {background-color:#269ac9;}
a.coursesLineGrey {padding-left:25px; padding-right:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
a.projectsLineGrey {padding-left:25px; padding-right:25px; color:#808080; display:block;}
a.projectsLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#269ac9;}
.homepageLeftMenuMoreIcon {background:url(../images/homepage_icon.png) -74px -240px no-repeat; display:block; height:18px;}
.homepageLeftMenuHideIcon {background:url(../images/homepage_icon.png) -74px -220px no-repeat;display:block; height:18px;}
.homepageMenuSetting {display:inline-block; background:url(../images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top: 16px; margin-right: 15px;}
.homepageMenuSetting:hover {background:url(../images/homepage_icon2.png) -190px -407px no-repeat;}
a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
@ -1500,3 +1503,47 @@ a:hover.Blue-btn{ background:#3598db; color:#fff;}
.box-con h4{ font-size:14px; font-weight: bold; width:450px; text-align:center;}
.box-con{ width:450px; margin:0 auto; text-align:center;}
.box-con-a{ width:170px; margin:0 auto; margin-top:10px;}
/*博客列表界面样式*/
a{text-decoration:none}
.listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; }
/*.bloglistbox{ min-height:690px;}*/
.list-h2{ font-size:16px; font-weight:bold; color:#000; border-bottom:2px solid #269ac9; padding-bottom:5px;}
.category{ padding:10px 0; border-bottom:1px solid #ddd;}
.category a,.category span{ float:left; margin-right:5px;}
.grayTxt{ color:#9093a6;}
.category a.sortTxt{ color:#9093a6;}
.category .sortTxt:hover{ color:#28be6c;}
a.sortupbtn{ background: url(../images/liststyle.png) 0 3px no-repeat; width:12px; height:17px; display:block; margin-right:10px; cursor:pointer;}
a.sortdownbtn{ background: url(../images/liststyle.png) 0 -12px no-repeat; width:12px; height:17px; display:block;margin-right:10px;cursor:pointer; }
.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;}
.list-file a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:550px;}
a:hover.list-title{ color:#269ac9;}
.c_red{ font-weight:normal; font-size:12px;}
.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;}
.list-file li{ line-height:1.9;}
.list-info span{ margin-left:5px;}
.pages a{ display:block; border:1px solid #d1d1d1; color:#000; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; }
.pages a:hover{ background-color:#269ac9; color:#fff;}
a.pages-big{ width:50px;}
.pages .active{ background-color:#269ac9; color:#fff;}
.pages{width:330px; margin:20px auto 10px;}
/*课程列表界面样式*/
a.course-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:590px;}
a:hover.course-title{ color:#269ac9;}
/*通知列表界面样式*/
a.messages-title{font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:630px;}
a:hover.messages-title{ color:#269ac9;}
.massages-content{ width:710px; color:#424242; max-height:65px; overflow:hidden; margin:10px 0;margin-left:15px; line-height:1.9;}
.red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
/****翻页***/
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}
ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3px;}
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
/*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}*/
.wlist_select a{background-color: #64bdd9;cursor: default;}

220
public/stylesheets/org2.css Normal file
View File

@ -0,0 +1,220 @@
/* CSS Document */
/* 样式重置 */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.9; background:#f2f2f2;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{color:#000;text-decoration:none;}
a:hover,a:active{color:#24366e;}
.sn-fl {float:left;}
.sn-fr {float:right;}
.sn-cl {clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
.sn-container {width:100%; background-color:#fff;}
.sn-p-absolute {position:absolute;}
.sn-grey-opacity {background:rgba(230, 230, 230, 0.9)!important; filter:Alpha(opacity=90); background:#e6e6e6;}
.sn-border {border-top:1px solid #dfdfdf; border-bottom:1px solid #dfdfdf;}
/* 公共 */
.cl {clear:both;}
.fl {float:left;}
.fr {float:right;}
.mb18 {margin-bottom:18px;}
.mt10 {margin-top:10px;}
.mr20 {margin-right:20px;}
.mr10 {margin-right:10px;}
/*字体,链接颜色*/
.sn-font-black {color:#000;}
.sn-font-grey {color:#b4bbbf;}
.sn-font-grey2 {color:#5e5e5e;}
.sn-font-grey3 {color:#999;}
a.sn-link-blue {color:#24366e;}
a.sn-link-white {color:#fff;}
a.sn-link-grey {color:#999;}
a.sn-link-grey:hover {color:#24366e;}
a.sn-link-grey2 {color:#888;}
a.sn-link-select {color:#809df9;}
/*字体大小*/
.sn-f12 {font-size:12px;}
.sn-f14 {font-size:14px;}
.sn-f18 {font-size:18px;}
/*padding&margin&width*/
.sn-mt-10 {margin-left:-10px;}
.sn-mt4 {margin-top:4px;}
.sn-mt10 {margin-top:10px;}
.sn-mt13 {margin-top:13px;}
.sn-mt15 {margin-top:15px;}
.sn-mt28 {margin-top:28px;}
.sn-mb40 {margin-bottom:40px;}
.sn-ml15 {margin-left:15px;}
.sn-ml55 {margin-left:55px;}
.sn-mr0 {margin-right:0px !important;}
.sn-mr50 {margin-right:50px;}
.sn-w229 {width:229px;}
/*头部样式*/
.sn-header {}
.sn-row {width:100%;}
.sn-bg-grey {background-color:#f4f4f4;}
.sn-bg-grey2 {background-color:#a5a5a5;}
.sn-bg-white {background-color:#fff;}
.sn-bg-blue {background-color:#24366e;}
.sn-login {width:1200px; height:45px; line-height:45px; margin:0 auto; font-size:14px; color:#24366e; vertical-align:middle; text-align:right;}
.sn-login2 {width:1200px; height:54px; line-height:54px; margin:0 auto; font-size:14px; color:#24366e; vertical-align:middle; text-align:right;}
.sn-logo {width:1200px; height:90px; line-height:90px; margin:0 auto; vertical-align:middle;}
.sn-search-input {width:328px; height:40px; font-size:16px; color:#ccc; padding-left:10px; border:1px solid #ccc; border-right:none; float:right; background-color:#fff; outline:none;}
a.sn-search-button {width:53px; height:40px; border:1px solid #ccc; border-left:none; float:right; outline:none; background:url(../images/sn_search_icon.jpg) 0 3px no-repeat;}
.sn-nav {width:1200px; height:55px; margin:0 auto; font-size:16px; position:relative; line-height:1;}
.sn-nav li {float:left; padding-top:11px; padding-bottom:12px; margin-right:50px;}
.sn-nav li a {display:inline-block; padding:8px 6px; border-radius:5px;}
.sn-nav li a:hover {background-color:#809df9;}
.sn-sub-nav {width:1200px; margin:0 auto; font-size:14px; position:relative; line-height:1;}
.sn-sub-nav li {color:#999; float:left;}
.sn-sub-nav li a {height:40px; line-height:40px; vertical-align:middle; margin:0 5px; padding:0 5px; display:inline-block;}
.sn-sub-nav li a:hover {border-bottom:3px solid #ffbd18; height:37px;}
.sn-subnav-slice {margin:12px 5px;}
.sn-banner {width:1200px; height:210px; margin:0 auto;}
.sn-content-position {width:1200px; height:50px; line-height:50px; vertical-align:middle; font-size:14px; color:#888; margin:0 auto;}
/*footer样式*/
.sn-footer {width:1200px; height:220px; margin:0 auto; text-align:center; font-size:14px; color:#fff; line-height:normal;}
.sn-footer-link {padding:40px 0 30px 0;}
.sn-footer-link li {display:inline-block;}
.sn-contact {margin-bottom:30px;}
/* 首页内容 */
.sn-content{ width:1200px; margin:0 auto;}
.sn-content-left{ width:820px; margin-right:12px; margin-bottom:100px;}
.sn-content-right{ width:368px; margin-bottom:74px; }
/* index-banner */
.sn-index-banner{ width:820px; height:435px; margin-bottom:20px;}
.focus{ position:relative; width:820px; height:435px; background-color: #000; float: left;}
.focus img{ width:820px; height:435px;}
.focus .shadow .title{width: 260px; height: 65px;padding-left: 30px;padding-top: 20px;}
.focus .shadow .title a{ text-decoration:none; color:#fff; font-size:14px; font-weight:bolder; overflow:hidden; }
.focus .btn{ position:absolute; bottom:34px; left:510px; overflow:hidden; zoom:1;}
.focus .btn a{position:relative; display:inline; width:13px; height:13px; border-radius:7px; margin:0 5px;color:#B0B0B0; text-decoration:none; text-align:center; outline:0; float:left; background:#D9D9D9; }
.focus .btn a:hover,.focus .btn a.current{ cursor:pointer;background:#fc114a;}
.focus .fPic{ position:absolute; left:0px; top:0px; }
.focus .D1fBt{ overflow:hidden; zoom:1; height:16px; z-index:10; }
.focus .shadow{ width:100%; position:absolute; bottom:0; left:0px; z-index:10; height:80px; line-height: 80px; background:rgba(0,0,0,0.6);
filter:progid:DXImageTransform.Microsoft.gradient( GradientType = 0,startColorstr = '#80000000',endColorstr = '#80000000')\9; display:block; text-align:left; }
.focus .shadow a{ text-decoration:none; color:#fff; font-size:20px; overflow:hidden; margin-left:10px; }
.focus .fcon{ position:relative; width:100%; float:left; display:none; background:#000 }
.focus .fcon-default{ position:relative; width:100%; float:left; background:#fff }
.focus .fcon img{ display:block; }
.focus .fbg{bottom:25px; right:40px; position:absolute; height:21px; text-align:center; z-index: 200; }
.focus .fbg div{margin:4px auto 0;overflow:hidden;zoom:1;height:14px}
.focus .D1fBt a{position:relative; display:inline; width:12px; height:12px; border-radius:7px; margin:0 5px;color:#B0B0B0; text-decoration:none; text-align:center; outline:0; float:left; background:#D9D9D9; }
.focus .D1fBt .current,.focus .D1fBt a:hover{background:#fc114a;}
.focus .D1fBt img{display:none}
.focus .D1fBt i{display:none; font-style:normal; }
.focus .prev,.focus .next{position:absolute;width:40px;height:74px;background: url(../images/banner/focus_btn.png) no-repeat;}
.focus .prev{top: 50%;margin-top: -37px; left: 0;background-position:0 -74px; cursor:pointer; }
.focus .next{top: 50%;margin-top: -37px; right: 0; background-position:-40px -74px; cursor:pointer;}
.focus .prev:hover{ background-position:0 0; }
.focus .next:hover{ background-position:-40px 0;}
/* index-news */
.sn-index-leftbox{ width:820px; background:#fff; margin-bottom:20px;}
.h2-title{ padding:5px 0 3px; border-bottom:1px solid #ebebeb; font-size:18px; color:#777; font-weight:normal; padding-left:17px;}
.h2-title a.more{ font-size:12px; color:#777; float:right; margin-right:17px; line-height:2.8;}
.h2-title a:hover.more{ color:#24366e;}
.sn-news-bigbox{ padding:0px 26px 0px 18px; margin:18px 0 26px; border-right:1px solid #ebebeb;}
.sn-news-bigbox a.h3-title{ font-size:18px; width:380px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
.sn-news-bigbox .sn-news-txt{ width:380px; color:#666;}
.sn-news-bigbox .sn-news-bigimg{ width:380px; height:165px;}
.txt-grey{ color:#999;}
.sn-news-smallbox{padding:0px 18px 0px 26px; margin:18px 0 26px; width:350px; }
.sn-news-smallbox .sn-news-smallimg{ width:85px; height:85px; margin-right:10px;}
.sn-news-smallbox a.h4-title{ font-size:14px; width:255px; float:left;}
/* index-resources */
.sn-index-resourcescon{ padding-top:12px;background:#f2f2f2;}
.sn-index-resourcesbox{ padding:10px; background:#f2f2f2; width:185px; float:left;}
.sn-index-resourcesbox:hover{ background:#fff;}
.sn-index-resourcesbox a.resources-title{ font-size:18px; font-weight:normal; line-height:2.0;width:185px; display:block; border-bottom:1px solid #ccc; margin-bottom:5px;}
.sn-hidden {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
.sn-index-resourcesbox a.resources-tag{ font-size:14px; color:#999; margin-right:5px; line-height:1.5;}
.resources-tagbox {width:185px; height: 46px; overflow:hidden;}
.resources-tagbox img {max-width: 100%;}
a.more-btn{ display:block; width:185px; height:30px; text-align:center; background:#ccc; color:#666; line-height:30px;}
/* index-partner */
.sn-index-partnerbox{ padding:25px 30px; }
.sn-index-partnerbox{ width:775px;}
.sn-index-partnerbox ul li{ height:55px;}
.sn-index-partnerbox ul li a.partnerimg{ display:block; margin:0 10px 10px 0; border:1px solid #ccc; width:370px; height:43px; float:left;}
.partner-btnbox{ width:90px; margin:0 auto;}
.partner-btn{ width:35px; height:22px; background-color:#999; line-height:1.0; font-size:18px; color:#fff; text-align: center; margin-right:5px; cursor:pointer;}
.partner-btn:hover{ background-color:#172b65;}
/* index-active */
.sn-index-activebox{ margin-bottom:20px; background:#fff; padding-bottom:10px;}
.active-title{width:330px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
.sn-index-active{ margin:0px 20px 5px 20px;}
.sn-index-active a.sn-activeimg{width:330px; height:210px;}
/* index-wx*/
.sn-index-wxbox{margin-bottom:20px; background:#fff;}
.sn-index-wximg{ margin:15px; margin-right:5px;}
.sn-index-txt{ font-size:16px; line-height:2.0; margin-top:30px;}
.sn-index-smallbanner img{ display:block; width:369px; height:169px; }
/* 内页新闻列表 */
.sn-inner-body{ width:100%; background-color:#fff;}
.sn-innner-content{ width:1200px; margin:0 auto;}
.sn-inner-newsh2{ font-size:20px; font-weight:normal; padding-bottom:5px; border-bottom:1px dashed #eee;}
.sn-circle{ margin:18px 5px 0 5px ;border:1px solid #24366e; width:5px; height:5px; -webkit-border-radius:50px; -moz-border-radius:50px; -o-border-radius:50px; border-radius:50px; }
.sn-inner-newslist ul li{ line-height:42px; font-size:15px; border-bottom:1px solid #eee;}
.sn-inner-newslist a{font-size:15px; color:#888;}
.sn-inner-newslist a:hover{ color:#24366e;}
a.sn-newslist-titile{ font-size:15px;width:840px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
a:hover.sn-newslist-reply,a:hover.sn-newslist-zan{ color:#379be9;}
.sn-inner-pages a{ display:block; font-size:12px; border:1px solid #d1d1d1; color:#999; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; }
.sn-inner-pages a:hover{ background-color:#24366e; color:#fff;}
a.sn-inner-pages-big{ width:50px;}
a.sn-pages-active{ background-color:#24366e; color:#fff;}
.sn-inner-pages{width:330px; margin:40px auto 100px;}
/* 内页新闻展示 */
.sn-inner-newscon{ width:1200px; padding:5px 0 50px; border-bottom:1px solid #e8e8e8; margin-bottom:30px; color:#999; font-size:14px; }
.sn-inner-pcon{text-indent:2em;}
.sn-inner-newscon img{ display:block; width:830px; margin:25px auto 5px;}
.sn-inner-psmall{ color:#999; font-size:12px; margin-bottom:15px;}
.sn-inner-imgp{ color:#000; text-align:center; margin-bottom:30px;}
a.sn-newslist-zan{ display:block; background:url(../images/zan.gif) 0 15px no-repeat; width:54px; height:28px; padding-left:12px; color:#999; }
a:hover.sn-newslist-zan{ background:url(../images/zan.gif) 0 -21px no-repeat; }
/* 留言 */
.sn-replybox{ margin-bottom:100px;}
.sn-reply-h2{ font-size:18px; font-weight:normal; color:#24366e; margin-bottom:6px;}
.sn-reply-form{ width:1200px;height:180px; border:1px solid #e8e8e8; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; background:#fff; margin-bottom:20px; }
.sn-reply-text{ width:1200px; height:130px; background:#fff; border:none; resize:none;}
.sn-reply-btnbox{border-top:1px solid #e8e8e8; height:48px;}
a.submit-btn{ display:block; color:#fff; text-align:center; font-size:14px; line-height:27px; width:79px; height:27px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; background:#24366e; margin:8px 0 0 10px;}
a:hover.submit-btn{ color:#16275c; color:#fff;}
.sn-comment-h2{ color:#999; font-size:16px; font-weight:normal; border-bottom:1px solid #e8e8e8; padding-bottom:5px;}
.sn-reply-userpic{ height:65px; margin-right:15px;}
.sn-reply-userpic img{ width:40px; height:40px;-webkit-border-radius:50px; -moz-border-radius:50px; -o-border-radius:50px; border-radius:50px;}
a.sn-reply-zan{ display:block; background:url(../images/zan.gif) 0 4px no-repeat; width:54px; height:16px; padding-left:12px; color:#999; }
a:hover.sn-reply-zan{ background:url(../images/zan.gif) 0 -32px no-repeat; }
.sn-comment-listbox{ padding:23px 0; width:1200px;border-bottom:1px solid #e8e8e8;}
a.sn-reply-username { color:#24366e; margin-right:15px; }
.sn-reply-usertxt{ width:1145px; font-size:14px; }
.sn-reply-more{ width:1200px; height:25px; background:#ddd; text-align:center; line-height:25px;}
/*用户图像*/
.topnav_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 1px;}
.topnav_login_list a{color:#269ac9;}
.topnav_login_list li{ }
.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;}
.homepageLeft {width:240px; float:left; margin-right:10px; margin-bottom:10px;}
.none {display: none;}
.user-img,.user-img img{ margin-right:10px; -moz-border-radius: 50px; -webkit-border-radius: 50px;border-radius: 50px; display:block; width:40px; height:40px;}
.ml60{ margin-left:60px;}
.user-img img{border:2px solid #e6473b; }
.user-img img:hover{border:2px solid #29156f;}

View File

@ -1204,3 +1204,30 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.subjectType {width:70px; text-align:center;}
.subjectCount {width:65px; text-align:center;}
.button-rep { color: #888;display: inline-block;background: #eee;padding: 2px 5px;}
/*博客列表界面样式*/
a{text-decoration:none}
.listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; }
/*.bloglistbox{ min-height:690px;}*/
.list-h2{ font-size:16px; font-weight:bold; color:#000; border-bottom:2px solid #269ac9; padding-bottom:5px;}
.category{ padding:10px 0; border-bottom:1px solid #ddd;}
.category a,.category span{ float:left; margin-right:5px;}
.grayTxt{ color:#9093a6;}
.category a.sortTxt{ color:#9093a6;}
.category .sortTxt:hover{ color:#28be6c;}
a.sortupbtn{ background: url(../images/liststyle.png) 0 3px no-repeat; width:12px; height:17px; display:block; margin-right:10px; cursor:pointer;}
a.sortdownbtn{ background: url(../images/liststyle.png) 0 -12px no-repeat; width:12px; height:17px; display:block;margin-right:10px;cursor:pointer; }
.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;}
.list-file a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:550px;}
a:hover.list-title{ color:#269ac9;}
.c_red{ font-weight:normal; font-size:12px;}
.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;}
.list-file li{ line-height:1.9;}
.list-info span{ margin-left:5px;}
.pages a{ display:block; border:1px solid #d1d1d1; color:#000; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; }
.pages a:hover{ background-color:#269ac9; color:#fff;}
a.pages-big{ width:50px;}
.pages .active{ background-color:#269ac9; color:#fff;}
.pages{width:330px; margin:20px auto 10px;}
.red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}