Added Contact-Us Component and Service
[portal.git] / portal-FE-common / src / app / pages / contact-us / contact-us-manage / contact-us-manage.component.html
1 <!--
2   ============LICENSE_START==========================================
3   ONAP Portal
4   ===================================================================
5   Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6   ===================================================================
7  
8   Unless otherwise specified, all software contained herein is licensed
9   under the Apache License, Version 2.0 (the "License");
10   you may not use this software except in compliance with the License.
11   You may obtain a copy of the License at
12  
13               http://www.apache.org/licenses/LICENSE-2.0
14  
15   Unless required by applicable law or agreed to in writing, software
16   distributed under the License is distributed on an "AS IS" BASIS,
17   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   See the License for the specific language governing permissions and
19   limitations under the License.
20  
21   Unless otherwise specified, all documentation contained herein is licensed
22   under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23   you may not use this documentation except in compliance with the License.
24   You may obtain a copy of the License at
25  
26               https://creativecommons.org/licenses/by/4.0/
27  
28   Unless required by applicable law or agreed to in writing, documentation
29   distributed under the License is distributed on an "AS IS" BASIS,
30   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31   See the License for the specific language governing permissions and
32   limitations under the License.
33  
34   ============LICENSE_END============================================
35  
36   
37   -->
38 <div class="container">
39   <!--Modal Headers-->
40   <div class="modal-header">
41     <h4 class="modal-title">Manage Contact Us</h4>
42     <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
43         <span aria-hidden="true">&times;</span>
44     </button>
45   </div>
46
47   <!--Modal Body goes here-->
48   <div class="modal-body">
49     <div class="c-ecomp-portal-abs-table contactus-manage-table">
50       <table b2b-table id="table-main" table-data="contactUsList"       current-page="ignoredCurrentPage">
51         <thead b2b-table-row type="header">
52           <tr>
53             <th id="th-users-0" b2b-table-header key="ecomp_function" default-sort="a">App Name</th>
54             <th id="th-users-1" b2b-table-header key="app_name" sortable="true">Contact Name</th>
55             <th id="th-users-2" b2b-table-header key="app_name" sortable="true">Contact Email</th>
56             <th id="th-users-3" b2b-table-header key="role_name" sortable="true">Contact URL</th>
57             <th id="th-users-4" b2b-table-header key="role_name" sortable="true">Description</th>
58             <th id="th-users-5" b2b-table-header key="role_name" sortable="true">Edit</th>
59             <th id="th-users-6" b2b-table-header key="role_name" sortable="true">Delete</th>
60           </tr>
61         </thead>
62         <!-- Use track-by="UNIQUE KEY HERE" or leave out if no unique keys in data -->
63         <tbody b2b-table-row type="body" class="table-body" track-by="$index" *ngFor="let rowData of contactUsList; index as i">
64           <tr id="tr-rowData" ng-click="">
65             <td b2b-table-body>
66               <div id="users-page-td-appName" [innerHtml]="rowData.appName"></div>
67             </td>
68             <td b2b-table-body>
69               <div id="users-page-td-name" [hidden]="showEdit" [innerHtml]="rowData.contactName"></div> 
70               <input    class="input-inline-edit-text" type="text"      *ngIf="showEdit"        [(ngModel)]="rowData.contactName" />
71             </td>
72             <td b2b-table-body>
73               <div id="users-page-td-email" [hidden]="showEdit" [innerHtml]="rowData.contactEmail"></div> 
74               <input    class="input-inline-edit-text" type="text"      *ngIf="showEdit"        [(ngModel)]="rowData.contactEmail" />
75             </td>
76             <td b2b-table-body>
77               <div id="users-page-td-url" [hidden]="showEdit"   [innerHtml]="rowData.url"></div> 
78               <input            class="input-inline-edit-text" type="text"      *ngIf="showEdit" [(ngModel)]="rowData.url" />
79             </td>
80             <td b2b-table-body>
81               <div id="users-page-td-descr" [hidden]="showEdit"         [innerHtml]=" rowData.description"></div> 
82               <input    class="input-inline-edit-text" type="text"      *ngIf="showEdit"        [(ngModel)]="rowData.description" />
83             </td>
84             <td b2b-table-body>
85               <div class="edit-contact-us" [hidden]="showEdit">
86                   <span class="icon-edit" (click)="showEdit=true">
87                       <i class="icon ion-md-create"></i>
88                   </span>
89               </div> 
90               <span *ngIf="showEdit" (click)="editContactUs(rowData)"> 
91                   <i class="icon ion-md-save"></i>
92               </span>
93             </td>
94             <td b2b-table-body>
95               <div class="delete-contact-us">
96                 <span class="icon-trash" (click)="delContactUs(rowData)">
97                     <i class="icon ion-md-trash"></i>
98                 </span>
99               </div>
100             </td>
101           </tr>
102         </tbody>
103       </table>
104     </div>
105   
106     <div class="divider-line"></div>
107   
108     <div class="contactus-addWidgetHeader">
109       <div id="addWidgetHeader" class="contact-us-margin">
110         <p class="edit-contactus-title">Add Application Contact Information</p>
111       </div>
112       <div id="addWidget" class="contact-us-margin">
113         <div>
114           <form name="contactForm" novalidate autocomplete="off">
115             <div id="add-contact-us-field-appname" class="add-contact-us-field">
116               <mat-form-field class="contact-us-applications-select">
117                   <mat-label> <span id="required" class="mots-property-label-spn"       visible="false"> *</span>Application Name </mat-label>
118                   <mat-select name="contact-us-applications-select" id="application" 
119                     name="applicationName" [(ngModel)]="selectedApp" [(value)]="selected">
120                     <mat-option *ngFor="let d of contactUsAllAppList" [value]="d" >{{d.title}}</mat-option>
121                   </mat-select>
122               </mat-form-field>
123               <div id="mots-property-label-required"    *ngIf="selectedApp==null || selectedApp==''">
124                 <small class="mandatory-categories">App Name is Required</small>
125               </div>
126             </div>
127             <br>
128             <div class="addApplicationContactInfo">
129               <div id="add-contact-us-field-contactname"        class="add-contact-us-field">
130                 <div id="property-label-name" class="property-label">Contact Name</div>
131                 <input id="property-input-name" name="name" class="input-text-area" type="text" [(ngModel)]="newContactUs.contactName" />
132               </div>
133               <div id="add-contact-us-field-email" class="add-contact-us-field">
134                 <div id="property-label-email" class="property-label">Contact Email</div>
135                 <input id="property-input-email" name="email" class="input-text-area" type="text" [(ngModel)]="newContactUs.contactEmail" />
136               </div>
137               <div id="add-contact-us-field-url" class="add-contact-us-field">
138                 <div id="property-label-url" class="property-label">Contact     URL</div>
139                 <input id="property-input-url" name="url" class="input-text-area" type="text" [(ngModel)]="newContactUs.url" />
140               </div>
141             </div>
142             <div id="add-contact-us-field-desc" class="add-contact-us-field-des">
143               <div id="property-label-desc" class="property-label">Description</div>
144               <textarea id="property-input-desc" name="description"     class="property-label-desc-txtarea" [(ngModel)]="newContactUs.description"></textarea>
145             </div>
146           </form>
147         </div>          
148       </div>
149     </div>
150   </div>
151   <!--Modal Footer goes Here-->
152   <div class="modal-footer">
153       <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Close</button> &nbsp;
154       <button type="button" class="btn btn-primary" (click)="addNewContactUs()">Add New</button>
155   </div>
156 </div>