mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 03:59:51 +08:00
fixes alert messages in samples [fixes SCI-1135]
This commit is contained in:
parent
3beb179f87
commit
9ce95470b3
3 changed files with 13 additions and 10 deletions
|
@ -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 = '<div class="alert alert' + alertType +
|
||||
'alert-dismissable alert-floating">' +
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue