组织框架结构(yeild)修改
This commit is contained in:
parent
a60356091b
commit
0e03798f6e
|
@ -76,7 +76,7 @@ class OrganizationsController < ApplicationController
|
|||
|
||||
def show
|
||||
# 组织新类型 show_mode:判断标准 1为新类型,0为旧
|
||||
if @organization.show_mode.to_i == 1 && params[:org_subfield_id].nil? && params[:list] .nil?
|
||||
if @organization.switch_type && params[:org_subfield_id].nil? && params[:list] .nil?
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
# REDO:时间紧,暂时先这样
|
||||
@org_logo_attchment = Attachment.find_by_sql("SELECT * from attachments WHERE container_id = #{@organization.id} and container_type = 'Organization' and attachtype = 0 and filename REGEXP '(.jpg|.png|.bmp|.gif|.jpeg)' ORDER BY created_on desc limit 1").first
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<%= javascript_include_tag 'attachments' %>
|
||||
<%#= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%#= yield :header_tags -%>
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
|
@ -130,39 +130,9 @@
|
|||
<%# over %>
|
||||
<!--内容开始-->
|
||||
<div class="sn-content">
|
||||
<div class="sn-content-left fl sn-mt15">
|
||||
<% @subfield_content.each do |field| %>
|
||||
<% if field.status.to_i == 1 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftT', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 3 %>
|
||||
<%#= render :partial => 'organizations/org_subfield_leftM', :locals => {:field => field} %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<%= render :partial => 'organizations/org_subfield_leftM1', :locals => {:field => field} %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM2', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% elsif field.status.to_i == 4 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 5 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftD', :locals => {:field => field} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--右侧-->
|
||||
<div class="sn-content-right fr sn-mt15">
|
||||
<% @subfield_content.each do |field| %>
|
||||
<% if field.status.to_i == 6 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightT', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 7 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightM', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 8 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightD', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 23 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightM2', :locals => {:field => field} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
</div>
|
||||
<!--内容结束-->
|
||||
<footer>
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<div class="sn-content-left fl sn-mt15">
|
||||
<% @subfield_content.each do |field| %>
|
||||
<% if field.status.to_i == 1 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftT', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 3 %>
|
||||
<%#= render :partial => 'organizations/org_subfield_leftM', :locals => {:field => field} %>
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<%= render :partial => 'organizations/org_subfield_leftM1', :locals => {:field => field} %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftM2', :locals => {:field => field} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% elsif field.status.to_i == 4 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftMD', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 5 %>
|
||||
<%= render :partial => 'organizations/org_subfield_leftD', :locals => {:field => field} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--右侧-->
|
||||
<div class="sn-content-right fr sn-mt15">
|
||||
<% @subfield_content.each do |field| %>
|
||||
<% if field.status.to_i == 6 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightT', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 7 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightM', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 8 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightD', :locals => {:field => field} %>
|
||||
<% elsif field.status.to_i == 23 %>
|
||||
<%= render :partial => 'organizations/org_subfield_rightM2', :locals => {:field => field} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -1,10 +1,14 @@
|
|||
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
||||
<%# 区分两种模式 %>
|
||||
<% if @organization.switch_type %>
|
||||
<%= render :partial => 'show_type2' %>
|
||||
<% else %>
|
||||
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
||||
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if params[:show_homepage].nil? and User.current.logged? %>
|
||||
<% if params[:show_homepage].nil? and User.current.logged? %>
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName"><%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %></div>
|
||||
<% if params[:org_subfield_id].nil? %>
|
||||
|
@ -45,8 +49,8 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
|
||||
<% end %>
|
||||
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
|
||||
<script>
|
||||
$(function() {
|
||||
sd_create_editor_from_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "100%", 'OrgActivity');
|
||||
|
@ -54,13 +58,14 @@
|
|||
</script>
|
||||
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
|
||||
<%= render :partial => 'show_home_page', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %>
|
||||
<% end %>
|
||||
<% if @org_activities %>
|
||||
<% end %>
|
||||
<% if @org_activities %>
|
||||
<%= render :partial => 'organizations/org_activities',
|
||||
:locals => {:org_activities => @org_activities,
|
||||
:page=> @page,
|
||||
:org => @organization,
|
||||
:org_act_count=> @org_activities.count} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
@ -70,3 +75,4 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue