This repository has been archived by the owner on Jun 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-project.html
159 lines (144 loc) · 5.7 KB
/
create-project.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html>
<head>
<title>Customer Portal API Integration</title>
<script src="js/angular.min.js"></script>
<script src="js/cookies.js"></script>
<script src="js/app.js"></script>
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/run_prettify.js"></script>
<link rel="stylesheet" href="./css/xtrf-api-landing-page.css">
<link rel="stylesheet" href="./css/api-demo.css">
<script src="./js/bootstrap.min.js"></script>
</head>
<body ng-app="apiIntegration" ng-controller="mainController">
<div ng-include="'templates/header.html'"></div>
<div class="row main-row">
<div class="col-md-1"></div>
<div class="col-md-10 main-col">
<div>
<div class="alert alert-danger">
<p><strong>WARNING!!!!</strong><br/>To use this example you need to run it in Google Chrome with <em>--disable-web-security</em>
flag</p>
</div>
<h1>Demo - Create Project</h1>
<hr/>
<div ng-include="'templates/login-form.html'"></div>
<hr/>
<h2>
2. Obtaining dictionary values
<i class="checkmark" ng-show="dictionariesLoaded"></i>
<button class="btn btn-default btn-xsx btn-snippet" data-source="#code-snippet-2">code snippet</button>
</h2>
<div class="row" ng-show="session">
<div class="col-md-12">
<button class="btn btn-primary" ng-click="getDictionaryValues()">Get dictionary values<span class="spinner"
ng-show="loaders.isGettingDictionaryValues"></span>
</button>
</div>
</div>
<div class="row" style="margin-top:10px;" ng-show="session">
<div class="col-md-6">
<p>GET: <em>{{apiURL}}system/languages</em></p>
<pre style="height: 300px; overflow: auto;">{{languages | json}}</pre>
</div>
<div class="col-md-6">
<p>GET: <em>{{apiURL}}system/workflows</em></p>
<pre style="height: 300px; overflow: auto;">{{workflows | json}}</pre>
</div>
</div>
<div class="row" style="margin-top:10px;" ng-show="session">
<div class="col-md-6">
<p>GET: <em>{{apiURL}}customers/{customerID}/persons</em></p>
<pre style="height: 300px; overflow: auto;">{{contactPersons | json}}</pre>
</div>
<div class="col-md-6">
<p>GET: <em>{{apiURL}}system/specializations</em></p>
<pre style="height: 300px; overflow: auto;">{{specializations | json}}</pre>
</div>
</div>
<hr/>
<h2>3. Sending quote/project
<i class="checkmark" ng-show="quoteResponse"></i>
</h2>
<div style="margin-left: 10px;">
<h3>3a. Uploading files
<button class="btn btn-default btn-xsx btn-snippet" data-source="#code-snippet-3">code snippet</button>
</h3>
<div class="row sub-row" ng-show="dictionariesLoaded">
<div class="col-md-12">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Choose file</label>
<input type="file" name="file" id="file-upload" ng-model="filepath"/>
</div>
<div class="form-group">
<label>Upload</label>
<button id="upload-button" class="btn btn-primary" disabled
onclick="angular.element(document.querySelector('#file-upload')).scope().uploadFile(document.querySelector('#file-upload').files)">
Upload file
</button>
</div>
</div>
<div class="col-md-6">
<h3>Uploaded files</h3>
<pre>{{uploadedFiles | json}}</pre>
</div>
</div>
</div>
</div>
<hr/>
<h3>3b. Sending quote
<button class="btn btn-default btn-xsx btn-snippet" data-source="#code-snippet-4">code snippet</button>
</h3>
<div class="row sub-row" ng-show="dictionariesLoaded">
<div class="col-md-6">
<h4>Quote JSON:</h4>
<textarea class="form-control" style="width:100%; height:500px; margin-bottom: 10px;"
ng-model="jsonString"></textarea>
<button class="btn btn-primary" ng-click="sendQuote()">
<span>Send quote/project</span>
<span class="spinner" ng-show="sendingQuote"></span>
</button>
<div ng-show="sendingQuoteFailed === true" class="alert alert-danger login-alert">
An error occurred while sending quote. Please check if API is online and if all files are not null.
</div>
</div>
<div class="col-md-6">
<h4>Received data:</h4>
<pre style="height: 500px; overflow: auto;">{{quoteResponse | json}}</pre>
</div>
</div>
</div>
<h2>4. Received data</h2>
<div class="row" style="margin-top:10px;" ng-show="quoteResponse">
<div class="col-md-6">
<p>Your Project Reference Number is: <strong>{{quoteResponse.refNumber}}</strong></p>
<p>You can
<button class="btn btn-default" ng-click="logOut()">Logout</button>
now or:
</p>
</div>
<div class="col-md-6">
</div>
</div>
<div class="row" style="margin-top:50px;" ng-show="quoteResponse">
<div class="col-md-12">
<a ng-disabled="!quoteResponse"
class="btn btn-primary btn-lg"
href="project-info.html"
style="width:100%">Get project info and files ></a>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<pre class="hide bg-warning prettyprint" id="code-snippet-1" ng-include="'code-snippets/code-snippet-1.js'"></pre>
<pre class="hide bg-warning prettyprint" id="code-snippet-2" ng-include="'code-snippets/code-snippet-2.js'"></pre>
<pre class="hide bg-warning prettyprint" id="code-snippet-3" ng-include="'code-snippets/code-snippet-3.js'"></pre>
<pre class="hide bg-warning prettyprint" id="code-snippet-4" ng-include="'code-snippets/code-snippet-4.js'"></pre>
</div>
</div>
</body>
</html>