组织下的链接用Setting.protocol表示协议
This commit is contained in:
parent
ea6de1407e
commit
baf547417e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue