- <% @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.myshixuns.count %>
-
-
-
-
- <% end %>
-
-
-
上一页
-
1
-
2
-
3
-
...
-
31
-
下一页
-
+ -->
+
+
+
+
排序方式:
+
+
+
+
+
+ <%= render "shixun_list" %>
-
\ No newline at end of file
diff --git a/app/views/shixuns/publish.js.erb b/app/views/shixuns/publish.js.erb
index 6ad466d10..ba4fed6fc 100644
--- a/app/views/shixuns/publish.js.erb
+++ b/app/views/shixuns/publish.js.erb
@@ -2,5 +2,7 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'shixuns/monitor_tip') %>";
pop_box_new(htmlvalue,460,406);
<% else %>
+ var htmlvalue = "<%= escape_javascript(render :partial => 'shixuns/monitor_tip', :locals => {:result => true}) %>";
+ pop_box_new(htmlvalue,460,406);
$("#shixun_top").html('<%= escape_javascript(render :partial => 'shixuns/shixun_top') %>');
<% end %>
diff --git a/app/views/shixuns/search.js.erb b/app/views/shixuns/search.js.erb
new file mode 100644
index 000000000..e82692b2f
--- /dev/null
+++ b/app/views/shixuns/search.js.erb
@@ -0,0 +1 @@
+$("#shixun_list_content").html('<%= escape_javascript( render :partial => 'shixuns/shixun_list') %>');
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index abf41129a..88af78475 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -44,6 +44,7 @@ RedmineApp::Application.routes.draw do
match 'publish', :via => [:get, :post]
end
collection do
+ get 'search'
end
resources :challenges do
@@ -69,7 +70,7 @@ RedmineApp::Application.routes.draw do
collection do
match 'training_task_status', :via => [:get, :post]
end
- resources :games do
+ resources :games, :path => "stages" do
member do
match 'game_build', :via => [:get, :post]
match 'next_step', :via => [:get, :post]
diff --git a/db/migrate/20170425072017_add_identifier_to_shixun.rb b/db/migrate/20170425072017_add_identifier_to_shixun.rb
new file mode 100644
index 000000000..ef77db474
--- /dev/null
+++ b/db/migrate/20170425072017_add_identifier_to_shixun.rb
@@ -0,0 +1,5 @@
+class AddIdentifierToShixun < ActiveRecord::Migration
+ def change
+ add_column :shixuns, :identifier, :string
+ end
+end
diff --git a/db/migrate/20170425085926_sync_identifier_to_shixun.rb b/db/migrate/20170425085926_sync_identifier_to_shixun.rb
new file mode 100644
index 000000000..47d0199ce
--- /dev/null
+++ b/db/migrate/20170425085926_sync_identifier_to_shixun.rb
@@ -0,0 +1,14 @@
+class SyncIdentifierToShixun < ActiveRecord::Migration
+ CODES = %W(2 3 4 5 6 7 8 9 A B C D E F G H J K L N M O P Q R S T U V W X Y Z)
+ def up
+ @shixuns = Shixun.all
+ @shixuns.each do |shixun|
+ code = CODES.sample(8).join
+ code = CODES.sample(8).join if Shixun.where(identifier: code).present?
+ shixun.update_attribute(:identifier, code)
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20170425092430_add_identifier_to_myshixun.rb b/db/migrate/20170425092430_add_identifier_to_myshixun.rb
new file mode 100644
index 000000000..d2d1cff4d
--- /dev/null
+++ b/db/migrate/20170425092430_add_identifier_to_myshixun.rb
@@ -0,0 +1,5 @@
+class AddIdentifierToMyshixun < ActiveRecord::Migration
+ def change
+ add_column :myshixuns, :identifier, :string
+ end
+end
diff --git a/db/migrate/20170426020613_add_shixun_count_to_shixuns.rb b/db/migrate/20170426020613_add_shixun_count_to_shixuns.rb
new file mode 100644
index 000000000..e33f4a15c
--- /dev/null
+++ b/db/migrate/20170426020613_add_shixun_count_to_shixuns.rb
@@ -0,0 +1,5 @@
+class AddShixunCountToShixuns < ActiveRecord::Migration
+ def change
+ add_column :shixuns, :shixun_count, :integer, default: 0
+ end
+end
diff --git a/db/migrate/20170426024708_add_identifier_to_games.rb b/db/migrate/20170426024708_add_identifier_to_games.rb
new file mode 100644
index 000000000..afe752b22
--- /dev/null
+++ b/db/migrate/20170426024708_add_identifier_to_games.rb
@@ -0,0 +1,5 @@
+class AddIdentifierToGames < ActiveRecord::Migration
+ def change
+ add_column :games, :identifier, :string
+ end
+end
diff --git a/db/migrate/20170426024822_sync_game_identifier.rb b/db/migrate/20170426024822_sync_game_identifier.rb
new file mode 100644
index 000000000..0590dad3c
--- /dev/null
+++ b/db/migrate/20170426024822_sync_game_identifier.rb
@@ -0,0 +1,14 @@
+class SyncGameIdentifier < ActiveRecord::Migration
+ CODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
+ def up
+ games = Game.all
+ games.each do |game|
+ code = CODES.sample(12).join
+ code = CODES.sample(12).join if Game.where(identifier: code).present?
+ game.update_attribute(:identifier, code)
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20170426060122_sync_identifier_to_myshixun.rb b/db/migrate/20170426060122_sync_identifier_to_myshixun.rb
new file mode 100644
index 000000000..eece1f3d8
--- /dev/null
+++ b/db/migrate/20170426060122_sync_identifier_to_myshixun.rb
@@ -0,0 +1,14 @@
+class SyncIdentifierToMyshixun < ActiveRecord::Migration
+ CODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
+ def up
+ myshixuns = Myshixun.all
+ myshixuns.each do |myshixun|
+ code = CODES.sample(10).join
+ code = CODES.sample(10).join if Myshixun.where(identifier: code).present?
+ myshixun.update_attribute(:identifier, code)
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20170427011453_rename_shixun_count.rb b/db/migrate/20170427011453_rename_shixun_count.rb
new file mode 100644
index 000000000..d2177b307
--- /dev/null
+++ b/db/migrate/20170427011453_rename_shixun_count.rb
@@ -0,0 +1,8 @@
+class RenameShixunCount < ActiveRecord::Migration
+ def up
+ rename_column :shixuns, :shixun_count, :myshixun_count
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20170427013052_sync_myshixun_count.rb b/db/migrate/20170427013052_sync_myshixun_count.rb
new file mode 100644
index 000000000..52ca4e215
--- /dev/null
+++ b/db/migrate/20170427013052_sync_myshixun_count.rb
@@ -0,0 +1,12 @@
+class SyncMyshixunCount < ActiveRecord::Migration
+ def up
+ shixuns = Shixun.all
+ shixuns.each do |shixun|
+ myshixun_count = shixun.myshixuns.count
+ shixun.update_attribute(:myshixun_count, myshixun_count)
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20170427031044_add_exec_path_to_challenges.rb b/db/migrate/20170427031044_add_exec_path_to_challenges.rb
new file mode 100644
index 000000000..e9aaa7076
--- /dev/null
+++ b/db/migrate/20170427031044_add_exec_path_to_challenges.rb
@@ -0,0 +1,5 @@
+class AddExecPathToChallenges < ActiveRecord::Migration
+ def change
+ add_column :challenges, :exec_path, :string
+ end
+end
diff --git a/public/stylesheets/css/bigdata-common.css b/public/stylesheets/css/bigdata-common.css
index 932e5de0d..4647f5aff 100644
--- a/public/stylesheets/css/bigdata-common.css
+++ b/public/stylesheets/css/bigdata-common.css
@@ -129,4 +129,27 @@ a:hover.task-btn-ver{background:#5f7cab;}
.break_word_firefox{white-space: pre-wrap !important;word-break: break-all;}
.pr {position:relative;}
+/***** Ajax indicator ******/
+#ajax-indicator {
+ position: absolute; /* fixed not supported by IE */
+ background-color:#eee;
+ border: 1px solid #bbb;
+ top:35%;
+ left:40%;
+ width:20%;
+ font-weight:bold;
+ text-align:center;
+ padding:0.6em;
+ z-index:100;
+ opacity: 0.5;
+}
+html>body #ajax-indicator { position: fixed; }
+
+#ajax-indicator span {
+ background-position: 0% 40%;
+ background-repeat: no-repeat;
+ background-image: url(/images/loading.gif);
+ padding-left: 26px;
+ vertical-align: bottom;
+}
diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css
index 7792ff8a8..dde542c21 100644
--- a/public/stylesheets/css/taskstyle.css
+++ b/public/stylesheets/css/taskstyle.css
@@ -185,6 +185,7 @@ input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f
.greytab-inner{ background:#fff; }
.blacktab-inner{ background:#333;}
.task-padding16{ padding:16px;}
+.task-padding-new{ padding-top: 16px}
/* TPM统计 20170321byLB */
.panel-warp-3{ width: 30%; background:#23b181; color:#fff; margin:2.5%; margin-right:0; position: relative; }
.panel-warp-3-over{ background:#fff;opacity:0.8; color:#29bd8b; width: 100%; height:135px; position: absolute; top:0; left:0; text-align: center; padding-top:130px;}