隐藏非项目信息

This commit is contained in:
huang 2016-08-31 10:30:23 +08:00
parent 6d0f22fd60
commit 936198a8bd
11 changed files with 40 additions and 22 deletions

View File

@ -37,6 +37,13 @@ module ApplicationHelper
# super # super
# end # end
# 隐藏项目以外的信息
# return: true 显示false 不显示
def hidden_unproject_infos
hidden_info = Setting.find_by_name("hidden_non_project")
(hidden_info && hidden_info.value == "1") ? true : false
end
# 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换 # 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换
def get_user_by_mail mail def get_user_by_mail mail
user = User.find_by_mail(mail) user = User.find_by_mail(mail)

View File

@ -4,7 +4,9 @@
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li> <li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li> <li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li> <li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li> <% if hidden_unproject_infos %>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<% end %>
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li> <li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li>
</ul> </ul>

View File

@ -10,12 +10,14 @@
<li class="navHomepageMenu fl"> <li class="navHomepageMenu fl">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %> <%= link_to "资源库", user_resource_user_path(User.current, :type => 6), :class => "c_white f16 db p10" %>
</li> </li>
<li class="navHomepageMenu fl"> <% if hidden_unproject_infos %>
<li class="navHomepageMenu fl">
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%> <%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
</li> </li>
<li class="navHomepageMenu fl mr30"> <li class="navHomepageMenu fl mr30">
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %> <%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
</li> </li>
<% end %>
</ul> </ul>
</div> </div>
<script> <script>

View File

@ -251,9 +251,10 @@
}); });
</script> </script>
</div> </div>
<% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
<div id="fade" class="black_overlay">123</div>
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>

View File

@ -298,6 +298,7 @@
<div class="cl"></div> <div class="cl"></div>
</div><!--Container end--> </div><!--Container end-->
<%= render :partial => 'layouts/new_feedback' %> <%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>

View File

@ -59,7 +59,9 @@
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/footer' %> <%= render :partial => 'layouts/footer' %>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/new_feedback' %> <% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>

View File

@ -157,9 +157,7 @@
</div> </div>
<div class="user_leftnav "> <div class="user_leftnav ">
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% if hidden_unproject_infos %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<ul class="users_accordion mb10"> <ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course"> <li id="user_01" class="user_icons_course">
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %> <%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
@ -220,7 +218,9 @@
<%= yield %> <%= yield %>
</div> </div>
</div> </div>
<%= render :partial => 'layouts/new_feedback' %> <% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%= render :partial => 'layouts/footer' %> <%= render :partial => 'layouts/footer' %>

View File

@ -3,6 +3,7 @@
<ul class="resourcesSelect"> <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a> <li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType"> <ul class="homepagePostType">
<% if hidden_unproject_infos %>
<li> <li>
<ul class="homepagePostTypeHomework fl"> <ul class="homepagePostTypeHomework fl">
<li class="f14"><strong>课程消息</strong></li> <li class="f14"><strong>课程消息</strong></li>
@ -12,7 +13,7 @@
<li><%= link_to "班级问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li> <li><%= link_to "班级问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li>
</ul> </ul>
</li> </li>
<% end %>
<li> <li>
<ul class="homepagePostTypeProject fl"> <ul class="homepagePostTypeProject fl">
<li class="f14"><strong>项目消息</strong></li> <li class="f14"><strong>项目消息</strong></li>

View File

@ -4,10 +4,12 @@
<li> <li>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 1, :search => @switch_search) %>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 1, :search => @switch_search) %>" id="resource_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部 </a>
</li> </li>
<li> <% if hidden_unproject_infos %>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">班级资源 </a> <li>
<%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 2, :search => @switch_search) %>" id="resource_type_course" class="homepagePostTypeAssignment postTypeGrey'" data-method="get" data-remote="true">班级资源 </a>
</li> <%#= link_to '课程资源' ,user_resource_user_path(:id => @user.id, :type => 2), id="resource_type_course", :remote => true, :method => 'get', :class=> 'homepagePostTypeAssignment postTypeGrey' %>
</li>
<% end %>
<li> <li>
<a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 3, :search => @switch_search) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a> <a href="<%= resource_search_user_path(:id => @user.id, :type => @type, :status => 3, :search => @switch_search) %>" id="resource_type_project" class="homepagePostTypeQuiz postTypeGrey" data-method="get" data-remote="true">项目资源 </a>
<%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %> <%#= link_to '项目资源' ,user_resource_user_path(:id => @user.id, :type => 3), id="resource_type_project", :remote => true, :method => 'get', :class => 'homepagePostTypeQuiz postTypeGrey' %>

View File

@ -7,9 +7,7 @@
<ul class="homepagePostType"> <ul class="homepagePostType">
<li> <li>
<ul class="homepagePostTypeHomework fl"> <ul class="homepagePostTypeHomework fl">
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% if hidden_unproject_infos %>
<% unvisiable = hidden_courses && hidden_courses.value == "1"%>
<% if !unvisiable %>
<li class="f14">课程动态</li> <li class="f14">课程动态</li>
<li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%> <li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li> <!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>

View File

@ -21,7 +21,9 @@
<%= render :partial => 'users/user_at_message', :locals => {:ma => ma} %> <%= render :partial => 'users/user_at_message', :locals => {:ma => ma} %>
<%# 课程消息 %> <%# 课程消息 %>
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %> <% if hidden_unproject_infos %>
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>
<% end %>
<!--项目消息--> <!--项目消息-->
<%= render :partial => 'users/user_message_forge', :locals => {:ma => ma} %> <%= render :partial => 'users/user_message_forge', :locals => {:ma => ma} %>