summaryrefslogtreecommitdiff
path: root/demo/src/main/resources/com/google/phonenumbers/demo/result.soy
blob: e3107109e8d5aae28135c6c7ab55b34c637a32eb (plain)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
{namespace com.google.phonenumbers.demo.singleNumber}
{template singleNumber}
{@param phoneNumber: string}
{@param defaultCountry: string}
{@param geocodingLocale: string}

{@param countryCode: int}
{@param nationalNumber: int}
{@param extension: string}
{@param countryCodeSource: string}
{@param italianLeadingZero: bool}
{@param numberOfLeadingZeros: int}
{@param rawInput: string}
{@param preferredDomesticCarrierCode: string}

{@param isPossibleNumber: bool}
{@param isValidNumber: bool}
{@param isValidNumberForRegion: bool|null}
{@param phoneNumberRegion: string|null}
{@param numberType: string}
{@param validationResult: string}

{@param isPossibleShortNumber: bool}
{@param isValidShortNumber: bool}
{@param isPossibleShortNumberForRegion: bool|null}
{@param isValidShortNumberForRegion: bool|null}

{@param e164Format: string}
{@param originalFormat: string}
{@param nationalFormat: string}
{@param internationalFormat: string}
{@param outOfCountryFormatFromUs: string}
{@param outOfCountryFormatFromCh: string}
{@param mobileDiallingFormatFromUs: string}
{@param nationalDiallingFormatWithPreferredCarrierCode: string}

{@param rows: list<list<string>>}

{@param descriptionForNumber: string}
{@param timeZonesForNumber: string}
{@param nameForNumber: string}
{@param newIssueLink: string}
{@param guidelinesLink: string}


<!DOCTYPE html>
<HTML lang="en">
<HEAD>
  <LINK type="text/css" rel="stylesheet" href="/stylesheets/main.css"/>
  <title>Results for {$phoneNumber}</title>
</HEAD>
<BODY>
<p>Phone Number entered: {$phoneNumber}</p>
<p>Default Country entered: {$defaultCountry}</p>
<p>Language entered: {$geocodingLocale}</p>
<DIV>
  <TABLE border=1>
    <TR>
      <TD colspan=2>Parsing Result (parseAndKeepRawInput())</TD>
    </TR>
    <TR>
      <TH>country_code</TH>
      <TD>{$countryCode}</TD>
    </TR>
    <TR>
      <TH>national_number</TH>
      <TD>{$nationalNumber}</TD>
    </TR>
    <TR>
      <TH>extension</TH>
      <TD>{$extension}</TD>
    </TR>
    <TR>
      <TH>country_code_source</TH>
      <TD>{$countryCodeSource}</TD>
    </TR>
    <TR>
      <TH>italian_leading_zero</TH>
      <TD>{$italianLeadingZero}</TD>
    </TR>
    <TR>
      <TH>number_of_leading_zeros</TH>
      <TD>{$numberOfLeadingZeros}</TD>
    </TR>
    <TR>
      <TH>raw_input</TH>
      <TD>{$rawInput}</TD>
    </TR>
    <TR>
      <TH>preferred_domestic_carrier_code</TH>
      <TD>{$preferredDomesticCarrierCode}</TD>
    </TR>
  </TABLE>
</DIV>
<DIV>
  <TABLE border=1>
    <TR>
      <TD colspan=2>Validation Results</TD>
    </TR>
    <TR>
      <TH>Result from isPossibleNumber()</TH>
      <TD>{$isPossibleNumber}</TD>
    </TR>
{if $isPossibleNumber}
  {if $validationResult == "IS_POSSIBLE_LOCAL_ONLY"}
    <TR>
      <TH>Result from isPossibleNumberWithReason()</TH>
      <TD>{$validationResult}</TD>
    </TR>
    <TR>
      <TD colspan=2>Number is considered invalid as it is not a possible national number.</TD>
    </TR>
  {else}
    <TR>
      <TH>Result from isValidNumber()</TH>
      <TD>{$isValidNumber}</TD>
    </TR>
    {if $isValidNumberForRegion != null}
    <TR>
      <TH>Result from isValidNumberForRegion()</TH>
      <TD>{$isValidNumberForRegion}</TD>
    </TR>
    {/if}
    <TR>
      <TH>Phone Number region</TH>
      <TD>{$phoneNumberRegion ?: ""}</TD>
    </TR>
    <TR>
      <TH>Result from getNumberType()</TH>
      <TD>{$numberType}</TD>
    </TR>
  {/if}
{else}
    <TR>
      <TH>Result from isPossibleNumberWithReason()</TH>
      <TD>{$validationResult}</TD>
    </TR>
    <TR>
      <TD colspan=2>Note: Numbers that are not possible have type UNKNOWN, an unknown region, and are considered invalid.</TD>
    </TR>
{/if}
  </TABLE>
