[sibebar] added polygon
[u/erikhf/frm.git] / src / components / sidebar / sidebar.html
index 4c826e6..f019dd8 100644 (file)
@@ -1,12 +1,14 @@
 <div>
-    <div [hidden]="!active" class="form-background">
+    <div [hidden]="!active" class="form-background" style="overflow-y:auto; position:relative; float:right; ">
         <form *ng-if="editmode" [(ng-form-model)]="form" (ng-submit)="onSubmit()" #of="form">
-            <h3>{{newObject?"Add new Organizational Unit":"Update Organizational Unit"}}</h3>
+            <h2>{{newObject?"Add new Organizational Unit":"Update Organizational Unit"}}</h2>
 
             <div class="form-group">
                 <label>Name</label>
                 <input class="form-control" type="text" ng-control="name">
-
+                <p [hidden]="name.valid || name.untouched" class="alert alert-danger">
+                    Name is required
+                </p>
 
             </div>
             <div class="form-group">
@@ -31,7 +33,7 @@
                 <label>Opening Date</label>
                 <input class="form-control" type="date" ng-control="openingDate" #openingDate="form">
 
-                <p [hidden]="openingdate.valid" class="alert alert-danger">Opening date is required</p>
+                <p [hidden]="openingdate.valid || openingdate.untouched" class="alert alert-danger">Opening date is required</p>
             </div>
             <div class="form-group">
                 <label>Closed Date</label>
             </div>
             <fieldset class="form-group">
                 <Legend>Coordinates</Legend>
-                <div class="form-group">
-                    <label>lat</label>
-                    <input class="form-control" type="number" ng-control="lat" #lat="form"/>
-                    <label>long</label>
-                    <input class="form-control" type="number" ng-control="lng" #lng="form"/>
+                <div *ng-if="featureType.value == 'POINT'" class="form-group">
+                    <label>Latitude</label>
+                    <input class="form-control" type="number" ng-control="lat" #lat="form" step="any" max="90" min="-90"/>
+                    <label>Longitude</label>
+                    <input class="form-control" type="number" ng-control="lng" #lng="form" step="any" max="180" min="-180"/>
+                </div>
+                <div *ng-if="featureType.value == 'NONE'" class="alert alert-danger">
+                    <p>This organisation unit has no associated coordinates</p>
                 </div>
-                <p>{{lat.valid}}</p>
-
-                <p>{{lng.valid}}</p>
             </fieldset>
 
 
@@ -76,6 +78,7 @@
 
 
         <section *ng-if="!editmode">
+            <h2>Organisation Unit</h2>
             <label for="actOrgUnitName">Name</label>
 
             <p id="actOrgUnitName">{{(form.controls.name.value) || "[None]"}}</p>
 
             <p id="actOrgUnitURL">{{(form.controls.url.value) ||["None"]}}</p>
 
+            <fieldset>
+                <legend>Coordinates</legend>
+                <div *ng-if="featureType.value == 'POINT'" class="form-group">
+                    <label>Latitude</label>
+                    <p>{{form.controls.lat.value}}</p>
+                    <label>Longitude</label>
+                    <p>{{form.controls.lng.value}}</p>
+                </div>
+                <div *ng-if="featureType.value == 'NONE'" class="alert alert-danger">
+                    <p>This organisation unit has no associated coordinates</p>
+                </div>
+                <div *ng-if="featureType.value == 'POLYGON' || featureType.value == 'MULTI_POLYGON'">
+                    <p>polygon</p>
+                </div>
+
+            </fieldset>
+
+            <fieldset>
+                <legend>Contact Information</legend>
+                <label>Contact person</label>
+                <p>{{form.controls.contactPerson.value || ["None"]}}</p>
+                <label>Address</label>
+                <p>{{form.controls.address.value || ["None"]}}</p>
+                <label>E-mail</label>
+                <p>{{form.controls.email.value || ["None"]}}</p>
+                <label>Phone number</label>
+                <p>{{form.controls.phoneNumber.vaule || ["None"]}}</p>
+            </fieldset>
             <button class="btn btn-default" (click)="editmode = !editmode">Edit</button>
         </section>