-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
se agrego la pagina de mensajes de aministrador (novedades)
- Loading branch information
1 parent
19c36a2
commit de9670c
Showing
4 changed files
with
145 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.message, | ||
.no-message { | ||
background: #fff; | ||
padding: 1rem; | ||
border-radius: 8px; | ||
border: 2px solid #2321; | ||
|
||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.message span { | ||
align-self: flex-end; | ||
font-size: .8rem; | ||
} | ||
|
||
.no-message { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
align-items: center; | ||
background: #d3a9a9; | ||
padding: 2rem; | ||
} | ||
|
||
.loader { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,34 @@ | ||
<p> | ||
message-admin works! | ||
</p> | ||
|
||
<div class="container"> | ||
<h2 class="mt-3"> Novedades </h2> | ||
<div class="row mt-5"> | ||
<div class="col-3"> | ||
<ul *ngIf="!loader" class="list-group shadow-box"> | ||
<li *ngFor="let message of messages" | ||
class="list-group-item" | ||
style="cursor: pointer" | ||
[ngClass]="{'active': selected !== undefined && selected.day === message.day }"> | ||
<a (click)="selected = message"> {{ message.title }} </a> | ||
</li> | ||
</ul> | ||
|
||
<div *ngIf="loader" class="loader"> | ||
<p>Buscando mensajes...</p> | ||
<app-loading></app-loading> | ||
</div> | ||
</div> | ||
|
||
<div class="col-8"> | ||
<div *ngIf="selected !== undefined;" class="message shadow-box"> | ||
<h3> {{ selected.title }} </h3> | ||
<p> {{ selected.body }} </p> | ||
<span> {{ selected.hour }} </span> | ||
</div> | ||
|
||
<div *ngIf="selected === undefined" class="no-message shadow-box"> | ||
<h3> Debe seleccionar un mensaje </h3> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { DatabaseService } from '../../services/database.service'; | ||
|
||
@Component({ | ||
selector: 'app-message-admin', | ||
templateUrl: './message-admin.component.html', | ||
styleUrls: ['./message-admin.component.css'] | ||
}) | ||
export class MessageAdminComponent implements OnInit { | ||
export class MessageAdminComponent { | ||
|
||
constructor() { } | ||
messages:any[]; | ||
selected:any; | ||
loader:boolean = true; | ||
|
||
ngOnInit() { | ||
constructor( _dbService: DatabaseService ) { | ||
_dbService.getData('global-messages') | ||
.valueChanges() | ||
.subscribe( resp => { | ||
this.messages = resp; | ||
this.loader = false; | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters