From 4259f63fbf4b494b00c3e733e240643fcf9847a1 Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 9 Jul 2014 14:53:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9C=A8issue=E5=92=8Cne?= =?UTF-8?q?w=E9=87=8C=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/previews_controller.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/controllers/previews_controller.rb b/app/controllers/previews_controller.rb index 579f8caa8..5ffebcb10 100644 --- a/app/controllers/previews_controller.rb +++ b/app/controllers/previews_controller.rb @@ -16,11 +16,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class PreviewsController < ApplicationController - before_filter :find_project, :find_attachments, :find_contest, except: [:contestnotification] + before_filter :find_project, :find_attachments, except: :contestnotification def issue @issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank? - @issue = @contest.issues.find_by_id(params[:id]) unless params[:id].blank? if @issue @description = params[:issue] && params[:issue][:description] if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n") @@ -65,12 +64,4 @@ class PreviewsController < ApplicationController render :partial => 'common/preview' end - private - def find_contest - contest_id = (params[:issue] && params[:issue][:contest_id]) || params[:contest_id] - @contest = Contest.find(contest_id) - rescue ActiveRecord::RecordNotFound - render_404 - end - end From 0998438e6735acef9497a1e9ffbb742ba60d9755 Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 9 Jul 2014 15:20:00 +0800 Subject: [PATCH 2/2] bootstrap fine tuning. --- app/controllers/test_controller.rb | 2 +- app/views/layouts/bootstrap_base.html.erb | 2 +- app/views/test/courselist.html.erb | 19 ++++++------------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/app/controllers/test_controller.rb b/app/controllers/test_controller.rb index ec3e5cbdb..22cf7d1d5 100644 --- a/app/controllers/test_controller.rb +++ b/app/controllers/test_controller.rb @@ -26,7 +26,7 @@ class TestController < ApplicationController end def courselist - @courses = Project.course_entities + @courses = paginateHelper Course.includes(:homeworks).all, 10 end def ziping files_path diff --git a/app/views/layouts/bootstrap_base.html.erb b/app/views/layouts/bootstrap_base.html.erb index 040857df4..fedcf9409 100644 --- a/app/views/layouts/bootstrap_base.html.erb +++ b/app/views/layouts/bootstrap_base.html.erb @@ -20,6 +20,7 @@
<%= render_flash_messages %> <%= yield %> + <%= render :partial => 'layouts/bootstrap_base_footer' %>
@@ -29,6 +30,5 @@ - <%= render :partial => 'layouts/bootstrap_base_footer' %> diff --git a/app/views/test/courselist.html.erb b/app/views/test/courselist.html.erb index e11c16fad..195913ed2 100644 --- a/app/views/test/courselist.html.erb +++ b/app/views/test/courselist.html.erb @@ -1,14 +1,5 @@ -
- Well done! You successfully read this important alert message. -
-
- Heads up! This alert needs your attention, but it's not super important. -
-
- Warning! Best check yo self, you're not looking too good. -
- Oh snap! Change a few things up and try submitting again. + Warning! you can stop.
<% end %> @@ -52,3 +44,4 @@
<% end %> + \ No newline at end of file