This commit is contained in:
huang 2016-06-02 14:54:04 +08:00
parent 94dd8befc8
commit 135e50b2e7
3 changed files with 13 additions and 5 deletions

View File

@ -1,6 +1,6 @@
class OrgDocumentCommentsController < ApplicationController
before_filter :find_organization, :only => [:new, :create, :show, :index]
before_filter :authorize_allowed, :only => [:create, :add_reply]
before_filter :authorize_allowed, :only => [:create]
helper :attachments,:organizations
layout 'base_org'

View File

@ -1,7 +1,7 @@
class SubDocumentCommentsController < ApplicationController
before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy, :edit]
before_filter :find_subfield_content, :only => [:show, :index]
before_filter :authorize_allowed, :only => [:create, :add_reply]
before_filter :authorize_allowed, :only => [:create]
helper :attachments,:organizations
layout 'base_sub_domain'

View File

@ -98,13 +98,21 @@
<% else %>
<% if field.field_type == "Post" && field.hide == 0 %>
<li class="nav-element">
<a href="#message_<%= field.id %>" class="sn-link-white"><%= field.name %></a>
<% 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 field.name, show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "sn-link-white", :target => "_blank" %>
<% else %>
<%= link_to field.name, show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "sn-link-white", :target => "_blank" %>
<% end %>
<% else %>
<%= link_to field.name, organization_path(@organization, :org_subfield_id => field.id), :class => "sn-link-white", :target => "_blank" %>
<% end %>
</li>
<!--二级目录-->
<div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;">
<ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;">
<% field.sub_domains.each do |subdomain| %>
<li><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => field.id), :class => "sn-link-grey" %></li>
<li><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => field.id), :class => "sn-link-grey", :target => "_blank" %></li>
<li class="sn-subnav-slice">|</li>
<% end %>
</ul>
@ -118,7 +126,7 @@
<% end %>
<% if User.current.admin_of_org?(@organization) %>
<li class="nav-element">
<a href="<%= setting_organization_path(@organization) %>" class="sn-link-white">配置</a>
<a href="<%= setting_organization_path(@organization) %>" class="sn-link-white" target = "_blank">配置</a>
</li>
<% end %>
</ul>