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
d1864c8b
Commit
d1864c8b
authored
Dec 04, 2018
by
Diego Rey
Browse files
Add language translations for modals
parent
23be3ddf
Changes
15
Hide whitespace changes
Inline
Side-by-side
Frontend Angular 4/src/app/layout/archivos/archivos.component.html
View file @
d1864c8b
...
...
@@ -21,14 +21,14 @@
<div
class=
"card"
>
<div>
<div
class=
"btn-group pull-right"
style=
"cursor: pointer; margin-top: -9px;"
>
<button
ngbPopover=
"Atras"
triggers=
"mouseenter:mouseleave"
data-placement=
"bottom"
class=
"btn btn-sm btn-secondary pull-right"
*ngIf=
"directorioActual.padreId!=-1"
style=
"cursor: pointer; margin-top: -33.5px; margin-right: 73px; height: 30px;"
(click)=
"navBack()"
>
<button
ngbPopover=
'{{ "i18n.action.goBack" | translate | titleCase }}'
triggers=
"mouseenter:mouseleave"
data-placement=
"bottom"
class=
"btn btn-sm btn-secondary pull-right"
*ngIf=
"directorioActual.padreId!=-1"
style=
"cursor: pointer; margin-top: -33.5px; margin-right: 73px; height: 30px;"
(click)=
"navBack()"
>
<i
class=
"fa fa-arrow-up"
></i>
</button>
</div>
<!-- <button class="btn btn-sm btn-secondary pull-right" style="cursor: pointer; margin-top: -35px;" >
<i class="fa fa-plus"></i>
</buton> -->
<div
class=
"btn-group pull-right"
style=
"cursor: pointer;
margin-top: -42px; height: 30px;
width: 29px;"
>
<div
class=
"btn-group pull-right"
style=
"cursor: pointer; margin-top: -42px; height: 30px; width: 29px;"
>
<button
ngbPopover=
'{{ "i18n.action.new" | translate | titleCase }}'
triggers=
"mouseenter:mouseleave"
...
...
@@ -42,13 +42,17 @@
<i
class=
"fa fa-plus"
></i>
</button>
<div
class=
"dropdown-menu"
>
<a
class=
"dropdown-item"
(click)=
"mkFile()"
>
Archivo
</a>
<a
class=
"dropdown-item"
(click)=
"mkFile()"
>
{{ "i18n.object.file" | translate | titleCase }}
</a>
<div
class=
"dropdown-divider"
></div>
<a
class=
"dropdown-item"
(click)=
"mkdir()"
>
Carpeta
</a>
<a
class=
"dropdown-item"
(click)=
"mkdir()"
>
{{ "i18n.object.folder" | translate | titleCase }}
</a>
</div>
</div>
<div
class=
"btn-group pull-right"
style=
"cursor: pointer;
margin-top: -42px; height: 30px;
width: 29px; margin-right: 36px;"
>
<div
class=
"btn-group pull-right"
style=
"cursor: pointer; margin-top: -42px; height: 30px; width: 29px; margin-right: 36px;"
>
<button
ngbPopover=
'{{ "i18n.action.order" | translate | titleCase }}'
triggers=
"mouseenter:mouseleave"
...
...
@@ -62,13 +66,15 @@
<i
class=
"fa fa-sort"
></i>
</button>
<div
class=
"dropdown-menu"
>
<a
class=
"dropdown-item"
(click)=
"ordenarPorTipo()"
>
Carpetas primero
</a>
<a
class=
"dropdown-item"
(click)=
"ordenarPorTipo()"
>
{{ "i18n.msg.order.kind" | translate }}
</a>
<div
class=
"dropdown-divider"
></div>
<a
class=
"dropdown-item"
(click)=
"ordenarPorFecha()"
>
Fecha de creación
</a>
<a
class=
"dropdown-item"
(click)=
"ordenarPorFecha()"
>
{{ "i18n.msg.order.date" | translate }}
</a>
</div>
</div>
</div>
<div
class=
"card-block"
>
<div
class=
"row listado-archivos"
style=
"min-height: 100px; overflow-y: scroll;"
>
...
...
@@ -89,7 +95,7 @@
</ng-template>
</ngb-tab>
<ngb-tab
title=
'{{ "i18n.
msg.file
.shared" | translate }}'
>
<ngb-tab
title=
'{{ "i18n.
action
.shared" | translate
| titleCase
}}'
>
<ng-template
ngbTabContent
>
<div
class=
"card"
*ngIf=
"esAlumno"
>
...
...
@@ -140,14 +146,29 @@
(click)=
"seleccionarDirectorioAMover()"
>
<i
class=
"fa fa-cut"
></i>
</button>
<button
class=
"btn btn-sm btn-secondary pull-left mr-2"
*ngIf=
"esAlumno && archivoSeleccionado && hayArchivoOriginal()"
(click)=
"seleccionarArchivoOriginal()"
>
Ver original
</button>
<button
class=
"btn btn-sm btn-secondary pull-left mr-2"
*ngIf=
"esAlumno && archivoSeleccionado && hayArchivoMio()"
(click)=
"seleccionarArchivoMio()"
>
Ver mio
</button>
<button
class=
"btn btn-sm btn-secondary pull-left mr-4"
*ngIf=
"esAlumno && archivoSeleccionado && !archivoSeleccionado.directorio && archivoSeleccionado.archivoOrigenId != -1 && (archivoSeleccionado.estado == 'Edicion' || archivoSeleccionado.estado == 'Devuelto')"
(click)=
"confirmarEntrega()"
>
Entregar
</button>
<button
class=
"btn btn-sm btn-secondary pull-left mr-2"
*ngIf=
"esAlumno && archivoSeleccionado && hayArchivoOriginal()"
(click)=
"seleccionarArchivoOriginal()"
>
{{ "i18n.msg.file.seeOriginal" | translate }}
</button>
<button
class=
"btn btn-sm btn-secondary pull-left mr-2"
*ngIf=
"esAlumno && archivoSeleccionado && hayArchivoMio()"
(click)=
"seleccionarArchivoMio()"
>
{{ "i18n.msg.file.seeMine" | translate }}
</button>
<button
class=
"btn btn-sm btn-secondary pull-left mr-4"
*ngIf=
"esAlumno && archivoSeleccionado && !archivoSeleccionado.directorio && archivoSeleccionado.archivoOrigenId != -1 && (archivoSeleccionado.estado == 'Edicion' || archivoSeleccionado.estado == 'Devuelto')"
(click)=
"confirmarEntrega()"
>
{{ "i18n.action.send" | translate }}
</button>
<div
class=
"pull-left mr-2"
*ngIf=
"esAlumno && (archivoSeleccionado?.estado == 'Entregado')"
>
{{archivoSeleccionado.estado}} -
</div>
<div
class=
"pull-left mr-2"
*ngIf=
"esAlumno && (archivoSeleccionado?.estado == 'Entregado')"
>
{{archivoSeleccionado.estado}} -
</div>
<button
*ngIf=
"esAlumno && archivoSeleccionado?.estado == 'Corregido'"
...
...
@@ -164,7 +185,7 @@
{{ "i18n.object.name" | translate | titleCase }}:
{{archivoSeleccionado?.nombre}}
-
{{ "i18n.
msg.file
.created" | translate }}:
{{ "i18n.
action
.created" | translate
| titleCase
}}:
{{archivoSeleccionado?.fechaCreacion | date}}
</div>
<div
class=
"pull-left"
*ngIf=
"!archivoSeleccionado"
>
{{ "i18n.msg.file.preview" | translate }}
</div>
...
...
Frontend Angular 4/src/app/layout/archivos/archivos.component.ts
View file @
d1864c8b
...
...
@@ -15,6 +15,7 @@ import { SeleccionarDirectorioMove } from './seleccionarDirectorio.component';
import
{
CodemirrorComponent
}
from
'
ng2-codemirror
'
;
import
{
NgbPopoverConfig
,
NgbPopover
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
TitleCasePipe
}
from
'
../../shared/pipes/titlecase.pipe
'
;
import
'
codemirror/mode/haskell/haskell
'
;
import
'
codemirror/addon/display/panel
'
;
...
...
@@ -29,6 +30,8 @@ import 'codemirror/mode/markdown/markdown';
})
export
class
ArchivosComponent
{
translateService
:
any
;
titlecasePipe
:
any
;
archivos
:
Archivo
[]
=
[];
archivosCompartidos
:
Archivo
[]
=
[];
archivosCompartidosSinDuplicados
:
Archivo
[]
=
[];
...
...
@@ -53,6 +56,9 @@ export class ArchivosComponent {
private
dialogService
:
DialogService
,
public
translate
:
TranslateService
){
this
.
translateService
=
translate
;
this
.
titlecasePipe
=
new
TitleCasePipe
();
this
.
esAlumno
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"
currentUser
"
)).
tipo
===
"
alumno
"
;
this
.
directorioActual
=
{};
this
.
directorioActual
.
archivos
=
[];
...
...
@@ -184,23 +190,21 @@ export class ArchivosComponent {
if
(
this
.
archivos
.
some
(
arch
=>
arch
.
id
==
this
.
archivoSeleccionado
.
id
)){
var
that
=
this
;
let
disposable
=
this
.
dialogService
.
addDialog
(
ConfirmarEliminar
,
{
nombreArchivo
:
that
.
archivoSeleccionado
.
nombre
,
esDirectorio
:
that
.
archivoSeleccionado
.
directorio
,
parentContext
:
that
})
nombreArchivo
:
{
fileName
:
that
.
archivoSeleccionado
.
nombre
}
,
esDirectorio
:
that
.
archivoSeleccionado
.
directorio
,
parentContext
:
that
})
.
subscribe
((
isConfirmed
)
=>
{
if
(
isConfirmed
)
{
//codeMirrorRef.options.readOnly = false;
//componentRef.editDialogFired = true;
}
});
console
.
log
(
disposable
);
}
else
{
this
.
notifService
.
warning
(
"
Sin permisos para eliminar el archivo
"
);
this
.
notifService
.
warning
(
this
.
translateService
.
get
(
'
i18n.warning.file.noPermissionRemove
'
).
value
);
}
}
else
{
this
.
notifService
.
warning
(
"
Archivo no seleccionado
"
);
this
.
notifService
.
warning
(
this
.
translateService
.
get
(
'
i18n.warning.file.noSelected
'
).
value
);
}
}
seleccionarDirectorioAMover
(){
...
...
@@ -223,10 +227,10 @@ export class ArchivosComponent {
}
});
}
else
{
this
.
notifService
.
warning
(
"
Sin permisos para mover el archivo
"
);
this
.
notifService
.
warning
(
this
.
translateService
.
get
(
'
i18n.warning.file.noPermissionMove
'
).
value
);
}
}
else
{
this
.
notifService
.
warning
(
"
Archivo no seleccionado
"
);
this
.
notifService
.
warning
(
this
.
translateService
.
get
(
'
i18n.warning.file.noSelected
'
).
value
);
}
}
...
...
@@ -261,7 +265,7 @@ export class ArchivosComponent {
this
.
haskellService
.
editarArchivo
(
this
.
archivoSeleccionado
.
id
,
this
.
archivoSeleccionado
)
.
subscribe
(
archivo
=>
{
console
.
log
(
"
Archivo modificado
"
);
console
.
log
(
this
.
translateService
.
get
(
'
i18n.msg.file.modified
'
).
value
);
},
error
=>
{
...
...
@@ -273,7 +277,7 @@ export class ArchivosComponent {
cargarArchivo
(){
if
(
this
.
archivoSeleccionado
){
if
(
this
.
archivoSeleccionado
.
directorio
){
this
.
notifService
.
warning
(
'
No se seleccionó ningún archivo
'
,
false
);
this
.
notifService
.
warning
(
this
.
translateService
.
get
(
'
i18n.warning.file.noSelected
'
).
value
,
false
);
}
else
{
//Si el archivo es compartido con el grupo, editabe y no lo he editado, lo voy a buscar al servidor.
if
(
this
.
archivosCompartidos
.
some
(
arch
=>
arch
.
id
==
this
.
archivoSeleccionado
.
id
)
&&
this
.
archivoSeleccionado
.
editable
&&
this
.
archivoSeleccionado
.
archivoOrigenId
==
-
1
){
...
...
@@ -298,16 +302,23 @@ export class ArchivosComponent {
}
}
}
else
{
this
.
notifService
.
warning
(
"
Archivo no seleccionado
"
);
this
.
notifService
.
warning
(
this
.
translateService
.
get
(
'
i18n.warning.file.noSelected
'
).
value
);
}
}
confirmarEntrega
(){
var
title
=
this
.
titlecasePipe
.
transform
(
this
.
translateService
.
get
(
'
i18n.action.send
'
).
value
)
+
"
"
+
this
.
titlecasePipe
.
transform
(
this
.
translateService
.
get
(
'
i18n.object.file
'
).
value
);
var
msg
=
''
;
this
.
translateService
.
get
(
'
i18n.msg.file.toSend
'
,
{
fileName
:
this
.
archivoSeleccionado
.
nombre
}).
subscribe
((
res
:
string
)
=>
{
msg
=
res
+
'
\n
'
+
this
.
translateService
.
get
(
'
i18n.msg.file.toSendInfo
'
).
value
;
});
let
disposable
=
this
.
dialogService
.
addDialog
(
ConfirmComponent
,
{
title
:
'
Entregar archivo
'
,
message
:
'
¿Desea entregar el archivo "
'
+
this
.
archivoSeleccionado
.
nombre
+
'
"?
\n
No se podrá editar luego de la entrega.
'
,
confirmText
:
'
Entregar
'
,
cancelText
:
'
C
ancel
ar
'
title
:
title
,
message
:
msg
,
confirmText
:
this
.
titlecasePipe
.
transform
(
this
.
translateService
.
get
(
'
i18n.action.send
'
))
,
cancelText
:
this
.
titlecasePipe
.
transform
(
this
.
translateService
.
get
(
'
i18n.action.c
ancel
'
)),
})
.
subscribe
((
isConfirmed
)
=>
{
if
(
isConfirmed
)
{
...
...
@@ -317,7 +328,7 @@ export class ArchivosComponent {
}
entregarArchivo
(){
this
.
archivoSeleccionado
.
estado
=
'
Entregado
'
;
this
.
archivoSeleccionado
.
estado
=
this
.
titlecasePipe
.
transform
(
this
.
translateService
.
get
(
'
i18n.action.sent
'
))
;
this
.
haskellService
.
editarArchivo
(
this
.
archivoSeleccionado
.
id
,
this
.
archivoSeleccionado
)
.
subscribe
(
archivo
=>
{
...
...
@@ -472,6 +483,7 @@ export class ArchivosComponent {
this
.
dialogService
.
addDialog
(
CompartirArchivoComponent
,
{
grupos
:
gruposRest
,
archivo
:
this
.
archivoSeleccionado
,
nombreArchivo
:
{
'
fileName
'
:
this
.
archivoSeleccionado
.
nombre
},
parent
:
this
})
.
subscribe
((
isConfirmed
)
=>
{
...
...
@@ -489,6 +501,7 @@ export class ArchivosComponent {
this
.
dialogService
.
addDialog
(
CompartirArchivoComponent
,
{
grupos
:
grupos
,
archivo
:
this
.
archivoSeleccionado
,
nombreArchivo
:
{
'
fileName
'
:
this
.
archivoSeleccionado
.
nombre
},
parent
:
this
})
.
subscribe
((
isConfirmed
)
=>
{
...
...
@@ -498,7 +511,7 @@ export class ArchivosComponent {
});
}
}
else
{
this
.
notifService
.
warning
(
"
Archivo no seleccionado
"
);
this
.
notifService
.
warning
(
this
.
translateService
.
get
(
'
i18n.warning.file.noSelected
'
).
value
);
}
}
...
...
@@ -530,8 +543,4 @@ export class ArchivosComponent {
}
});
}
}
Frontend Angular 4/src/app/layout/archivos/compartirArchivo.component.ts
View file @
d1864c8b
...
...
@@ -2,18 +2,22 @@ import { Component } from '@angular/core';
import
{
DialogComponent
,
DialogService
}
from
"
ng2-bootstrap-modal
"
;
import
{
Archivo
}
from
'
../../shared/objects/archivo
'
;
import
{
Grupo
}
from
'
../../shared/objects/grupo
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
export
interface
ConfirmModel
{
archivo
:
Archivo
;
grupos
:
any
;
parent
:
any
;
nombreArchivo
:
{
'
fileName
'
:
string
};
}
@
Component
({
selector
:
'
confirm
'
,
template
:
`<div class="modal-dialog" style="margin-top:100px;">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title pull-lefth">Compartir "{{archivo.nombre}}" con:</h6>
<h6 class="modal-title pull-lefth">
{{ "i18n.msg.file.share" | translate:nombreArchivo }}
</h6>
<button type="button" class="close" (click)="close()" style="margin-rigth:8px;">×</button>
</div>
<div class="modal-body" style="height:350px;overflow-y: scroll;">
...
...
@@ -27,7 +31,9 @@ export interface ConfirmModel {
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" (click)="compartir()">Compartir</button>
<button type="button" class="btn btn-primary" (click)="compartir()">
{{ "i18n.action.share" | translate | titleCase }}
</button>
</div>
</div>
</div>`
...
...
@@ -37,9 +43,12 @@ export class CompartirArchivoComponent extends DialogComponent<ConfirmModel, boo
grupos
:
any
;
grupo
:
Grupo
;
parent
:
any
;
nombreArchivo
:
{
'
fileName
'
:
string
};
translateService
:
any
;
constructor
(
dialogService
:
DialogService
)
{
constructor
(
dialogService
:
DialogService
,
public
translate
:
TranslateService
)
{
super
(
dialogService
);
this
.
translateService
=
translate
;
}
seleccionarGrupo
(
grupo
){
...
...
@@ -47,18 +56,19 @@ export class CompartirArchivoComponent extends DialogComponent<ConfirmModel, boo
}
compartir
(){
this
.
nombreArchivo
=
{
'
fileName
'
:
this
.
archivo
.
nombre
};
if
(
this
.
grupo
){
this
.
parent
.
haskellService
.
compartirArchivoGrupo
(
this
.
grupo
,
this
.
archivo
.
id
)
.
subscribe
(
success
=>
{
this
.
parent
.
notifService
.
success
(
"
Archivo compartido
"
);
this
.
parent
.
notifService
.
success
(
this
.
translateService
.
get
(
'
i18n.msg.file.shared
'
).
value
);
this
.
close
();
},
error
=>
{
this
.
parent
.
notifService
.
error
(
error
);
});
}
else
{
this
.
parent
.
notifService
.
error
(
"
Seleccione un
grup
o
"
);
this
.
parent
.
notifService
.
error
(
this
.
translateService
.
get
(
'
i18n.warning.
gr
o
up
.select
'
).
value
);
}
}
}
\ No newline at end of file
Frontend Angular 4/src/app/layout/archivos/confirmarEliminar.component.ts
View file @
d1864c8b
import
{
Component
}
from
'
@angular/core
'
;
import
{
DialogComponent
,
DialogService
}
from
"
ng2-bootstrap-modal
"
;
import
{
Archivo
}
from
'
../../shared/objects/archivo
'
;
export
interface
ConfirmModel
{
nombreArchivo
:
string
;
nombreArchivo
:
{
fileName
:
string
}
;
esDirectorio
:
boolean
;
parentContext
:
any
;
}
@
Component
({
selector
:
'
confirm
'
,
template
:
`<div class="modal-dialog" style="margin-top:100px;">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" *ngIf="!esDirectorio">Eliminar archivo</h6>
<h6 class="modal-title" *ngIf="esDirectorio">Eliminar carpeta</h6>
<h6 class="modal-title" *ngIf="!esDirectorio">
{{ "i18n.action.delete" | translate | titleCase }}
{{ "i18n.object.file" | translate | titleCase }}
</h6>
<h6 class="modal-title" *ngIf="esDirectorio">
{{ "i18n.action.delete" | translate | titleCase }}
{{ "i18n.object.folder" | translate | titleCase }}
</h6>
<button type="button" class="close" (click)="close()" style="margin-left:8px;">×</button>
</div>
<div class="modal-body">
<p *ngIf="!esDirectorio">¿Está seguro que desea eliminar el archivo {{nombreArchivo}}?</p>
<p *ngIf="esDirectorio">¿Está seguro que desea eliminar la carpeta {{nombreArchivo}}?</p>
<p *ngIf="!esDirectorio">
{{ "i18n.msg.file.delete" | translate:nombreArchivo }}
</p>
<p *ngIf="esDirectorio">
{{ "i18n.msg.file.delete" | translate:nombreArchivo }}
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" (click)="close()">Cancelar</button>
<button type="button" class="btn btn-success" (click)="confirmarEliminar()">Eliminar</button>
<button type="button" class="btn btn-default" (click)="close()">
{{ "i18n.action.cancel" | translate | titleCase }}
</button>
<button type="button" class="btn btn-success" (click)="confirmarEliminar()">
{{ "i18n.action.delete" | translate | titleCase }}
</button>
</div>
</div>
</div>`
})
export
class
ConfirmarEliminar
extends
DialogComponent
<
ConfirmModel
,
boolean
>
implements
ConfirmModel
{
nombreArchivo
:
string
;
nombreArchivo
:
{
fileName
:
string
}
;
esDirectorio
:
boolean
;
parentContext
:
any
;
constructor
(
dialogService
:
DialogService
)
{
super
(
dialogService
);
}
...
...
@@ -44,7 +59,6 @@ export class ConfirmarEliminar extends DialogComponent<ConfirmModel, boolean> im
this
.
parentContext
.
haskellService
.
eliminarArchivo
(
this
.
parentContext
.
archivoSeleccionado
.
id
)
.
subscribe
(
archivo
=>
{
console
.
log
(
"
Archivo eliminado
"
);
if
(
directorio
){
var
idDirActual
=
that
.
directorioActual
.
padreId
;
}
else
{
...
...
Frontend Angular 4/src/app/layout/archivos/nuevoArchivo.component.ts
View file @
d1864c8b
import
{
Component
}
from
'
@angular/core
'
;
import
{
DialogComponent
,
DialogService
}
from
"
ng2-bootstrap-modal
"
;
import
{
Archivo
}
from
'
../../shared/objects/archivo
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
export
interface
ConfirmModel
{
nombre
:
string
;
descripcion
:
string
;
parentContext
:
any
;
esDirectorio
:
boolean
;
}
@
Component
({
selector
:
'
confirm
'
,
...
...
@@ -14,26 +15,38 @@ export interface ConfirmModel {
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" *ngIf="esDirectorio">Nueva carpeta</h6>
<h6 class="modal-title" *ngIf="!esDirectorio">Nuevo archivo</h6>
<h6 class="modal-title" *ngIf="esDirectorio">
{{ "i18n.action.new" | translate | titleCase }}
{{ "i18n.object.folder" | translate | titleCase }}
</h6>
<h6 class="modal-title" *ngIf="!esDirectorio">
{{ "i18n.action.new" | translate | titleCase }}
{{ "i18n.object.file" | translate | titleCase }}
</h6>
<button type="button" class="close" (click)="close()" style="margin-left:8px;">×</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="recipient-name" class="form-control-label">Nombre:</label>
<label for="recipient-name" class="form-control-label">
{{ "i18n.object.name" | translate | titleCase }}:
</label>
<input type="text" class="form-control" id="recipient-name" [(ngModel)]="nombre" [ngModelOptions]="{standalone: true}" >
</div>
<div class="form-group" *ngIf="esDirectorio">
<label for="message-text" class="form-control-label">Descripción:</label>
<label for="message-text" class="form-control-label">
{{ "i18n.object.descr" | translate | titleCase }}:
</label>
<textarea class="form-control" id="message-text" [(ngModel)]="descripcion" [ngModelOptions]="{standalone: true}" ></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" (click)="confirm()">Crear</button>
<button type="button" class="btn btn-success" (click)="confirm()">
{{ "i18n.action.create" | translate | titleCase }}
</button>
</div>
</div>
...
...
@@ -44,8 +57,11 @@ export class NuevoArchivo extends DialogComponent<ConfirmModel, boolean> impleme
esDirectorio
:
boolean
;
descripcion
:
string
;
parentContext
:
any
;
constructor
(
dialogService
:
DialogService
)
{
translateService
:
any
;
constructor
(
dialogService
:
DialogService
,
public
translate
:
TranslateService
)
{
super
(
dialogService
);
this
.
translateService
=
translate
;
}
confirm
()
{
var
nombre
=
this
.
nombre
;
...
...
@@ -67,18 +83,16 @@ export class NuevoArchivo extends DialogComponent<ConfirmModel, boolean> impleme
var
regex
=
/^
[
A-Z
]
/
if
(
regex
.
test
(
nombre
)){
this
.
parentContext
.
haskellService
.
crearArchivo
(
archivo
).
subscribe
(
archivo
=>
{
var
id
=
that
.
directorioActual
.
id
;
that
.
recargarArchivos
(
id
);
},
error
=>
{
this
.
parentContext
.
notifService
.
error
(
error
);
});
archivo
=>
{
var
id
=
that
.
directorioActual
.
id
;
that
.
recargarArchivos
(
id
);
},
error
=>
{
this
.
parentContext
.
notifService
.
error
(
error
);
});
this
.
close
();
}
else
{
alert
(
"
Nombre de archivo debe iniciar con mayusula.
"
)
alert
(
this
.
translateService
.
get
(
'
i18n.warning.file.capitalLetter
'
).
value
);
}
}
...
...
Frontend Angular 4/src/app/layout/archivos/seleccionarDirectorio.component.ts
View file @
d1864c8b
...
...
@@ -14,7 +14,9 @@ export interface ConfirmModel {
template
:
`<div class="modal-dialog" style="margin-top:100px;">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title pull-lefth">¿Dónde quieres mover el archivo?</h6>
<h6 class="modal-title pull-lefth">
{{ "i18n.msg.file.move" | translate }}
</h6>
<button type="button" class="close" (click)="close()" style="margin-rigth:8px;">×</button>
</div>
<div class="modal-body" style="height:350px;overflow-y: scroll;">
...
...
@@ -29,8 +31,13 @@ export interface ConfirmModel {
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" (click)="navBack()">Atras</button>
<button type="button" class="btn btn-primary" (click)="move()">Mover aquí</button>
<button type="button" class="btn btn-default" (click)="navBack()">
{{ "i18n.action.goBack" | translate | titleCase }}
</button>
<button type="button" class="btn btn-primary" (click)="move()">
{{ "i18n.action.move" | translate | titleCase }}
{{ "i18n.object.here" | translate }}
</button>
</div>
</div>
</div>`
...
...
Frontend Angular 4/src/app/layout/archivos/verCalificacion.component.ts
View file @
d1864c8b
...
...
@@ -10,18 +10,22 @@ export interface ConfirmModel {
template
:
`<div class="modal-dialog" style="margin-top:100px;">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title pull-lefth">Calificación "{{archivo.nombre}}":</h6>
<h6 class="modal-title pull-lefth">
{{ "i18n.object.qualification" | translate | titleCase }} "{{archivo.nombre}}":
</h6>
<button type="button" class="close" (click)="close()" style="margin-rigth:8px;">×</button>
</div>
<div class="modal-body">
<div>
<label><b>
Fecha
: </b></label> {{archivo.evaluacion.fecha | date}}<br>
<label><b>
Nota
(1-100): </b></label> {{archivo.evaluacion.nota}}<br>
<label><b>
Detalle
: </b></label> {{archivo.evaluacion.descripcion}}
<label><b>
{{ "i18n.object.date" | translate | titleCase }}
: </b></label> {{archivo.evaluacion.fecha | date}}<br>
<label><b>
{{ "i18n.objet.score" | translate | titleCase }}
(1-100): </b></label> {{archivo.evaluacion.nota}}<br>
<label><b>
{{ "i18n.object.detail" | translate | titleCase }}
: </b></label> {{archivo.evaluacion.descripcion}}
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" (click)="close()">Cerrar</button>
<button type="button" class="btn btn-primary" (click)="close()">
{{ "i18n.action.close" | translate | titleCase }}
</button>
</div>
</div>
</div>`
...
...
Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts
View file @
d1864c8b
import
{
Component
}
from
'
@angular/core
'
;
import
{
DialogComponent
,
DialogService
}
from
"
ng2-bootstrap-modal
"
;
import
{
Archivo
,
Evaluacion
}
from
'
../../shared/objects/archivo
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
export
interface
ConfirmModel
{
cedula
:
string
;
...
...
@@ -13,26 +14,26 @@ export interface ConfirmModel {
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
Calificar entrega
</h5>
<h5 class="modal-title">
{{ "i18n.msg.file.qualify" | translate }}
</h5>
<button type="button" class="close" (click)="close()" style="margin-left:8px;">×</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="message-text" class="form-control-label">
Calificacion
(1-100):</label>
<label for="message-text" class="form-control-label">
{{ "i18n.objet.score" | translate | titleCase }}
(1-100):</label>