</DIV>

{if not $isValidNumber}
<DIV>
  <TABLE border=1>
  <TR><TD colspan=2>Short Number Results</TD></TR>
    <TR>
      <TH>Result from isPossibleShortNumber()</TH>
      <TD>{$isPossibleShortNumber}</TD>
    </TR>
  {if $isPossibleShortNumber}
    <TR>
      <TH>Result from isValidShortNumber()</TH>
      <TD>{$isValidShortNumber}</TD>
    </TR>
  {/if}
  {if $isPossibleShortNumberForRegion != null}
    <TR>
      <TH>Result from isPossibleShortNumberForRegion()</TH>
      <TD>{$isPossibleShortNumberForRegion}</TD>
    </TR>
    {if $isPossibleShortNumberForRegion and $isValidShortNumberForRegion != null}
      <TR>
        <TH>Result from isValidShortNumberForRegion()</TH>
        <TD>{$isValidShortNumberForRegion}</TD>
      </TR>
    {/if}
  {/if}
  </TABLE>
</DIV>
{/if}

<DIV>
  <TABLE border=1>
    <TR>
      <TD colspan=2>Formatting Results</TD>
    </TR>
    <TR>
      <TH>E164 format</TH>
      <TD>{$e164Format}</TD>
    </TR>
    <TR>
      <TH>Original format</TH>
      <TD>{$originalFormat}</TD>
    </TR>
    <TR>
      <TH>National format</TH>
      <TD>{$nationalFormat}</TD>
    </TR>
    <TR>
      <TH>International format</TH>
      <TD>{$internationalFormat}</TD>
    </TR>
    <TR>
      <TH>Out-of-country format from US</TH>
      <TD>{$outOfCountryFormatFromUs}</TD>
    </TR>
    <TR>
      <TH>Out-of-country format from CH</TH>
      <TD>{$outOfCountryFormatFromCh}</TD>
    </TR>
    <TR>
      <TH>Format for mobile dialing (calling from US)</TH>
      <TD>{$mobileDiallingFormatFromUs}</TD>
    </TR>
    <TR>
      <TH>Format for national dialing with preferred carrier code and empty fallback carrier code</TH>
      <TD>{$nationalDiallingFormatWithPreferredCarrierCode}</TD>
    </TR>
  </TABLE>
</DIV>

<DIV>
  <TABLE border=1>
    <TR>
      <TD colspan=2>AsYouTypeFormatter Results</TD>
    </TR>
    {for $row in $rows}
    <TR>
      <TH>Char entered: '{$row[0]}' Output: "</TH>
      <TD>{$row[1]}</TD>
    </TR>
    {/for}

  </TABLE>
</DIV>


{if $isValidNumber}

<DIV>
  <TABLE border=1>
    <TR>
      <TD colspan=2>PhoneNumberOfflineGeocoder Results</TD>
    </TR>
    <TR>
      <TH>Location</TH>
      <TD>{$descriptionForNumber}</TD>
    </TR>
  </TABLE>
</DIV>
<DIV>
  <TABLE border=1>
    <TR>
      <TD colspan=2>PhoneNumberToTimeZonesMapper Results</TD>
    </TR>
    <TR>
      <TH>Time zone(s)</TH>
      <TD>{$timeZonesForNumber}</TD>
    </TR>
  </TABLE>
</DIV>
  {if ['MOBILE', 'FIXED_LINE_OR_MOBILE', 'PAGER'].contains($numberType)}
<DIV>
  <TABLE border=1>
    <TR>
      <TD colspan=2>PhoneNumberToCarrierMapper Results</TD>
    </TR>
    <TR>
      <TH>Carrier</TH>
      <TD>{$nameForNumber}</TD>
    </TR>
  </TABLE>
</DIV>
  {/if}
{/if}

<b style="color:red">File an issue</b>: by clicking on <a target="_blank" href="{$newIssueLink}">this link</a>, I confirm that I have read the <a target="_blank" href="{$guidelinesLink}">contributor's guidelines</a>.
</BODY>
</HTML>
{/template}