Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matefun
Frontend
Commits
a1bbaef4
Commit
a1bbaef4
authored
Nov 25, 2018
by
Diego Rey
Browse files
Add translations language for layout component
parent
3bbc2af3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Frontend Angular 4/src/app/layout/layout.component.ts
View file @
a1bbaef4
...
...
@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
import
{
Router
}
from
'
@angular/router
'
;
import
{
GHCIService
}
from
'
../shared/services/ghci.service
'
;
import
{
NotificacionService
}
from
'
../shared/services/notificacion.service
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
@
Component
({
selector
:
'
app-layout
'
,
templateUrl
:
'
./layout.component.html
'
,
...
...
@@ -9,7 +11,7 @@ import { NotificacionService } from '../shared/services/notificacion.service';
providers
:
[
GHCIService
]
})
export
class
LayoutComponent
implements
OnInit
{
constructor
(
public
router
:
Router
)
{
}
constructor
(
public
router
:
Router
,
public
translate
:
TranslateService
)
{
}
ngOnInit
()
{
if
(
this
.
router
.
url
===
'
/
'
)
{
this
.
router
.
navigate
([
'
/login
'
]);
...
...
Frontend Angular 4/src/app/layout/layout.module.ts
View file @
a1bbaef4
...
...
@@ -9,7 +9,9 @@ import { HeaderComponent, SidebarComponent } from '../shared';
import
{
AuthenticationService
}
from
'
../shared/services/authentication.service
'
;
import
{
HaskellService
}
from
'
../shared/services/haskell.service
'
;
import
{
CodemirrorModule
}
from
'
ng2-codemirror
'
;
import
{
NotificacionModule
}
from
'
../notificacion/notificacion.module
'
;
import
{
NotificacionModule
}
from
'
../notificacion/notificacion.module
'
;
import
{
I18nModule
}
from
'
../shared/modules/translate/i18n.module
'
;
import
{
TitleCaseModule
}
from
'
../shared/modules/titlecase.module
'
;
@
NgModule
({
imports
:
[
...
...
@@ -18,12 +20,14 @@ import { NotificacionModule } from '../notificacion/notificacion.module';
NgbModule
.
forRoot
(),
LayoutRoutingModule
,
CodemirrorModule
,
NotificacionModule
NotificacionModule
,
I18nModule
,
TitleCaseModule
],
declarations
:
[
LayoutComponent
,
HeaderComponent
,
SidebarComponent
SidebarComponent
],
providers
:
[
AuthenticationService
,
HaskellService
]
})
...
...
Frontend Angular 4/src/app/shared/components/header/header.component.html
View file @
a1bbaef4
...
...
@@ -11,7 +11,9 @@
<i
class=
"fa fa-user"
></i>
{{usuario.nombre+' '+usuario.apellido}}
<b
class=
"caret"
></b>
</a>
<div
class=
"dropdown-menu dropdown-menu-right"
>
<a
class=
"dropdown-item"
style=
"cursor: pointer;"
(click)=
logout()
><i
class=
"fa fa-fw fa-power-off"
></i>
Salir
</a>
<a
class=
"dropdown-item"
style=
"cursor: pointer;"
(click)=
logout()
><i
class=
"fa fa-fw fa-power-off"
></i>
{{ "i18n.action.exit" | translate | titleCase }}
</a>
</div>
</div>
</ul>
...
...
Frontend Angular 4/src/app/shared/components/sidebar/sidebar.component.html
View file @
a1bbaef4
<nav
class=
"sidebar"
#sidebarNav
[ngClass]=
"{sidebarPushRight: isActive}"
style=
"background: #036b9a !important;"
>
<ul
class=
"list-group"
>
<a
[routerLink]=
"['/matefun']"
(click)=
toggleSidebar()
[routerLinkActive]=
"['router-link-active']"
class=
"list-group-item"
style=
"color: white;"
>
<i
class=
"fa fa-fw fa-desktop"
></i>
Programa
<i
class=
"fa fa-fw fa-desktop"
></i>
{{ "i18n.object.program" | translate | titleCase }}
</a>
<a
[routerLink]=
"['/archivos']"
(click)=
toggleSidebar()
[routerLinkActive]=
"['router-link-active']"
class=
"list-group-item"
style=
"color: white;"
>
<i
class=
"fa fa-fw fa-file-o"
></i>
Archivos
<i
class=
"fa fa-fw fa-file-o"
></i>
{{ "i18n.object.files" | translate | titleCase }}
</a>
<a
*ngIf=
"esDocente()"
[routerLink]=
"['/grupos']"
(click)=
toggleSidebar()
[routerLinkActive]=
"['router-link-active']"
class=
"list-group-item"
style=
"color: white;"
>
<i
class=
"fa fa-fw fa-users"
></i>
Grupos
<i
class=
"fa fa-fw fa-users"
></i>
{{ "i18n.object.groups" | translate | titleCase }}
</a>
</ul>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment