|
6 | 6 | {{ $allCatalogues := .catalogues }} |
7 | 7 | {{ $cataloguesLength := len $allCatalogues}} |
8 | 8 | {{ $hasDocs := false }} |
9 | | -{{ $initialAPI := index $thisProduct.APIDetails 0}} |
| 9 | +{{ if $thisProduct.IsDocumentationOnly}} |
| 10 | + {{ if gt (len $thisProduct.SpecDetails) 0 }} |
| 11 | + {{ $initialAPI := index $thisProduct.SpecDetails 0}} |
| 12 | + {{ end }} |
| 13 | +{{else}} |
| 14 | + {{ if gt (len $thisProduct.APIDetails) 0 }} |
| 15 | + {{ $initialAPI := index $thisProduct.APIDetails 0}} |
| 16 | + {{ end }} |
| 17 | +{{end}} |
10 | 18 | {{ $initialAPIOasUrl := ""}} |
11 | 19 | {{ $initialAPIID := ""}} |
12 | 20 | {{ $initialTemplate := ""}} |
13 | | -{{ range $thisProduct.APIDetails }} |
14 | | - {{ $oasfile := gt (.OASDocument.Base.Url | trim | length) 0 }} |
15 | | - {{ $oasurl := gt (.OASUrl | trim | length) 0 }} |
16 | | - {{ if or $oasfile $oasurl }} |
17 | | - {{ $hasDocs = true}} |
| 21 | +{{ if $thisProduct.IsDocumentationOnly}} |
| 22 | + {{ $hasDocs = true}} |
| 23 | + |
| 24 | +{{else}} |
| 25 | + {{ range $thisProduct.APIDetails }} |
| 26 | + {{ $oasfile := gt (.OASDocument.Base.Url | trim | length) 0 }} |
| 27 | + {{ $oasurl := gt (.OASUrl | trim | length) 0 }} |
| 28 | + {{ if or $oasfile $oasurl }} |
| 29 | + {{ $hasDocs = true}} |
| 30 | + {{ end }} |
18 | 31 | {{ end }} |
19 | | -{{ end }} |
| 32 | +{{end}} |
20 | 33 | {{ $redoc := "product_doc_redoc" }} |
21 | 34 | {{ $asyncapi := "product_doc_asyncapi" }} |
22 | 35 |
|
|
290 | 303 | <p>Select an API</p> |
291 | 304 | <div class="d-flex flex-row justify-content-between align-items-center mt-1 mb-5 pb-3"> |
292 | 305 | <select id="OasApiSelect"> |
293 | | - {{ range $index, $api_detail := $thisProduct.APIDetails }} |
294 | | - {{ $oasfile := gt ($api_detail.OASDocument.Base.Url | trim | length) 0 }} |
295 | | - {{ $oasurl := gt ($api_detail.OASUrl | trim | length) 0 }} |
| 306 | + {{ $docArray := $thisProduct.APIDetails}} |
| 307 | + {{ if $thisProduct.IsDocumentationOnly}} |
| 308 | + {{ range $index, $spec_detail := $thisProduct.SpecDetails }} |
| 309 | + {{ $oasfile := gt ($spec_detail.OASDocument.Base.Url | trim | length) 0 }} |
| 310 | + {{ $oasurl := gt ($spec_detail.OASUrl | trim | length) 0 }} |
296 | 311 | {{ if or $oasfile $oasurl }} |
297 | 312 | {{$url := ""}} |
298 | 313 | {{if $oasfile }} |
299 | 314 | {{$url = .OASDocument.Base.Url}} |
300 | 315 | {{else}} |
301 | 316 | {{$url = .OASUrl}} |
302 | 317 | {{end}} |
303 | | - {{$template := ProductDocTemplate req $thisProduct.Path $api_detail.APIID }} |
304 | | - <option value="{{$api_detail.APIID}}-{{$url}}" data-template="{{$template}}">{{$api_detail.Name}}</option> |
| 318 | + {{$template := ProductDocTemplate req $thisProduct.Path $spec_detail.SpecAlias }} |
| 319 | + <option value="{{$spec_detail.SpecAlias}}-{{$url}}" data-template="{{$template}}">{{$spec_detail.SpecAlias}}</option> |
305 | 320 | {{if eq $initialAPIOasUrl ""}}{{ $initialAPIOasUrl = $url }}{{end}} |
306 | | - {{if eq $initialAPIID ""}}{{ $initialAPIID = $api_detail.APIID }}{{end}} |
| 321 | + {{if eq $initialAPIID ""}}{{ $initialAPIID = $spec_detail.SpecAlias }}{{end}} |
307 | 322 | {{if eq $initialTemplate ""}}{{ $initialTemplate = $template }}{{end}} |
308 | 323 | {{end}} |
309 | 324 | {{end}} |
| 325 | + {{else}} |
| 326 | + {{ range $index, $api_detail := $thisProduct.APIDetails }} |
| 327 | + {{ $oasfile := gt ($api_detail.OASDocument.Base.Url | trim | length) 0 }} |
| 328 | + {{ $oasurl := gt ($api_detail.OASUrl | trim | length) 0 }} |
| 329 | + {{ if or $oasfile $oasurl }} |
| 330 | + {{$url := ""}} |
| 331 | + {{if $oasfile }} |
| 332 | + {{$url = .OASDocument.Base.Url}} |
| 333 | + {{else}} |
| 334 | + {{$url = .OASUrl}} |
| 335 | + {{end}} |
| 336 | + {{$template := ProductDocTemplate req $thisProduct.Path $api_detail.APIID }} |
| 337 | + <option value="{{$api_detail.APIID}}-{{$url}}" data-template="{{$template}}">{{$api_detail.Name}}</option> |
| 338 | + {{if eq $initialAPIOasUrl ""}}{{ $initialAPIOasUrl = $url }}{{end}} |
| 339 | + {{if eq $initialAPIID ""}}{{ $initialAPIID = $api_detail.APIID }}{{end}} |
| 340 | + {{if eq $initialTemplate ""}}{{ $initialTemplate = $template }}{{end}} |
| 341 | + {{end}} |
| 342 | + {{end}} |
| 343 | + {{end}} |
310 | 344 | </select> |
311 | 345 | <div class="oas-display-content-download-button"> |
312 | 346 | <form name="oas_form" method="get" data-path="/portal/catalogue-products/{{$thisProduct.Path}}" id="display-download-button" action="/portal/catalogue-products/{{$thisProduct.Path}}/{{$initialAPIID}}/docs/download"> |
|
0 commit comments