mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 07:34:41 +08:00
Merge pull request #529 from ZmagoD/zd_SCI_1135
fixes alert messages in samples [fixes SCI-1135]
This commit is contained in:
commit
2b35b34eb8
3 changed files with 13 additions and 10 deletions
|
@ -234,6 +234,9 @@ var HelperModule = (function(){
|
||||||
} else if (type === 'danger') {
|
} else if (type === 'danger') {
|
||||||
alertType = ' alert-danger ';
|
alertType = ' alert-danger ';
|
||||||
glyphSign = ' glyphicon-exclamation-sign ';
|
glyphSign = ' glyphicon-exclamation-sign ';
|
||||||
|
} else if (type === 'info') {
|
||||||
|
alertType = ' alert-info ';
|
||||||
|
glyphSign = ' glyphicon-exclamation-sign ';
|
||||||
}
|
}
|
||||||
var htmlSnippet = '<div class="alert alert' + alertType +
|
var htmlSnippet = '<div class="alert alert' + alertType +
|
||||||
'alert-dismissable alert-floating">' +
|
'alert-dismissable alert-floating">' +
|
||||||
|
|
|
@ -504,7 +504,7 @@ function onClickEdit() {
|
||||||
error: function (e, data, status, xhr) {
|
error: function (e, data, status, xhr) {
|
||||||
if (e.status == 403) {
|
if (e.status == 403) {
|
||||||
HelperModule.flashAlertMsg(
|
HelperModule.flashAlertMsg(
|
||||||
I18n.t('samples.js.permission_error'), 'danger'
|
I18n.t('samples.js.permission_error'), e.responseJSON.style
|
||||||
);
|
);
|
||||||
changeToViewMode();
|
changeToViewMode();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
@ -1245,7 +1245,7 @@ function changeToEditMode() {
|
||||||
|
|
||||||
renderFormError(undefined,
|
renderFormError(undefined,
|
||||||
$(li).find('.text-edit'),
|
$(li).find('.text-edit'),
|
||||||
Object.keys(msg)[0] + ' ' + msg.name.toString());
|
msg.name.toString());
|
||||||
var verticalHeight = $(li).offset().top;
|
var verticalHeight = $(li).offset().top;
|
||||||
dropdownList.scrollTo(verticalHeight,0);
|
dropdownList.scrollTo(verticalHeight,0);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
@ -1332,7 +1332,7 @@ function changeToEditMode() {
|
||||||
|
|
||||||
renderFormError(undefined,
|
renderFormError(undefined,
|
||||||
$(li).find('.text-edit'),
|
$(li).find('.text-edit'),
|
||||||
Object.keys(msg)[0] + ' ' + msg.name.toString());
|
msg.name.toString());
|
||||||
var verticalHeight = $(li).offset().top;
|
var verticalHeight = $(li).offset().top;
|
||||||
dropdownList.scrollTo(verticalHeight,0);
|
dropdownList.scrollTo(verticalHeight,0);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
|
@ -44,16 +44,16 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_403
|
def render_403(style = 'danger')
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
render file: 'public/403.html', status: :forbidden, layout: false
|
render file: 'public/403.html', status: :forbidden, layout: false
|
||||||
}
|
end
|
||||||
format.json {
|
format.json do
|
||||||
render json: {}, status: :forbidden
|
render json: { style: style }, status: :forbidden
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
return true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_404
|
def render_404
|
||||||
|
|
Loading…
Add table
Reference in a new issue