1 <md-dialog class="project-dialog" aria-label="New Project">
2 <form name="projectForm" class="md-inline-form" novalidate>
3 <md-toolbar class="md-accent md-hue-2">
5 class="md-toolbar-tools"
7 layout-align="space-between center"
9 <span class="title">{{vm.title | translate}}</span>
10 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
12 md-font-icon="icon-close"
13 aria-label="Close dialog"
19 <md-dialog-content ms-scroll>
20 <div class="error-list">
22 ng-repeat="error in vm.errors"
25 layout-align="space-between center"
28 <span class="message">{{error.message}}</span>
29 <span class="type">({{error.type}})</span>
31 <md-button class="md-icon-button">
33 md-font-icon="icon-alert-box"
34 aria-label="alert error"
40 <md-input-container class="md-block">
41 <label translate="CALLYSQUARE.NAME">Name</label>
44 ng-model="vm.project.name"
47 ng-pattern="/^[A-Za-z0-9\.\_]+$/i"
48 ng-disabled="!vm.newProject"
51 ng-messages="projectForm.name.$error"
52 ng-show="projectForm.name.$touched"
55 <div ng-message="required">
56 <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED"
57 >Name field is required</span
60 <div ng-message="pattern">
62 translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN"
63 translate-values="{ regex: '/^[A-Za-z0-9\.\_]+$/i' }"
64 >Name must be valid pattern
69 <md-input-container class="md-block">
70 <label translate="CALLYSQUARE.DESCRIPTION">Description</label>
71 <input name="description" ng-model="vm.project.description" />
73 ng-messages="projectForm.description.$error"
74 ng-show="projectForm.description.$touched"
77 <div ng-message="required">
78 <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED"
79 >Description field is required</span
84 <md-input-container ng-if="vm.openFromEditor" class="md-block"
85 ><!-- Added to check if I'm opening the dialog directly from the square editor -->
87 ng-model="vm.newWindow"
88 aria-label="{{'CALLYSQUARE.OPEN_NEW_WINDOW' | translate }}"
89 ><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span
92 <div class="error-list">
94 ng-repeat="error in vm.errors"
97 layout-align="space-between center"
100 <span class="message">{{error.message}}</span>
101 <span class="type">({{error.type}})</span>
103 <md-button class="md-icon-button">
105 md-font-icon="icon-alert-box"
106 aria-label="alert error"
114 <md-dialog-actions layout="row" layout-align="space-between center">
117 layout-align="start center"
118 ng-if="vm.crudPermissions.canEdit"
122 ng-if="!vm.newProject"
123 ng-click="vm.saveProject()"
124 class="send-button md-accent md-raised"
125 ng-disabled="projectForm.$invalid || projectForm.$pristine"
127 translate="CALLYSQUARE.SAVE"
128 translate-attr-aria-label="CALLYSQUARE.SAVE"
135 ng-if="vm.newProject"
136 ng-click="vm.addNewProject()"
137 class="send-button md-accent md-raised"
138 ng-disabled="projectForm.$invalid || projectForm.$pristine"
140 translate="CALLYSQUARE.ADD_PROJECT"
141 translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT"
148 class="md-icon-button"
149 ng-if="vm.crudPermissions.canDelete && !vm.newProject"
150 ng-click="vm.deleteProject($event)"
153 translate-attr-aria-label="CALLYSQUARE.DELETE"
155 <md-icon md-font-icon="icon-delete"></md-icon>
157 ><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip