组织下的链接用Setting.protocol表示协议

ouyang
ouyangxuhua 10 years ago
parent ea6de1407e
commit baf547417e

@ -2943,91 +2943,83 @@ int main(int argc, char** argv){
end end
def user_url_in_org(user_id) def user_url_in_org(user_id)
if Rails.env.development? Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s
return "http://localhost:3000/users/" + user_id.to_s
else
return "https://" + Setting.host_name + "/users/" + user_id.to_s
end
end end
def project_issues_url_in_org(project_id) 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 end
def issue_url_in_org(id) def issue_url_in_org(id)
Setting.host_name + "/issues/" + id.to_s Setting.protocol + "://" + Setting.host_name + "/issues/" + id.to_s
end end
def project_boards_url_in_org(id) 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 end
def board_message_url_in_org(board_id, message_id) 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 end
def project_url_in_org(id) def project_url_in_org(id)
Setting.host_name + "/projects/" + id.to_s Setting.protocol + "://" + Setting.host_name + "/projects/" + id.to_s
end end
def homework_common_index_url_in_org(course_id) 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 end
def student_work_index_url_in_org(homework_id) 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 end
def course_url_in_org(course_id) 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 end
def user_watchlist_url_in_org(id) 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 end
def user_fanslist_url_in_org(id) 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 end
def user_blogs_url_in_org(user_id) 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 end
def feedback_url_in_org(user_id) 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 end
def user_activities_url_in_org(user_id) 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 end
def course_news_index_url_in_org(course_id) 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 end
def news_url_in_org(news_id) 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 end
def course_boards_url_in_org(course_id) 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 end
def logout_url_without_domain def logout_url_without_domain
if Rails.env.development? Setting.protocol + "://" + Setting.host_name + "/logout"
return "http://localhost:3000/logout"
else
return "https://" + Setting.host_name + "/logout"
end
end end
def signin_url_without_domain def signin_url_without_domain
Setting.host_name + "/login?login=true" Setting.protocol + "://" + Setting.host_name + "/login?login=true"
end end
def register_url_without_domain def register_url_without_domain
Setting.host_name + "/login?login=false" Setting.protocol + "://" + Setting.host_name + "/login?login=false"
end end
#判断是否为默认的组织栏目 #判断是否为默认的组织栏目
def is_default_field? field def is_default_field? field

Loading…
Cancel
Save