Improved logout (do redirect before rerender).
This commit is contained in:
parent
aabffa8ca4
commit
4cc68551d9
7 changed files with 16 additions and 18 deletions
|
@ -133,7 +133,7 @@ class App.Controller extends Spine.Controller
|
||||||
updateNavMenu: =>
|
updateNavMenu: =>
|
||||||
delay = ->
|
delay = ->
|
||||||
App.Event.trigger('menu:render')
|
App.Event.trigger('menu:render')
|
||||||
@delay(delay, 200)
|
@delay(delay, 150)
|
||||||
|
|
||||||
scrollTo: (x = 0, y = 0, delay = 0) ->
|
scrollTo: (x = 0, y = 0, delay = 0) ->
|
||||||
a = ->
|
a = ->
|
||||||
|
|
|
@ -4,10 +4,5 @@ class Index extends App.ControllerContent
|
||||||
|
|
||||||
App.Auth.logout()
|
App.Auth.logout()
|
||||||
|
|
||||||
# redirect to login
|
|
||||||
redirect = =>
|
|
||||||
@navigate 'login'
|
|
||||||
@delay redirect, 100
|
|
||||||
|
|
||||||
App.Config.set('logout', Index, 'Routes')
|
App.Config.set('logout', Index, 'Routes')
|
||||||
App.Config.set('Logout', { prio: 1800, parent: '#current_user', name: 'Sign out', translate: true, target: '#logout', divider: true, iconClass: 'signout', role: [ 'Agent', 'Customer' ] }, 'NavBarRight')
|
App.Config.set('Logout', { prio: 1800, parent: '#current_user', name: 'Sign out', translate: true, target: '#logout', divider: true, iconClass: 'signout', role: [ 'Agent', 'Customer' ] }, 'NavBarRight')
|
||||||
|
|
|
@ -141,6 +141,7 @@ class App.Auth
|
||||||
|
|
||||||
App.Event.trigger('auth')
|
App.Event.trigger('auth')
|
||||||
App.Event.trigger('auth:logout')
|
App.Event.trigger('auth:logout')
|
||||||
|
window.location.href = '#login'
|
||||||
if rerender
|
if rerender
|
||||||
App.Event.trigger('ui:rerender')
|
App.Event.trigger('ui:rerender')
|
||||||
App.Event.trigger('clearStore')
|
App.Event.trigger('clearStore')
|
||||||
|
|
|
@ -68,6 +68,8 @@
|
||||||
<%- @T('will be created') %>
|
<%- @T('will be created') %>
|
||||||
<% else if item.to_delete is true: %>
|
<% else if item.to_delete is true: %>
|
||||||
<%- @T('will be deleted') %>
|
<%- @T('will be deleted') %>
|
||||||
|
<% else if item.to_migrate is true || item.to_config is true: %>
|
||||||
|
<%- @T('has changed') %>
|
||||||
<% else if item.editable isnt false: %>
|
<% else if item.editable isnt false: %>
|
||||||
<a href="#" class="js-delete" title="<%- @Ti('Delete') %>"><%- @Icon('trash') %></a>
|
<a href="#" class="js-delete" title="<%- @Ti('Delete') %>"><%- @Icon('trash') %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
<% if @organization[row.name] || row.name is 'note': %>
|
<% if @organization[row.name] || row.name is 'note': %>
|
||||||
<div class="sidebar-block">
|
<div class="sidebar-block">
|
||||||
<% if row.tag isnt 'richtext': %>
|
<% if row.tag isnt 'richtext': %>
|
||||||
<label><%- @T( row.display ) %></label>
|
<label><%- @T(row.display) %></label>
|
||||||
<%- @P( @organization, row.name ) %>
|
<%- @P(@organization, row.name) %>
|
||||||
<% else: %>
|
<% else: %>
|
||||||
<label><%- @T( row.display ) %></label>
|
<label><%- @T(row.display) %></label>
|
||||||
<div contenteditable="true" data-name="<%= row.name %>" data-type="update-org" data-placeholder="<%- @Ti('Add a Note') %>"><%- @organization[row.name] %></div>
|
<div contenteditable="true" data-name="<%= row.name %>" data-type="update-org" data-placeholder="<%- @Ti('Add a Note') %>"><%- @organization[row.name] %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
<% if @user[row.name] || row.name is 'note': %>
|
<% if @user[row.name] || row.name is 'note': %>
|
||||||
<div class="sidebar-block">
|
<div class="sidebar-block">
|
||||||
<% if row.tag isnt 'richtext': %>
|
<% if row.tag isnt 'richtext': %>
|
||||||
<label><%- @T( row.display ) %></label>
|
<label><%- @T(row.display) %></label>
|
||||||
<%- @P( @user, row.name ) %>
|
<%- @P(@user, row.name) %>
|
||||||
<% else: %>
|
<% else: %>
|
||||||
<label><%- @T( row.display ) %></label>
|
<label><%- @T(row.display) %></label>
|
||||||
<div contenteditable="true" data-name="<%= row.name %>" data-type="update" data-placeholder="<%- @Ti('Add a Note') %>"><%- @user[row.name] %></div>
|
<div contenteditable="true" data-name="<%= row.name %>" data-type="update" data-placeholder="<%- @Ti('Add a Note') %>"><%- @user[row.name] %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,11 +9,11 @@ class Store
|
||||||
|
|
||||||
add new file to store
|
add new file to store
|
||||||
|
|
||||||
store_file_id = Store::File.add(binary_data)
|
store_file_id = Store::File.add(binary_data)
|
||||||
|
|
||||||
do also verify of written data
|
do also verify of written data
|
||||||
|
|
||||||
store_file_id = Store::File.add(binary_data, true)
|
store_file_id = Store::File.add(binary_data, true)
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -51,9 +51,9 @@ do also verify of written data
|
||||||
|
|
||||||
read content of a file
|
read content of a file
|
||||||
|
|
||||||
store = Store::File.find(123)
|
store = Store::File.find(123)
|
||||||
|
|
||||||
store.content # returns binary
|
store.content # returns binary
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -66,13 +66,13 @@ read content of a file
|
||||||
|
|
||||||
file system check of store, check data and sha (in case fix it)
|
file system check of store, check data and sha (in case fix it)
|
||||||
|
|
||||||
Store::File.verify
|
Store::File.verify
|
||||||
|
|
||||||
read each file which should be in backend and verify agsinst sha hash
|
read each file which should be in backend and verify agsinst sha hash
|
||||||
|
|
||||||
in case of fixing sha hash use:
|
in case of fixing sha hash use:
|
||||||
|
|
||||||
Store::File.verify(true)
|
Store::File.verify(true)
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue