diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index ec96fcf76..af3783e3d 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -245,6 +245,10 @@ class AdminController < ApplicationController end end + def shixuns + @shixuns = Shixun.all + end + # 单位名称列表下的已审批按照名字排序 def apply_shcool_sort @order = "" diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index be4f094fb..4b6e764a0 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -21,6 +21,9 @@ class ShixunsController < ApplicationController end def index + @shixuns = Shixun.all + + @shixuns_count = @shixuns.count render :layout => "base_edu" end diff --git a/app/helpers/shixuns_helper.rb b/app/helpers/shixuns_helper.rb index 66ffdc9cc..fa22930b1 100644 --- a/app/helpers/shixuns_helper.rb +++ b/app/helpers/shixuns_helper.rb @@ -1,5 +1,9 @@ module ShixunsHelper + def had_passed_count + + end + #显示项目配置菜单 def show_project_memu user if user.allowed_to?(:edit_project, @shixun) diff --git a/app/models/shixun.rb b/app/models/shixun.rb index 5ab4e4b99..0bc98ff0c 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -1,4 +1,4 @@ -# status 控制实训的状态,0:未开启;1: 已开启(TPM) +# status 控制实训的状态,0:未开启;1: 已开启(TPM); 2:已认证 class Shixun < ActiveRecord::Base attr_accessible :description, :is_public, :name, :changeset_num, :status, :user_id, :gpid, :language diff --git a/app/views/admin/shixuns.html.erb b/app/views/admin/shixuns.html.erb new file mode 100644 index 000000000..dd2536cdd --- /dev/null +++ b/app/views/admin/shixuns.html.erb @@ -0,0 +1,48 @@ +<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', :media => 'all' %> +

实训列表

+<%#= render 'admin/tab_excellent_courses' %> + + + + + +
+ + + + + + + + + + + <% @shixuns.each do |shixun| %> + "> + + + + + + <% end %> + +
+ 序号 + + 实训名 + + 创建者 + + 操作 +
+ <%= shixun.id %> + + + <%= link_to(shixun.name, shixun_path(shixun.id)) %> + + + <%= link_to(shixun.try(:owner).try(:realname).truncate(6, omission: '...'), user_path(shixun.owner)) %> + + <%= link_to(shixun.status == 2 ? "已认证" : "认证", { :controller => 'admin', :action => 'shixun', :id => shixun.id }, :class => 'icon-del') %> +
+
diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index f98eec104..c8ad22cfc 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -35,12 +35,12 @@ diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb index 3d01865ad..7b2563ae6 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -18,12 +18,17 @@ - 注册 - 登录 +
+ 注册 + + 登录 +