组织base中添加二级域名

This commit is contained in:
huang 2016-05-03 14:55:08 +08:00
parent 517db8f105
commit 6635ded1e8
5 changed files with 37 additions and 17 deletions

View File

@ -134,6 +134,7 @@
</div>
<div class="homepageLeftMenuContainer" id="sub_field_left_lists">
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
</div>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @organization.visits.to_i %></div>
</div>

View File

@ -96,31 +96,19 @@
<%#= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuPost').slideToggle();"><%= field.name %></a>
<%#= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
<% end %>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuPost" style="display:<%= organization.projects.count == 0?'none':'' %>">
<div class="homepageLeftMenuCourses" id="homepageLeftMenuPost" style="display:<%= field.sub_domains.count == 0?'none':'' %>">
<ul>
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.where("status=1").reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
<%= render :partial => 'organizations/org_subdomain',:locals=>{:subdomains => field.sub_domains.reorder('created_at').uniq.limit(5), :org_subfield_id => field.id} %>
</ul>
</div>
<% 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" %>
<% else %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% end %>
<% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
<% end %>
<% if User.current.member_of_org?organization %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
<% end %>
<% else %>
<% 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) %>

View File

@ -0,0 +1,11 @@
<% subdomains.each do |subdomain|%>
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to subdomain.name, org_subfield_sub_domain_path(subdomain, :org_subfield_id => org_subfield_id), :class => "coursesLineGrey hidden", :title => subdomain.name %>
</li>
<% end %>
<% if subdomains.size == 5 %>
<li class="homepageLeftMenuMore" id="show_more_org_project">
<input type="hidden" value="<%= page %>" id="org_project_page_num">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_project('<%= more_org_projects_organization_path(org_id) %>');"></a>
</li>
<% end%>

View File

@ -98,7 +98,7 @@
<a href="javascript:void(0);" class="linkGrey fr ml5 mr5" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
<span class="fr">|</span>
<a href="javascript:void(0);" class="linkGrey fr mr5" onclick="org_submain_new('<%= escape_javascript(render :partial => 'sub_domains/new', :locals => {:organization => @organization, :field => field}) %>');">添加二级目录</a>
<a href="javascript:void(0);" class="linkGrey fr mr5" onclick="org_submain_new('<%= escape_javascript(render :partial => 'sub_domains/new', :locals => {:organization => @organization, :field => field}).html_safe %>');">添加二级目录</a>
</li>
<div class="cl"></div>
</ul>

View File

@ -0,0 +1,20 @@
<div class="org-popup-wrap sn-w300"> <a href="javascript:void(0);" class="org-popup-close"></a>
<div class="f16 fb fontBlue mb10">添加二级目录</div>
<span class="fontGrey3 fb mb5 mr10">二级栏目名称</span>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
<ul class="orgAddRole mb10">
<li class="fontGrey3 fb ml24 mr10 fl">栏目类型</li>
<li class="fl mr15">
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
<label for="orgMng">帖子</label>
</li>
<li class="fl mr15">
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
<li class="cl"></li>
</ul>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText">确定</a></div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText">取消</a></div>
<div class="cl"></div>
</div>