Commit 4ead5ee574141e2fd4b3da2fc4826b5b6894aea1
1 parent
9c1e293b
Exists in
master
and in
5 other branches
Show logout button and process logout
Showing
2 changed files
with
9 additions
and
4 deletions
Show diff stats
index.html
... | ... | @@ -99,13 +99,11 @@ |
99 | 99 | <script id="proposal-template" type="text/x-handlebars-template"> |
100 | 100 | <header class="container"> |
101 | 101 | <a id="display-contrast" href="#">Alto Contraste</a> |
102 | - <!-- | |
103 | 102 | <div class="participar"> |
104 | - <a href="#" class="button button-inline participe">Participe</a> | |
105 | - <a href="#" class="entrar">Entrar</a> | |
103 | + <!--<a href="#" class="button button-inline participe">Participe</a>--> | |
104 | + <!--<a href="#" class="entrar">Entrar</a>--> | |
106 | 105 | <a href="#" class="logout hide">Sair</a> |
107 | 106 | </div> |
108 | - --> | |
109 | 107 | <h1> |
110 | 108 | <a href="#" class='logo'>{{article.title}}</a> |
111 | 109 | </h1> | ... | ... |
js/main.js
... | ... | @@ -199,6 +199,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
199 | 199 | var requireLoginContainer = loginButton.closest('.require-login-container'); |
200 | 200 | |
201 | 201 | if(logged_in) { |
202 | + $('.logout').show(); | |
202 | 203 | if(token){ |
203 | 204 | Main.private_token = token; |
204 | 205 | } |
... | ... | @@ -219,6 +220,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
219 | 220 | } else { |
220 | 221 | requireLoginContainer.find('.require-login').hide(); |
221 | 222 | requireLoginContainer.find('.login-container').show(); |
223 | + $('.logout').hide(); | |
222 | 224 | } |
223 | 225 | }, |
224 | 226 | guid: function() { |
... | ... | @@ -740,6 +742,8 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
740 | 742 | }); |
741 | 743 | }); |
742 | 744 | |
745 | + | |
746 | + | |
743 | 747 | }) |
744 | 748 | .fail(function( jqxhr, textStatus, error ) { |
745 | 749 | var err = textStatus + ', ' + error; |
... | ... | @@ -760,6 +764,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
760 | 764 | $.getJSON(url).done(function( /*data*/ ) { |
761 | 765 | logged_in = true; |
762 | 766 | Main.private_token = $.cookie('_dialoga_session'); |
767 | + setTimeout(function(){ $('.logout').show(); }, 2000); | |
763 | 768 | }); |
764 | 769 | } |
765 | 770 | |
... | ... | @@ -895,5 +900,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
895 | 900 | console.log('The browser not supports the hashchange event!'); |
896 | 901 | } |
897 | 902 | |
903 | + | |
904 | + | |
898 | 905 | return Main; |
899 | 906 | }); | ... | ... |