Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
commit
b681e3a597
@ -1 +1 @@
|
||||
{"access_token":"yFUfEXFu0_Pl_jdojoRv6eA8pmGjyRkRIL1VCB2HZ4kVJhEq6crriyCRCI-_u5QbWgtepiIOvqTHtXpKgzMuaB7Eo7MjlMcXeecqhzTjnvpivK5HUzGhZXBG1dk_BxicJAFlCAARIN","expires_in":7200,"got_token_at":1461934858}
|
||||
{"access_token":"bFlabz0uBcoIBfWL7nBJkgpl26aOWDy-dyCOvH_MjUo_hMOOKG83WV1cCL1MG6H-AE-6eMI0iyLoOoAMv9Y3pFFsLYD-GAGr3UH9fT8OqeHMDlFhXyRTvHv9l2QPHGpcARUcCGANEH","expires_in":7200,"got_token_at":1462934760}
|
@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the sub_document_comments controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the sub_domains controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,63 @@
|
||||
class SubDomainsController < ApplicationController
|
||||
layout 'base_org'
|
||||
before_filter :find_org_subfield_and_subdomain, :only => [:show, :index, :domain_update_priority, :destroy, :update, :hide_sub_domain, :show_sub_domain]
|
||||
|
||||
def new
|
||||
@subdomain = SubDomain.new
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@organization = @org_subfield.organization
|
||||
end
|
||||
|
||||
def create
|
||||
if SubDomain.where("org_subfield_id=#{params[:org_subfield_id]} and name=?",params[:name]).count == 0
|
||||
@res = true
|
||||
@subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@organization = @subfield.organization
|
||||
@subdomain = SubDomain.create(:name => params[:name], :org_subfield_id => params[:org_subfield_id], :priority => @subfield.sub_domains.blank? ? 1 : @subfield.sub_domains.order("priority").last.priority + 1)
|
||||
@subdomain.update_column(:field_type, params[:field_type])
|
||||
else
|
||||
@res = false
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@subdomain.update_column(:name, params[:name])
|
||||
end
|
||||
|
||||
def domain_update_priority
|
||||
@subdomain.update_attribute(:priority, params[:priority].to_i)
|
||||
end
|
||||
|
||||
def destroy
|
||||
@subdomain.destroy
|
||||
end
|
||||
|
||||
def show
|
||||
render_404
|
||||
# @subfield_content = @organization.org_subfields.order("priority")
|
||||
# render layout: @organization.switch_type ? 'base_sub_domain' : 'base_org'
|
||||
end
|
||||
|
||||
def index
|
||||
|
||||
end
|
||||
|
||||
def hide_sub_domain
|
||||
@subdomain.update_attribute(:hide, 1)
|
||||
end
|
||||
|
||||
def show_sub_domain
|
||||
@subdomain.update_attribute(:hide, 0)
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def find_org_subfield_and_subdomain
|
||||
@subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@subdomain = SubDomain.find(params[:id])
|
||||
@organization = @subfield.organization
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
# source_subdomain not found
|
||||
render_404
|
||||
end
|
||||
end
|
@ -0,0 +1,2 @@
|
||||
module SubDocumentCommentsHelper
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
module SubDomainsHelper
|
||||
include OrganizationsHelper
|
||||
|
||||
|
||||
end
|
@ -0,0 +1,33 @@
|
||||
class SubDocumentComment < ActiveRecord::Base
|
||||
attr_accessible :content, :creator_id, :locked, :org_subfield_id, :parent_id, :reply_id, :sticky, :sub_domain_id, :title
|
||||
|
||||
include Redmine::SafeAttributes
|
||||
include ApplicationHelper
|
||||
belongs_to :sub_domain
|
||||
belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id'
|
||||
acts_as_tree :order => "#{SubDocumentComment.table_name}.sticky asc, #{SubDocumentComment.table_name}.created_at desc"
|
||||
acts_as_attachable
|
||||
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
|
||||
after_create :document_save_as_sub_activity
|
||||
after_update :update_activity
|
||||
validates_presence_of :content
|
||||
|
||||
#动态的更新
|
||||
private
|
||||
def update_activity
|
||||
org_activity = OrgActivity.where("org_act_type='SubDocumentComment' and org_act_id =?", id).first
|
||||
if org_activity
|
||||
org_activity.updated_at = Time.now
|
||||
org_activity.save
|
||||
end
|
||||
end
|
||||
|
||||
def document_save_as_sub_activity
|
||||
if(self.parent().nil?)
|
||||
self.org_acts << OrgActivity.new(:user_id => User.current.id, :container_id => self.sub_domain.id, :container_type => 'SubDomain')
|
||||
else
|
||||
act = OrgActivity.where("org_act_type='SubDocumentComment' and org_act_id =?", self.root.id).first
|
||||
act.update_attributes(:updated_at => self.updated_at)
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class SubDomain < ActiveRecord::Base
|
||||
attr_accessible :field_type, :hide, :name, :org_subfield_id, :priority, :status
|
||||
belongs_to :org_subfield, :foreign_key => :org_subfield_id
|
||||
has_many :sub_document_comments, :dependent => :destroy
|
||||
end
|
@ -0,0 +1,89 @@
|
||||
<h3>
|
||||
<%=l(:label_apply_homework)%>
|
||||
</h3>
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
作业名称
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程名称
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
作者
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
申请者
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
申请状态
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
申请日期
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%@count=@page*30 %>
|
||||
<% for homework in @homework do %>
|
||||
<% unless homework.nil? %>
|
||||
<% @count+=1 %>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<%=@count %>
|
||||
</td>
|
||||
<% c_h = HomeworkCommon.find homework.homework_common_id %>
|
||||
<% if c_h %>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=c_h.name%>'>
|
||||
<%=link_to(c_h.try(:name), student_work_index_path(:homework => c_h.id))%>
|
||||
</td>
|
||||
<% if c_h.course %>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=c_h.course.name%>'>
|
||||
<%= link_to(c_h.course.name, course_path(c_h.course.id)) %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if c_h.try(:user).try(:realname) == ' '%><%= c_h.try(:user)%><% else %><%=c_h.try(:user).try(:realname) %><% end %>'>
|
||||
<% if c_h.try(:user).try(:realname) == ' '%>
|
||||
<%= link_to(c_h.try(:user), user_path(c_h.user_id)) %>
|
||||
<% else %>
|
||||
<%= link_to(c_h.try(:user).try(:realname), user_path(c_h.user_id)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if homework.try(:user).try(:realname) == ' '%><%= homework.try(:user)%><% else %><%=homework.try(:user).try(:realname) %><% end %>'>
|
||||
<% if homework.try(:user).try(:realname) == ' '%>
|
||||
<%= link_to(homework.try(:user), user_path(homework.user_id)) %>
|
||||
<% else %>
|
||||
<%= link_to(homework.try(:user).try(:realname), user_path(homework.user_id)) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<% if homework.status == 1 %>
|
||||
等待回复
|
||||
<% elsif homework.status == 2 %>
|
||||
已通过
|
||||
<% else %>
|
||||
已拒绝
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=format_date( homework.created_at ) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_apply_homework)) -%>
|
@ -1,2 +1 @@
|
||||
$("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos})%>")
|
||||
$("#pages").html('<%= pagination_links_full @topic_pages, @topic_count,:per_page_links => false,:remote =>true%>');
|
@ -1,2 +1,2 @@
|
||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
||||
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
||||
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
|
||||
|
@ -0,0 +1,9 @@
|
||||
<% 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 "更多", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more" , :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to "更多", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more" , :target => "_blank" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "更多", organization_path(@organization, :org_subfield_id => field.id), :class => "more" , :target => "_blank" %>
|
||||
<% end %>
|
@ -0,0 +1,11 @@
|
||||
<% subdomains.each do |subdomain|%>
|
||||
<li class="homepageLeftMenuCoursesLine" style="display:<%= subdomain.hide.to_i == 0?'block':'none' %>;position:relative;" id="sub_domain_hide_<%= subdomain.id %>">
|
||||
<%= link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => org_subfield_id), :class => "coursesLineGrey hidden", :title => subdomain.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
<%# if subdomains.size == 5 %>
|
||||
<!--<li class="homepageLeftMenuMore" id="show_more_org_project">-->
|
||||
<!--<input type="hidden" value="<%#= page %>" id="org_project_page_num">-->
|
||||
<!--<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_project('<%#= more_org_projects_organization_path(org_id) %>');"></a>-->
|
||||
<!--</li>-->
|
||||
<%# end%>
|
@ -0,0 +1,19 @@
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">栏目名称</h2>
|
||||
<div class="sn-index-partnerbox " >
|
||||
<ul id="scrollPic" >
|
||||
<div style="width: 760px;">
|
||||
<li class="fl"><a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="/images/default_blank/left-05.jpg" width="368" height="43" alt="" /></a></li>
|
||||
<li class="fl"><a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="/images/default_blank/left-05.jpg" width="368" height="43" alt="" /></a></li>
|
||||
<li class="fl"><a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="/images/default_blank/left-05.jpg" width="368" height="43" alt="" /></a></li>
|
||||
<li class="fl"><a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="/images/default_blank/left-05.jpg" width="368" height="43" alt="" /></a></li>
|
||||
</div>
|
||||
</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>
|
@ -1,26 +1,38 @@
|
||||
<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(0);" target="_blank" class="sn-news-smallimg fl"><img src="/images/default_blank/left-03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><div class="sn-title-wrap"><a href="javascript:void(0);" target="_blank" class="h4-title fl mt10">帖子标题</a><span class="title-ellipsis"></span></div></h4>
|
||||
<span class="txt-grey fl">时间</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sn-news-small mb18">
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-news-smallimg fl"><img src="/images/default_blank/left-03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><div class="sn-title-wrap"><a href="javascript:void(0);" target="_blank" class="h4-title fl mt10">帖子标题</a><span class="title-ellipsis"></span></div></h4>
|
||||
<span class="txt-grey fl">时间</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>
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-news-smallimg fl"><img src="/images/default_blank/left-03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><div class="sn-title-wrap"><a href="javascript:void(0);" target="_blank" class="h4-title fl mt10">帖子标题</a><span class="title-ellipsis"></span></div></h4>
|
||||
<span class="txt-grey fl">时间</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>
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-news-smallimg fl"><img src="/images/default_blank/left-03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><div class="sn-title-wrap"><a href="javascript:void(0);" target="_blank" class="h4-title fl mt10">帖子标题</a><span class="title-ellipsis"></span></div></h4>
|
||||
<span class="txt-grey fl">时间</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".h4-title").each(function(){
|
||||
var titleHeight = $(this).height();
|
||||
if (titleHeight > 52){
|
||||
$(this).next().show();
|
||||
}
|
||||
else {
|
||||
$(this).next().hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
@ -1,258 +1,300 @@
|
||||
<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} %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">课程动态</h2>
|
||||
<div class="sn-index-resourcescon">
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% 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-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">课程动态</h2>
|
||||
<div class="sn-index-resourcescon">
|
||||
<% @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/left-04.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 sn-hidden" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= link_to activity.description.to_s.html_safe, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<%#= link_to "更多", student_work_index_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %>
|
||||
</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"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<%= link_to image_tag("/images/default_blank/left-04.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"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<%= 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 has_commit %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title" %>
|
||||
<% 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 sn-hidden" %>
|
||||
<% else %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title" %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
|
||||
<% 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" %>
|
||||
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</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-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/left-04.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 sn-hidden" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= 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>
|
||||
<%#= link_to "更多", news_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %>
|
||||
</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/left-04.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 sn-hidden" %>
|
||||
<% else %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title sn-hidden" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.polls_description, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= 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>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% when 'project' %>
|
||||
<% if @project_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">项目动态</h2>
|
||||
<div class="sn-index-resourcescon">
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% 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" %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">项目动态</h2>
|
||||
<div class="sn-index-resourcescon">
|
||||
<% @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/left-04.jpg", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<% 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" %>
|
||||
<%= 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>
|
||||
<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" %>
|
||||
<h3>
|
||||
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= link_to activity.description.to_s.html_safe, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
</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>
|
||||
<% 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/left-04.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 sn-hidden" %>
|
||||
<% 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 sn-hidden" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</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-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/left-04.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 sn-hidden" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= link_to activity.content.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<%#= link_to "更多", news_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</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_leftMD_default', :locals => {:field => field} %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title"><%= field.name %></h2>
|
||||
<div class="sn-index-resourcescon">
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% 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%>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title"><%= field.name %>
|
||||
<%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %>
|
||||
</h2>
|
||||
<div class="sn-index-resourcescon">
|
||||
<% 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/left-04.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 sn-hidden" %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= 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>
|
||||
<%#= link_to "更多", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => "more-btn", :target => "_blank" %>
|
||||
|
||||
</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/left-04.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 sn-hidden" %>
|
||||
<% 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 sn-hidden" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<%#= link_to "更多", board_message_url_in_org(message.board.id,message.id), :class => "more-btn", :target => "_blank" %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="sn-index-resourcesbox">
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/default_blank/left-04.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 sn-hidden" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-title sn-hidden" %>
|
||||
<% end %>
|
||||
</h3>
|
||||
<div class="resources-tagbox">
|
||||
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %>
|
||||
<%#= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %>
|
||||
</div>
|
||||
<%#= link_to "更多", board_message_path(message.board,activity), :class => "more-btn", :target => "_blank" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<% 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"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<%= link_to image_tag("/images/default_blank/left-04.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"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_path(news), :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 %>
|
||||
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "resources-title sn-hidden" %>
|
||||
</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" %>
|
||||
<%#= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %>
|
||||
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => news.id, :content=> news.description, :maxheight=>54, :maxwordsnum => 28, :maxwordsnum => 28} %>
|
||||
</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>
|
||||
<%#= link_to "更多", news_path(news), :class => "more-btn", :target => "_blank" %>
|
||||
</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 %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
@ -1,11 +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>
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-resourcesimg"><img src="/images/default_blank/left-04.jpg" width="185" height="125" alt=""/></a>
|
||||
<!--<h3><a href="javascript:void(0);" target="_blank" class="resources-title sn-hidden">仪器资源</a></h3>-->
|
||||
<!--<div class="resources-tagbox">-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="resources-tag">测试服务</a>-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="resources-tag">开放日</a>-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="resources-tag">仪器共享</a>-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="resources-tag">定制测试</a>-->
|
||||
<!--</div>-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>-->
|
||||
</div>
|
@ -0,0 +1,33 @@
|
||||
<% unless excellent_teachers.count == 0 %>
|
||||
<div class="sn-teacher-wrap" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title sn-mb5"><%= field.name %>
|
||||
<%= link_to "更多", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => field.id), :target => "_blank", :class => "more" %>
|
||||
</h2>
|
||||
<% excellent_teachers.each do |teacher| %>
|
||||
<div class="sn-teacher-list">
|
||||
<%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sn-fl sn-avatar-circle", :style => "display:block;"), user_path(teacher), :alt => "用户头像", :target => '_blank' %>
|
||||
<!--<a href="javascript:void(0);" target="_blank"><img src="images/avatar_default.png" width="60" height="60" style="display:block;" class="sn-fl" /></a>-->
|
||||
<div class="sn-teacher-info">
|
||||
<%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "sn-teacher-name sn-hidden", :title => '', :target => '_blank' %></a>
|
||||
<span class="sn-teacher-unit sn-hidden" title="<%= teacher.my_workplace %>"><%= teacher.my_workplace %></span> </div>
|
||||
<div class="sn-teacher-social">
|
||||
<% unless teacher.my_blogs_count == 0 %>
|
||||
<span class="sn-mr20">博客 <%= teacher.my_blogs_count %></span>
|
||||
<% end %>
|
||||
<% unless teacher.courses.count == 0 %>
|
||||
<span class="sn-mr20">课程 <%= teacher.courses.count %></span>
|
||||
<% end %>
|
||||
<% unless teacher.my_students == 0 %>
|
||||
<span>学生 <%= teacher.my_students %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="sn-cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(".sn-teacher-list:last").addClass("sn-border-none");
|
||||
</script>
|
||||
<% end %>
|
||||
|
@ -1,223 +1,247 @@
|
||||
<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} %>
|
||||
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title mb18">课程动态</h2>
|
||||
<%= render :partial => 'organizations/org_subfield_rightT_default', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% 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" %>
|
||||
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title mb18">课程动态</h2>
|
||||
<% @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-01.jpg", :width => "330", :height => "210"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% 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" %>
|
||||
<%= 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>
|
||||
<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" %>
|
||||
<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/right-01.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 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" %>
|
||||
<%= 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>
|
||||
<% if has_commit %>
|
||||
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "active-title" %>
|
||||
</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/right-01.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/right-01.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 poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "active-title" %>
|
||||
<%= 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>
|
||||
<span class="txt-grey "><%= format_date activity.published_at %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% 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 %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
<% when 'project' %>
|
||||
<% if @project_acts.blank? %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
|
||||
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title mb18">项目动态</h2>
|
||||
<%= render :partial => 'organizations/org_subfield_rightT_default', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% 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" %>
|
||||
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title mb18">项目动态</h2>
|
||||
<% @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/right-01.jpg", :width => "330", :height => "210"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% 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" %>
|
||||
<%= 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>
|
||||
<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 %>
|
||||
<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/right-01.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/right-01.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 %>
|
||||
<div class="cl"></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_leftMD_default', :locals => {:field => field} %>
|
||||
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title mb18"><%= field.name %></h2>
|
||||
<%= render :partial => 'organizations/org_subfield_rightT_default', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% 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%>
|
||||
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title mb18"><%= field.name %>
|
||||
<%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %>
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="more">更多</a>-->
|
||||
</h2>
|
||||
<% 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/right-01.jpg", :width => "330", :height => "210"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<%= 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 %>
|
||||
<% 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" %>
|
||||
<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/right-01.jpg", :width => "330", :height => "210"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% 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" %>
|
||||
<%= 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>
|
||||
<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" %>
|
||||
<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/right-01.jpg", :width => "330", :height => "210"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-activeimg" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "active-title" %>
|
||||
<%= 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>
|
||||
<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" %>
|
||||
<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 %>
|
||||
<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 %>
|
||||
<% 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/right-01.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 %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
<div class="sn-index-active">
|
||||
<a href="javascript:void()" target="_blank" class="sn-activeimg"><img src="/images/default_blank/right-01.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>
|
@ -0,0 +1,59 @@
|
||||
<% org_teachers.each do |org_teacher| %>
|
||||
<% school = School.where("id =?", org_teacher.school_id).first %>
|
||||
<div class="teacher-list-row">
|
||||
<div>
|
||||
<div class="teacher-avatar">
|
||||
<%= link_to image_tag(url_to_avatar(org_teacher), :width => "90", :height => "90"), user_url_in_org(org_teacher), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="fl">
|
||||
<div class="ml25 mb20"><span class="teacher-name"><%=link_to org_teacher.try(:realname).nil? ? org_teacher.try(:login) : org_teacher.try(:realname), user_url_in_org(org_teacher) %></span>
|
||||
<% unless school.nil? %>
|
||||
<span class="f12 fontGrey2 mr15"><%= school.name %></span>
|
||||
<% end %>
|
||||
<% unless org_teacher.nil? %>
|
||||
<span class="f12 fontGrey2"><%= org_teacher.technical_title %></span></div>
|
||||
<% end %>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num"><%= org_teacher.courses.count %></div>
|
||||
<div class="block-title">课程数</div>
|
||||
</div>
|
||||
<div class="block-slice"></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num"><%= org_teacher.my_students %></div>
|
||||
<div class="block-title">学生数</div>
|
||||
</div>
|
||||
<div class="block-slice"></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num"><%= org_teacher_resource_count(org_teacher) %></div>
|
||||
<div class="block-title">资源数</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if User.current.admin_of_org?(@organization) %>
|
||||
<a href="javascript:void(0);" class="fr teacher-select" onclick="hide($(this),'<%= org_teacher.id %>');" id="hide_<%= org_teacher.id %>"><%= org_teacher.excellent_teacher==0?"设为名师":"取消设置" %></a>
|
||||
<!--<a href="javascript:void(0);" class="fr teacher-select">设为名师</a>-->
|
||||
<% else %>
|
||||
<!--<%# if(org_teacher.watched_by?(User.current)) %>-->
|
||||
<!--<%#= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>org_teacher.id,:target_id=>org_teacher.id),:class => "fr teacher-select", :method => "delete",:remote => "true", :title => "取消关注"%>-->
|
||||
<!--<%# else %>-->
|
||||
<!--<%#= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>org_teacher.id,:target_id=>org_teacher.id),:class => "fr teacher-select", :method => "post",:remote => "true", :title => "添加关注"%>-->
|
||||
<!--<%# end %>-->
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
function hide(content, id){
|
||||
if (content.text() == '设为名师')
|
||||
$.ajax({
|
||||
url: "/organizations/set_excellent_teacher?user=" + id,
|
||||
type: "post"
|
||||
});
|
||||
else
|
||||
$.ajax({
|
||||
url: "/organizations/reset_excellent_teacher?user=" + id,
|
||||
type: "post"
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,6 @@
|
||||
<% if @organization.allow_set_teachers && !org_subfield_had_created?(@organization, "Comptec") %>
|
||||
<li class="fl mr15">
|
||||
<input type="radio" id="orgTec" value="Comptec" name="field_type" />
|
||||
<label for="Comptec">教师</label>
|
||||
</li>
|
||||
<% end %>
|
@ -0,0 +1,36 @@
|
||||
<div class="resources mt10">
|
||||
<div class="function-row">
|
||||
<input type="text" placeholder="搜索" class="teacher-list-search fl" />
|
||||
<a href="javascript:void(0);" class="teacher-search-icon fl"></a>
|
||||
<select class="teacher-search-type fr">
|
||||
<option>课程数</option>
|
||||
<option>学生数</option>
|
||||
<option>资源数</option>
|
||||
</select>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="teacher-list-row">
|
||||
<div>
|
||||
<div class="teacher-avatar"><img src="images/homepageImage.jpg" width="90" height="90" /></div>
|
||||
<div class="fl">
|
||||
<div class="ml25 mb20"><span class="teacher-name">尹刚</span><span class="f12 fontGrey2 mr15">国防科学技术大学</span><span class="f12 fontGrey2">教授</span></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num">6000</div>
|
||||
<div class="block-title">课程数</div>
|
||||
</div>
|
||||
<div class="block-slice"></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num">500</div>
|
||||
<div class="block-title">学生数</div>
|
||||
</div>
|
||||
<div class="block-slice"></div>
|
||||
<div class="teacher-social-block">
|
||||
<div class="block-num">8000</div>
|
||||
<div class="block-title">资源数</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="fr teacher-select">添加</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,22 @@
|
||||
<div class="resources mt10">
|
||||
<div class="function-row">
|
||||
<%= form_tag( url_for(:controller => 'organizations', :action => 'teacher_search'),
|
||||
:remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
||||
<input type="text" name="search" placeholder="输入教师名进行搜索" class="teacher-list-search fl" />
|
||||
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :style => 'border-style:none', :class => "teacher-search-icon fl" %>
|
||||
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
|
||||
<% end %>
|
||||
<!--<a href="javascript:" class="f_l" onclick="$('#search_student').submit();">搜索</a>-->
|
||||
<!--<input type="text" placeholder="搜索" class="teacher-list-search fl" />-->
|
||||
<!--<a href="javascript:void(0);" class="teacher-search-icon fl"></a>-->
|
||||
<select class="teacher-search-type fr" onclick="chooseTeacherType();">
|
||||
<option value="1">课程数</option>
|
||||
<option value="2">学生数</option>
|
||||
<option value="3">资源数</option>
|
||||
</select>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div id="org_teachers_list">
|
||||
<%=render 'organizations/org_teachers_list' %>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,84 @@
|
||||
<% sub_domains = field.sub_domains.order("priority") %>
|
||||
<% if sub_domains %>
|
||||
<% sub_domains.each do |subdomain| %>
|
||||
<ul class="orgSubList">
|
||||
<li class="orgSubTree"></li>
|
||||
<li class="orgSubNum ml5 mr5">
|
||||
<div id="show_domain_priority_<%= subdomain.id %>" ondblclick="edit_priority('#show_domain_priority_<%= subdomain.id %>','#edit_domain_priority_<%= subdomain.id %>');" class="subNumBlock" title="双击可编辑">
|
||||
<%= subdomain.priority %>
|
||||
</div>
|
||||
<div id="edit_domain_priority_<%= subdomain.id %>" style="display:none; width:30px;">
|
||||
<input type="text" onblur="domain_update_priority('#show_domain_priority_<%= subdomain.id %>','#edit_domain_priority_<%= subdomain.id %>','<%= subdomain.org_subfield.id %>','<%= subdomain.id %>',$(this).val());" style="width:20px;" value="<%= subdomain.priority %>"/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="orgSubColumn">
|
||||
<div id="subsubdomain_show_<%= subdomain.id %>" class="subColumnControl" title="<%= subdomain.name %>"><%= subdomain.name %></div>
|
||||
<div id="subsubdomain_edit_<%= subdomain.id %>" style="display:none;">
|
||||
<input type="text" name="name" onblur="update_subfield_subdomain('#subsubdomain_show_<%= subdomain.id %>','#subsubdomain_edit_<%= subdomain.id %>','<%= subdomain.org_subfield.id %>','<%= subdomain.id %>',$(this).val());" value="<%= subdomain.name %>" style="width:70px;"/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="orgSubStatus">新增</li>
|
||||
<li class="orgSubOrder">
|
||||
默认
|
||||
</li>
|
||||
<li class="orgSubType"><%= subdomain.field_type == "Post" ? "帖子" : "资源" %></li>
|
||||
<li class="orgListCatalog hidden"> -- </li>
|
||||
<%#= link_to "隐藏", hide_org_subsubdomain_organizations_path(subdomain), :method => 'post', :remote => true, :id => "hide_#{subdomain.id}", :class => "linkBlue fr mr5" %>
|
||||
<li class="orgSubOperation">
|
||||
<a href="javascript:void(0);" class="linkGrey fr ml5 mr10" onclick="hide_domain($(this),'<%= subdomain.org_subfield.id %>','<%= subdomain.id %>');" id="hide_<%= subdomain.id %>"><%= subdomain.hide==0?"隐藏":"可见" %></a>
|
||||
<span class="fr">|</span>
|
||||
<%= link_to "删除", org_subfield_sub_domain_path(subdomain, :org_subfield_id => subdomain.org_subfield.id), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %>
|
||||
<span class="fr">|</span>
|
||||
<a href="javascript:void(0);" class="linkGrey fr ml5 mr5" onclick="edit('#subsubdomain_show_<%= subdomain.id %>','#subsubdomain_edit_<%= subdomain.id %>');">编辑</a>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
function update_subfield_subdomain(show_id, edit_id, field_id, domain_id, input_value) {
|
||||
if ($(show_id).html().trim() != input_value.trim()) {
|
||||
if (confirm('确定修改为' + input_value + "?"))
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/sub_domains/" + domain_id + "?name=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
else{
|
||||
$(edit_id).children("input").val($(show_id).html().trim());
|
||||
}
|
||||
}
|
||||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
// $(edit_id).focus();
|
||||
}
|
||||
|
||||
|
||||
function domain_update_priority(show_id, edit_id, field_id, domain_id, input_value){
|
||||
var re = /^[0-9]*[1-9]*[0-9]$/
|
||||
if(re.test(input_value) && $(show_id).html().trim() != input_value.trim() && input_value.trim() != ''){
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/sub_domains/" + domain_id + "/domain_update_priority?priority=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
}
|
||||
else{
|
||||
$(edit_id).children("input").val($(show_id).html().trim());
|
||||
}
|
||||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
}
|
||||
|
||||
function hide_domain(content, field_id, domain_id){
|
||||
if (content.text() == '隐藏')
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/sub_domains/" + domain_id + "/hide_sub_domain",
|
||||
type: "post"
|
||||
});
|
||||
else
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/sub_domains/" + domain_id + "/show_sub_domain",
|
||||
type: "post"
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1 @@
|
||||
$("#hide_<%= @ex_teacher.id %>").text("设为名师");
|
@ -0,0 +1 @@
|
||||
$("#hide_<%= @ex_teacher.id %>").text("取消设置");
|
@ -0,0 +1 @@
|
||||
$("#org_teachers_list").html('<%= escape_javascript( render :partial => 'organizations/org_teachers_list')%>');
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue