@ -0,0 +1 @@
|
|||||||
|
$("#blog-list").replaceWith('<%= escape_javascript( render :partial => 'blogs/article', :locals => {:topics => @topics} ) %>');
|
@ -1,5 +1,5 @@
|
|||||||
<% if @course %>
|
<% 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 %>
|
<% 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 %>
|
<% end %>
|
@ -1,5 +1,5 @@
|
|||||||
<% if @project %>
|
<% if @project %>
|
||||||
$("#show_more_project_news").replaceWith("<%= escape_javascript(render :partial => 'project_news_detail', :locals=>{ :all_news=>@newss,:page => @page})%>");
|
$("#show_more_project_news").replaceWith("<%= escape_javascript(render :partial => 'project_news_detail', :locals=>{ :all_news=>@newss,:page => @page})%>");
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#show_more_course_news").replaceWith("<%= escape_javascript( render :partial => 'course_news_detail', :locals =>{:newss => @newss, :page => @page} )%>");
|
$("#course-newslist").replaceWith('<%= escape_javascript( render :partial => 'users/course_newslist', :locals => {:topics => @newss}) %>');
|
||||||
<% end %>
|
<% end %>
|
@ -1,48 +1,54 @@
|
|||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<div class="navHomepageProfile" id="navHomepageProfile">
|
<div class="sn-row sn-bg-grey">
|
||||||
<ul>
|
<div class="sn-login2">
|
||||||
<li class="homepageProfileMenuIcon fr" id="homepageProfileMenuIcon">
|
<div class="navHomepageProfile sn-mt4" id="navHomepageProfile">
|
||||||
<%= 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) %>
|
<ul>
|
||||||
<%#= link_to image_tag(url_to_avatar(User.current)), user_url_in_org(User.current.id), :alt => '用户头像', :target => '_blank', :class => "fr user-img" %>
|
<li class="homepageProfileMenuIcon fr" id="homepageProfileMenuIcon">
|
||||||
<ul class="topnav_login_list none" id="topnav_login_list">
|
<%= 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) %>
|
||||||
<li>
|
<%#= link_to image_tag(url_to_avatar(User.current)), user_url_in_org(User.current.id), :alt => '用户头像', :target => '_blank', :class => "fr user-img" %>
|
||||||
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
<ul class="topnav_login_list none sn-f12" id="topnav_login_list" style="text-align:left;">
|
||||||
</li>
|
<li>
|
||||||
<li>
|
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
||||||
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
</li>
|
||||||
</li>
|
<li>
|
||||||
<li>
|
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
||||||
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
</li>
|
||||||
</li>
|
<li>
|
||||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
||||||
<li>
|
</li>
|
||||||
<%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%>
|
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||||
</li>
|
<li>
|
||||||
</ul>
|
<%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</li>
|
||||||
<% else %>
|
</ul>
|
||||||
<div class="login fr" >
|
</div>
|
||||||
<a href="<%= signin_url_without_domain %>" class=" " >登录 | </a>
|
</div>
|
||||||
<a href="<%= register_url_without_domain %>" class=" " >退出</a>
|
</div>
|
||||||
</div>
|
<% else %>
|
||||||
<% end %>
|
<div class="sn-row sn-bg-grey">
|
||||||
|
<div class="sn-login">
|
||||||
<script type="text/javascript">
|
<a href="<%= signin_url_without_domain %>" class="sn-link-blue">登录</a> |
|
||||||
$("#navHomepageProfile").mouseenter(function(){
|
<a href="<%= register_url_without_domain %>" class="sn-link-blue">注册</a>
|
||||||
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
</div>
|
||||||
$("#topnav_login_list").show();
|
</div>
|
||||||
});
|
<% end %>
|
||||||
$("#navHomepageProfile").mouseleave(function(){
|
|
||||||
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
<script type="text/javascript">
|
||||||
$("#topnav_login_list").hide();
|
$("#navHomepageProfile").mouseenter(function(){
|
||||||
});
|
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
||||||
|
$("#topnav_login_list").show();
|
||||||
function signout(){
|
});
|
||||||
$.post(
|
$("#navHomepageProfile").mouseleave(function(){
|
||||||
'<%= signout_path%>',
|
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
||||||
{}
|
$("#topnav_login_list").hide();
|
||||||
);
|
});
|
||||||
}
|
|
||||||
|
function signout(){
|
||||||
|
$.post(
|
||||||
|
'<%= signout_path%>',
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
@ -0,0 +1,117 @@
|
|||||||
|
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<h2 class="h2-title">合作伙伴<a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||||
|
<div class="sn-index-partnerbox " >
|
||||||
|
<ul id="scrollPic" >
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-dhyq.jpg" width="363" height="43" alt=""/></a>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-qhdx.jpg" width="363" height="43" alt=""/></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-jzdz.jpg" width="363" height="43" alt=""/></a>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-zgdz.jpg" width="363" height="43" alt=""/></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="partner-btnbox">
|
||||||
|
<div class="partner-prev partner-btn fl " id="LeftArr"><</div>
|
||||||
|
<div class="partner-next partner-btn fl" id="RightArr">></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% if is_default_field?(field) %>
|
||||||
|
<% case field.name %>
|
||||||
|
<% when 'course' %>
|
||||||
|
<p>暂无内容!</p>
|
||||||
|
<% when 'project' %>
|
||||||
|
<p>暂无内容!</p>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
||||||
|
<% org_acts = get_subfield_acts field %>
|
||||||
|
<% unless org_acts.blank? %>
|
||||||
|
<% org_acts.each do |activity| %>
|
||||||
|
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<h2 class="h2-title">合作伙伴<a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||||
|
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||||
|
<% document = activity.org_act %>
|
||||||
|
<% org_subfield_id = params[:org_subfield_id] %>
|
||||||
|
<% flag = 2 %>
|
||||||
|
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% elsif activity.container_type == 'OrgSubfield' %>
|
||||||
|
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(activity.org_act_id) %>
|
||||||
|
<% if message.board.org_subfield_id %>
|
||||||
|
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||||
|
<% news = News.find(activity.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<h2 class="h2-title">合作伙伴<a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||||
|
<div class="sn-index-partnerbox " >
|
||||||
|
<ul id="scrollPic" >
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-dhyq.jpg" width="363" height="43" alt=""/></a>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-qhdx.jpg" width="363" height="43" alt=""/></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-jzdz.jpg" width="363" height="43" alt=""/></a>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="images/partner/img-zgdz.jpg" width="363" height="43" alt=""/></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="partner-btnbox">
|
||||||
|
<div class="partner-prev partner-btn fl " id="LeftArr"><</div>
|
||||||
|
<div class="partner-next partner-btn fl" id="RightArr">></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% elsif field.field_type == "Resource" %>
|
||||||
|
<% org_attachs = get_attach_org2(field) %>
|
||||||
|
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<% if !field.subfield_subdomain_dir.nil? %>
|
||||||
|
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
@ -0,0 +1,256 @@
|
|||||||
|
<h2 class="h2-title"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% if is_default_field?(field) %>
|
||||||
|
<% case field.name %>
|
||||||
|
<% when 'course' %>
|
||||||
|
<% if @course_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftM1_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% @course_acts.first(1).each do |act| %>
|
||||||
|
<% if act.org_act_type == "HomeworkCommon" %>
|
||||||
|
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date activity.updated_at %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= activity.description.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date activity.updated_on %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= activity.content.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date activity.created_on %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= activity.description.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Poll" %>
|
||||||
|
<% activity = Poll.find(act.org_act_id) %>
|
||||||
|
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||||
|
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||||
|
<% if ( activity.polls_status==2) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if has_commit %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date activity.published_at %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= activity.polls_description.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% when 'project' %>
|
||||||
|
<% if @project_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftM1_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% @project_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "Issue" %>
|
||||||
|
<% activity = Issue.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date activity.updated_on %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= activity.description.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date activity.updated_on %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= activity.content.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey">2016-04-08</span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= activity.description.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if field.field_type == "Post" %>
|
||||||
|
<% org_acts = get_subfield_acts field %>
|
||||||
|
<% if org_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftM1_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% org_acts.first(4).each do |activity| %>
|
||||||
|
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||||
|
<% document = activity.org_act %>
|
||||||
|
<% org_subfield_id = params[:org_subfield_id] %>
|
||||||
|
<% flag = 2 %>
|
||||||
|
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date document.created_at %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= document.content.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% else activity.container_type == 'OrgSubfield' %>
|
||||||
|
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(activity.org_act_id) %>
|
||||||
|
<% if message.parent_id.nil? %>
|
||||||
|
<% content = message.content%>
|
||||||
|
<% else %>
|
||||||
|
<% content = message.parent.content%>
|
||||||
|
<% end %>
|
||||||
|
<% iamge_path = get_image_path_from_content(content) %>
|
||||||
|
<% if message.board.org_subfield_id %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date message.created_on %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= content.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "h3-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date message.created_on %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= content.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||||
|
<% news = News.find(activity.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "h3-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey"><%= format_date news.created_on %></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p><%= news.description.to_s.html_safe %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
<div class="sn-news-bigbox fl">
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="sn-news-bigimg"><img src="/images/news/img-news-big.jpg" width="380" height="165" alt=""/></a>
|
||||||
|
<h3><a href="javascript:void(0);" target="_blank" class="h3-title"></a></h3>
|
||||||
|
<span class="txt-grey"></span>
|
||||||
|
<div class="sn-news-txt">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,233 @@
|
|||||||
|
<div class="sn-news-smallbox fl" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<% if is_default_field?(field) %>
|
||||||
|
<% case field.name %>
|
||||||
|
<% when 'course' %>
|
||||||
|
<% if @course_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftM2_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% @course_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "HomeworkCommon" %>
|
||||||
|
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/right_top.jpg", :width => "85", :height => "85"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date activity.updated_at %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date activity.updated_on %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date activity.created_on %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Poll" %>
|
||||||
|
<% activity = Poll.find(act.org_act_id) %>
|
||||||
|
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||||
|
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||||
|
<% if ( activity.polls_status==2) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if has_commit %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date activity.published_at %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% when 'project' %>
|
||||||
|
<% if @project_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftM2_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% @project_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "Issue" %>
|
||||||
|
<% activity = Issue.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date activity.updated_on %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date activity.updated_on %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date activity.created_on %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if field.field_type == "Post" %>
|
||||||
|
<% org_acts = get_subfield_acts field %>
|
||||||
|
<% if org_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftM2_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% org_acts.first(4).each do |activity| %>
|
||||||
|
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||||
|
<% document = activity.org_act %>
|
||||||
|
<% org_subfield_id = params[:org_subfield_id] %>
|
||||||
|
<% flag = 2 %>
|
||||||
|
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date document.created_at %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% else activity.container_type == 'OrgSubfield' %>
|
||||||
|
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(activity.org_act_id) %>
|
||||||
|
<% if message.parent_id.nil? %>
|
||||||
|
<% content = message.content%>
|
||||||
|
<% else %>
|
||||||
|
<% content = message.parent.content%>
|
||||||
|
<% end %>
|
||||||
|
<% iamge_path = get_image_path_from_content(content) %>
|
||||||
|
<% if message.board.org_subfield_id %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date message.created_on %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date message.created_on %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||||
|
<% news = News.find(activity.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), news_path(news), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), news_path(news), :target => "_blank", :class =>"sn-news-smallimg fl" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "h4-title fl mt10" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey fl "><%= format_date news.created_on %></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
@ -0,0 +1,26 @@
|
|||||||
|
<div class="sn-news-smallbox fl">
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small01.jpg" width="85" height="85" alt=""/></a>
|
||||||
|
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||||
|
<span class="txt-grey fl">2016-04-08</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small02.jpg" width="85" height="85" alt=""/></a>
|
||||||
|
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||||
|
<span class="txt-grey fl">2016-04-08</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="sn-news-small mb18">
|
||||||
|
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small03.jpg" width="85" height="85" alt=""/></a>
|
||||||
|
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||||
|
<span class="txt-grey fl">2016-04-08</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="sn-news-small ">
|
||||||
|
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small04.jpg" width="85" height="85" alt=""/></a>
|
||||||
|
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||||
|
<span class="txt-grey fl">2016-04-08</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,258 @@
|
|||||||
|
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<h2 class="h2-title"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||||
|
<div class="sn-index-resourcescon">
|
||||||
|
<% if is_default_field?(field) %>
|
||||||
|
<% case field.name %>
|
||||||
|
<% when 'course' %>
|
||||||
|
<% if @course_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% @course_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "HomeworkCommon" %>
|
||||||
|
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to activity.description.to_s.html_safe, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Poll" %>
|
||||||
|
<% activity = Poll.find(act.org_act_id) %>
|
||||||
|
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||||
|
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||||
|
<% if ( activity.polls_status==2) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if has_commit %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to activity.polls_description.to_s.html_safe, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% when 'project' %>
|
||||||
|
<% if @project_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% @project_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "Issue" %>
|
||||||
|
<% activity = Issue.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to activity.description.to_s.html_safe, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to activity.content.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if field.field_type == "Post" %>
|
||||||
|
<% org_acts = get_subfield_acts field %>
|
||||||
|
<% if org_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% org_acts.first(4).each do |activity| %>
|
||||||
|
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||||
|
<% document = activity.org_act %>
|
||||||
|
<% org_subfield_id = params[:org_subfield_id] %>
|
||||||
|
<% flag = 2 %>
|
||||||
|
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to document.content.to_s.html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% else activity.container_type == 'OrgSubfield' %>
|
||||||
|
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(activity.org_act_id) %>
|
||||||
|
<% if message.parent_id.nil? %>
|
||||||
|
<% content = message.content%>
|
||||||
|
<% else %>
|
||||||
|
<% content = message.parent.content%>
|
||||||
|
<% end %>
|
||||||
|
<% iamge_path = get_image_path_from_content(content) %>
|
||||||
|
<% if message.board.org_subfield_id %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||||
|
<% news = News.find(activity.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "resources-title" %>
|
||||||
|
</h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<%= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,11 @@
|
|||||||
|
<div class="sn-index-resourcesbox">
|
||||||
|
<a href="javascript:void()" target="_blank" class="sn-resourcesimg"><img src="/images/default_blank/files-default.jpg" width="185" height="125" alt=""/></a>
|
||||||
|
<h3><a href="javascript:void()" target="_blank" class="resources-title">仪器资源</a></h3>
|
||||||
|
<div class="resources-tagbox">
|
||||||
|
<a href="javascript:void()" target="_blank" class="resources-tag">测试服务</a>
|
||||||
|
<a href="javascript:void()" target="_blank" class="resources-tag">开放日</a>
|
||||||
|
<a href="javascript:void()" target="_blank" class="resources-tag">仪器共享</a>
|
||||||
|
<a href="javascript:void()" target="_blank" class="resources-tag">定制测试</a>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void()" target="_blank" class="more-btn">更多</a>
|
||||||
|
</div>
|
@ -0,0 +1,276 @@
|
|||||||
|
<% if is_default_field?(field) %>
|
||||||
|
<% case field.name %>
|
||||||
|
<% when 'course' %>
|
||||||
|
<% if @course_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<!-- 代码 开始 -->
|
||||||
|
<div id="fsD1" class="focus">
|
||||||
|
<div id="D1pic1" class="fPic">
|
||||||
|
<% @course_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "HomeworkCommon" %>
|
||||||
|
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), student_work_index_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), student_work_index_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow"><%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank' %></span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow">
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow">
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Poll" %>
|
||||||
|
<% activity = Poll.find(act.org_act_id) %>
|
||||||
|
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||||
|
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||||
|
<% if ( activity.polls_status==2) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow">
|
||||||
|
<% if has_commit %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank' %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s, :target => '_blank' %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="fbg">
|
||||||
|
<div class="D1fBt" id="D1fBt">
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="prev"></span>
|
||||||
|
<span class="next"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% when 'project' %>
|
||||||
|
<% if @project_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<!-- 代码 开始 -->
|
||||||
|
<div id="fsD1" class="focus">
|
||||||
|
<div id="D1pic1" class="fPic">
|
||||||
|
<% @project_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "Issue" %>
|
||||||
|
<% activity = Issue.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), issue_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), issue_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow"><%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank' %></span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow">
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow">
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="fbg">
|
||||||
|
<div class="D1fBt" id="D1fBt">
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="prev"></span>
|
||||||
|
<span class="next"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if field.field_type == "Post" %>
|
||||||
|
<% org_acts = get_subfield_acts field %>
|
||||||
|
<% if org_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<!-- 代码 开始 -->
|
||||||
|
<div id="fsD1" class="focus">
|
||||||
|
<div id="D1pic1" class="fPic">
|
||||||
|
<% org_acts.first(4).each do |activity| %>
|
||||||
|
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||||
|
<% document = activity.org_act %>
|
||||||
|
<% org_subfield_id = params[:org_subfield_id] %>
|
||||||
|
<% flag = 2 %>
|
||||||
|
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank' %></span>
|
||||||
|
</div>
|
||||||
|
<% elsif activity.container_type == 'OrgSubfield' %>
|
||||||
|
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(activity.org_act_id) %>
|
||||||
|
<% if message.board.org_subfield_id %>
|
||||||
|
<% if message.parent_id.nil? %>
|
||||||
|
<% content = message.content%>
|
||||||
|
<% else %>
|
||||||
|
<% content = message.parent.content%>
|
||||||
|
<% end %>
|
||||||
|
<% iamge_path = get_image_path_from_content(content) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow">
|
||||||
|
<% if message.parent_id.nil? %>
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank' %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank'%>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<% if message.parent_id.nil? %>
|
||||||
|
<% content = message.content%>
|
||||||
|
<% else %>
|
||||||
|
<% content = message.parent.content%>
|
||||||
|
<% end %>
|
||||||
|
<% iamge_path = get_image_path_from_content(content) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_path(message.board,activity), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_path(message.board,activity), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow">
|
||||||
|
<% if message.parent_id.nil? %>
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :class=> "postGrey" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :class=> "postGrey" %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||||
|
<% news = News.find(activity.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||||
|
<div class="fcon" style="display: none;">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_path(news), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_path(news), :target => "_blank", :style =>"opacity: 1; " %>
|
||||||
|
<% end %>
|
||||||
|
<span class="shadow"><%= link_to news.title.to_s, news_path(news), :target => '_blank' %></span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="fbg">
|
||||||
|
<div class="D1fBt" id="D1fBt">
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
|
||||||
|
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="prev"></span>
|
||||||
|
<span class="next"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
Qfast.add('widgets', { path: "/javascripts/terminator2.2.min.js", type: "js", requires: ['fx'] });
|
||||||
|
Qfast(false, 'widgets', function () {
|
||||||
|
K.tabs({
|
||||||
|
id: 'fsD1', //焦点图包裹id
|
||||||
|
conId: "D1pic1", //** 大图域包裹id
|
||||||
|
tabId:"D1fBt",
|
||||||
|
tabTn:"a",
|
||||||
|
conCn: '.fcon', //** 大图域配置class
|
||||||
|
auto: 1, //自动播放 1或0
|
||||||
|
effect: 'fade', //效果配置
|
||||||
|
eType: 'click', //** 鼠标事件
|
||||||
|
pageBt:true, //是否有按钮切换页码
|
||||||
|
bns: ['.prev', '.next'],//** 前后按钮配置class
|
||||||
|
interval: 3000 //** 停顿时间
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
@ -0,0 +1,10 @@
|
|||||||
|
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<!-- 代码 开始 -->
|
||||||
|
<div id="fsD1" class="focus">
|
||||||
|
<div class="fPic">
|
||||||
|
<div class="fcon-default">
|
||||||
|
<a target="_blank" href="javascript:void(0);"><img src="/images/default_blank/banner-default.jpg" alt="" ></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,73 @@
|
|||||||
|
<% if is_default_field?(field) %>
|
||||||
|
<% case field.name %>
|
||||||
|
<% when 'course' %>
|
||||||
|
<p>暂无内容!</p>
|
||||||
|
<% when 'project' %>
|
||||||
|
<p>暂无内容!</p>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
||||||
|
<% org_acts = get_subfield_acts field %>
|
||||||
|
<% unless org_acts.blank? %>
|
||||||
|
<% activity = org_acts.first %>
|
||||||
|
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||||
|
<% document = activity.org_act %>
|
||||||
|
<% org_subfield_id = params[:org_subfield_id] %>
|
||||||
|
<% flag = 2 %>
|
||||||
|
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% elsif activity.container_type == 'OrgSubfield' %>
|
||||||
|
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(activity.org_act_id) %>
|
||||||
|
<% if message.board.org_subfield_id %>
|
||||||
|
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||||
|
<% news = News.find(activity.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<a href="javascript:void(0);" target="_blank" ><img src="/images/default_blank/ad-default.jpg" width="369" height="169" alt=""/></a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% elsif field.field_type == "Resource" %>
|
||||||
|
<% org_attachs = get_attach_org2(field) %>
|
||||||
|
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<% if !field.subfield_subdomain_dir.nil? %>
|
||||||
|
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
@ -0,0 +1,98 @@
|
|||||||
|
<% if is_default_field?(field) %>
|
||||||
|
<% case field.name %>
|
||||||
|
<% when 'course' %>
|
||||||
|
<p>暂无内容!</p>
|
||||||
|
<% when 'project' %>
|
||||||
|
<p>暂无内容!</p>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
||||||
|
<% org_acts = get_subfield_acts field %>
|
||||||
|
<% unless org_acts.blank? %>
|
||||||
|
<% activity = org_acts.first %>
|
||||||
|
<div class="sn-index-wxbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||||
|
<% document = activity.org_act %>
|
||||||
|
<% org_subfield_id = params[:org_subfield_id] %>
|
||||||
|
<% flag = 2 %>
|
||||||
|
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||||
|
<h2 class="h2-title "><%= field.name %></h2>
|
||||||
|
<div class="sn-index-wx">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||||
|
<% end %>
|
||||||
|
<p class="fl sn-index-txt sn-w229"><%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% else activity.container_type == 'OrgSubfield' %>
|
||||||
|
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(activity.org_act_id) %>
|
||||||
|
<% if message.board.org_subfield_id %>
|
||||||
|
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||||
|
<h2 class="h2-title "><%= field.name %></h2>
|
||||||
|
<div class="sn-index-wx">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||||
|
<% end %>
|
||||||
|
<p class="fl sn-index-txt"><%=link_to message.content.to_s.html_safe, board_message_url_in_org(message.board.id, message.id), :target => "_blank" %></p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<% iamge_path = get_image_path_from_content(message.content) %>
|
||||||
|
<h2 class="h2-title "><%= field.name %></h2>
|
||||||
|
<div class="sn-index-wx">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||||
|
<% end %>
|
||||||
|
<p class="fl sn-index-txt"><%=link_to message.content.to_s.html_safe, board_message_path(message.board, activity), :target => "_blank" %></p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||||
|
<% news = News.find(activity.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||||
|
<h2 class="h2-title "><%= field.name %></h2>
|
||||||
|
<div class="sn-index-wx">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %>
|
||||||
|
<% end %>
|
||||||
|
<p class="fl sn-index-txt"><%=link_to news.description.to_s.html_safe, news_path(news), :target => "_blank" %></p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-index-wxbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<h2 class="h2-title "><%= field.name %></h2>
|
||||||
|
<div class="sn-index-wx">
|
||||||
|
<img class="fl sn-index-wximg" src="/images/wx.gif" width="104" height="104" alt=""/>
|
||||||
|
<p class="fl sn-index-txt">暂无内容!</p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% elsif field.field_type == "Resource" %>
|
||||||
|
<% org_attachs = get_attach_org2(field) %>
|
||||||
|
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<% if !field.subfield_subdomain_dir.nil? %>
|
||||||
|
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
@ -0,0 +1,223 @@
|
|||||||
|
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<h2 class="h2-title mb18"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||||
|
<% if is_default_field?(field) %>
|
||||||
|
<% case field.name %>
|
||||||
|
<% when 'course' %>
|
||||||
|
<% if @course_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_rightT_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% @course_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "HomeworkCommon" %>
|
||||||
|
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/right_top.jpg", :width => "330", :height => "210"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date activity.updated_at %></span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date activity.updated_on %></span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date activity.created_on %></span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Poll" %>
|
||||||
|
<% activity = Poll.find(act.org_act_id) %>
|
||||||
|
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
|
||||||
|
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
|
||||||
|
<% if ( activity.polls_status==2) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if has_commit %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "active-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "active-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date activity.published_at %></span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% when 'project' %>
|
||||||
|
<% if @project_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% @project_acts.first(4).each do |act| %>
|
||||||
|
<% if act.org_act_type == "Issue" %>
|
||||||
|
<% activity = Issue.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date activity.updated_on %></span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date activity.updated_on %></span>
|
||||||
|
</div>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date activity.created_on %></span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<% if field.field_type == "Post" %>
|
||||||
|
<% org_acts = get_subfield_acts field %>
|
||||||
|
<% if org_acts.blank? %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||||
|
<% else %>
|
||||||
|
<% org_acts.first(4).each do |activity| %>
|
||||||
|
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||||
|
<% document = activity.org_act %>
|
||||||
|
<% org_subfield_id = params[:org_subfield_id] %>
|
||||||
|
<% flag = 2 %>
|
||||||
|
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date document.created_at %></span>
|
||||||
|
</div>
|
||||||
|
<% else activity.container_type == 'OrgSubfield' %>
|
||||||
|
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(activity.org_act_id) %>
|
||||||
|
<% if message.parent_id.nil? %>
|
||||||
|
<% content = message.content%>
|
||||||
|
<% else %>
|
||||||
|
<% content = message.parent.content%>
|
||||||
|
<% end %>
|
||||||
|
<% iamge_path = get_image_path_from_content(content) %>
|
||||||
|
<% if message.board.org_subfield_id %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "active-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date message.created_on %></span>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "active-title" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "active-title" %>
|
||||||
|
<% end %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date message.created_on %></span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||||
|
<% news = News.find(activity.org_act_id) %>
|
||||||
|
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||||
|
<div class="sn-index-active">
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "330", :height => "210"), news_path(news), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), news_path(news), :target => "_blank", :class =>"sn-activeimg" %>
|
||||||
|
<% end %>
|
||||||
|
<h3>
|
||||||
|
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "active-title" %>
|
||||||
|
</h3>
|
||||||
|
<span class="txt-grey "><%= format_date news.created_on %></span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
@ -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>
|
@ -0,0 +1,5 @@
|
|||||||
|
<% if @notifiable.value == "0"%>
|
||||||
|
$("#hidden_courses").replaceWith("<%= escape_javascript(link_to '隐藏课程信息',settings_hidden_courses_path,:id => 'hidden_courses',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
|
||||||
|
<% else%>
|
||||||
|
$("#hidden_courses").replaceWith("<%= escape_javascript(link_to '显示课程信息',settings_hidden_courses_path,:id => 'hidden_courses',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
|
||||||
|
<% end%>
|
@ -0,0 +1,80 @@
|
|||||||
|
<div class = "cl"> </div>
|
||||||
|
<div id="course-boardlist">
|
||||||
|
<div class="listbox mt10" >
|
||||||
|
<h2 class="list-h2">问答区列表</h2>
|
||||||
|
<div class="category">
|
||||||
|
<span class="grayTxt ">排序:</span>
|
||||||
|
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||||
|
<% if @type.to_i == 1 %>
|
||||||
|
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
|
<% end %>
|
||||||
|
<%= link_to "人气", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||||
|
<% if @type.to_i == 2 %>
|
||||||
|
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="bloglistbox">
|
||||||
|
<% topics.each do |activity| %>
|
||||||
|
<div class="list-file">
|
||||||
|
<div><span class="item_list fl"></span>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.sticky == 1 %>
|
||||||
|
<span class="fl ml10 red-cir-btn">顶</span>
|
||||||
|
<% end%>
|
||||||
|
<% if activity.locked %>
|
||||||
|
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||||
|
<% end %>
|
||||||
|
<% u = User.where("id=?",activity.author_id).first%>
|
||||||
|
<span class="fr grayTxt">
|
||||||
|
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="massages-content ml15">
|
||||||
|
<% if activity.parent_id.nil? %>
|
||||||
|
<% content = activity.content %>
|
||||||
|
<% else %>
|
||||||
|
<% content = activity.parent.content %>
|
||||||
|
<% end %>
|
||||||
|
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54} %></p>
|
||||||
|
</div>
|
||||||
|
<div class="ml15 mt10">
|
||||||
|
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||||
|
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||||
|
<% count=0 %>
|
||||||
|
<% if activity.parent %>
|
||||||
|
<% count=activity.parent.children.count%>
|
||||||
|
<% else %>
|
||||||
|
<% count=activity.children.count%>
|
||||||
|
<% end %>
|
||||||
|
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<ul class="wlist" id="pages" >
|
||||||
|
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
||||||
|
$(function(){
|
||||||
|
var leftHeight = $("#LSide").height()-$(".fontGrey5").height()-20;
|
||||||
|
var rightHeight = $(".homepageRight").height();
|
||||||
|
if (rightHeight < leftHeight){
|
||||||
|
var diffHeight = leftHeight - rightHeight;
|
||||||
|
var tmpHeight = $(".listbox").height()+diffHeight;
|
||||||
|
$(".listbox").css("height",tmpHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
@ -0,0 +1,64 @@
|
|||||||
|
<div class = "cl"> </div>
|
||||||
|
<div id="course-newslist">
|
||||||
|
<div class="listbox mt10" >
|
||||||
|
<h2 class="list-h2">通知列表</h2>
|
||||||
|
<div class="category">
|
||||||
|
<span class="grayTxt ">排序:</span>
|
||||||
|
<%= link_to "时间", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||||
|
<% if @type.to_i == 1 %>
|
||||||
|
<%= link_to "", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
|
<% end %>
|
||||||
|
<%= link_to "人气", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||||
|
<% if @type.to_i == 2 %>
|
||||||
|
<%= link_to "", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="bloglistbox">
|
||||||
|
<% topics.each do |activity| %>
|
||||||
|
<div class="list-file">
|
||||||
|
<div><span class="item_list fl"></span>
|
||||||
|
<%= link_to activity.title.to_s, news_path(activity), :class => "list-title fl" %>
|
||||||
|
<% if activity.sticky == 1 %>
|
||||||
|
<span class="fl ml10 red-cir-btn">顶</span>
|
||||||
|
<% end%>
|
||||||
|
<% u = User.where("id=?",activity.author_id).first%>
|
||||||
|
<span class="fr grayTxt">
|
||||||
|
发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="massages-content ml15">
|
||||||
|
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54} %></p>
|
||||||
|
</div>
|
||||||
|
<div class="ml15 mt10">
|
||||||
|
<span class="grayTxt">发布时间:<%= format_time(activity.created_on) %></span>
|
||||||
|
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||||
|
<% count=0 %>
|
||||||
|
<% count=activity.comments.count %>
|
||||||
|
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<ul class="wlist" id="pages" >
|
||||||
|
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
||||||
|
$(function(){
|
||||||
|
var leftHeight = $("#LSide").height()-$(".fontGrey5").height()-20;
|
||||||
|
var rightHeight = $(".homepageRight").height();
|
||||||
|
if (rightHeight < leftHeight){
|
||||||
|
var diffHeight = leftHeight - rightHeight;
|
||||||
|
var tmpHeight = $(".listbox").height()+diffHeight;
|
||||||
|
$(".listbox").css("height",tmpHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
@ -0,0 +1,17 @@
|
|||||||
|
<div class="homepagePostIntro break_word upload_img list_style table_maxWidth lh18" id="activity_description_<%= user_activity_id%>">
|
||||||
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
|
<%= content.to_s.html_safe%>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#intro_content_<%= user_activity_id%>").hide();
|
||||||
|
$(function() {
|
||||||
|
var heightType = <%= maxheight %>;
|
||||||
|
|
||||||
|
if (heightType > 0) {
|
||||||
|
$("#activity_description_<%= user_activity_id%>").css("max-height", heightType + "px");
|
||||||
|
}
|
||||||
|
|
||||||
|
description_showwords_ellipsis(<%=user_activity_id %>);
|
||||||
|
});
|
||||||
|
</script>
|
@ -0,0 +1,80 @@
|
|||||||
|
<div class = "cl"> </div>
|
||||||
|
<div id="project-boardlist">
|
||||||
|
<div class="listbox mt10" >
|
||||||
|
<h2 class="list-h2">讨论区列表</h2>
|
||||||
|
<div class="category">
|
||||||
|
<span class="grayTxt ">排序:</span>
|
||||||
|
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||||
|
<% if @type.to_i == 1 %>
|
||||||
|
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
|
<% end %>
|
||||||
|
<%= link_to "人气", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||||
|
<% if @type.to_i == 2 %>
|
||||||
|
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="bloglistbox">
|
||||||
|
<% topics.each do |activity| %>
|
||||||
|
<div class="list-file">
|
||||||
|
<div><span class="item_list fl"></span>
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||||
|
<% end %>
|
||||||
|
<% if activity.sticky == 1 %>
|
||||||
|
<span class="fl ml10 red-cir-btn">顶</span>
|
||||||
|
<% end%>
|
||||||
|
<% if activity.locked %>
|
||||||
|
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||||
|
<% end %>
|
||||||
|
<% u = User.where("id=?",activity.author_id).first%>
|
||||||
|
<span class="fr grayTxt">
|
||||||
|
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="massages-content ml15">
|
||||||
|
<% if activity.parent_id.nil? %>
|
||||||
|
<% content = activity.content %>
|
||||||
|
<% else %>
|
||||||
|
<% content = activity.parent.content %>
|
||||||
|
<% end %>
|
||||||
|
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54 } %></p>
|
||||||
|
</div>
|
||||||
|
<div class="ml15 mt10">
|
||||||
|
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||||
|
<span class="grayTxt">更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %></span>
|
||||||
|
<% count=0 %>
|
||||||
|
<% if activity.parent %>
|
||||||
|
<% count=activity.parent.children.count%>
|
||||||
|
<% else %>
|
||||||
|
<% count=activity.children.count%>
|
||||||
|
<% end %>
|
||||||
|
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<ul class="wlist" id="pages" >
|
||||||
|
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
||||||
|
$(function() {
|
||||||
|
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||||
|
var rightHeight = $(".homepageRight").height();
|
||||||
|
if (rightHeight < leftHeight) {
|
||||||
|
var diffHeight = leftHeight - rightHeight;
|
||||||
|
var tmpHeight = $(".listbox").height() + diffHeight;
|
||||||
|
$(".listbox").css("height", tmpHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
@ -0,0 +1,55 @@
|
|||||||
|
<div class="listbox" id="project-list">
|
||||||
|
<h2 class="list-h2">项目列表</h2>
|
||||||
|
<div class="category">
|
||||||
|
<span class="grayTxt ">排序:</span>
|
||||||
|
<%= link_to "时间", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||||
|
<% if @type.to_i == 1 %>
|
||||||
|
<%= link_to "", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
|
<% end %>
|
||||||
|
<%= link_to "人气", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
||||||
|
<% if @type.to_i == 2 %>
|
||||||
|
<%= link_to "", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bloglistbox">
|
||||||
|
<% @projects.each do |project|%>
|
||||||
|
<ul class="list-file">
|
||||||
|
<li>
|
||||||
|
<span class="item_list fl"></span>
|
||||||
|
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||||
|
<% projectUser = User.where("id=?",project.user_id).first%>
|
||||||
|
<span class="fr grayTxt">
|
||||||
|
<%='创建者:'+(projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)) %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<li class="ml15">
|
||||||
|
<span class="grayTxt">创建时间:<%= format_time(project.created_on) %></span>
|
||||||
|
<p class="list-info fr grayTxt"><span><%= project.project_score.issue_num %></span><span>问题</span><span>|</span><span> <%= project.project_score.attach_num %></span><span>资源</span></p>
|
||||||
|
</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<ul class="wlist" id="pages" >
|
||||||
|
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
|
||||||
|
$(function() {
|
||||||
|
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||||
|
var rightHeight = $(".homepageRight").height();
|
||||||
|
if (rightHeight < leftHeight) {
|
||||||
|
var diffHeight = leftHeight - rightHeight;
|
||||||
|
var tmpHeight = $(".listbox").height() + diffHeight;
|
||||||
|
$(".listbox").css("height", tmpHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
@ -0,0 +1,8 @@
|
|||||||
|
<% if @state == 1 %>
|
||||||
|
alert("您还未登录");
|
||||||
|
<% elsif @state == 2 %>
|
||||||
|
alert("申请成功,请等待审核");
|
||||||
|
$("#homework_apply_status_<%=@homework.id %>").html("待审核");
|
||||||
|
<% elsif @state == 3 %>
|
||||||
|
alert("您已经发送过申请了,请耐心等待");
|
||||||
|
<% end %>
|
@ -1,11 +1,17 @@
|
|||||||
<% if params[:is_observe].nil? %>
|
<% if @status == 1 %>
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>');
|
alert("您的申请尚未通过审核,暂时不可发送至课程");
|
||||||
showModal('ajax-modal', '452px');
|
<% elsif @status == 2 %>
|
||||||
$('#ajax-modal').siblings().remove();
|
alert("该作业是私有的,请先提交申请并通过审核后再发送");
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
|
||||||
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
|
||||||
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#send_homework_to_course_form").html("<%= escape_javascript(render :partial => 'users/send_homework_to_course_form', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>");
|
<% if params[:is_observe].nil? %>
|
||||||
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>');
|
||||||
|
showModal('ajax-modal', '452px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||||
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||||
|
<% else %>
|
||||||
|
$("#send_homework_to_course_form").html("<%= escape_javascript(render :partial => 'users/send_homework_to_course_form', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>");
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
@ -0,0 +1,11 @@
|
|||||||
|
$("#deal_info_<%=@msg.id%>").html(
|
||||||
|
<% if @msg.apply_result == 0 || @msg.apply_result.nil?%>
|
||||||
|
<%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>@msg.id),:remote=>'true'%>
|
||||||
|
'|'
|
||||||
|
<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>@msg.id),:remote=>'true'%>
|
||||||
|
<% elsif @msg.apply_result == 1%>
|
||||||
|
'您已经同意了该申请'
|
||||||
|
<% elsif @msg.apply_result == 2%>
|
||||||
|
'您已经拒绝了该申请'
|
||||||
|
<%end %>
|
||||||
|
);
|
@ -0,0 +1 @@
|
|||||||
|
<%= render :partial => 'users/user_course_list'%>
|
@ -0,0 +1 @@
|
|||||||
|
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_course_list') %>');
|
@ -0,0 +1 @@
|
|||||||
|
<%= render :partial => 'users/user_project_list'%>
|
@ -0,0 +1 @@
|
|||||||
|
$("#project-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_project_list') %>');
|
@ -0,0 +1,13 @@
|
|||||||
|
class CreateApplyHomeworks < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :apply_homeworks do |t|
|
||||||
|
t.integer :status
|
||||||
|
t.references :user
|
||||||
|
t.references :homework_common
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
add_index :apply_homeworks, :user_id
|
||||||
|
add_index :apply_homeworks, :homework_common_id
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,6 @@
|
|||||||
|
class AddColumnToCourseMessages < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :course_messages, :apply_user_id, :integer
|
||||||
|
add_column :course_messages, :apply_result, :integer
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 220 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 272 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 10 KiB |