From 3e870f115b410ac8974f5bef893f5de152f98fef Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 16 Mar 2017 14:40:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?css=E5=8A=A0=E8=BD=BD=E9=A1=BA=E5=BA=8F=20?= =?UTF-8?q?=20=E8=B7=AF=E7=94=B1=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/myshixun.rb | 5 +++-- app/views/layouts/base_myshixun.html.erb | 11 ++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index c7f6c64a7..bf1273cc7 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -10,9 +10,10 @@ class Myshixun < ActiveRecord::Base def current_task games = self.games current_game = games.select{|game| game.status != 2} - if undo_agame.blank? - current_game = Game.find_by_sql("SELECT * FROM `games` where myshixun_id=#{self.id} and status = 2 order by stage desc;") + if current_game.blank? + current_game = Game.where(:status => 2, :myshixun_id => self.id).order("stage desc").first end + return current_game end def parent diff --git a/app/views/layouts/base_myshixun.html.erb b/app/views/layouts/base_myshixun.html.erb index 20aa389b8..c50006ab3 100644 --- a/app/views/layouts/base_myshixun.html.erb +++ b/app/views/layouts/base_myshixun.html.erb @@ -9,7 +9,7 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome','css/taskstyle' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/font-awesome','css/taskstyle','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> @@ -31,14 +31,11 @@ From a6d8f6834a68dd830af1d6805d56cfb135a75fc0 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 16 Mar 2017 14:44:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?top=E5=85=AC=E5=85=B1=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/show.html.erb | 9 --------- app/views/layouts/base_myshixun.html.erb | 1 + app/views/myshixuns/_myshixun_top.html.erb | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 app/views/myshixuns/_myshixun_top.html.erb diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index f38a48703..f856342dd 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,12 +1,3 @@ -
-

Helloworld:Java入门实训项目

- 暂时离开 - -
diff --git a/app/views/layouts/base_myshixun.html.erb b/app/views/layouts/base_myshixun.html.erb index c50006ab3..c2d8659d1 100644 --- a/app/views/layouts/base_myshixun.html.erb +++ b/app/views/layouts/base_myshixun.html.erb @@ -41,6 +41,7 @@
+ <%= render :partial => "myshixuns/myshixun_top" %> <%= render_flash_messages %> <%= yield %>
diff --git a/app/views/myshixuns/_myshixun_top.html.erb b/app/views/myshixuns/_myshixun_top.html.erb new file mode 100644 index 000000000..c2c0a0d8b --- /dev/null +++ b/app/views/myshixuns/_myshixun_top.html.erb @@ -0,0 +1,9 @@ +
+

Helloworld:Java入门实训项目

+ 暂时离开 + +
\ No newline at end of file