Commit bdbea3cdec08c33d2b61d5fc048b870dd3452e70

Authored by Carlos Purificação
1 parent e1903c92

Fixed user since html in login block

src/app/layout/blocks/login-block/login-block.component.ts
@@ -41,6 +41,7 @@ export class LoginBlockComponent { @@ -41,6 +41,7 @@ export class LoginBlockComponent {
41 41
42 this.$scope.$on(AUTH_EVENTS.loginSuccess, () => { 42 this.$scope.$on(AUTH_EVENTS.loginSuccess, () => {
43 this.currentUser = this.session.currentUser(); 43 this.currentUser = this.session.currentUser();
  44 + console.debug("User: ", this.currentUser);
44 }); 45 });
45 46
46 this.$scope.$on(AUTH_EVENTS.logoutSuccess, () => { 47 this.$scope.$on(AUTH_EVENTS.logoutSuccess, () => {
1
src/app/layout/blocks/login-block/login-block.html
1 <div class="logged-user-info" ng-show="ctrl.currentUser"> 1 <div class="logged-user-info" ng-show="ctrl.currentUser">
2 <h4>Logged in as {{ctrl.currentUser.person.identifier}}</h4> 2 <h4>Logged in as {{ctrl.currentUser.person.identifier}}</h4>
3 <ul> 3 <ul>
4 - <li>User since {{ctrl.currentUser.created_at.month}}/{{ctrl.currentUser.created_at.year}}</li> 4 + <li>User since
1
  • Me
    Michel Felipe @mfdeveloper

    A biblioteca moment que estamos utilizando como dependência no projeto possui alguns métodos para exibir essas informações de data. Por favor, verifique se não há uma que já faça isso

    Choose File ...   File name...
    Cancel
  5 + <span class="time">
  6 + <span am-time-ago="ctrl.currentUser.person.created_at | dateFormat"></span>
  7 + </span>
  8 + </li>
5 <li><a ui-sref="main.profile.info({profile: ctrl.currentUser.person.identifier})">Profile Homepage</a></li> 9 <li><a ui-sref="main.profile.info({profile: ctrl.currentUser.person.identifier})">Profile Homepage</a></li>
6 </ul> 10 </ul>
7 <div class="user-actions"> 11 <div class="user-actions">
src/lib/ng-noosfero-api/interfaces/person.ts
@@ -6,6 +6,7 @@ namespace noosfero { @@ -6,6 +6,7 @@ namespace noosfero {
6 * A representation of a Person in Noosfero. 6 * A representation of a Person in Noosfero.
7 */ 7 */
8 export interface Person extends Profile { 8 export interface Person extends Profile {
9 - 9 + created_at: string;
1
  • Me
    Michel Felipe @mfdeveloper

    identifier e created_at não são dados específicos de Person, mas sim de qualquer Profile(Comunidades, Organizações...). Não seria melhor mover esses atributos para Profile?

    Choose File ...   File name...
    Cancel
  10 + identifier: string;
10 } 11 }
11 } 12 }
12 \ No newline at end of file 13 \ No newline at end of file