-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
40 changes: 40 additions & 0 deletions
40
src/app/components/animaux/animaux-list/animaux-list.component.html
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,40 @@ | ||
<div *ngIf="chats" class="px-4 py-16 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24 lg:px-8 lg:py-20"> | ||
|
||
<div class="grid gap-8 lg:grid-cols-3 sm:max-w-sm sm:mx-auto lg:max-w-full"> | ||
|
||
<div *ngFor="let chat of chats; let index = index" | ||
class="overflow-hidden transition-shadow duration-300 bg-white rounded shadow-sm"> | ||
<img [src]="chat.photos[0].url" loading="lazy" decoding="async" class="object-cover w-full h-64" alt="" /> | ||
<div class="p-5 border border-t-0"> | ||
<p class="mb-3 text-xs font-semibold tracking-wide uppercase"> | ||
<a href="/assos/1" | ||
class="transition-colors duration-200 text-blue-gray-900 hover:text-deep-purple-accent-700" | ||
aria-label="Catégorie" title="Association de Chats">Association : {{chat.association.nom}}</a> | ||
<span class="text-gray-600">— 28 Dec 2020</span> | ||
</p> | ||
<div href="/animaux/1" aria-label="Animaux" title="En savoir plus" | ||
class="inline-block mb-3 text-2xl font-bold leading-5 transition-colors duration-200 hover:text-deep-purple-accent-700"> | ||
<a href="/animaux/1" class="inline-block">{{chat.nom}}</a> | ||
<fa-icon *ngIf="chat.sexe === 'FEMELLE'" [icon]="faVenus" aria-label="Sexe" title="Femelle" | ||
class="ml-2" style="color: fuchsia;"></fa-icon> | ||
<fa-icon *ngIf="chat.sexe === 'MALE'" [icon]="faMars" aria-label="Sexe" title="Male" class="ml-2" | ||
style="color: Dodgerblue;"></fa-icon> | ||
|
||
</div> | ||
<p class="mb-2 text-gray-700"> | ||
{{chat.description}} | ||
</p> | ||
<a href="/animaux/1" aria-label="" | ||
class="inline-flex items-center font-semibold transition-colors duration-200 text-deep-purple-accent-400 hover:text-deep-purple-800"> | ||
En savoir plus sur {{chat.nom}} | ||
</a> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
||
|
||
</div> | ||
</div> |
Empty file.
21 changes: 21 additions & 0 deletions
21
src/app/components/animaux/animaux-list/animaux-list.component.spec.ts
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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AnimauxListComponent } from './animaux-list.component'; | ||
|
||
describe('AnimauxListComponent', () => { | ||
let component: AnimauxListComponent; | ||
let fixture: ComponentFixture<AnimauxListComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [AnimauxListComponent] | ||
}); | ||
fixture = TestBed.createComponent(AnimauxListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
31 changes: 31 additions & 0 deletions
31
src/app/components/animaux/animaux-list/animaux-list.component.ts
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 @@ | ||
import { Component } from '@angular/core'; | ||
import { faMars, faVenus } from '@fortawesome/free-solid-svg-icons'; | ||
import { AppService } from '../../../services/app.service'; | ||
import { Chat } from '../../../interfaces/interfaces'; | ||
|
||
@Component({ | ||
selector: 'app-animaux-list', | ||
templateUrl: './animaux-list.component.html', | ||
styleUrls: ['./animaux-list.component.scss'], | ||
}) | ||
export class AnimauxListComponent { | ||
faMars = faMars; | ||
faVenus = faVenus; | ||
constructor(private appService: AppService) {} | ||
|
||
chats: Chat[] = []; | ||
|
||
ngOnInit() { | ||
this.getCats(); | ||
} | ||
|
||
getCats() { | ||
this.appService.getAllCats().subscribe((chats) => { | ||
this.chats = chats; | ||
console.log( | ||
'🚀 ~ AnimauxListComponent ~ this.appService.getAllCats ~ this.chats:', | ||
this.chats | ||
); | ||
}); | ||
} | ||
} |
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,42 @@ | ||
export interface Chat { | ||
id: number; | ||
nom: string; | ||
age: number; | ||
automatiqueAnnonce: boolean; | ||
description: string; | ||
race: string; | ||
annonceUrl: string; | ||
sterilise: any; | ||
vaccinations: string; | ||
adopte: boolean; | ||
histoire: string; | ||
type: string; | ||
sexe: string; | ||
couleur: string; | ||
taille: string; | ||
ententeChien: boolean; | ||
ententeChat: boolean; | ||
ententeEnfant: boolean; | ||
typeFoyerMaison: boolean; | ||
typeFoyerAppartement: boolean; | ||
contactEmail: string; | ||
contactTel: string; | ||
contactUrl: any; | ||
createdAt: string; | ||
updatedAt: string; | ||
associationId: number; | ||
photos: Photo[]; | ||
association: Association; | ||
} | ||
|
||
export interface Photo { | ||
id: number; | ||
createdAt: string; | ||
url: string; | ||
chatId: number; | ||
} | ||
|
||
export interface Association { | ||
id: number; | ||
nom: string; | ||
} |
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