edit
diff --git a/front/src/app/component/top-menu/top-menu.component.ts b/front/src/app/component/top-menu/top-menu.component.ts
index e973738..be10159 100644
--- a/front/src/app/component/top-menu/top-menu.component.ts
+++ b/front/src/app/component/top-menu/top-menu.component.ts
@@ -35,7 +35,7 @@ export class TopMenuComponent implements OnInit {
public ariane_saison_id: number = null;
public ariane_saison_name: string = null;
- public editable:boolean = false;
+ public edit: string = "";
constructor(private router: Router,
private sessionService: SessionService,
@@ -43,13 +43,6 @@ export class TopMenuComponent implements OnInit {
}
- updateEditable() {
- if (this.arianeService.getVideoId() != null) {
- this.editable = true;
- } else {
- this.editable = false;
- }
- }
ngOnInit() {
this.sessionService.change.subscribe(isConnected => {
console.log("receive event from session ..." + isConnected);
@@ -94,11 +87,54 @@ export class TopMenuComponent implements OnInit {
this.displayUserMenu = !this.displayUserMenu;
}
+ updateEditable() {
+ if (this.arianeService.getVideoId() != null) {
+ this.edit = "video";
+ return;
+ }
+ if (this.arianeService.getSaisonId() != null) {
+ this.edit = "saison";
+ return;
+ }
+ if (this.arianeService.getGroupId() != null) {
+ this.edit = "group";
+ return;
+ }
+ /*
+ if (this.arianeService.getUniversId() != null) {
+ this.edit = "univers";
+ return;
+ }
+ if (this.arianeService.getTypeId() != null) {
+ this.edit = "type";
+ return;
+ }
+ */
+ this.edit = null;
+ }
onEdit(): void {
console.log("onEdit()");
if (this.arianeService.getVideoId() != null) {
this.router.navigate(['video-edit/' + this.arianeService.getVideoId()]);
+ return;
}
+ if (this.arianeService.getSaisonId() != null) {
+ this.router.navigate(['saison-edit/' + this.arianeService.getSaisonId()]);
+ return;
+ }
+ if (this.arianeService.getGroupId() != null) {
+ this.router.navigate(['group-edit/' + this.arianeService.getGroupId()]);
+ return;
+ }
+ if (this.arianeService.getUniversId() != null) {
+ this.router.navigate(['univers-edit/' + this.arianeService.getUniversId()]);
+ return;
+ }
+ if (this.arianeService.getTypeId() != null) {
+ this.router.navigate(['type-edit/' + this.arianeService.getTypeId()]);
+ return;
+ }
+ this.edit = null;
}
onHome(): void {
@@ -146,33 +182,35 @@ export class TopMenuComponent implements OnInit {
onArianeType(): void {
console.log("onArianeType(" + this.ariane_type_id + ")");
this.router.navigate(['type/' + this.ariane_type_id ]);
- this.ariane_univers_id = null;
- this.ariane_univers_name = null;
- this.ariane_group_id = null;
- this.ariane_group_name = null;
- this.ariane_saison_id = null;
- this.ariane_saison_name = null;
+ this.arianeService.setVideo(null);
+ this.arianeService.setSaison(null);
+ this.arianeService.setGroup(null);
+ this.arianeService.setUnivers(null);
+ this.updateEditable();
}
onArianeUnivers(): void {
console.log("onArianeUnivers(" + this.ariane_univers_id + ")");
this.router.navigate(['univers/' + this.ariane_univers_id ]);
- this.ariane_group_id = null;
- this.ariane_group_name = null;
- this.ariane_saison_id = null;
- this.ariane_saison_name = null;
+ this.arianeService.setVideo(null);
+ this.arianeService.setSaison(null);
+ this.arianeService.setGroup(null);
+ this.updateEditable();
}
onArianeGroup(): void {
console.log("onArianeGroup(" + this.ariane_group_id + ")");
this.router.navigate(['group/' + this.ariane_group_id ]);
- this.ariane_saison_id = null;
- this.ariane_saison_name = null;
+ this.arianeService.setVideo(null);
+ this.arianeService.setSaison(null);
+ this.updateEditable();
}
onArianeSaison(): void {
console.log("onArianeSaison(" + this.ariane_saison_id + ")");
this.router.navigate(['saison/' + this.ariane_saison_id ]);
+ this.arianeService.setVideo(null);
+ this.updateEditable();
}
}
diff --git a/front/src/app/scene/group-edit/group-edit.html b/front/src/app/scene/group-edit/group-edit.html
new file mode 100644
index 0000000..afac2a2
--- /dev/null
+++ b/front/src/app/scene/group-edit/group-edit.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+ Description:
+
+
+
+
+
+
+
+
+
+
+
+ Covers:
+
+
+ {{upload_file_value}}
+
+
+
+
\ No newline at end of file
diff --git a/front/src/app/scene/group-edit/group-edit.less b/front/src/app/scene/group-edit/group-edit.less
new file mode 100644
index 0000000..d6c2f02
--- /dev/null
+++ b/front/src/app/scene/group-edit/group-edit.less
@@ -0,0 +1,103 @@
+.fill-all{
+ //width:100%;
+ max-width:80%;
+ height:100%;
+ margin: 20px auto;
+ padding: 20px;
+ border:0;
+ background-color: rgba(200, 200, 200, 0.5);
+ box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.6);
+}
+
+.request_raw {
+ width: 90%;
+ margin: 0 auto;
+ height: 45px;
+ .label {
+ width: 20%;
+ margin-right: 10px;
+ text-align: right;
+ float: left;
+ display: block;
+ }
+ .input {
+ width: 75%;
+ float: left;
+ display: block;
+ input {
+ width: 100%;
+ font-size: 20px;
+ }
+ select {
+ width: 100%;
+ font-size: 20px;
+ }
+ }
+ .cover_div {
+ //float: left;
+ display: block;
+ }
+ .cover {
+ max-width: 30%;
+ }
+}
+.send_value {
+ width: 300px;
+ margin: 0 auto;
+ padding: 10px;
+ display: block;
+}
+
+.item {
+ font-size: 20px;
+ height: 21%;
+ width: 23%;
+ margin: 1%;
+ padding: 0;
+ overflow: hidden;
+ //box-shadow: 0 1px 1.5px 0 rgba(0,0,0,.12),0 1px 1px 0 rgba(0,0,0,.24);
+ box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.6);
+ line-height: normal;
+ border: none;
+ font-family: "Roboto","Helvetica","Arial",sans-serif;
+ font-weight: 500;
+ text-transform: uppercase;
+ letter-spacing: 0;
+ will-change: box-shadow;
+ outline: none;
+ cursor: pointer;
+ text-decoration: none;
+ text-align: center;
+ vertical-align: middle;
+ transition-duration: 0.4s;
+ float:left;
+ display:block;
+
+ h1 {
+ font-size: 24px;
+ }
+
+ &:hover {
+ background-color: #F00;
+ }
+
+ .material-icons {
+ vertical-align: middle;
+ }
+
+ .material-icons {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: ~"translate(-12px,-12px)";
+ line-height: 24px;
+ width: 24px;
+ }
+}
+
+.item-video {
+ &:hover {
+ background-color: #0F0;
+ }
+}
+
diff --git a/front/src/app/scene/group-edit/group-edit.ts b/front/src/app/scene/group-edit/group-edit.ts
new file mode 100644
index 0000000..bcd258f
--- /dev/null
+++ b/front/src/app/scene/group-edit/group-edit.ts
@@ -0,0 +1,142 @@
+/** @file
+ * @author Edouard DUPIN
+ * @copyright 2018, Edouard DUPIN, all right reserved
+ * @license PROPRIETARY (see license file)
+ */
+
+import { Component, OnInit } from '@angular/core';
+import { Router, ActivatedRoute, ParamMap } from '@angular/router';
+import { Location } from '@angular/common';
+import { NgForm } from '@angular/forms';
+import { FormGroup, FormControl } from "@angular/forms";
+import { fadeInAnimation } from '../../_animations/index';
+
+import { GroupService } from '../../service/group.service';
+import { DataService } from '../../service/data.service';
+
+export class ElementList {
+ value: number;
+ label: string;
+ constructor(_value: number, _label: string) {
+ this.value = _value;
+ this.label = _label;
+ }
+}
+
+@Component({
+ selector: 'app-group-edit',
+ templateUrl: './group-edit.html',
+ styleUrls: ['./group-edit.less'],
+ animations: [fadeInAnimation],
+ host: { '[@fadeInAnimation]': '' }
+})
+// https://www.sitepoint.com/angular-forms/
+export class GroupEditComponent implements OnInit {
+ id_group:number = -1;
+
+ error:string = ""
+
+ name:string = ""
+ description:string = ""
+ coverFile:File;
+ upload_file_value:string = ""
+ selectedFiles:FileList;
+
+ covers_display:Array
= [];
+
+ constructor(private route: ActivatedRoute,
+ private router: Router,
+ private locate: Location,
+ private dataService: DataService,
+ private groupService: GroupService) {
+
+ }
+
+ ngOnInit() {
+ this.id_group = parseInt(this.route.snapshot.paramMap.get('group_id'));
+ let self = this;
+ this.groupService.get(this.id_group)
+ .then(function(response) {
+ console.log("get response of video : " + JSON.stringify(response, null, 2));
+ self.name = response.name;
+ self.description = response.description;
+ if (response.covers !== undefined && response.covers !== null) {
+ for (let iii=0; iii
+
+
+
+
+ Description:
+
+
+
+
+
+
+
+
+
+
+
+ Covers:
+
+
+ {{upload_file_value}}
+
+
+
+
\ No newline at end of file
diff --git a/front/src/app/scene/saison-edit/saison-edit.less b/front/src/app/scene/saison-edit/saison-edit.less
new file mode 100644
index 0000000..d6c2f02
--- /dev/null
+++ b/front/src/app/scene/saison-edit/saison-edit.less
@@ -0,0 +1,103 @@
+.fill-all{
+ //width:100%;
+ max-width:80%;
+ height:100%;
+ margin: 20px auto;
+ padding: 20px;
+ border:0;
+ background-color: rgba(200, 200, 200, 0.5);
+ box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.6);
+}
+
+.request_raw {
+ width: 90%;
+ margin: 0 auto;
+ height: 45px;
+ .label {
+ width: 20%;
+ margin-right: 10px;
+ text-align: right;
+ float: left;
+ display: block;
+ }
+ .input {
+ width: 75%;
+ float: left;
+ display: block;
+ input {
+ width: 100%;
+ font-size: 20px;
+ }
+ select {
+ width: 100%;
+ font-size: 20px;
+ }
+ }
+ .cover_div {
+ //float: left;
+ display: block;
+ }
+ .cover {
+ max-width: 30%;
+ }
+}
+.send_value {
+ width: 300px;
+ margin: 0 auto;
+ padding: 10px;
+ display: block;
+}
+
+.item {
+ font-size: 20px;
+ height: 21%;
+ width: 23%;
+ margin: 1%;
+ padding: 0;
+ overflow: hidden;
+ //box-shadow: 0 1px 1.5px 0 rgba(0,0,0,.12),0 1px 1px 0 rgba(0,0,0,.24);
+ box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.6);
+ line-height: normal;
+ border: none;
+ font-family: "Roboto","Helvetica","Arial",sans-serif;
+ font-weight: 500;
+ text-transform: uppercase;
+ letter-spacing: 0;
+ will-change: box-shadow;
+ outline: none;
+ cursor: pointer;
+ text-decoration: none;
+ text-align: center;
+ vertical-align: middle;
+ transition-duration: 0.4s;
+ float:left;
+ display:block;
+
+ h1 {
+ font-size: 24px;
+ }
+
+ &:hover {
+ background-color: #F00;
+ }
+
+ .material-icons {
+ vertical-align: middle;
+ }
+
+ .material-icons {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: ~"translate(-12px,-12px)";
+ line-height: 24px;
+ width: 24px;
+ }
+}
+
+.item-video {
+ &:hover {
+ background-color: #0F0;
+ }
+}
+
diff --git a/front/src/app/scene/saison-edit/saison-edit.ts b/front/src/app/scene/saison-edit/saison-edit.ts
new file mode 100644
index 0000000..7e0b69b
--- /dev/null
+++ b/front/src/app/scene/saison-edit/saison-edit.ts
@@ -0,0 +1,142 @@
+/** @file
+ * @author Edouard DUPIN
+ * @copyright 2018, Edouard DUPIN, all right reserved
+ * @license PROPRIETARY (see license file)
+ */
+
+import { Component, OnInit } from '@angular/core';
+import { Router, ActivatedRoute, ParamMap } from '@angular/router';
+import { Location } from '@angular/common';
+import { NgForm } from '@angular/forms';
+import { FormGroup, FormControl } from "@angular/forms";
+import { fadeInAnimation } from '../../_animations/index';
+
+import { SaisonService } from '../../service/saison.service';
+import { DataService } from '../../service/data.service';
+
+export class ElementList {
+ value: number;
+ label: string;
+ constructor(_value: number, _label: string) {
+ this.value = _value;
+ this.label = _label;
+ }
+}
+
+@Component({
+ selector: 'app-saison-edit',
+ templateUrl: './saison-edit.html',
+ styleUrls: ['./saison-edit.less'],
+ animations: [fadeInAnimation],
+ host: { '[@fadeInAnimation]': '' }
+})
+// https://www.sitepoint.com/angular-forms/
+export class SaisonEditComponent implements OnInit {
+ id_saison:number = -1;
+
+ error:string = "";
+
+ numberVal:number = null;
+ description:string = "";
+ coverFile:File;
+ upload_file_value:string = ""
+ selectedFiles:FileList;
+
+ covers_display:Array