dialog confirmation for publish unpublish

This commit is contained in:
Zachary Chai 2016-11-07 17:19:54 -05:00
parent 9fad2a4ef8
commit bc7a77ef77
5 changed files with 35 additions and 2 deletions

View File

@ -11,6 +11,14 @@
var rowData = table.row("#"+data.record_id).data(); var rowData = table.row("#"+data.record_id).data();
rowData.published = data.published rowData.published = data.published
table.row("#"+data.record_id).data(rowData).draw(); 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);
} }
}); });
}; };

View File

@ -13,6 +13,15 @@ html, body {
background: linear-gradient(0, white 65%, #4DC0A2 35%); background: linear-gradient(0, white 65%, #4DC0A2 35%);
} }
#alerts {
position: absolute;
top: 10px;
left: 50%;
margin-left: -250px;
width: 500px;
z-index: 999;
}
.header { .header {
padding: 20px 40px; padding: 20px 40px;

View File

@ -63,4 +63,18 @@
<%= t('no') %> <%= t('no') %>
</button> </button>
</div> </div>
<div class="alert-template">
<div class="alert alert-success alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<span class="alert-message">Recording was successfully published</span>
</div>
</div>
<div class="publish-alert">
<%= t('recording_publish_success') %>
</div>
<div class="unpublish-alert">
<%= t('recording_unpublish_success') %>
</div>
</div> </div>

View File

@ -11,7 +11,7 @@
<body class="app-background" data-controller="<%= params[:controller] %>" data-action="<%= params[:action] %>"> <body class="app-background" data-controller="<%= params[:controller] %>" data-action="<%= params[:action] %>">
<!-- Messages --> <!-- Messages -->
<div id='messages' class='hidden'> <div id='alerts'>
</div> </div>
<!-- Header --> <!-- Header -->

View File

@ -41,6 +41,8 @@ en-US:
past_recordings: Past Recordings past_recordings: Past Recordings
powered_bigbluebutton: Powered by BigBlueButton powered_bigbluebutton: Powered by BigBlueButton
presentation: Presentation presentation: Presentation
recording_publish_success: Recording was successfully published
recording_unpublish_success: Recording was successfully unpublished
refresh_html: <a href="#" class="generate-link">Click refresh</a> to generate a new meeting URL refresh_html: <a href="#" class="generate-link">Click refresh</a> to generate a new meeting URL
session_url_explanation: The session will be taking place using the following URL session_url_explanation: The session will be taking place using the following URL
start: Start start: Start