From baf547417e276bab6bed95ab80b58530b61652e6 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 16 Mar 2016 14:57:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E7=94=A8Setting.protocol=E8=A1=A8=E7=A4=BA=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 48 +++++++++++++------------------ 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d27119c0e..928f99588 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2943,91 +2943,83 @@ int main(int argc, char** argv){ end def user_url_in_org(user_id) - if Rails.env.development? - return "http://localhost:3000/users/" + user_id.to_s - else - return "https://" + Setting.host_name + "/users/" + user_id.to_s - end + Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s end def project_issues_url_in_org(project_id) - Setting.host_name + "/projects/" + project_id.to_s + "/issues" + Setting.protocol + "://" + Setting.host_name + "/projects/" + project_id.to_s + "/issues" end def issue_url_in_org(id) - Setting.host_name + "/issues/" + id.to_s + Setting.protocol + "://" + Setting.host_name + "/issues/" + id.to_s end def project_boards_url_in_org(id) - Setting.host_name + "/projects/" + id.to_s + "/boards" + Setting.protocol + "://" + Setting.host_name + "/projects/" + id.to_s + "/boards" end def board_message_url_in_org(board_id, message_id) - Setting.host_name + "/boards/" + board_id.to_s + "/topics/" + message_id.to_s + Setting.protocol + "://" + Setting.host_name + "/boards/" + board_id.to_s + "/topics/" + message_id.to_s end def project_url_in_org(id) - Setting.host_name + "/projects/" + id.to_s + Setting.protocol + "://" + Setting.host_name + "/projects/" + id.to_s end def homework_common_index_url_in_org(course_id) - Setting.host_name + "/homework_common?course=" + course_id.to_s + Setting.protocol + "://" + Setting.host_name + "/homework_common?course=" + course_id.to_s end def student_work_index_url_in_org(homework_id) - Setting.host_name + "/student_work?homework=" + homework_id.to_s + Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s end def course_url_in_org(course_id) - Setting.host_name + "/courses/" + course_id.to_s + Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s end def user_watchlist_url_in_org(id) - Setting.host_name + "/users/" + id.to_s + "/user_watchlist" + Setting.protocol + "://" + Setting.host_name + "/users/" + id.to_s + "/user_watchlist" end def user_fanslist_url_in_org(id) - Setting.host_name + "/users/" + id.to_s + "/user_fanslist" + Setting.protocol + "://" + Setting.host_name + "/users/" + id.to_s + "/user_fanslist" end def user_blogs_url_in_org(user_id) - Setting.host_name + "/users/" + user_id.to_s + "/blogs" + Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/blogs" end def feedback_url_in_org(user_id) - Setting.host_name + "/users/" + user_id.to_s + "/user_newfeedback" + Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/user_newfeedback" end def user_activities_url_in_org(user_id) - Setting.host_name + "/users/" + user_id.to_s + "/user_activities" + Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/user_activities" end def course_news_index_url_in_org(course_id) - Setting.host_name + "/courses/" + course_id.to_s + "/news" + Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s + "/news" end def news_url_in_org(news_id) - Setting.host_name + "/news/" + news_id.to_s + Setting.protocol + "://" + Setting.host_name + "/news/" + news_id.to_s end def course_boards_url_in_org(course_id) - Setting.host_name + "/courses/" + course_id.to_s + "/boards" + Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s + "/boards" end def logout_url_without_domain - if Rails.env.development? - return "http://localhost:3000/logout" - else - return "https://" + Setting.host_name + "/logout" - end + Setting.protocol + "://" + Setting.host_name + "/logout" end def signin_url_without_domain - Setting.host_name + "/login?login=true" + Setting.protocol + "://" + Setting.host_name + "/login?login=true" end def register_url_without_domain - Setting.host_name + "/login?login=false" + Setting.protocol + "://" + Setting.host_name + "/login?login=false" end #判断是否为默认的组织栏目 def is_default_field? field