From 4cc972d3febaef37cf6e43d1d3a4fd02ba4ab065 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 24 Apr 2017 17:29:38 +0800 Subject: [PATCH] =?UTF-8?q?admin=E6=8F=90=E4=BE=9B=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 4 + app/controllers/shixuns_controller.rb | 3 + app/helpers/shixuns_helper.rb | 4 + app/models/shixun.rb | 2 +- app/views/admin/shixuns.html.erb | 48 +++++++++ app/views/shixuns/index.html.erb | 144 ++++---------------------- config/locales/zh.yml | 1 + config/routes.rb | 1 + lib/redmine.rb | 1 + 9 files changed, 85 insertions(+), 123 deletions(-) create mode 100644 app/views/admin/shixuns.html.erb 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/shixuns/index.html.erb b/app/views/shixuns/index.html.erb index ed5cae83e..c2c96fc16 100644 --- a/app/views/shixuns/index.html.erb +++ b/app/views/shixuns/index.html.erb @@ -2,11 +2,11 @@

游戏实训

- 创建 + <%= link_to "创建", new_shixun_path, :class => "task-btn task-btn-green fr" %>
@@ -68,129 +68,29 @@
-
-
-
- 未审核 -

Helloworld:Python入门实训项目

-
- 用户 - Cillian + <% @shixuns.each do |shixun| %> +
+
+
+ 未审核 +

<%= shixun.name %>

+
+ <%= link_to image_tag(url_to_avatar(shixun.owner), :width =>"60", :height => "60", :class => "panel-warp-img mr10 fl", :alt=>"头像"),user_path(shixun.owner)%> + <%= link_to shixun.owner.try(:show_name), user_path(shixun.owner), :class => "task-index-name task-hide fl" %> +
+
+

<%= shixun.description %>

+
+
+
    +
  • <%= shixun.challenges.count %>
  • + +
  • <%= shixun.myshixuns.count %>
  • +
-
-

大家好,本项目是一个Python的入门学习和训练课程。 - 课程知识点和训练内容包括: - 1、介绍Python的字符串输出功能的实现要点,并要求学生提交Helloworld的实现代码; - 2、介绍Python的命令行输入的实现要点,并要求学生根据输入参数决定输出的字符串。

-
-
    -
  • 5
  • -
  • 1255
  • -
  • 2.1万
  • -
-
- -
-
-
-
- vip - 已审核 -

Helloworld:Python入门实训项目Helloworld:Python入门实训项目

- -
-

大家好,本项目是一个Python的入门学习和训练课程。 - - 课程知识点和训练内容包括: - 1、介绍Python的字符串输出功能的实现要点,并要求学生提交Helloworld的实现代码; - 2、介绍Python的命令行输入的实现要点,并要求学生根据输入参数决定输出的字符串。

-
-
-
    -
  • 5
  • -
  • 1255
  • -
  • 2.1万
  • -
-
-
-
-
-
- 未审核 -

Helloworld:Python入门实训项目

-
- 用户 - Cillian -
-
-

大家好,本项目是一个Python的入门学习和训练课程。 - - 课程知识点和训练内容包括: - 1、介绍Python的字符串输出功能的实现要点,并要求学生提交Helloworld的实现代码; - 2、介绍Python的命令行输入的实现要点,并要求学生根据输入参数决定输出的字符串。

-
-
-
    -
  • 5
  • -
  • 1255
  • -
  • 2.1万
  • -
-
-
-
-
-
- vip - 已审核 -

Helloworld:Python入门实训项目Helloworld:Python入门实训项目

- -
-

大家好,本项目是一个Python的入门学习和训练课程。 - - 课程知识点和训练内容包括: - 1、介绍Python的字符串输出功能的实现要点,并要求学生提交Helloworld的实现代码; - 2、介绍Python的命令行输入的实现要点,并要求学生根据输入参数决定输出的字符串。

-
-
-
    -
  • 5
  • -
  • 1255
  • -
  • 2.1万
  • -
-
-
-
-
-
- 未审核 -

Helloworld:Python入门实训项目

-
- 用户 - Cillian -
-
-

大家好,本项目是一个Python的入门学习和训练课程。 - - 课程知识点和训练内容包括: - 1、介绍Python的字符串输出功能的实现要点,并要求学生提交Helloworld的实现代码; - 2、介绍Python的命令行输入的实现要点,并要求学生根据输入参数决定输出的字符串。

-
-
-
    -
  • 5
  • -
  • 1255
  • -
  • 2.1万
  • -
-
-
+ <% end %>
上一页 diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 2c02d3a50..c817e6ad2 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -493,6 +493,7 @@ zh: label_course_all: 班级列表 label_syllabus_all: 课程列表 label_excellent_courses_list: 精品班级列表 + label_shixuns_list: 实训列表 label_course_resource_list: 班级资源列表 label_project_resource_list: 項目资源列表 label_teacher_all: 所有教师 diff --git a/config/routes.rb b/config/routes.rb index 19aceb941..e44c6cf0a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1388,6 +1388,7 @@ RedmineApp::Application.routes.draw do post 'admin/update_course_name' post 'admin/update_syllabus_title' get 'admin/excellent_courses', as: :excellent_courses + get 'admin/shixuns', as: :admin_shixuns get 'admin/excellent_all_courses', as: :excellent_all_courses match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course' match 'admin/cancel_excellent_course/:id', :to => 'admin#cancel_excellent_course' diff --git a/lib/redmine.rb b/lib/redmine.rb index f7604a054..90b06dec0 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -406,6 +406,7 @@ Redmine::MenuManager.map :admin_menu do |menu| menu.push :notices, {:controller => 'admin', :action => 'notices'}, :caption => :label_notification_list menu.push :latest_login_users, {:controller => 'admin', :action => 'latest_login_users'}, :caption => :label_latest_login_user_list menu.push :excellent_courses, {:controller => 'admin', :action => 'excellent_courses'}, :caption => :label_excellent_courses_list + menu.push :shixuns, {:controller => 'admin', :action => 'shixuns'}, :caption => :label_shixuns_list menu.push :course_resource_list, {:controller => 'admin', :action => 'course_resource_list'}, :caption => :label_course_resource_list menu.push :project_resource_list, {:controller => 'admin', :action => 'project_resource_list'}, :caption => :label_project_resource_list menu.push :homework, {:controller => 'admin', :action => 'homework'}, :caption => :label_user_homework