more链接添加,区分两种模式

This commit is contained in:
huang 2016-03-29 20:33:16 +08:00
parent a26cf19b86
commit f2106d0045
3 changed files with 16 additions and 16 deletions

View File

@ -70,13 +70,12 @@ class OrganizationsController < ApplicationController
def show def show
# 组织新类型 show_mode判断标准 1为新类型0为旧 # 组织新类型 show_mode判断标准 1为新类型0为旧
if @organization.show_mode == 1 if @organization.show_mode == 1 && params[:org_subfield_id].nil?
@subfield_content = @organization.org_subfields.order("priority") @subfield_content = @organization.org_subfields.order("priority")
@project_acts = get_project_activities_org @organization @project_acts = get_project_activities_org @organization
@course_acts_homework = get_course_homework_activities_org @organization @course_acts_homework = get_course_homework_activities_org @organization
@course_acts_message = get_course_message_activities_org @organization @course_acts_message = get_course_message_activities_org @organization
render :layout => 'base_org_newstyle' render :layout => 'base_org_newstyle'
else else
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@organization = Organization.find(params[:id]) @organization = Organization.find(params[:id])

View File

@ -210,24 +210,13 @@
</div><!--box2 end--> </div><!--box2 end-->
<% end %> <% end %>
<% else %> <% else %>
<% if field.field_type == "Post" %> <% if field.field_type == "Post" %> <%# 讨论类型 %>
<% message_ats = get_message_org(@organization.id, field.id) %> <% message_ats = get_message_org(@organization.id, field.id) %>
<div class="box1" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>"> <div class="box1" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="content"> <div class="content">
<div class="box-top" id="message_<%= field.id %>"><h2 class="box-title"><%= field.name %></h2><p class="box-title-p">activity zone</p></div> <div class="box-top" id="message_<%= field.id %>"><h2 class="box-title"><%= field.name %></h2><p class="box-title-p">discussion zone</p></div>
<div class="row"> <div class="row">
<% message_ats.each do |message| %> <%= render :partial => 'organizations/org_new_forum', :locals => {:message_ats => message_ats, :field => field, :organization => @organization} %>
<div class="row-box3 mr30 fl">
<a href="#" target="_blank" class="row-img2"><img src="/images/org_new_style/pic1.jpg"></a>
<a href="#" target="_blank" class="row-con">
<h3 class="row-title3 fl"><%=link_to message.title %></h3>
<span class="row-time fr"><%= format_date(message.updated_at) %></span>
<div class="cl"></div>
<div class="row-txt"><%= message.content.html_safe %></div>
</a>
<a href="#" target="_blank" class="btn-more">More</a>
</div><!--row-box3 end-->
<% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div><!--content end--> </div><!--content end-->

View File

@ -0,0 +1,12 @@
<% message_ats.each do |message| %>
<div class="row-box3 mr30 fl">
<a href="#" target="_blank" class="row-img2"><img src="/images/org_new_style/pic1.jpg"></a>
<a href="#" target="_blank" class="row-con">
<h3 class="row-title3 fl"><%=link_to message.title %></h3>
<span class="row-time fr"><%= format_date(message.updated_at) %></span>
<div class="cl"></div>
<div class="row-txt"><%= message.content.html_safe %></div>
</a>
<%= link_to "More", organization_path(organization, :org_subfield_id => field.id), :class => "btn-more" %>
</div><!--row-box3 end-->
<% end %>