Commit 4ead5ee574141e2fd4b3da2fc4826b5b6894aea1

Authored by Evandro Jr
1 parent 9c1e293b

Show logout button and process logout

Showing 2 changed files with 9 additions and 4 deletions   Show diff stats
@@ -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>
@@ -199,6 +199,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -199,6 +199,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], 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([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -219,6 +220,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], 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([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -740,6 +742,8 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], 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([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -760,6 +764,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], 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([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -895,5 +900,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], 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 });