[sidebar] fixed form design
[u/erikhf/frm.git] / src / components / sidebar / sidebar.html
1 <div>
2     <div [hidden]="!active" class="form-background" style="overflow-y:auto;">
3         <form *ng-if="editmode" [(ng-form-model)]="form" (ng-submit)="onSubmit()" #of="form">
4             <h3>{{newObject?"Add new Organizational Unit":"Update Organizational Unit"}}</h3>
5
6             <div class="form-group">
7                 <label>Name</label>
8                 <input class="form-control" type="text" ng-control="name">
9                 <p [hidden]="name.valid || name.untouched" class="alert alert-danger">
10                     Name is required
11                 </p>
12
13             </div>
14             <div class="form-group">
15                 <label>Short Name</label>
16                 <input class="form-control" type="text" ng-control="shortName" #shortname="form">
17
18                 <p [hidden]="shortname.valid || shortname.untouched" class="alert alert-danger">
19                     Short name is required
20                 </p>
21             </div>
22
23             <div class="form-group">
24                 <label>Description</label>
25                 <textarea class="form-control" ng-control="description" rows="3"></textarea>
26             </div>
27             <div class="form-group">
28                 <label>Code</label>
29                 <input class="form-control" type="text" ng-control="code">
30             </div>
31
32             <div class="form-group">
33                 <label>Opening Date</label>
34                 <input class="form-control" type="date" ng-control="openingDate" #openingDate="form">
35
36                 <p [hidden]="openingdate.valid || openingdate.untouched" class="alert alert-danger">Opening date is required</p>
37             </div>
38             <div class="form-group">
39                 <label>Closed Date</label>
40                 <input class="form-control" type="date" ng-control="closedDate">
41             </div>
42             <div class="form-group">
43                 <label>URL</label>
44                 <input class="form-control" type="url" ng-control="url" #url="form">
45
46                 <p [hidden]="url.valid" class="alert alert-danger">The specified URL is not valid</p>
47             </div>
48             <fieldset class="form-group" *ng-if="coordinatePoint">
49                 <Legend>Coordinates</Legend>
50                 <div class="form-group">
51                     <label>lat</label>
52                     <input class="form-control" type="number" ng-control="lat" #lat="form" step="any" max="90" min="-90"/>
53                     <label>long</label>
54                     <input class="form-control" type="number" ng-control="lng" #lng="form" step="any" max="180" min="-180"/>
55                 </div>
56             </fieldset>
57
58
59             <fieldset class="form-group">
60                 <legend>Contact information</legend>
61                 <label>Contact person</label>
62                 <input class="form-control" type="text" ng-control="contactPerson"/>
63                 <label>Address</label>
64                 <input class="form-control" type="text" ng-control="address"/>
65                 <label>E-mail</label>
66                 <input class="form-control" type="email" ng-control="email"/>
67                 <label>Phone number</label>
68                 <input class="form-control" type="text" ng-control="phoneNumber"/>
69             </fieldset>
70             <button type="button" (click)="cancel()" class="btn btn-default">Cancel</button>
71             <button type="submit" [disabled]="!of.form.valid" class="btn btn-default">{{newObject? "Add":"Update"}}
72             </button>
73
74         </form>
75
76
77         <section *ng-if="!editmode">
78             <label for="actOrgUnitName">Name</label>
79
80             <p id="actOrgUnitName">{{(form.controls.name.value) || "[None]"}}</p>
81
82             <label for="actOrgUnitShortName">Short Name</label>
83
84             <p id="actOrgUnitShortName">{{(form.controls.shortName.value)||["None"]}}</p>
85
86             <label for="actOrgUnitDescription">Description</label>
87
88             <p id="actOrgUnitDescription">{{(form.controls.description.value)||"None"}}</p>
89
90             <label for="actOrgUnitCode">Code</label>
91
92             <p id="actOrgUnitCode">{{(form.controls.code.value)||["None"]}}</p>
93
94             <label for="actOrgUnitOpeningDate">Opening Date</label>
95
96             <p id="actOrgUnitOpeningDate">{{form.controls.openingDate.value||["None"]}}</p>
97
98             <label for="actOrgUnitClosingDate">Closed Date</label>
99
100             <p id="actOrgUnitClosingDate">{{form.controls.closedDate.value||["None"]}}</p>
101
102             <label for="actOrgUnitURL">Url</label>
103
104             <p id="actOrgUnitURL">{{(form.controls.url.value) ||["None"]}}</p>
105
106             <button class="btn btn-default" (click)="editmode = !editmode">Edit</button>
107         </section>
108
109     </div>
110 </div>