From 15f9c5293ff32251ed5d0794631d39de66635ee6 Mon Sep 17 00:00:00 2001 From: AbdullRahman ElHusseini Date: Fri, 25 Apr 2014 00:12:49 +0200 Subject: [PATCH] Issue #297 More on button layouts --- tutor/app/controllers/problems_controller.rb | 2 +- tutor/app/views/problems/_flash.html.erb | 2 +- tutor/app/views/problems/done.js.erb | 1 - tutor/app/views/problems/edit.html.erb | 4 ++-- tutor/app/views/tracks/show.html.erb | 10 +++++----- 5 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 tutor/app/views/problems/done.js.erb diff --git a/tutor/app/controllers/problems_controller.rb b/tutor/app/controllers/problems_controller.rb index ebaf703c..48e6b9a9 100644 --- a/tutor/app/controllers/problems_controller.rb +++ b/tutor/app/controllers/problems_controller.rb @@ -121,7 +121,7 @@ def update elsif (problem_params[:description] != @problem.description) @message = "Description updated" elsif (problem_params[:track_id].to_i != @problem.track_id) - @message = "Problem moved to Track #{problem_params[:track_id]}" + @message = "Problem is moved to Track #{problem_params[:track_id]}" else flash.keep[:notice] = "You have entered the same paramater no change has been made!" end diff --git a/tutor/app/views/problems/_flash.html.erb b/tutor/app/views/problems/_flash.html.erb index ff4bdef0..080609bd 100644 --- a/tutor/app/views/problems/_flash.html.erb +++ b/tutor/app/views/problems/_flash.html.erb @@ -1,3 +1,3 @@ <% if flash[:notice] %> -
<%= flash[:notice] %>
+
<%= flash[:notice] %>
<% end %> \ No newline at end of file diff --git a/tutor/app/views/problems/done.js.erb b/tutor/app/views/problems/done.js.erb deleted file mode 100644 index 7aacef6d..00000000 --- a/tutor/app/views/problems/done.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#div1').html("<%= escape_javascript(render 'problems/flash') %>"); \ No newline at end of file diff --git a/tutor/app/views/problems/edit.html.erb b/tutor/app/views/problems/edit.html.erb index 5ca19c54..2e8dbc91 100644 --- a/tutor/app/views/problems/edit.html.erb +++ b/tutor/app/views/problems/edit.html.erb @@ -1,6 +1,6 @@ -
+
<% if flash[:notice] %> -
<%= flash[:notice] %>
+
<%= flash[:notice] %>
<% end %>
diff --git a/tutor/app/views/tracks/show.html.erb b/tutor/app/views/tracks/show.html.erb index 068efcab..1164e265 100644 --- a/tutor/app/views/tracks/show.html.erb +++ b/tutor/app/views/tracks/show.html.erb @@ -44,8 +44,8 @@
<%= problem.description %> <% if @can_edit %> - + <%= link_to "Edit", + edit_problem_path(:id => problem.id), class: 'btn btn-primary' %> <% end %>
@@ -78,8 +78,8 @@
<%= problem.description %> <% if @can_edit %> - + <%= link_to "Edit", + edit_problem_path(:id => problem.id), class: 'btn btn-primary' %> <% end %>
@@ -92,5 +92,5 @@ <% if @can_edit %> - + <%= link_to "Add", new_problem_path(:id => @track.id), class: 'btn btn-primary' %> <% end %> \ No newline at end of file