Skip to content

Commit 7a76276

Browse files
committed
Show categoryList page
1 parent d4b14c1 commit 7a76276

File tree

5 files changed

+120
-4
lines changed

5 files changed

+120
-4
lines changed

angular/wallypop/src/app/app.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import {NotFoundComponent} from './components/404/NotFound.component';
1212
import {NewaccountComponent} from './components/login/newaccount.component';
1313
import { ProfileComponent } from './components/profile/profile.component';
1414
import { CategoryComponent } from './components/category/category.component';
15+
import { CategoryListComponent } from './components/category/categoryList.component';
1516

1617
@NgModule({
17-
declarations: [AppComponent, IndexComponent, LoginComponent, SearchComponent, NotFoundComponent, NewaccountComponent, ProfileComponent, CategoryComponent],
18+
declarations: [AppComponent, IndexComponent, LoginComponent, SearchComponent, NotFoundComponent, NewaccountComponent, ProfileComponent, CategoryComponent, CategoryListComponent],
1819
imports: [BrowserModule, FormsModule, HttpClientModule, routing],
1920
bootstrap: [AppComponent]
2021
})

angular/wallypop/src/app/app.routing.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import {NotFoundComponent} from './components/404/NotFound.component';
66
import {NewaccountComponent} from './components/login/newaccount.component';
77
import {ProfileComponent} from './components/profile/profile.component';
88
import { CategoryComponent } from './components/category/category.component';
9+
import { CategoryListComponent } from './components/category/categoryList.component';
910

1011
const appRoutes = [
1112
{ path: '', component: IndexComponent },
1213
{ path: 'login', component: LoginComponent },
1314
{ path: 'newaccount', component: NewaccountComponent },
1415
{ path: 'profile', component: ProfileComponent },
1516
{ path: 'category', component: CategoryComponent},
17+
{ path: 'categoryList', component: CategoryListComponent},
1618
{ path: '**', component: NotFoundComponent}
1719
];
1820

