Merge branch 'szzh' into develop

This commit is contained in:
huang 2016-01-14 18:41:04 +08:00
commit 831f678390
3 changed files with 65 additions and 63 deletions

View File

@ -1,7 +1,7 @@
<% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine pr">
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">

View File

@ -1,5 +1,7 @@
<% if @project.is_public? %>
$("#set_project_public_<%= @project.id %>").text("设为私有");
$("#show_project_<%= @project.id %>").attr("title","公开项目:<%= @project.name %>");
<% else %>
$("#set_project_public_<%= @project.id %>").text("设为公开");
$("#show_project_<%= @project.id %>").attr("title","私有项目:<%= @project.name %>");
<% end %>

View File

@ -74,10 +74,10 @@ RedmineApp::Application.routes.draw do
end
Organization.where("domain is not null").each do |org|
org_domains = []
org_domains << org.domain
#get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: {subdomain: org.domain}
get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: lambda{ |request| org_domains.include?(request.remote_ip) }
# org_domains = []
# org_domains << org.domain
get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: {subdomain: org.domain}
#get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: lambda{ |request| org_domains.include?(request.remote_ip) }
end
get '/', to: 'organizations#show', defaults: { id: 5 }, constraints: {subdomain: 'micros'}
get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'}