diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index e73ce0214..1f72f00e0 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -42,6 +42,17 @@ class SubjectsController < ApplicationController redirect_to subject_path(subject) end + def edit + render :layout => "base_edu" + end + + def update + if params[:subject] + subject = @subject.update_attributes(:name => params[:subject][:name], :description => params[:subject][:description]) + end + redirect_to subject_path(@subject) + end + def update_attr if params[:name] @subject.update_attributes(:name => params[:name]) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 29fbf65f0..38aa397e7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -225,6 +225,10 @@ module ApplicationHelper myshixun = Myshixun.where(:shixun_id => shixun.id, :user_id => user.id).first if myshixun.nil? 0 + elsif !myshixun.nil? && myshixun.games.select{|game| game.status == 2}.count == 0 + -1 + elsif myshixun.games.select{|game| game.status == 0}.count > 0 + [myshixun.games.select{|game| game.status == 0}.count + 1] else myshixun.games.select{|game| game.status == 2}.count end diff --git a/app/views/challenges/_content_list.html.erb b/app/views/challenges/_content_list.html.erb index 7a36fa413..0cd13ea7b 100644 --- a/app/views/challenges/_content_list.html.erb +++ b/app/views/challenges/_content_list.html.erb @@ -5,15 +5,20 @@ <%= @challenges.count %> <% end %> <% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %> - +单选任务 + + +编程任务--> + 新建阶段 <% end %>
<%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey" %> diff --git a/app/views/layouts/_public_left_info.html.erb b/app/views/layouts/_public_left_info.html.erb index 691ace887..bd46d72b7 100644 --- a/app/views/layouts/_public_left_info.html.erb +++ b/app/views/layouts/_public_left_info.html.erb @@ -5,7 +5,7 @@
全部实训
- <%= link_to "+ 创建实训".html_safe, new_shixun_path, :class => "fr color_white font-20" %> + <%= link_to "+ 新建".html_safe, new_shixun_path, :class => "task-btn task-btn-green fr mt6" %>@@ -70,7 +70,7 @@ 筛选条件
-
- 所有状态
+ 所有状态
-
diff --git a/app/views/subjects/_subject_top.html.erb b/app/views/subjects/_subject_top.html.erb
index add31b9ef..80e3cc5ad 100644
--- a/app/views/subjects/_subject_top.html.erb
+++ b/app/views/subjects/_subject_top.html.erb
@@ -8,13 +8,13 @@
\ No newline at end of file
diff --git a/app/views/subjects/edit.html.erb b/app/views/subjects/edit.html.erb
new file mode 100644
index 000000000..623057ba3
--- /dev/null
+++ b/app/views/subjects/edit.html.erb
@@ -0,0 +1,29 @@
+
+
+ 编辑实训套件
+
+
+ <%= labelled_form_for @subject do |f| %>
+ -
+
+
+
+ 请输入名称
+
+ -
+
+
+
+ -
+
+ <%= link_to "取消", subject_path(@subject), :class => "task-btn fl mr10 ml20" %>
+ 保存
+
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/subjects/index.html.erb b/app/views/subjects/index.html.erb
index 7efca3b78..355a579f2 100644
--- a/app/views/subjects/index.html.erb
+++ b/app/views/subjects/index.html.erb
@@ -3,7 +3,7 @@
<% end %>
<% @stages.each do |stage| %>
-
+
- -
-
+
+ -
+
<%= shixun.name %>
- -
+
-
<%= shixun.challenges.count %>
- -
- <%= shixun.shixun_score %>经验值
- -
+
-
+ <%= shixun.shixun_score %>
+ -
<% if @subject.status == 0 && User.current.manager_of_subject?(@subject) %>
- <%= shixun.shixun_status %>
-
+ <%= shixun.shixun_status %>
+
<% else %>
<% case my_shixun_status(shixun, User.current) %>
<% when '已通关' %>
diff --git a/app/views/users/_my_homepage_courses_list.html.erb b/app/views/users/_my_homepage_courses_list.html.erb
index 1d5724e99..a3aa56098 100644
--- a/app/views/users/_my_homepage_courses_list.html.erb
+++ b/app/views/users/_my_homepage_courses_list.html.erb
@@ -9,10 +9,10 @@
<% @courses.each do |course| %>
<%= @subject.name %>
- <% if User.current.manager_of_subject?(@subject) && @subject.status == 0 %> - - <% end %> + <%# if User.current.manager_of_subject?(@subject) && @subject.status == 0 %> + + <%# end %> <% if !User.current.manager_of_subject?(@subject) || @subject.status > 1 %>-- <%= @subject.stage_shixuns.count %>
- - <%= @subject.subject_challenges %>
+ - <%= @subject.stage_shixuns.count %>
+ - <%= @subject.subject_challenges %>
- <%= @subject.subject_score %>
<% elsif @subject.status == 0 && @subject.stages.count > 0 && User.current.manager_of_subject?(@subject) %> @@ -27,35 +27,39 @@+ + <%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to "实训套件", subjects_path() %> + > 编辑 +
+实训套件
- <%= link_to "+ 创建套件".html_safe, new_subject_path(), :class => "fr color_white font-20" %> + <%= link_to "+ 新建".html_safe, new_subject_path(), :class => "task-btn task-btn-green fr mt6" %>diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb index 1ab903787..c8d669b5c 100644 --- a/app/views/subjects/show.html.erb +++ b/app/views/subjects/show.html.erb @@ -4,82 +4,75 @@
+ <%= @subject.description.blank? ? "暂未填写" : @subject.description %>
+
简介 <% if User.current.manager_of_subject?(@subject) && @subject.status == 0 %> - + <% end %>
-<%= @subject.description.blank? ? "暂未填写" : @subject.description %>
+- + <%= stage.name %> <% if @subject.status == 0 && User.current.manager_of_subject?(@subject) %> - + <% end %>
-<%= stage.description %>
+<%= stage.description %>
<% stage.stage_shixuns.each_with_index do |stage_shixun, index| %> <% shixun = stage_shixun.shixun %> -- <%= course.name %> - <%= course.syllabus.title %> - <%= User.where(:id => course.tea_id).first.show_name %> - <%= format_time course.updated_at %> + <%= course.name %> + <%= course.syllabus.title %> + <%= User.where(:id => course.tea_id).first.show_name %> + <%= time_from_now course.updated_at %>更新 分享
<% end %> diff --git a/app/views/users/_my_homepage_shixuns_list.html.erb b/app/views/users/_my_homepage_shixuns_list.html.erb index 6c9cf6156..f8da3a90b 100644 --- a/app/views/users/_my_homepage_shixuns_list.html.erb +++ b/app/views/users/_my_homepage_shixuns_list.html.erb @@ -10,9 +10,22 @@ <% @shixuns.each do |shixun| %><%= shixun.name.strip %> - 已解锁第<%= had_passed_changllenge_count(shixun, @user) %>关/共<%= shixun.challenges.count %>关 - <%= User.where(:id => shixun.user_id).first.show_name %> - <%= format_time shixun.created_at %> + + + + <% if had_passed_changllenge_count(shixun, @user) == 0 %> + 尚未挑战 + <% elsif had_passed_changllenge_count(shixun, @user) == -1 %> + 已挑战至 第1关 / 共<%= shixun.challenges.count %>关 + <% elsif (had_passed_changllenge_count(shixun, @user).class == Array) %> + 已挑战至 第<%= had_passed_changllenge_count(shixun, @user)[0].to_i %>关 / 共<%= shixun.challenges.count %>关 + <% else %> + 已完成至 第<%= had_passed_changllenge_count(shixun, @user) %>关 / 共<%= shixun.challenges.count %>关 + <% end %> + + + <%= User.where(:id => shixun.user_id).first.show_name %> + <%= time_from_now shixun.updated_at %>更新 分享
<% end %> diff --git a/public/images/bigdata/singel.png b/public/images/bigdata/singel.png new file mode 100644 index 000000000..c62175e86 Binary files /dev/null and b/public/images/bigdata/singel.png differ diff --git a/public/javascripts/edu/base_edu.js b/public/javascripts/edu/base_edu.js index 6857e28f7..354543d78 100644 --- a/public/javascripts/edu/base_edu.js +++ b/public/javascripts/edu/base_edu.js @@ -1000,4 +1000,13 @@ function submit_new_subject(){ $("#new_subject_name_notice").hide(); $("#new_subject").submit(); } +} + +function submit_edit_subject(id){ + if($("#new_subject_name").val().trim() == ""){ + $("#new_subject_name_notice").show(); + } else{ + $("#new_subject_name_notice").hide(); + $("#edit_subject_"+id).submit(); + } } \ No newline at end of file diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index 9c480269f..19d5b6e95 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -3,7 +3,7 @@ html,body{ font-size:14px; line-height:2.0; height:100%;} .newContainer{ min-height:100%; height: auto !important; height: 100%; /*IE6不识别min-height*/position: relative;} .newMain{ margin: 0 auto; padding-bottom: 155px; } .newFooter{ position: absolute; bottom: 0; width: 100%; height: 155px;background: #323232; clear:both; min-width: 1200px} -.newHeader{background: #46484c;width:100%; height: 50px; min-width: 1200px} +.newHeader{background: #303133;width:100%; height: 50px; min-width: 1200px} /* 重置样式 */ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td,span{ margin:0; padding:0;} body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5;; color:#333;} diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index 310185d32..2d04c25cc 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -15,7 +15,7 @@ input.header-search-input{ width:150px; height:30px; padding:0 5px; border-style .new-container-inner02{width:1200px; margin:0px auto; padding:50px 0;} .inner-nav-mes{ font-size:16px; color:#fff; margin-right:35px; margin-top:18px; } .inner-nav-cir{ background:#ff6530; color:#fff; border-radius:15px;padding:0 5px; display: inline-block; font-size:10px; height:17px; line-height:17px;} -.inner-nav-user{ width: 75px; height: 45px; margin-top:5px; position: relative; padding-left: 20px;} +.inner-nav-user{ width: 75px; height: 45px; margin-top:5px; position: relative; padding-left: 0px;} .inner-nav-user-img{ width: 40px; height: 40px; border-radius:50px;} select.header-search-select{ border:none; font-size:14px; padding:5px; background: none;} .edu-unlogin-nav a{ color:#fff!important; font-size:14px; line-height:50px;} diff --git a/public/stylesheets/css/edu-subject.css b/public/stylesheets/css/edu-subject.css index c1fe54c60..d409e8ff9 100644 --- a/public/stylesheets/css/edu-subject.css +++ b/public/stylesheets/css/edu-subject.css @@ -1,5 +1,5 @@ /*------课程实训首页---------*/ -.header-color{background: linear-gradient(304.95deg, rgb(0, 158, 138) 0%, rgb(22, 212, 190) 100%) rgb(22, 212, 190);padding: 30px} +.header-color{background: linear-gradient(to right, rgb(68, 190, 164) 0%, rgb(62, 158, 207) 100%);padding: 30px} .active-class .content .sub-con{width:23.7%;border:1px solid #eee;background:#fff;margin: 0 1.5% 1.5% 0px;box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);} .active-class .content .sub-con:nth-child(4n+0){margin:0 0 1.5% 0;} .active-class .content .sub-con:hover{box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.15);cursor: pointer;-webkit-animation: bounce-down 1s linear 1;animation: bounce-down 1s linear 1;} @@ -24,16 +24,17 @@ /*-----------新版新建实训------------*/ .produce-content:hover i{color:#29bd8b!important;} -.subject-main-name{outline: none} -.subject-produce{outline: none;} -.stage-info-line{padding-left: 50px} +.subject-main-name{outline: none;background: none;border: none;width: auto;height: 45px} +.subject-produce{outline: none;line-height: 1.5;width: 100%;border: none;background: none;height: 30px;} .stage-info-line:hover{background-color:rgba(142,212,254,0.3)} -.lesson-saved-list-item:hover{box-shadow: 0 0 8px 0 rgba(0,0,0,.2);} +.lesson-saved-list-item{border:1px solid #EEEEEE} .lesson-saved-list-item:hover .edit{color:#29bd8b!important;} .lesson-saved-list-item:hover .delete{color:#29bd8b!important;} -li.li-width50{width: 50%;text-align: left} +li.li-width63{width: 63%;text-align: left} li.li-width20{width: 20%;text-align: left} -li.li-width10{width: 10%;text-align: left} +li.li-width15{width: 15%;text-align: left} +li.li-width7{width: 7%;text-align: left} +.lesson-saved-list-item{background-color: #FFFFFF} /*------课程实训首页---------*/ .course_tip_box{width: 460px;padding: 10px;background-color: #FFFFFF;} diff --git a/public/stylesheets/css/edu-user.css b/public/stylesheets/css/edu-user.css index 9e5fea434..688d35556 100644 --- a/public/stylesheets/css/edu-user.css +++ b/public/stylesheets/css/edu-user.css @@ -200,7 +200,7 @@ input.new_loggin_input_test{ -webkit-box-shadow: 0 0 0px 1000px white inset; ou /*头部排版更改*/ -.lector{display: block;width: auto;padding: 0px 8px;background: cornflowerblue;color: #ffffff;font-size: 14px;margin-right: 15px;border-radius: 4px;margin-top: 3px;} +.lector{display: block;width: auto;padding: 0px 8px;background: #5ECFBA;color: #ffffff;font-size: 14px;margin-right: 15px;border-radius: 4px;margin-top: 3px;} .u-color-light-red{color: #FF6666} .u-color-light-grey{color: #CCCCCC} .user-info-span{border-radius: 50%;float:left;background: #F3F5F7;text-align: center;width: 23px;height: 23px;line-height: 23px;margin-top: 3px;margin-right: 5px} diff --git a/public/stylesheets/css/ketang.css b/public/stylesheets/css/ketang.css index 3f8c4f446..6f5e0a6e6 100644 --- a/public/stylesheets/css/ketang.css +++ b/public/stylesheets/css/ketang.css @@ -22,8 +22,8 @@ 25% {margin-top:-10px;} 50%, 100% {margin-top: 0;} } -.sidebar{width:60px;height:100%;box-shadow: 0 30px 30px 0 rgba(0, 0, 0, 0.15);position:fixed;left:0;top:0;background:#fff;} -.sidebar-top{height:50px;line-height:50px;background:#46484c;text-align:center;} +.sidebar{width:50px;height:100%;box-shadow: 0 30px 30px 0 rgba(0, 0, 0, 0.15);position:fixed;left:0;top:0;background:#fff;} +.sidebar-top{height:50px;line-height:50px;background:#35373a;text-align:center;} .sidebar-top span{color:#fff;display:none;} .sidebar-con{padding-top:20px;white-space: nowrap;} .sidebar-con .list{min-height:45px;margin-top:15px;} diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 5d5f6539a..dde38cb05 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -64,6 +64,7 @@ a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:15px; margin-top: .content-submitbox{ width:120px; margin: 15px auto; height:135px;} .panel-inner{ background:#EFF2F7; margin:15px; padding:15px;} .panel-inner-title{ font-size: 14px; color: #666; max-width:85%; line-height:30px;word-wrap: break-word; margin-bottom: 10px} +.panel-inner-icon{width: 22px;height: 22px;line-height: 22px;border-radius: 50%;background: #29bd8b;display: block;text-align: center} .panel-footer{ min-width:1000px; height: 210px!important;} /* 弹框 */ .task-popup-text-center{ text-align: center; color: #666;} @@ -149,11 +150,13 @@ input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f .-flex-basic40{flex-basis:auto;} .-flex-basic50{flex-basis:auto;} .b-label{width:4px;cursor:ew-resize;background:#2b2b2b;} -.h-center{height:4px;cursor:ns-resize;background:#33485F;z-index:9999;} +.h-center{height:4px;cursor:ns-resize;background:#33485F;} +.-changebg{height:3px;} .-brother{width:100%;height:100%;position:absolute;left:0;top:0;z-index:999;} .-bg-weightblack{background:#000;} +.-flex-basic70{flex:4 9 auto;} /*---------------------------------------------*/ -.-flex-basic60{flex:4 9 auto;} +.-flex-basic60{flex:none;} .-flex-basic100{flex-basis: 100%!important;} .-header-title{ max-width:500px; font-weight: normal;} .-header-right{ background:#333;border-radius:25px; padding:5px 15px; height: 30px; position: absolute; right:10px;line-height: 30px;} @@ -217,8 +220,8 @@ input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f .task-index{ width: 1200px; margin:0 auto;} .task-index-head{ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); } /*.task-index-head-top{background-image: linear-gradient(to right, rgb(106, 177, 216) 0%, rgb(1, 74, 78) 100%);background-color: rgb(1, 70, 74); padding:30px;}*/ -.task-index-head-top{background: #1ECDCE linear-gradient(to top left, #48A7D1 0%, #1ECDCE 100%);background-color: rgb(1, 70, 74); padding:30px;} -.task-index-head-top-course{background: linear-gradient(to right, rgb(162, 171, 234) 0%, rgb(114, 123, 177) 100%);background-color:rgb(160, 175, 247); padding:30px;} +.task-index-head-top{background: linear-gradient(to right, rgb(104, 177, 215) 0%, rgb(1,75,79) 100%);background-color: rgb(1, 70, 74); padding:30px;} +.task-index-head-top-course{background: linear-gradient(to right, rgb(69, 191, 165) 0%, rgb(164, 175, 247) 100%);background-color:rgb(160, 175, 247); padding:30px;} .task-inde-head-title{ color:#fff; } .task-index-head-info{ background:#fff; padding:10px 30px;} .task-index-head-info li{ width:100px; float: left; text-align: center; color:#666;}