angular/wallypop/src/app/components/category/category.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ <h3 class="text-info">Añade una nueva Categoría</h3>
148148
</div>
149149
</div>
150150
<br><br><br>
151-
<!--
151+
152152
<h3 class="text-info">Foto</h3>
153153
<p>¡Añade una foto a la categoría!</p>
154154
<div class="form-group">
@@ -159,8 +159,7 @@ <h3 class="text-info">Foto</h3>
159159
<br>
160160
<p class="text-muted text-center archivo">Archivo...</p>
161161
</div>
162-
-->
163-
<!--<input name="_csrf" type="hidden" value="{{token}}"/>-->
162+
164163
<p class="text-center">
165164
<button (click)="addCategory($event, title.value, description.value, icon.value)" class="btn btn-danger btn-lg" type="submit">Guardar</button>
166165
</p>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
<!-- ====== Page content ======-->
3+
<!-- {{>nav_side}} -->
4+
<section class="full-width section">
5+
<div class="container">
6+
<div class="row">
7+
<div class="col-xs-12 col-sm-4 col-md-3">
8+
<!--<buttom class="btn btn-default btn-block visible-xs btn-dropdown-conatiner"
9+
data-drop-cont=".user-menu-xs">
10+
<i aria-hidden="true" class="fa fa-user fa-fw"></i> MOSTRAR MENÚ <i aria-hidden="true"
11+
class="fa fa-sort pull-right"></i>
12+
</buttom> -->
13+
<div class="full-width user-menu-xs" style="text-align: center">
14+
<div class="full-width post-user-info" style="margin: 0 !important;">
15+
<!-- {{#admin}} -->
16+
<p class="full-width"><small *ngIf="loginService.isLogged() && loginService.isAdmin()">ADMIN</small></p>
17+
<!-- {{/admin}} -->
18+
<p class="full-width"><small>{{loginService.currentUser().full_NAME}}</small></p>
19+
<img alt="User" class="" height="auto" src="/assets/img/user.png"
20+
style="border:1px;top:0px;" width="90px">
21+
<p class="full-width"><small>{{loginService.currentUser().name}}</small></p>
22+
<div class="full-width div-table">
23+
<div class="full-width div-table-row">
24+
<div class="div-table-cell div-table-cell-xs"
25+
style="height: auto !important; line-height: inherit; border:none;">
26+
{{loginService.currentUser().n_SELL}} <br>
27+
<small>En venta</small>
28+
</div>
29+
<div class="div-table-cell div-table-cell-xs"
30+
style="height: auto !important; line-height: inherit; border:none;">
31+
{{loginService.currentUser().n_SOLD}} <br>
32+
<small>Vendidos</small>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
<div class="full-width list-group" style="border-radius: 0;">
38+
<!-- {{>nav_side}} -->
39+
<a class="list-group-item" href="/profile">
40+
<i aria-hidden="true" class="fa fa-user fa-fw"></i> TU PERFIL
41+
</a>
42+
<a class="list-group-item" href="/yourcommercial">
43+
<i aria-hidden="true" class="fa fa-object-group fa-fw"></i> TUS ANUNCIOS
44+
</a>
45+
<a class="list-group-item" href="/yourcommercialsold">
46+
<i aria-hidden="true" class="fa fa-object-group fa-fw"></i> TUS ANUNCIOS VENDIDOS
47+
</a>
48+
<a class="list-group-item" href="/favorites">
49+
<i aria-hidden="true" class="fa fa-heart-o fa-fw"></i> FAVORITOS
50+
</a>
51+
<span *ngIf="loginService.isAdmin()">
52+
<a class="list-group-item" href="/category">
53+
<i aria-hidden="true" class="fa fa-object-group fa-fw"></i> GESTIÓN CATEGORÍAS
54+
</a>
55+
<a class="list-group-item" href="/reports">
56+
<i aria-hidden="true" class="fa fa-object-group fa-fw"></i> GESTIÓN REPORTES
57+
</a>
58+
</span>
59+
</div>
60+
</div>
61+
</div>
62+
<div class="col-xs-12 col-sm-8 col-md-9">
63+
<!-- Content-->
64+
<div class="col-xs-12 col-sm-8 col-md-9">
65+
<div class="full-width bar-info-user">
66+
<i aria-hidden="true" class="fa fa-object-group fa-fw"></i>
67+
<div>CATEGORÍAS</div>
68+
</div>
69+
<!-- Content-->
70+
<div class="full-widht">
71+
<i class="fa fa-th-large btn btn-default hidden-xs btn-change-post"></i>
72+
<i class="fa fa-refresh btn btn-default"></i>
73+
<i class="fa fa-angle-right btn btn-default"></i>
74+
</div>
75+
<div class="full-width container-post">
76+
<!--
77+
{{#category}}
78+
<div class="full-width post">
79+
<figure class="full-width post-img">
80+
<img alt="" class="img-responsive" src="category/{{ID_CATEGORY}}/imagen">
81+
</figure>
82+
<div class="full-width post-info">
83+
<a class="full-width post-info-price" href="/commercial/{{ID_CATEGORY}}">{{TITLE}}</a>
84+
<span class="post-info-zone">{{DESCRIPTION}}</span>
85+
<a class="post-info-date" href="/categoryList/{{ID_CATEGORY}}/delete">x</a>
86+
87+
</div>
88+
</div>
89+
{{/category}}
90+
-->
91+
</div>
92+
</div>
93+
</div>
94+
</div>
95+
</div>
96+
</section>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {Component} from '@angular/core';
2+
import { Category } from 'src/app/models/category.model';
3+
import {CategoryService} from '../../services/category.service';
4+
import {LoginService} from '../../services/login.service';
5+
6+
@Component({
7+
selector: 'categoryList',
8+
templateUrl: './categoryList.component.html'
9+
})
10+
export class CategoryListComponent {
11+
constructor(public categoryService: CategoryService, public loginService: LoginService) {
12+
}
13+
14+
addCategory(event: any, title: string, description: string, icon: string): void {
15+
event.preventDefault();
16+
this.categoryService.addCategory(title,description,icon);
17+
}
18+
}

0 commit comments

Comments
 (0)