From f2f9a89e9dca5abca09ac8f40c193f98ef01c0d6 Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Wed, 3 Dec 2014 12:05:08 -0500 Subject: [PATCH] Update bootstrap-sass to version 3.3.1.0 Due to changes to bootstrap modals, I had to refactor the warning modals, which is a good thing because it got rid of a bunch of code. --- Gemfile | 2 +- Gemfile.lock | 4 ++-- app/controllers/admin/locations_controller.rb | 10 ---------- app/controllers/admin/organizations_controller.rb | 9 --------- app/controllers/admin/programs_controller.rb | 9 --------- app/controllers/admin/services_controller.rb | 9 --------- .../admin/locations/_confirm_delete_location.html.haml | 6 +++--- app/views/admin/locations/_form.html.haml | 3 ++- .../admin/locations/confirm_delete_location.js.erb | 1 - .../_confirm_delete_organization.html.haml | 4 ++-- app/views/admin/organizations/_form.html.haml | 3 ++- .../organizations/confirm_delete_organization.js.erb | 1 - .../admin/programs/_confirm_delete_program.html.haml | 4 ++-- app/views/admin/programs/confirm_delete_program.js.erb | 1 - app/views/admin/programs/forms/_danger.html.haml | 3 ++- .../admin/services/_confirm_delete_service.html.haml | 4 ++-- app/views/admin/services/_form.html.haml | 3 ++- app/views/admin/services/confirm_delete_service.js.erb | 1 - config/routes.rb | 5 ----- 19 files changed, 20 insertions(+), 62 deletions(-) delete mode 100644 app/views/admin/locations/confirm_delete_location.js.erb delete mode 100644 app/views/admin/organizations/confirm_delete_organization.js.erb delete mode 100644 app/views/admin/programs/confirm_delete_program.js.erb delete mode 100644 app/views/admin/services/confirm_delete_service.js.erb diff --git a/Gemfile b/Gemfile index 8b89604a7..10ea60c03 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem 'pg' gem 'sass-rails', '~> 4.0.3' gem 'coffee-rails', '~> 4.1.0' gem 'uglifier', '>= 1.3.0' -gem 'bootstrap-sass', '~> 3.2.0' +gem 'bootstrap-sass', '~> 3.3.0' # Rails 4 gem 'protected_attributes' diff --git a/Gemfile.lock b/Gemfile.lock index 21dedf9f7..f65449468 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -44,7 +44,7 @@ GEM rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-sass (3.2.0.2) + bootstrap-sass (3.3.1.0) sass (~> 3.2) builder (3.2.2) bullet (4.14.0) @@ -283,7 +283,7 @@ DEPENDENCIES auto_strip_attributes (~> 2.0) better_errors (>= 0.7.2) binding_of_caller (>= 0.7.1) - bootstrap-sass (~> 3.2.0) + bootstrap-sass (~> 3.3.0) bullet capybara coffee-rails (~> 4.1.0) diff --git a/app/controllers/admin/locations_controller.rb b/app/controllers/admin/locations_controller.rb index 53b851ccd..f7805d7cc 100644 --- a/app/controllers/admin/locations_controller.rb +++ b/app/controllers/admin/locations_controller.rb @@ -56,16 +56,6 @@ def destroy end end - def confirm_delete_location - @loc_name = params[:loc_name] - @org_name = params[:org_name] - @location_id = params[:location_id] - respond_to do |format| - format.html - format.js - end - end - private def assign_location_to_org(admin_orgs) diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index 4c8f27f71..4bc5bce91 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -71,14 +71,5 @@ def destroy format.html { redirect_to admin_organizations_path } end end - - def confirm_delete_organization - @org_name = params[:org_name] - @org_id = params[:org_id] - respond_to do |format| - format.html - format.js - end - end end end diff --git a/app/controllers/admin/programs_controller.rb b/app/controllers/admin/programs_controller.rb index a8cc68e22..7b19a2246 100644 --- a/app/controllers/admin/programs_controller.rb +++ b/app/controllers/admin/programs_controller.rb @@ -59,15 +59,6 @@ def destroy end end - def confirm_delete_program - @program_name = params[:program_name] - @program_id = params[:program_id] - respond_to do |format| - format.html - format.js - end - end - private def add_org_to_program_if_authorized diff --git a/app/controllers/admin/services_controller.rb b/app/controllers/admin/services_controller.rb index e589a087c..cab27a100 100644 --- a/app/controllers/admin/services_controller.rb +++ b/app/controllers/admin/services_controller.rb @@ -65,15 +65,6 @@ def destroy redirect_to admin_locations_path end - def confirm_delete_service - @service_name = params[:service_name] - @service_id = params[:service_id] - respond_to do |format| - format.html - format.js - end - end - private def preprocess_service diff --git a/app/views/admin/locations/_confirm_delete_location.html.haml b/app/views/admin/locations/_confirm_delete_location.html.haml index c99d7c29d..10d317741 100644 --- a/app/views/admin/locations/_confirm_delete_location.html.haml +++ b/app/views/admin/locations/_confirm_delete_location.html.haml @@ -12,11 +12,11 @@ %p This action CANNOT be undone. This will delete %strong - = @loc_name + = loc_name and all of its associated services from %strong - = @org_name + = org_name permanently. .modal-footer %button.btn.btn-default{'data-dismiss' => 'modal'} Close - = link_to 'I understand the consequences, delete this location', { action: :destroy, id: @location_id }, method: :delete, class: 'btn btn-danger' + = link_to 'I understand the consequences, delete this location', { action: :destroy, id: location_id }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/admin/locations/_form.html.haml b/app/views/admin/locations/_form.html.haml index c1a40f9ce..916a2c61e 100644 --- a/app/views/admin/locations/_form.html.haml +++ b/app/views/admin/locations/_form.html.haml @@ -30,8 +30,9 @@ %p Once you delete a location, there is no going back. Please be certain. %p - = link_to 'Permanently delete this location', { action: :confirm_delete_location, location_id: @location.id, org_name: @org.name, loc_name: @location.name }, remote: true, data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' + = link_to 'Permanently delete this location', {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' .modal.fade#modal-window{ 'aria-hidden' => 'true', 'aria-labelledby' => 'myModalLabel', 'role' => 'dialog', 'tabindex' => '-1' } + = render 'admin/locations/confirm_delete_location', location_id: @location.id, loc_name: @location.name, org_name: @org.name .save-box.navbar-default %p diff --git a/app/views/admin/locations/confirm_delete_location.js.erb b/app/views/admin/locations/confirm_delete_location.js.erb deleted file mode 100644 index bbe838e73..000000000 --- a/app/views/admin/locations/confirm_delete_location.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#modal-window").html("<%= escape_javascript(render 'admin/locations/confirm_delete_location') %>"); \ No newline at end of file diff --git a/app/views/admin/organizations/_confirm_delete_organization.html.haml b/app/views/admin/organizations/_confirm_delete_organization.html.haml index 829a99074..b5ea04fef 100644 --- a/app/views/admin/organizations/_confirm_delete_organization.html.haml +++ b/app/views/admin/organizations/_confirm_delete_organization.html.haml @@ -12,8 +12,8 @@ %p This action CANNOT be undone. This will delete %strong - = @org_name + = org_name and all of its associated locations permanently. .modal-footer %button.btn.btn-default{'data-dismiss' => 'modal'} Close - = link_to 'I understand the consequences, delete this organization', { action: :destroy, id: @org_id }, method: :delete, class: 'btn btn-danger' + = link_to 'I understand the consequences, delete this organization', { action: :destroy, id: org_id }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/admin/organizations/_form.html.haml b/app/views/admin/organizations/_form.html.haml index 9dd3d55fc..4d3fb61df 100644 --- a/app/views/admin/organizations/_form.html.haml +++ b/app/views/admin/organizations/_form.html.haml @@ -20,8 +20,9 @@ %p Once you delete an organization, there is no going back. Please be certain. %p - = link_to 'Permanently delete this organization', { action: :confirm_delete_organization, org_id: @organization.id, org_name: @organization.name }, remote: true, data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' + = link_to 'Permanently delete this organization', {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' .modal.fade#modal-window{ 'aria-hidden' => 'true', 'aria-labelledby' => 'myModalLabel', 'role' => 'dialog', 'tabindex' => '-1' } + = render 'admin/organizations/confirm_delete_organization', org_id: @organization.id, org_name: @organization.name .save-box.navbar-default %p diff --git a/app/views/admin/organizations/confirm_delete_organization.js.erb b/app/views/admin/organizations/confirm_delete_organization.js.erb deleted file mode 100644 index d8cc1a0cf..000000000 --- a/app/views/admin/organizations/confirm_delete_organization.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#modal-window").html("<%= escape_javascript(render 'admin/organizations/confirm_delete_organization') %>"); \ No newline at end of file diff --git a/app/views/admin/programs/_confirm_delete_program.html.haml b/app/views/admin/programs/_confirm_delete_program.html.haml index 9be4e8d9a..1c9ae4633 100644 --- a/app/views/admin/programs/_confirm_delete_program.html.haml +++ b/app/views/admin/programs/_confirm_delete_program.html.haml @@ -12,8 +12,8 @@ %p This action CANNOT be undone. This will delete %strong - = @program_name + = program_name and all of its associated services permanently. .modal-footer %button.btn.btn-default{'data-dismiss' => 'modal'} Close - = link_to 'I understand the consequences, delete this program', { action: :destroy, id: @program_id }, method: :delete, class: 'btn btn-danger' + = link_to 'I understand the consequences, delete this program', { action: :destroy, id: program_id }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/admin/programs/confirm_delete_program.js.erb b/app/views/admin/programs/confirm_delete_program.js.erb deleted file mode 100644 index c94c2f8e7..000000000 --- a/app/views/admin/programs/confirm_delete_program.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#modal-window").html("<%= escape_javascript(render 'admin/programs/confirm_delete_program') %>"); \ No newline at end of file diff --git a/app/views/admin/programs/forms/_danger.html.haml b/app/views/admin/programs/forms/_danger.html.haml index 5491b2449..db8cd39f6 100644 --- a/app/views/admin/programs/forms/_danger.html.haml +++ b/app/views/admin/programs/forms/_danger.html.haml @@ -7,5 +7,6 @@ %p Once you delete a program, there is no going back. All of the program's services will be deleted as well. Please be certain. %p - = link_to 'Permanently delete this program', { action: :confirm_delete_program, program_id: @program.id, program_name: @program.name }, remote: true, data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' + = link_to 'Permanently delete this program', {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' .modal.fade#modal-window{ 'aria-hidden' => 'true', 'aria-labelledby' => 'myModalLabel', 'role' => 'dialog', 'tabindex' => '-1' } + = render 'admin/programs/confirm_delete_program', program_id: @program.id, program_name: @program.name diff --git a/app/views/admin/services/_confirm_delete_service.html.haml b/app/views/admin/services/_confirm_delete_service.html.haml index d041ef25e..9f533f37b 100644 --- a/app/views/admin/services/_confirm_delete_service.html.haml +++ b/app/views/admin/services/_confirm_delete_service.html.haml @@ -12,7 +12,7 @@ %p This action CANNOT be undone. This will delete %strong - #{@service_name || @service_id}. + #{service_name || service_id}. .modal-footer %button.btn.btn-default{'data-dismiss' => 'modal'} Close - = link_to 'I understand the consequences, delete this service', { action: :destroy, id: @service_id, name: @service_name }, method: :delete, class: 'btn btn-danger' + = link_to 'I understand the consequences, delete this service', { action: :destroy, id: service_id, name: service_name }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/admin/services/_form.html.haml b/app/views/admin/services/_form.html.haml index f550b6eb0..89a877098 100644 --- a/app/views/admin/services/_form.html.haml +++ b/app/views/admin/services/_form.html.haml @@ -20,8 +20,9 @@ %p Once you delete a service, there is no going back. Please be certain. %p - = link_to 'Permanently delete this service', { action: :confirm_delete_service, service_id: @service.id, service_name: @service.name }, remote: true, data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' + = link_to 'Permanently delete this service', {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' .modal.fade#modal-window{ 'aria-hidden' => 'true', 'aria-labelledby' => 'myModalLabel', 'role' => 'dialog', 'tabindex' => '-1' } + = render 'admin/services/confirm_delete_service', service_id: @service.id, service_name: @service.name .save-box.navbar-default %p diff --git a/app/views/admin/services/confirm_delete_service.js.erb b/app/views/admin/services/confirm_delete_service.js.erb deleted file mode 100644 index 20d7123f4..000000000 --- a/app/views/admin/services/confirm_delete_service.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#modal-window").html("<%= escape_javascript(render 'admin/services/confirm_delete_service') %>"); diff --git a/config/routes.rb b/config/routes.rb index 8fded76e7..51a41bf3a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,11 +27,6 @@ resources :programs, except: :show resources :services, only: :index - get 'locations/:location_id/services/confirm_delete_service', to: 'services#confirm_delete_service', as: :confirm_delete_service - get 'organizations/confirm_delete_organization', to: 'organizations#confirm_delete_organization', as: :confirm_delete_organization - get 'locations/confirm_delete_location', to: 'locations#confirm_delete_location', as: :confirm_delete_location - get 'programs/confirm_delete_program', to: 'programs#confirm_delete_program', as: :confirm_delete_program - get 'locations/:location_id/services/:id', to: 'services#edit' get 'locations/:location_id/services/:service_id/contacts/:id', to: 'service_contacts#edit' get 'locations/:location_id/contacts/:id', to: 'contacts#edit'