From bc7a77ef77d07a3cf194d5cb0e05c135cc58133c Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Mon, 7 Nov 2016 17:19:54 -0500 Subject: [PATCH] dialog confirmation for publish unpublish --- .../javascripts/channels/recording_update.js | 8 ++++++++ app/assets/stylesheets/shared.scss | 9 +++++++++ app/views/landing/rooms.html.erb | 14 ++++++++++++++ app/views/layouts/application.html.erb | 4 ++-- config/locales/en-us.yml | 2 ++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/channels/recording_update.js b/app/assets/javascripts/channels/recording_update.js index 23c8a387..f27bf7ea 100644 --- a/app/assets/javascripts/channels/recording_update.js +++ b/app/assets/javascripts/channels/recording_update.js @@ -11,6 +11,14 @@ var rowData = table.row("#"+data.record_id).data(); rowData.published = data.published table.row("#"+data.record_id).data(rowData).draw(); + var publish = (data.published) ? 'publish' : 'unpublish'; + + // show alert success alert + $('.alert-template .alert-message').html($('.'+publish+'-alert').html()); + $('#alerts').html($('.alert-template').html()); + setTimeout(function() { + $('#alerts > .alert').alert('close'); + }, 4000); } }); }; diff --git a/app/assets/stylesheets/shared.scss b/app/assets/stylesheets/shared.scss index 378788d6..ac8845a5 100644 --- a/app/assets/stylesheets/shared.scss +++ b/app/assets/stylesheets/shared.scss @@ -13,6 +13,15 @@ html, body { background: linear-gradient(0, white 65%, #4DC0A2 35%); } +#alerts { + position: absolute; + top: 10px; + left: 50%; + margin-left: -250px; + width: 500px; + z-index: 999; +} + .header { padding: 20px 40px; diff --git a/app/views/landing/rooms.html.erb b/app/views/landing/rooms.html.erb index 3ebb6fab..5dd7f122 100644 --- a/app/views/landing/rooms.html.erb +++ b/app/views/landing/rooms.html.erb @@ -63,4 +63,18 @@ <%= t('no') %> +
+ +
+
+ <%= t('recording_publish_success') %> +
+
+ <%= t('recording_unpublish_success') %> +
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2475e4da..9fda7d81 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -11,9 +11,9 @@ -