实训入口
This commit is contained in:
parent
598e00f5c6
commit
3719b8c973
|
@ -20,17 +20,22 @@ class GamesController < ApplicationController
|
|||
# 首次进入版本库自动打开文件
|
||||
# path:"" && path: @game.path
|
||||
def show
|
||||
logger.info("*** ###############")
|
||||
game_path = (@game.path.blank? ? @game.path : @game.path.strip)
|
||||
@rev = @rev.nil? ? "master" : @rev
|
||||
@git_url = git_repository_url(@myshixun, "Myshixun")
|
||||
logger.info("*** git_url is###{@git_url}")
|
||||
@type = params[:type]
|
||||
logger.info("*** ###{@rev}#######{@path}")
|
||||
# 默认打开文件
|
||||
if @path == "" && !game_path.nil? && !@repository.cat(game_path, @rev).blank? && @type != "root"
|
||||
@path = game_path
|
||||
@file_open = true
|
||||
@content = @repository.cat(@path, @rev)
|
||||
logger.info("content result is ###############{@content}")
|
||||
else
|
||||
@entries = @repository.entries(@path, @rev)
|
||||
logger.info("result is ###############{@entries.first.try(:path)}")
|
||||
end
|
||||
@latest_output = @game.latest_output.try(:out_put)
|
||||
outputs = @game.outputs
|
||||
|
|
|
@ -42,7 +42,8 @@ class UsersController < ApplicationController
|
|||
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,:user_contestlist, :user_manage_issues, :user_receive_issues,
|
||||
:user_courses4show,:user_projects4show,:user_contests4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
|
||||
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community, :contest_community]
|
||||
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community, :contest_community,
|
||||
:user_shixuns]
|
||||
before_filter :auth_user_extension, only: :show
|
||||
before_filter :show_system_message, :only => [:show]
|
||||
#before_filter :rest_user_score, only: :show
|
||||
|
@ -651,6 +652,14 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# 我发布的实训
|
||||
def user_shixuns
|
||||
@shixuns = Shixun.where(:user_id => User.current)
|
||||
respond_to do |format|
|
||||
format.html{render :layout=>'base_users_new'}
|
||||
end
|
||||
end
|
||||
|
||||
#处理加入课程成为教辅教师的请求
|
||||
#status 1 同意 2 拒绝
|
||||
def dealwith_apply_request
|
||||
|
|
|
@ -55,6 +55,9 @@
|
|||
<li>
|
||||
<%= link_to "竞赛", user_contest_community_path(User.current), :class => "new-nav-a", :target => "_blank" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "智能实训", user_shixuns_user_path(User.current), :class => "new-nav-a", :target => "_blank" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "问吧", forums_path, :class =>"new-nav-a", :target => "_blank" %>
|
||||
</li>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<ul>
|
||||
<% @shixuns.each do |shixun| %>
|
||||
<li><%= shixun.name %></li>
|
||||
<% end %>
|
||||
</ul>
|
|
@ -744,6 +744,8 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
|
||||
member do
|
||||
get 'user_shixuns', :to => 'users#user_shixuns'
|
||||
get 'user_myshixuns', :to => 'users#user_myshixuns'
|
||||
match 'user_projects_index', :to => 'users#user_projects_index', :via => :get
|
||||
match 'user_projects', :to => 'users#user_projects', :via => :get
|
||||
match 'user_activities', :to => 'users#user_activities', :via => :get, :as => "user_activities"
|
||||
|
|
Loading…
Reference in New Issue