forked from BD-Python-PIP/code-examples-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhome.html
More file actions
88 lines (74 loc) · 4.15 KB
/
home.html
File metadata and controls
88 lines (74 loc) · 4.15 KB
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
<!-- extend base layout -->
{% extends "base.html" %}
{% block content %}
{% if not 'ds_user_name' in session %}
<!-- IF not signed in -->
<div>
<div class="jumbotron jumbotron-fluid"> <table>
<tbody>
<tr>
<td>
<h1 class="display-4">Python Launcher</h1>
<p class="Xlead">{{ session['manifest']['SupportingTexts']['HomePageText'] }}</p>
</td>
<td>
<img src="/static/assets/banner-code.png" />
</td>
</tr>
</tbody>
</table>
</div>
{% endif %}
<!-- Future: add a table of contents or navigation pane
Eg, see https://stackoverflow.com/questions/21868610/make-column-fixed-position-in-bootstrap
-->
<div class="container" style="margin-top: 40px" id="index-page">
<div class="form-group has-search">
<span class="fa fa-search form-control-feedback"></span>
<input type="text" class="form-control" id="code_example_search" placeholder="Search for code example">
</div>
<div id="filtered_code_examples" class="container" style="margin-top: 10px; padding-left: 0px;">
{% if show_doc %}
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> on using JWT or Authorization Code Grant from a Python Flask application.</p>
{% endif %}
{% for api in manifest['APIs'] -%}
{% for group in api['Groups'] -%}
<h2>{{ group["Name"] }}</h2>
{% for example in group["Examples"] -%}
{% if not example["SkipForLanguages"] or "python" not in example["SkipForLanguages"] %}
{% if example.CFREnabled != "CFROnly" %}
{% set api_prefix = "a" if api["Name"] == "Admin" else "c" if api["Name"] == "Click" else "r" if api["Name"] == "Rooms" else "m" if api["Name"] == "Monitor" else "cn" if api["Name"] == "Connect" else "ms" if api["Name"] == "Maestro" else "w" if api["Name"] == "WebForms" else "" %}
<h4
id="{{ api_prefix + 'example' + '0' * (3 - example['ExampleNumber'] | string() | length ) + example['ExampleNumber'] | string() }}"
>
<a
href="{{ api_prefix + 'eg' + '0' * (3 - example['ExampleNumber'] | string() | length ) + example['ExampleNumber'] | string() }}">{{ example["ExampleName"] }}
</a>
</h4>
<p>{{ example["ExampleDescription"] | safe }}</p>
{% if example["LinksToAPIMethod"] | length > 0 %}
{% if example["LinksToAPIMethod"] | length > 1 %}
{{ session["manifest"]["SupportingTexts"]["APIMethodUsedPlural"] | safe }}
{% else %}
{{ session["manifest"]["SupportingTexts"]["APIMethodUsed"] | safe }}
{% endif %}
{% for link in example["LinksToAPIMethod"] -%}
<a target='_blank' href="{{ link['Path'] }}">{{ link['PathName'] }}</a>
{% endfor %}
<br></br>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
</div>
<div id="api_json_data" class="hidden">{{ manifest | to_json }}</div>
<div id="cfr11_data" class="hidden">{{ crfEnabled }}</div>
</div>
<!-- anchor-js is only for the index page -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.1/anchor.min.js"></script>
<script>anchors.options.placement = 'left'; anchors.add('h4')</script>
<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.6.2"></script>
<script src="/static/assets/search.js"></script>
{% endblock %}