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,13 +99,11 @@ | ||
99 | <script id="proposal-template" type="text/x-handlebars-template"> | 99 | <script id="proposal-template" type="text/x-handlebars-template"> |
100 | <header class="container"> | 100 | <header class="container"> |
101 | <a id="display-contrast" href="#">Alto Contraste</a> | 101 | <a id="display-contrast" href="#">Alto Contraste</a> |
102 | - <!-- | ||
103 | <div class="participar"> | 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 | <a href="#" class="logout hide">Sair</a> | 105 | <a href="#" class="logout hide">Sair</a> |
107 | </div> | 106 | </div> |
108 | - --> | ||
109 | <h1> | 107 | <h1> |
110 | <a href="#" class='logo'>{{article.title}}</a> | 108 | <a href="#" class='logo'>{{article.title}}</a> |
111 | </h1> | 109 | </h1> |
js/main.js
@@ -199,6 +199,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -199,6 +199,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
199 | var requireLoginContainer = loginButton.closest('.require-login-container'); | 199 | var requireLoginContainer = loginButton.closest('.require-login-container'); |
200 | 200 | ||
201 | if(logged_in) { | 201 | if(logged_in) { |
202 | + $('.logout').show(); | ||
202 | if(token){ | 203 | if(token){ |
203 | Main.private_token = token; | 204 | Main.private_token = token; |
204 | } | 205 | } |
@@ -219,6 +220,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -219,6 +220,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
219 | } else { | 220 | } else { |
220 | requireLoginContainer.find('.require-login').hide(); | 221 | requireLoginContainer.find('.require-login').hide(); |
221 | requireLoginContainer.find('.login-container').show(); | 222 | requireLoginContainer.find('.login-container').show(); |
223 | + $('.logout').hide(); | ||
222 | } | 224 | } |
223 | }, | 225 | }, |
224 | guid: function() { | 226 | guid: function() { |
@@ -740,6 +742,8 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -740,6 +742,8 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
740 | }); | 742 | }); |
741 | }); | 743 | }); |
742 | 744 | ||
745 | + | ||
746 | + | ||
743 | }) | 747 | }) |
744 | .fail(function( jqxhr, textStatus, error ) { | 748 | .fail(function( jqxhr, textStatus, error ) { |
745 | var err = textStatus + ', ' + error; | 749 | var err = textStatus + ', ' + error; |
@@ -760,6 +764,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -760,6 +764,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
760 | $.getJSON(url).done(function( /*data*/ ) { | 764 | $.getJSON(url).done(function( /*data*/ ) { |
761 | logged_in = true; | 765 | logged_in = true; |
762 | Main.private_token = $.cookie('_dialoga_session'); | 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,5 +900,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
895 | console.log('The browser not supports the hashchange event!'); | 900 | console.log('The browser not supports the hashchange event!'); |
896 | } | 901 | } |
897 | 902 | ||
903 | + | ||
904 | + | ||
898 | return Main; | 905 | return Main; |
899 | }); | 906 | }); |