组织模式一左侧权限控制
This commit is contained in:
parent
8f897cbf89
commit
6bfe344cbf
|
@ -112,46 +112,20 @@
|
|||
<%= render :partial => 'organizations/org_subdomain',:locals=>{:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<% unless (field.sub_domains.count == 0 || !if_hidden_subdomain(field)) %>
|
||||
<li class="homepageLeftMenuMore" id="sub_domain_jiantou_<%= field %>">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% elsif field.field_type == "Comptec" %>
|
||||
<% elsif field.field_type == "Comptec" && User.current.admin? %>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</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 => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Comptec" && User.current.admin? %>
|
||||
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||
<% elsif field.field_type == "Compstu" && User.current.admin? %>
|
||||
<%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||
<% elsif field.field_type != "Comptec" && field.field_type != "Compstu" %>
|
||||
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if User.current.logged? and User.current.admin_of_org?(organization) && field.field_type != "Comptec" && field.field_type != "Compstu" %>
|
||||
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
|
||||
<% end %>
|
||||
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||
</div>
|
||||
<div class="<%= (field.sub_domains.count == 0) ? 'homepageLeftMenuCourses':'homepageLeftMenuCourses borderBottomNone' %>" id="PostDomain_<%= field.id %>" style="display:none;">
|
||||
<ul>
|
||||
<%= render :partial => 'organizations/org_subdomain',:locals=>{:subdomains => field.sub_domains.reorder('priority').uniq.limit(5), :org_subfield_id => field.id} %>
|
||||
</ul>
|
||||
<% elsif field.field_type == "Compstu" && User.current.admin? %>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||
</div>
|
||||
|
||||
<% unless (field.sub_domains.count == 0 || !if_hidden_subdomain(field)) %>
|
||||
<li class="homepageLeftMenuMore" id="sub_domain_jiantou_<%= field %>">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% elsif field.field_type == "Resource" %>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<% 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) %>
|
||||
|
|
Loading…
Reference in New Issue