0001-templates-factorize-endpoint-template-27782.patch
passerelle/templates/passerelle/manage/endpoint.html | ||
---|---|---|
1 |
{% load i18n passerelle %} |
|
2 |
<li class="{{ endpoint.http_method|default:"get" }}-method">{% if endpoint.description %}<span class="description">{{endpoint.description}}{% trans ':' %}</span>{% endif %} |
|
3 |
<a href="{{endpoint.example_url}}" class="example-url">{{ site_base_uri }}{{endpoint.example_url_as_html}}</a> |
|
4 |
<ul class="params"> |
|
5 |
{% if endpoint.get_params %} |
|
6 |
<li>{% trans "Query parameters" %} |
|
7 |
<ul class="get-params"> |
|
8 |
{% for param in endpoint.get_params %} |
|
9 |
<li><span class="param-name">{{param.name}}</span> |
|
10 |
{% if param.optional %}<span class="param-optional">({% trans 'optional' %}{% if param.default_value %}, |
|
11 |
{% trans 'default value:' %} {{param.default_value}}{% endif %})</span>{% endif %} |
|
12 |
{% if param.description %}{% trans ':' %} {{param.description}}{% endif %} |
|
13 |
<span class="type">({% if param.type %}{{ param.type }}{% else %}string{% endif %})</span> |
|
14 |
</li> |
|
15 |
{% endfor %} |
|
16 |
</ul> |
|
17 |
</li> |
|
18 |
{% endif %} |
|
19 |
{% if endpoint.body_schemas %} |
|
20 |
<li><span class="params-title">{% trans "Request body" %}</span> |
|
21 |
<div class="body-schemas"> |
|
22 |
{% render_body_schemas body_schemas=endpoint.body_schemas %} |
|
23 |
</div> |
|
24 |
</li> |
|
25 |
{% endif %} |
|
26 |
</ul> |
|
27 |
{% if endpoint.long_description %} |
|
28 |
<div class="long-description"> |
|
29 |
{{ endpoint.long_description }} |
|
30 |
</div> |
|
31 |
{% endif %} |
|
32 |
</li> |
passerelle/templates/passerelle/manage/service_view.html | ||
---|---|---|
64 | 64 |
{% block endpoints %} |
65 | 65 |
<ul class="endpoints"> |
66 | 66 |
{% for endpoint in object.get_endpoints_infos %} |
67 |
<li class="{{ endpoint.http_method|default:"get" }}-method">{% if endpoint.description %}<span class="description">{{endpoint.description}}{% trans ':' %}</span>{% endif %} |
|
68 |
<a href="{{endpoint.example_url}}" class="example-url">{{ site_base_uri }}{{endpoint.example_url_as_html}}</a> |
|
69 |
<ul class="params"> |
|
70 |
{% if endpoint.get_params %} |
|
71 |
<li>{% trans "Query parameters" %} |
|
72 |
<ul class="get-params"> |
|
73 |
{% for param in endpoint.get_params %} |
|
74 |
<li><span class="param-name">{{param.name}}</span> |
|
75 |
{% if param.optional %}<span class="param-optional">({% trans 'optional' %}{% if param.default_value %}, |
|
76 |
{% trans 'default value:' %} {{param.default_value}}{% endif %})</span>{% endif %} |
|
77 |
{% if param.description %}{% trans ':' %} {{param.description}}{% endif %} |
|
78 |
<span class="type">({% if param.type %}{{ param.type }}{% else %}string{% endif %})</span> |
|
79 |
</li> |
|
80 |
{% endfor %} |
|
81 |
</ul> |
|
82 |
</li> |
|
83 |
{% endif %} |
|
84 |
{% if endpoint.body_schemas %} |
|
85 |
<li><span class="params-title">{% trans "Request body" %}</span> |
|
86 |
<div class="body-schemas"> |
|
87 |
{% render_body_schemas body_schemas=endpoint.body_schemas %} |
|
88 |
</div> |
|
89 |
</li> |
|
90 |
{% endif %} |
|
91 |
</ul> |
|
92 |
{% if endpoint.long_description %} |
|
93 |
<div class="long-description"> |
|
94 |
{{ endpoint.long_description }} |
|
95 |
</div> |
|
96 |
{% endif %} |
|
97 |
</li> |
|
67 |
{% include "passerelle/manage/endpoint.html" with endpoint=endpoint %} |
|
98 | 68 |
{% endfor %} |
99 | 69 |
</ul> |
100 | 70 |
{% endblock %} |
101 |
- |