将setting中的domain合并到host配置中
This commit is contained in:
parent
9f3cdba9db
commit
39308dacfd
|
@ -315,7 +315,7 @@ class AccountController < ApplicationController
|
|||
#根据home_url生产正则表达式
|
||||
eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/")
|
||||
if (code=~params[:back_url] || params[:back_url].to_s.include?('lost_password')) && last_login_on != ''
|
||||
redirect_to user_activities_path(user,host: Setting.user_domain)
|
||||
redirect_to user_activities_path(user,host: Setting.host_user)
|
||||
else
|
||||
if last_login_on == ''
|
||||
redirect_to my_account_url
|
||||
|
|
|
@ -118,11 +118,11 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
#if user.active? || (User.current.admin? && user.logged?)
|
||||
# link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
|
||||
# link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => user.css_classes
|
||||
#else
|
||||
# name
|
||||
#end
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => user.css_classes
|
||||
else
|
||||
h(user.to_s)
|
||||
end
|
||||
|
@ -131,7 +131,7 @@ module ApplicationHelper
|
|||
def link_to_isuue_user(user, options={})
|
||||
if user.is_a?(User)
|
||||
name = h(user.name(options[:format]))
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => "pro_info_p"
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => "pro_info_p"
|
||||
else
|
||||
h(user.to_s)
|
||||
end
|
||||
|
@ -140,7 +140,7 @@ module ApplicationHelper
|
|||
def link_to_settings_user(user, options={})
|
||||
if user.is_a?(User)
|
||||
name = h(user.name(options[:format]))
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => "w90 c_orange fl"
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => "w90 c_orange fl"
|
||||
else
|
||||
h(user.to_s)
|
||||
end
|
||||
|
@ -155,7 +155,7 @@ module ApplicationHelper
|
|||
else
|
||||
name = user.login
|
||||
end
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => options[:class]
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => options[:class]
|
||||
else
|
||||
h(user.to_s)
|
||||
end
|
||||
|
@ -2076,21 +2076,21 @@ module ApplicationHelper
|
|||
hidden_non_project = Setting.find_by_name("hidden_non_project")
|
||||
visiable = !(hidden_non_project && hidden_non_project.value == "0")
|
||||
|
||||
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.course_domain}
|
||||
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain}
|
||||
main_contest_link = link_to l(:label_contest_innovate), {:controller => 'welcome', :action => 'index', :host => Setting.contest_domain}
|
||||
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.host_course}
|
||||
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.host_name}
|
||||
main_contest_link = link_to l(:label_contest_innovate), {:controller => 'welcome', :action => 'index', :host => Setting.host_contest}
|
||||
|
||||
# course_all_course_link = link_to l(:label_course_all), {:controller => 'courses', :action => 'index'}
|
||||
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.course_domain}
|
||||
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.host_course}
|
||||
# courses_link = link_to l(:label_course_practice), {:controller => 'courses', :action => 'index'}
|
||||
#users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain}
|
||||
#users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.host_user}
|
||||
# contest_link = link_to l(:label_contest_innovate), {:controller => 'contests', :action => 'index'}
|
||||
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
|
||||
forum_link = link_to l(:label_forum_all), {:controller => "forums", :action => "index"}
|
||||
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
|
||||
school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'}
|
||||
project_new_link = link_to l(:label_project_new), {:controller => 'projects', :action => 'new', :host => Setting.project_domain}
|
||||
# project_mine_link = link_to l(:label_my_project), {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
|
||||
project_new_link = link_to l(:label_project_new), {:controller => 'projects', :action => 'new', :host => Setting.host_name}
|
||||
# project_mine_link = link_to l(:label_my_project), {:controller => 'users', :action => 'user_projects', :host => Setting.host_name}
|
||||
|
||||
#@nav_dispaly_project_label
|
||||
nav_list = Array.new
|
||||
|
|
|
@ -11,7 +11,7 @@ module GitlabHelper
|
|||
PROJECT_PATH_CUT = 40
|
||||
# gitlab版本库所在服务器
|
||||
# 注意REPO_IP_ADDRESS必须以http://开头,暂时只支持HTTP协议,未支持SSH
|
||||
#REPO_IP_ADDRESS = "http://" + Setting.repository_domain
|
||||
#REPO_IP_ADDRESS = "http://" + Setting.host_repository
|
||||
REPO_IP_ADDRESS = "http://192.168.137.100"
|
||||
GITLAB_API = "/api/v3"
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ module RepositoriesHelper
|
|||
ROOT_PATH="/home/pdl/redmine-2.3.2-0/apache2/"
|
||||
end
|
||||
PROJECT_PATH_CUT = 40
|
||||
REPO_IP_ADDRESS = Setting.repository_domain
|
||||
REPO_IP_ADDRESS = Setting.host_repository
|
||||
|
||||
def format_revision(revision)
|
||||
if revision.respond_to? :format_identifier
|
||||
|
|
|
@ -187,7 +187,7 @@
|
|||
|
||||
<!-- modified by longjun -->
|
||||
<%= link_to l(:label_create_new_projects),
|
||||
new_project_path(:course => 0, :project_type => 0, :host => Setting.project_domain),
|
||||
new_project_path(:course => 0, :project_type => 0, :host => Setting.host_name),
|
||||
:target => '_blank'
|
||||
%>
|
||||
<!-- end longjun -->
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
<% end %>
|
||||
<%= render :partial => 'layouts/user_project_list', :locals => {:hasCourse => hasCourse} %>
|
||||
<li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
|
||||
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;">
|
||||
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')',
|
||||
{ :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain },
|
||||
{ :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user },
|
||||
{:class => 'my-message'} if User.current.logged?%>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -67,17 +67,17 @@ end
|
|||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=User.current%> <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged? -%>
|
||||
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user }, {:class => 'my-message'} if User.current.logged? -%>
|
||||
</li>
|
||||
<li>
|
||||
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %>
|
||||
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.host_course} %>
|
||||
</li>
|
||||
<li>
|
||||
<%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
|
||||
<%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name} %>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li>
|
||||
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
|
||||
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -18,15 +18,15 @@
|
|||
<% if User.current.logged? -%>
|
||||
|
||||
<li id="current_user_li">
|
||||
<%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.user_domain}, :class => "uses_name"%>
|
||||
<%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, :class => "uses_name"%>
|
||||
<ul id="user_sub_menu" style="right: 0px;display: none;">
|
||||
<% unless User.current.projects.empty? %>
|
||||
<li id="my_projects_li">
|
||||
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain}, :class => "parent" %>
|
||||
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name}, :class => "parent" %>
|
||||
<ul id="my_projects_ul">
|
||||
<% User.current.projects.each do |project| %>
|
||||
<li title="<%=project.name%>">
|
||||
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %>
|
||||
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name } %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<li>
|
||||
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
|
||||
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<% if User.current.projects.count>0 %>
|
||||
<li id="project_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
|
||||
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.host_name} %>
|
||||
<ul class="project_sub_menu" style="top:<%= hasCourse ? 35 : 0 %>px;">
|
||||
<% User.current.projects.each do |project| %>
|
||||
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=project.name%>">
|
||||
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %>
|
||||
<%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.host_name } %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<% memberships = user.memberships.all(:conditions => cond) %>
|
||||
<%= l(:label_x_contribute_to, :count => memberships.count) %>
|
||||
<% for member in memberships %>
|
||||
<%= link_to member.project.name, {:controller => 'projects', :action => 'show',id: member.project.id, host: Setting.project_domain } %><%= (memberships.last == member) ? '' : ',' %>
|
||||
<%= link_to member.project.name, {:controller => 'projects', :action => 'show',id: member.project.id, host: Setting.host_name } %><%= (memberships.last == member) ? '' : ',' %>
|
||||
<% end %>
|
||||
<p>
|
||||
<%# unless user.memberships.empty? %>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<%= ":" unless user_courses.empty? %>
|
||||
<% for course in user_courses %>
|
||||
<%# if course.name != nil %>
|
||||
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
<%# end %>
|
||||
<% end %>
|
||||
<%# end %>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
|
||||
<%= ":" unless user_courses.empty? %>
|
||||
<% for course in user_courses %>
|
||||
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
<% end %>
|
||||
</p>
|
||||
</td>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<%= ":" unless user_courses.empty? %>
|
||||
<% for course in user_courses %>
|
||||
<%# if course.name != nil %>
|
||||
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
<%# end %>
|
||||
<% end %>
|
||||
<%# end %>
|
||||
|
|
|
@ -254,16 +254,6 @@ tags_max_length:
|
|||
tags_show_search_results:
|
||||
format: int
|
||||
default: 5
|
||||
user_domain:
|
||||
default: user.trustie.net
|
||||
project_domain:
|
||||
default: forge.trustie.net
|
||||
contest_domain:
|
||||
default: contest.trustie.net
|
||||
course_domain:
|
||||
default: course.trustie.net
|
||||
repository_domain:
|
||||
default: repository.trustie.net
|
||||
please_chose:
|
||||
default: 请选择
|
||||
hidden_non_project:
|
||||
|
|
2967
db/schema.rb
2967
db/schema.rb
File diff suppressed because it is too large
Load Diff
|
@ -267,7 +267,7 @@ Redmine::AccessControl.map do |map|
|
|||
end
|
||||
#by young
|
||||
Redmine::MenuManager.map :top_menu do |menu|
|
||||
menu.push :home, {:host => Setting.user_domain}
|
||||
menu.push :home, {:host => Setting.host_user}
|
||||
menu.push :course_practice, {:controller => 'projects', :action => 'course', :project_type => 1}
|
||||
menu.push :project_deposit, { :controller => 'projects', :action => 'index', :project_type => 0}, :caption => :label_project_deposit
|
||||
menu.push :software_user, {:controller => 'users', :action => 'index'}
|
||||
|
@ -336,7 +336,7 @@ end
|
|||
########fq
|
||||
Redmine::MenuManager.map :bid_menu do |menu|
|
||||
menu.push :respond, { :controller => 'bids', :action => 'show' }, :caption => :label_user_response
|
||||
menu.push :project, { :controller => 'bids', :action => 'show_project', :host => Setting.project_domain }, :caption => :label_bidding_project
|
||||
menu.push :project, { :controller => 'bids', :action => 'show_project', :host => Setting.host_name }, :caption => :label_bidding_project
|
||||
# menu.push :result, { :controller => 'bids', :action => 'show_results' },
|
||||
# :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }
|
||||
end
|
||||
|
@ -422,7 +422,7 @@ Redmine::MenuManager.map :course_menu do |menu|
|
|||
|
||||
end
|
||||
Redmine::MenuManager.map :user_menu do |menu|
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain }
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.host_user }
|
||||
menu.push :user_course, {:controller => 'users', :action => 'user_courses'},
|
||||
:if => Proc.new {|u| if User.current == u || User.current.admin?
|
||||
membership = u.coursememberships.all
|
||||
|
@ -432,7 +432,7 @@ Redmine::MenuManager.map :user_menu do |menu|
|
|||
FirstPage.find_by_page_type('project').show_course != 2 && membership && membership.count > 0
|
||||
}
|
||||
#menu.push :user_homework, {:controller => 'users', :action => 'user_homeworks'} by huang
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects_index', :host => Setting.project_domain},
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects_index', :host => Setting.host_name},
|
||||
:if => Proc.new {|u| if User.current.admin?
|
||||
memberships = u.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}").first
|
||||
else
|
||||
|
@ -443,24 +443,24 @@ Redmine::MenuManager.map :user_menu do |menu|
|
|||
memberships || watch_projects
|
||||
}
|
||||
# menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} by huang
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user}
|
||||
|
||||
end
|
||||
Redmine::MenuManager.map :user_enterprise_menu do |menu|
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain }
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.host_user }
|
||||
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.host_name}
|
||||
|
||||
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.user_domain}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain}
|
||||
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user}
|
||||
|
||||
end
|
||||
Redmine::MenuManager.map :user_menu_self do |menu|
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.project_domain }
|
||||
menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.user_domain}
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
|
||||
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.user_domain}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain}
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.host_name }
|
||||
menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.host_user}
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.host_name}
|
||||
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.host_user}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.host_user}
|
||||
|
||||
end
|
||||
#end
|
||||
|
|
Loading…
Reference in New Issue