Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
TicketTech
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit fef86573
authored
2020-03-02 12:04:39 +0000
by
Luciano Barletta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
forms added, search added
1 parent
0bc7ec18
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
12 deletions
src/app/app-routing.module.ts
src/app/app.module.ts
src/app/busqueda/busqueda.component.ts
src/app/nav-bar/nav-bar.component.css
src/app/nav-bar/nav-bar.component.html
src/app/nav-bar/nav-bar.component.ts
src/app/app-routing.module.ts
View file @
fef8657
...
@@ -7,7 +7,7 @@ import { BusquedaComponent } from './busqueda/busqueda.component';
...
@@ -7,7 +7,7 @@ import { BusquedaComponent } from './busqueda/busqueda.component';
const
routes
:
Routes
=
[
const
routes
:
Routes
=
[
{
path
:
''
,
component
:
MainComponent
},
{
path
:
''
,
component
:
MainComponent
},
{
path
:
'informacion/:id'
,
component
:
InformacionComponent
},
{
path
:
'informacion/:id'
,
component
:
InformacionComponent
},
{
path
:
'busqueda'
,
component
:
BusquedaComponent
}
{
path
:
'busqueda
/:search
'
,
component
:
BusquedaComponent
}
];
];
/* { path: '**', component: PageNotFoundComponent } */
/* { path: '**', component: PageNotFoundComponent } */
...
...
src/app/app.module.ts
View file @
fef8657
...
@@ -9,6 +9,7 @@ import { NavBarComponent } from './nav-bar/nav-bar.component';
...
@@ -9,6 +9,7 @@ import { NavBarComponent } from './nav-bar/nav-bar.component';
import
{
InformacionComponent
}
from
'./informacion/informacion.component'
;
import
{
InformacionComponent
}
from
'./informacion/informacion.component'
;
import
{
ImagesService
}
from
'./services/images.service'
;
import
{
ImagesService
}
from
'./services/images.service'
;
import
{
BusquedaComponent
}
from
'./busqueda/busqueda.component'
;
import
{
BusquedaComponent
}
from
'./busqueda/busqueda.component'
;
import
{
FormsModule
}
from
'@angular/forms'
;
@
NgModule
({
@
NgModule
({
declarations
:
[
declarations
:
[
...
@@ -21,7 +22,8 @@ import { BusquedaComponent } from './busqueda/busqueda.component';
...
@@ -21,7 +22,8 @@ import { BusquedaComponent } from './busqueda/busqueda.component';
],
],
imports
:
[
imports
:
[
BrowserModule
,
BrowserModule
,
AppRoutingModule
AppRoutingModule
,
FormsModule
],
],
providers
:
[
ImagesService
],
providers
:
[
ImagesService
],
bootstrap
:
[
AppComponent
]
bootstrap
:
[
AppComponent
]
...
...
src/app/busqueda/busqueda.component.ts
View file @
fef8657
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
ParamMap
}
from
'@angular/router'
;
@
Component
({
@
Component
({
selector
:
'app-busqueda'
,
selector
:
'app-busqueda'
,
...
@@ -7,12 +8,18 @@ import { Component, OnInit } from '@angular/core';
...
@@ -7,12 +8,18 @@ import { Component, OnInit } from '@angular/core';
})
})
export
class
BusquedaComponent
implements
OnInit
{
export
class
BusquedaComponent
implements
OnInit
{
search
:
string
;
order
:
string
=
"Asc"
;
order
:
string
=
"Asc"
;
results
:
any
[];
results
:
any
[];
constructor
()
{
}
constructor
(
private
route
:
ActivatedRoute
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
route
.
paramMap
.
subscribe
(
(
params
)
=>
this
.
search
=
params
.
get
(
'search'
)
);
this
.
results
=
[
this
.
results
=
[
"cosa1"
,
"cosa1"
,
"cosa2"
,
"cosa2"
,
...
@@ -25,6 +32,6 @@ export class BusquedaComponent implements OnInit {
...
@@ -25,6 +32,6 @@ export class BusquedaComponent implements OnInit {
}
}
change
()
{
change
()
{
this
.
order
=
=
"Asc"
?
"Des"
:
"Asc"
;
this
.
order
=
(
this
.
order
==
"Asc"
?
"Des"
:
"Asc"
)
;
}
}
}
}
src/app/nav-bar/nav-bar.component.css
View file @
fef8657
...
@@ -38,3 +38,14 @@
...
@@ -38,3 +38,14 @@
border-radius
:
10px
;
border-radius
:
10px
;
}
}
.NavSuggestion
{
background-color
:
white
;
border
:
solid
1px
grey
;
position
:
absolute
;
width
:
30%
;
left
:
70%
;
padding
:
3px
;
top
:
0
;
transform
:
translate
(
-50%
,
220%
);
}
src/app/nav-bar/nav-bar.component.html
View file @
fef8657
...
@@ -6,10 +6,13 @@
...
@@ -6,10 +6,13 @@
<img
class=
"NavLogo"
src=
"assets/images/LogoProv2.png"
style=
"height: auto; width: 250px;"
>
<img
class=
"NavLogo"
src=
"assets/images/LogoProv2.png"
style=
"height: auto; width: 250px;"
>
</a>
</a>
<div
class=
"NavSearchContainer"
>
<div
class=
"NavSearchContainer"
>
<input
class=
"NavInput"
type=
"text"
placeholder=
"Search.."
>
<input
[(
ngModel
)]="
search
"
(
keyup
)="
showinput
()"
(
keydown
)="
hideinput
()"
class=
"NavInput"
type=
"text"
placeholder=
"Search.."
>
<a
routerLink=
"/busqueda"
>
<a
routerLink=
"/busqueda
/{{ search }}
"
>
<i
class=
"fas fa-search fa-2x"
style=
"color:white;"
></i>
<i
class=
"fas fa-search fa-2x"
style=
"color:white;"
></i>
</a>
</a>
<div
*
ngIf=
"suggestion"
class=
"NavSuggestion"
>
<i>
buscar {{ search }}
</i>
</div>
</div>
</div>
<a
href=
"javascript:"
routerLink=
"/"
>
<a
href=
"javascript:"
routerLink=
"/"
>
<i
class=
"fas fa-user-circle fa-3x"
style=
"color:white;"
></i>
<i
class=
"fas fa-user-circle fa-3x"
style=
"color:white;"
></i>
...
...
src/app/nav-bar/nav-bar.component.ts
View file @
fef8657
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Observable
,
interval
}
from
'rxjs'
;
import
{
switchMap
,
take
}
from
'rxjs/operators'
;
@
Component
({
@
Component
({
selector
:
'nav-bar'
,
selector
:
'nav-bar'
,
templateUrl
:
'./nav-bar.component.html'
,
templateUrl
:
'./nav-bar.component.html'
,
styleUrls
:
[
'./nav-bar.component.css'
]
styleUrls
:
[
'./nav-bar.component.css'
]
})
})
export
class
NavBarComponent
implements
OnInit
{
export
class
NavBarComponent
implements
OnInit
{
constructor
()
{
}
search
:
string
=
''
;
suggestion
:
boolean
=
false
;
ngOnInit
():
void
{
constructor
()
{
}
}
ngOnInit
():
void
{
}
showinput
()
{
interval
(
1000
).
pipe
(
take
(
1
)
)
.
subscribe
(
()
=>
this
.
suggestion
=
true
);
}
hideinput
()
{
this
.
suggestion
=
false
;
}
}
}
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment