1
1
< section >
2
-
2
+ < h1 > kkkkkkkkkkkkkkk</ h1 >
3
+ <!--<div *ngIf="news">-->
3
4
< form action ="/createNew " method ="post " enctype ="multipart/form-data ">
4
5
5
6
< div class ="container " style ="background-color:#f5f5f5; margin-top: 2%; padding-bottom: 1%; ">
@@ -14,13 +15,15 @@ <h2 style="text-align: center; padding-top: 2%;">Edit New Form</h2>
14
15
< div class ="col-md-4 ">
15
16
< div >
16
17
< label > Title: </ label >
17
- < p > < textarea name ="title " placeholder ="title " style ="width: 100%; " [(ngModel)] ="title "> </ textarea > </ p >
18
+ < p > < textarea name ="title " placeholder ="title " style ="width: 100%; "
19
+ [(ngModel)] ="title "> </ textarea > </ p >
18
20
</ div >
19
21
</ div >
20
22
< div class ="col-md-4 ">
21
23
< div >
22
24
< label > Date: </ label >
23
- < p > < textarea name ="date " placeholder ="date " style ="width: 100%; " [(ngModel)] ="date "> </ textarea > </ p >
25
+ < p > < textarea name ="date " placeholder ="date " style ="width: 100%; " [(ngModel)] ="date "> </ textarea >
26
+ </ p >
24
27
</ div >
25
28
</ div >
26
29
</ div >
@@ -29,13 +32,15 @@ <h2 style="text-align: center; padding-top: 2%;">Edit New Form</h2>
29
32
< div class ="col-md-4 ">
30
33
< div >
31
34
< label > Read Time: </ label >
32
- < p > < textarea name ="readTime " placeholder ="readTime " style ="width: 100%; " [(ngModel)] ="read_time "> </ textarea > </ p >
35
+ < p > < textarea name ="readTime " placeholder ="readTime " style ="width: 100%; "
36
+ [(ngModel)] ="read_time "> </ textarea > </ p >
33
37
</ div >
34
38
</ div >
35
39
< div class ="col-md-4 ">
36
40
< div >
37
41
< label > Badge: </ label >
38
- < p > < textarea name ="badge " placeholder ="badge " style ="width: 100%; " [(ngModel)] ="badge "> </ textarea > </ p >
42
+ < p > < textarea name ="badge " placeholder ="badge " style ="width: 100%; "
43
+ [(ngModel)] ="badge "> </ textarea > </ p >
39
44
</ div >
40
45
</ div >
41
46
</ div >
@@ -44,8 +49,8 @@ <h2 style="text-align: center; padding-top: 2%;">Edit New Form</h2>
44
49
< div class ="col-md-8 ">
45
50
< div >
46
51
< label style ="text-align: left !important; "> New Content: </ label >
47
- < p > < textarea name ="description " placeholder ="description " rows ="10 "
48
- style =" width: 100%; " [(ngModel)] ="content "> </ textarea > </ p >
52
+ < p > < textarea name ="description " placeholder ="description " rows ="10 " style =" width: 100%; "
53
+ [(ngModel)] ="content "> </ textarea > </ p >
49
54
</ div >
50
55
</ div >
51
56
</ div >
@@ -63,10 +68,8 @@ <h2 style="text-align: center; padding-top: 2%;">Edit New Form</h2>
63
68
< div class ="row mt-3 d-flex justify-content-center ">
64
69
< div class ="col-8 ">
65
70
< p > Related Videogames: </ p >
66
- < select name ="videogames " multiple style ="width: 100%; ">
67
- {{#videogame}}
68
- < option value ="{{ id }} "> {{ title }}</ option >
69
- {{/videogame}}
71
+ < select name ="videogames " multiple style ="width: 100%; " ngFor >
72
+ < option *ngFor ="let vg of videogame "> {{ vg.title }}</ option >
70
73
</ select >
71
74
</ div >
72
75
</ div >
@@ -76,24 +79,22 @@ <h2 style="text-align: center; padding-top: 2%;">Edit New Form</h2>
76
79
< div class ="col-8 ">
77
80
< p > Image: </ p >
78
81
< p >
79
- < input type ='file ' name ='imageField ' accept =".jpg, .jpeg .png .svg " [(ngModel)] ="image "/>
80
- < input type ="hidden " name ="_csrf " value ="{{token}} " />
82
+ < input type ='file ' name ='imageField ' accept =".jpg, .jpeg .png .svg "
83
+ (click) ="updateNewImage() " />
84
+ <!--<input type="hidden" name="_csrf" value="{{token}}" />-->
81
85
</ p >
82
86
</ div >
83
87
</ div >
84
88
85
89
< p style ="text-align: center; ">
86
- < input class ="btn btn-primary " type ="submit " value ="Save " (click) ="addNew(title, date, read_time, badge, content, header) "; />
90
+ < input class ="btn btn-primary " type ="submit " value ="Save "
91
+ (click) ="addNew(title, date, read_time, badge, content, header, true) " ; />
87
92
<!--Boton que ejecutara la función ajax-->
88
93
< button class ="btn btn-outline-light " style ="color: black; border-color: black; "
89
94
onclick ="location.href='/'; "> Cancel</ button >
90
95
<!--Boton para cancelar la acción-->
91
96
</ p >
92
97
</ div >
93
98
</ form >
94
- </ section >
95
-
96
- <!-- Bootstrap core JS-->
97
- < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/js/bootstrap.bundle.min.js "
> </ script >
98
- <!-- Core theme JS-->
99
- < script src ="js/scripts.js "> </ script >
99
+ <!--/div-->
100
+ </ section >
0 commit comments