北斗组织微信块调整

This commit is contained in:
Tim 2016-04-27 09:57:41 +08:00
parent b6f5bfc450
commit c9cc4739aa
2 changed files with 100 additions and 99 deletions

View File

@ -1,98 +1,98 @@
<% if is_default_field?(field) %> <% if is_default_field?(field) %>
<% case field.name %> <% case field.name %>
<% when 'course' %> <% when 'course' %>
<p>暂无内容!</p> <p>暂无内容!</p>
<% when 'project' %> <% when 'project' %>
<p>暂无内容!</p> <p>暂无内容!</p>
<% end %> <% end %>
<% else %> <% else %>
<% if field.field_type == "Post" %> <%# 讨论类型 %> <% if field.field_type == "Post" %> <%# 讨论类型 %>
<% org_acts = get_subfield_acts field %> <% org_acts = get_subfield_acts field %>
<% unless org_acts.blank? %> <% unless org_acts.blank? %>
<% activity = org_acts.first %> <% activity = org_acts.first %>
<div class="sn-index-wxbox" style="display:<%= field.hide == 0?'block':'none' %>;"> <div class="sn-index-wxbox" style="display:<%= field.hide == 0?'block':'none' %>;">
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> <% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
<% document = activity.org_act %> <% document = activity.org_act %>
<% org_subfield_id = params[:org_subfield_id] %> <% org_subfield_id = params[:org_subfield_id] %>
<% flag = 2 %> <% flag = 2 %>
<% iamge_path = get_image_path_from_content(document.content) %> <% iamge_path = get_image_path_from_content(document.content) %>
<h2 class="h2-title "><%= field.name %></h2> <h2 class="h2-title "><%= field.name %></h2>
<div class="sn-index-wx"> <div class="sn-index-wx">
<% if iamge_path.nil? %> <% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %>
<% else %> <% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %> <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %>
<% end %> <% end %>
<p class="fl sn-index-txt"><%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></p> <p class="fl sn-index-txt sn-w229"><%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></p>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% else activity.container_type == 'OrgSubfield' %> <% 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 %> <% 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) %> <% message = Message.find(activity.org_act_id) %>
<% if message.board.org_subfield_id %> <% if message.board.org_subfield_id %>
<% iamge_path = get_image_path_from_content(message.content) %> <% iamge_path = get_image_path_from_content(message.content) %>
<h2 class="h2-title "><%= field.name %></h2> <h2 class="h2-title "><%= field.name %></h2>
<div class="sn-index-wx"> <div class="sn-index-wx">
<% if iamge_path.nil? %> <% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %>
<% else %> <% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %> <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %>
<% end %> <% end %>
<p class="fl sn-index-txt"><%=link_to message.content.to_s.html_safe, board_message_url_in_org(message.board.id, message.id), :target => "_blank" %></p> <p class="fl sn-index-txt"><%=link_to message.content.to_s.html_safe, board_message_url_in_org(message.board.id, message.id), :target => "_blank" %></p>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% else %> <% else %>
<% iamge_path = get_image_path_from_content(message.content) %> <% iamge_path = get_image_path_from_content(message.content) %>
<h2 class="h2-title "><%= field.name %></h2> <h2 class="h2-title "><%= field.name %></h2>
<div class="sn-index-wx"> <div class="sn-index-wx">
<% if iamge_path.nil? %> <% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %>
<% else %> <% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %> <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %>
<% end %> <% end %>
<p class="fl sn-index-txt"><%=link_to message.content.to_s.html_safe, board_message_path(message.board, activity), :target => "_blank" %></p> <p class="fl sn-index-txt"><%=link_to message.content.to_s.html_safe, board_message_path(message.board, activity), :target => "_blank" %></p>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
<% news = News.find(activity.org_act_id) %> <% news = News.find(activity.org_act_id) %>
<% iamge_path = get_image_path_from_content(news.description) %> <% iamge_path = get_image_path_from_content(news.description) %>
<h2 class="h2-title "><%= field.name %></h2> <h2 class="h2-title "><%= field.name %></h2>
<div class="sn-index-wx"> <div class="sn-index-wx">
<% if iamge_path.nil? %> <% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %>
<% else %> <% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %> <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %>
<% end %> <% end %>
<p class="fl sn-index-txt"><%=link_to news.description.to_s.html_safe, news_path(news), :target => "_blank" %></p> <p class="fl sn-index-txt"><%=link_to news.description.to_s.html_safe, news_path(news), :target => "_blank" %></p>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<% else %> <% else %>
<div class="sn-index-wxbox" style="display:<%= field.hide == 0?'block':'none' %>;"> <div class="sn-index-wxbox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title "><%= field.name %></h2> <h2 class="h2-title "><%= field.name %></h2>
<div class="sn-index-wx"> <div class="sn-index-wx">
<img class="fl sn-index-wximg" src="/images/wx.gif" width="104" height="104" alt=""/> <img class="fl sn-index-wximg" src="/images/wx.gif" width="104" height="104" alt=""/>
<p class="fl sn-index-txt">暂无内容!</p> <p class="fl sn-index-txt">暂无内容!</p>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
<% end %> <% end %>
<% elsif field.field_type == "Resource" %> <% elsif field.field_type == "Resource" %>
<% org_attachs = get_attach_org2(field) %> <% org_attachs = get_attach_org2(field) %>
<div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;"> <div class="sn-index-smallbanner" style="display:<%= field.hide == 0?'block':'none' %>;">
<% if !field.subfield_subdomain_dir.nil? %> <% 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) %> <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %>
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
<% else %> <% else %>
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %>
<% end %> <% end %>
<% else %> <% else %>
<%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -39,7 +39,7 @@ a.sn-link-select {color:#809df9;}
.sn-f12 {font-size:12px;} .sn-f12 {font-size:12px;}
.sn-f14 {font-size:14px;} .sn-f14 {font-size:14px;}
.sn-f18 {font-size:18px;} .sn-f18 {font-size:18px;}
/*padding&margin*/ /*padding&margin&width*/
.sn-mt-10 {margin-left:-10px;} .sn-mt-10 {margin-left:-10px;}
.sn-mt4 {margin-top:4px;} .sn-mt4 {margin-top:4px;}
.sn-mt10 {margin-top:10px;} .sn-mt10 {margin-top:10px;}
@ -51,6 +51,7 @@ a.sn-link-select {color:#809df9;}
.sn-ml55 {margin-left:55px;} .sn-ml55 {margin-left:55px;}
.sn-mr0 {margin-right:0px !important;} .sn-mr0 {margin-right:0px !important;}
.sn-mr50 {margin-right:50px;} .sn-mr50 {margin-right:50px;}
.sn-w229 {width:229px;}
/*头部样式*/ /*头部样式*/
.sn-header {} .sn-header {}
.sn-row {width:100%;} .sn-row {width:100%;}