add msg when user session expired at page admin

This commit is contained in:
Matt K. Fu 2013-04-24 11:58:48 +08:00
parent 5ff7dfbac6
commit 62fa589e8a
3 changed files with 11 additions and 0 deletions

View File

@ -2,5 +2,14 @@
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
</ol>
<script type="text/javascript">
$.ajaxSetup({
error: function(xhr, status, err) {
if (xhr.status == 401){
alert("<%= I18n.t('access.denied.ajax_401_error') %>");
window.location.href = '/';
}
}
});
bindTreeDragHandle();
</script>

View File

@ -4,6 +4,7 @@ en:
access:
denied:
ajax_401_error: "User session has been expired,please login again."
app:
not_authed_user: Access Denied for you are not User for this app
not_manager: Access Denied for you are not Manager for this app

View File

@ -4,6 +4,7 @@ zh_tw:
access:
denied:
ajax_401_error: 使用者已逾時或是登出,請重新登入
app:
not_authed_user: 拒絕存取,因你不是此應用程式授權使用者
not_manager: 拒絕存取,因你不是此應用程式管理員