diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb
index 56bf2fb5f..be79110f3 100644
--- a/app/assets/javascripts/application.js.erb
+++ b/app/assets/javascripts/application.js.erb
@@ -234,6 +234,9 @@ var HelperModule = (function(){
} else if (type === 'danger') {
alertType = ' alert-danger ';
glyphSign = ' glyphicon-exclamation-sign ';
+ } else if (type === 'info') {
+ alertType = ' alert-info ';
+ glyphSign = ' glyphicon-exclamation-sign ';
}
var htmlSnippet = '
' +
diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb
index 0dd4b21e7..d492cf4ba 100644
--- a/app/assets/javascripts/samples/sample_datatable.js.erb
+++ b/app/assets/javascripts/samples/sample_datatable.js.erb
@@ -504,7 +504,7 @@ function onClickEdit() {
error: function (e, data, status, xhr) {
if (e.status == 403) {
HelperModule.flashAlertMsg(
- I18n.t('samples.js.permission_error'), 'danger'
+ I18n.t('samples.js.permission_error'), e.responseJSON.style
);
changeToViewMode();
updateButtons();
@@ -1245,7 +1245,7 @@ function changeToEditMode() {
renderFormError(undefined,
$(li).find('.text-edit'),
- Object.keys(msg)[0] + ' ' + msg.name.toString());
+ msg.name.toString());
var verticalHeight = $(li).offset().top;
dropdownList.scrollTo(verticalHeight,0);
setTimeout(function() {
@@ -1332,7 +1332,7 @@ function changeToEditMode() {
renderFormError(undefined,
$(li).find('.text-edit'),
- Object.keys(msg)[0] + ' ' + msg.name.toString());
+ msg.name.toString());
var verticalHeight = $(li).offset().top;
dropdownList.scrollTo(verticalHeight,0);
setTimeout(function() {
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index f0314e07a..b3fcb0de1 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -44,16 +44,16 @@ class ApplicationController < ActionController::Base
end
end
- def render_403
+ def render_403(style = 'danger')
respond_to do |format|
- format.html {
+ format.html do
render file: 'public/403.html', status: :forbidden, layout: false
- }
- format.json {
- render json: {}, status: :forbidden
- }
+ end
+ format.json do
+ render json: { style: style }, status: :forbidden
+ end
end
- return true
+ true
end
def render_404