一级帖子栏目默认展示5个,点击可进入详情页面,
This commit is contained in:
parent
acbc94af1a
commit
b259f92381
|
@ -460,6 +460,16 @@ class OrganizationsController < ApplicationController
|
|||
@members = paginateHelper @members, 20
|
||||
end
|
||||
|
||||
def more_org_submains
|
||||
@org_subfield = OrgSubfield.find params[:org_subfield_id].to_i
|
||||
|
||||
@page = params[:page]
|
||||
@submains = @org_subfield.sub_domains.reorder('priority').uniq.page((params[:page].to_i || 1) +1).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def more_org_projects
|
||||
@organization = Organization.find params[:id]
|
||||
@page = params[:page]
|
||||
|
|
|
@ -43,12 +43,11 @@
|
|||
$(this).prev().css("color","#808080");
|
||||
$(this).css("z-index", "1");
|
||||
});
|
||||
|
||||
//二级菜单滑动时箭头方向控制
|
||||
$(".homepageLeftMenuMoreIcon").toggle(function(){
|
||||
$(this).css("background","url(/images/homepage_icon.png) 100px -624px no-repeat");
|
||||
},function(){
|
||||
$(this).css("background","url(/images/homepage_icon.png) -74px -240px no-repeat");
|
||||
},function(){
|
||||
$(this).css("background","url(/images/homepage_icon.png) 100px -624px no-repeat");
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
@ -103,17 +102,15 @@
|
|||
<%= 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 %>
|
||||
<!-- link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" -->
|
||||
<a href = "javascript:void(0);" class = "homepageMenuText" onclick = "$('#PostDomain_<%= field.id %>').slideToggle();"><%= field.name %></a>
|
||||
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :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="PostDomain_<%= field.id %>" style="display:<%= field.sub_domains.count == 0 ? 'none' : '' %>">
|
||||
|
||||
<div class="<%= (field.sub_domains.count == 0) ? 'homepageLeftMenuCourses':'homepageLeftMenuCourses borderBottomNone' %>" id="PostDomain_<%= field.id %>" style="display:block;">
|
||||
<ul>
|
||||
<%= render :partial => 'organizations/org_subdomain',:locals => {:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
|
||||
<%= render :partial => 'organizations/org_subdomain',:locals => {:subdomains => field.sub_domains.reorder('priority').uniq.limit(5), :org_subfield_id => field.id, :page=>1, :org_id => organization.id } %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -139,20 +136,20 @@
|
|||
</div>
|
||||
<% 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) %>
|
||||
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden" %>
|
||||
<% 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" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText homepageMenuControl hidden" %>
|
||||
<% end %>
|
||||
<% if User.current.member_of_org?organization %>
|
||||
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
|
||||
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->
|
||||
<% end %>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText"><%#= 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 => "homepageMenuText homepageMenuControl hidden" %>
|
||||
<% 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" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText homepageMenuControl hidden" %>
|
||||
<% end %>
|
||||
<% if User.current.member_of_org?organization %>
|
||||
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
|
||||
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->
|
||||
<% end %>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText"><%#= field.name %></a>-->
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
<%= link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_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%>
|
||||
<% if subdomains.size == 5 %>
|
||||
<li class="homepageLeftMenuMore" id="show_more_org_submains">
|
||||
<input type="hidden" value="<%= page %>" id="org_submains_page_num">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_submain('<%= more_org_submains_organization_path(org_id, :org_subfield_id => org_subfield_id) %>');"></a>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#show_more_org_submains").replaceWith("<%= escape_javascript( render :partial => 'organizations/org_subdomain',:locals => {:subdomains => @submains, :org_subfield_id => @org_subfield.id, :page=> @page, :org_id => @organization } )%>");
|
|
@ -73,6 +73,7 @@ RedmineApp::Application.routes.draw do
|
|||
put 'set_homepage'
|
||||
put 'cancel_homepage'
|
||||
get 'members'
|
||||
get 'more_org_submains'
|
||||
get 'more_org_projects'
|
||||
get 'more_org_courses'
|
||||
get 'search_courses'
|
||||
|
|
|
@ -34,6 +34,17 @@ function observeSearchfield(fieldId, targetId, url) {
|
|||
});
|
||||
}
|
||||
|
||||
//显示更多子栏目
|
||||
function show_more_org_submain(url){
|
||||
$.get(
|
||||
url,
|
||||
{ page: $("#org_submains_page_num").val() },
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//显示更多的项目
|
||||
function show_more_org_project(url){
|
||||
$.get(
|
||||
|
|
Loading…
Reference in New Issue