haveapi 0.32.1 → 0.32.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -8
- data/README.md +3 -422
- data/Rakefile +17 -7
- data/benchmarks/performance_compare.rb +27 -6
- data/doc/cs/client-examples.md +535 -0
- data/doc/cs/create-client.md +118 -0
- data/doc/cs/json-schema.html +1182 -0
- data/doc/cs/protocol.md +595 -0
- data/doc/cs/readme.md +432 -0
- data/doc/cs/typed-input-validation.md +122 -0
- data/doc/{client-examples.md → en/client-examples.md} +20 -10
- data/doc/{documentation-ui.md → en/documentation-ui.md} +42 -6
- data/doc/{performance.md → en/performance.md} +11 -0
- data/doc/{protocol.md → en/protocol.md} +2 -2
- data/doc/en/readme.md +423 -0
- data/haveapi.gemspec +2 -2
- data/lib/haveapi/client_example.rb +18 -5
- data/lib/haveapi/client_examples/curl.rb +5 -5
- data/lib/haveapi/client_examples/dynamic_helpers.rb +10 -10
- data/lib/haveapi/client_examples/go_client.rb +1 -1
- data/lib/haveapi/client_examples/http.rb +4 -4
- data/lib/haveapi/client_examples/js_client.rb +10 -10
- data/lib/haveapi/client_examples/php_client.rb +24 -25
- data/lib/haveapi/client_examples/python_client.rb +11 -11
- data/lib/haveapi/client_examples/ruby_cli.rb +6 -9
- data/lib/haveapi/client_examples/ruby_client.rb +24 -16
- data/lib/haveapi/client_examples/rust_client.rb +1 -1
- data/lib/haveapi/client_examples/ts_generated_client.rb +1 -1
- data/lib/haveapi/documentation_context.rb +14 -2
- data/lib/haveapi/documentation_helpers.rb +92 -15
- data/lib/haveapi/documentation_locale.rb +65 -0
- data/lib/haveapi/documentation_oauth.rb +12 -12
- data/lib/haveapi/documentation_search.rb +5 -5
- data/lib/haveapi/documentation_validators.rb +43 -33
- data/lib/haveapi/locales/cs.yml +468 -0
- data/lib/haveapi/locales/en.yml +467 -0
- data/lib/haveapi/public/css/documentation.css +8 -4
- data/lib/haveapi/public/js/documentation.js +73 -20
- data/lib/haveapi/server.rb +32 -47
- data/lib/haveapi/shared_documentation_helpers.rb +53 -5
- data/lib/haveapi/version.rb +1 -1
- data/lib/haveapi/views/doc_layout.erb +3 -2
- data/lib/haveapi/views/doc_sidebars/create-client.erb +10 -10
- data/lib/haveapi/views/doc_sidebars/json-schema.erb +2 -2
- data/lib/haveapi/views/doc_sidebars/protocol.erb +24 -24
- data/lib/haveapi/views/documentation/search_form.erb +5 -4
- data/lib/haveapi/views/documentation/search_results.erb +6 -6
- data/lib/haveapi/views/index.erb +3 -3
- data/lib/haveapi/views/main_layout.erb +4 -4
- data/lib/haveapi/views/shared_documentation.erb +8 -5
- data/lib/haveapi/views/shared_sidebar.erb +11 -11
- data/lib/haveapi/views/version_page/auth_body.erb +7 -7
- data/lib/haveapi/views/version_page/client_auth.erb +1 -1
- data/lib/haveapi/views/version_page/client_example.erb +1 -1
- data/lib/haveapi/views/version_page/client_init.erb +1 -1
- data/lib/haveapi/views/version_page/client_overview.erb +7 -5
- data/lib/haveapi/views/version_page/example_panels.erb +5 -2
- data/lib/haveapi/views/version_page/resource_body.erb +24 -24
- data/lib/haveapi/views/version_page/resource_directory.erb +2 -2
- data/lib/haveapi/views/version_page/usage.erb +5 -5
- data/lib/haveapi/views/version_page.erb +11 -11
- data/lib/haveapi/views/version_sidebar/auth_nav.erb +2 -2
- data/lib/haveapi/views/version_sidebar/authentication_control.erb +8 -8
- data/lib/haveapi/views/version_sidebar/authentication_status.erb +1 -1
- data/lib/haveapi/views/version_sidebar/brand.erb +16 -5
- data/lib/haveapi/views/version_sidebar.erb +33 -18
- data/spec/client_examples/assets/documentation_test.cjs +107 -9
- data/spec/client_examples/comment_capture.rb +72 -0
- data/spec/client_examples/comments_spec.rb +162 -0
- data/spec/client_examples/context_spec.rb +18 -2
- data/spec/client_examples/detail_spec.rb +68 -0
- data/spec/documentation/client_overview_spec.rb +60 -0
- data/spec/documentation/example_selection_spec.rb +192 -0
- data/spec/documentation/language_settings_spec.rb +132 -0
- data/spec/documentation/locale_spec.rb +367 -0
- data/spec/documentation/navigation_spec.rb +61 -3
- data/spec/documentation/oauth_spec.rb +42 -0
- data/spec/documentation/search_index_routes_spec.rb +8 -4
- data/spec/documentation/search_spec.rb +1 -1
- data/spec/documentation/shared_pages_spec.rb +63 -2
- data/spec/documentation/validators_spec.rb +25 -0
- data/spec/extensions/exception_mailer_spec.rb +2 -2
- data/spec/packaging_spec.rb +68 -9
- data/spec/performance/event_baseline_spec.rb +1 -1
- data/spec/performance/source_versions_spec.rb +111 -2
- metadata +24 -11
- /data/doc/{create-client.md → en/create-client.md} +0 -0
- /data/doc/{documentation-oauth.md → en/documentation-oauth.md} +0 -0
- /data/doc/{json-schema.html → en/json-schema.html} +0 -0
- /data/doc/{typed-input-validation.md → en/typed-input-validation.md} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
2
|
+
<html lang="<%= escape_html(documentation_locale) %>">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title><%= escape_html(documentation_document_title) %></title>
|
|
7
7
|
<% if @documentation_ui %>
|
|
8
|
-
<script src="<%= escape_html(url('/js/documentation.js', false)) %>" data-highlighter-url="<%= escape_html(url('/js/highlighter.js', false)) %>"></script>
|
|
9
|
-
<link rel="stylesheet" href="<%= escape_html(url('/css/documentation.css', false)) %>">
|
|
8
|
+
<script src="<%= escape_html("#{url('/js/documentation.js', false)}?v=#{HaveAPI::DocumentationHelpers::ASSET_DIGESTS.fetch('js/documentation.js')}") %>" data-highlighter-url="<%= escape_html(url('/js/highlighter.js', false)) %>"></script>
|
|
9
|
+
<link rel="stylesheet" href="<%= escape_html("#{url('/css/documentation.css', false)}?v=#{HaveAPI::DocumentationHelpers::ASSET_DIGESTS.fetch('css/documentation.css')}") %>">
|
|
10
10
|
<% else %>
|
|
11
11
|
|
|
12
12
|
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
|
|
87
87
|
<footer class="docs-footer">
|
|
88
88
|
<div>
|
|
89
|
-
<p class="text-right"
|
|
89
|
+
<p class="text-right"><%= escape_html(documentation_t('footer.generated')) %> <a href="https://github.com/vpsfreecz/haveapi">HaveAPI</a> v<%= version %></p>
|
|
90
90
|
</div>
|
|
91
91
|
</footer>
|
|
92
92
|
</div>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<% if @documentation_page == 'guide' %>
|
|
2
|
-
<nav aria-label="
|
|
2
|
+
<nav class="docs-breadcrumb" aria-label="<%= escape_html(documentation_t('accessibility.breadcrumb')) %>">
|
|
3
3
|
<ol>
|
|
4
|
-
<li><a href="<%= escape_html(shared_documentation_url) %>"
|
|
5
|
-
<% unless
|
|
6
|
-
<li><a href="<%= escape_html(shared_documentation_url('doc')) %>"
|
|
4
|
+
<li><a href="<%= escape_html(shared_documentation_url) %>"><%= escape_html(documentation_t('labels.api_versions')) %></a></li>
|
|
5
|
+
<% unless @documentation_article_id == 'readme' %>
|
|
6
|
+
<li><a href="<%= escape_html(shared_documentation_url('doc')) %>"><%= escape_html(documentation_t('articles.readme')) %></a></li>
|
|
7
7
|
<% end %>
|
|
8
8
|
<li aria-current="page"><%= escape_html(title) %></li>
|
|
9
9
|
</ol>
|
|
10
10
|
</nav>
|
|
11
11
|
<% end %>
|
|
12
|
-
|
|
12
|
+
<% if @documentation_article_locale && @documentation_article_locale != documentation_locale %>
|
|
13
|
+
<p class="docs-article-fallback"><%= escape_html(documentation_t('article.fallback')) %></p>
|
|
14
|
+
<% end %>
|
|
15
|
+
<div lang="<%= escape_html(@documentation_article_locale || documentation_locale) %>"><%= content %></div>
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
<% if (search_options = documentation_search_form_options(id: 'docs-search-sidebar')) %>
|
|
3
3
|
<%= erb :'documentation/search_form', locals: search_options %>
|
|
4
4
|
<% end %>
|
|
5
|
-
<nav aria-label="
|
|
5
|
+
<nav aria-label="<%= escape_html(documentation_t('accessibility.pages')) %>">
|
|
6
6
|
<ul>
|
|
7
|
-
<li><a href="<%= escape_html(shared_documentation_url) %>"<% if @documentation_page == 'versions' %> aria-current="page"<% end
|
|
7
|
+
<li><a href="<%= escape_html(shared_documentation_url) %>"<% if @documentation_page == 'versions' %> aria-current="page"<% end %>><%= escape_html(documentation_t('labels.api_versions')) %></a></li>
|
|
8
8
|
<% if (reference = shared_documentation_reference_url) %>
|
|
9
|
-
<li><a href="<%= escape_html(reference) %>"
|
|
10
|
-
<li><a href="<%= escape_html(shared_documentation_reference_url(page: 'resources')) %>"
|
|
9
|
+
<li><a href="<%= escape_html(reference) %>"><%= escape_html(documentation_t('labels.api_reference')) %></a></li>
|
|
10
|
+
<li><a href="<%= escape_html(shared_documentation_reference_url(page: 'resources')) %>"><%= escape_html(documentation_t('labels.resources')) %></a></li>
|
|
11
11
|
<% end %>
|
|
12
12
|
</ul>
|
|
13
13
|
</nav>
|
|
14
14
|
<% if @documentation_toc && !@documentation_toc.empty? %>
|
|
15
|
-
<nav aria-label="
|
|
15
|
+
<nav aria-label="<%= escape_html(documentation_t('labels.contents')) %>" data-action-nav><%= @documentation_toc %></nav>
|
|
16
16
|
<% end %>
|
|
17
|
-
<nav aria-label="
|
|
18
|
-
<h2><a href="<%= escape_html(shared_documentation_url('doc')) %>"
|
|
17
|
+
<nav aria-label="<%= escape_html(documentation_t('accessibility.shared')) %>">
|
|
18
|
+
<h2><a href="<%= escape_html(shared_documentation_url('doc')) %>"><%= escape_html(documentation_t('articles.readme')) %></a></h2>
|
|
19
19
|
<ul>
|
|
20
|
-
<li><a href="<%= escape_html(shared_documentation_url('doc/protocol')) %>"
|
|
21
|
-
<li><a href="<%= escape_html(shared_documentation_url('doc/json-schema')) %>"
|
|
22
|
-
<li><a href="<%= escape_html(shared_documentation_url('doc/create-client')) %>"
|
|
23
|
-
<li><a href="<%= escape_html(shared_documentation_url('doc/client-examples')) %>"
|
|
20
|
+
<li><a href="<%= escape_html(shared_documentation_url('doc/protocol')) %>"><%= escape_html(documentation_t('articles.protocol')) %></a></li>
|
|
21
|
+
<li><a href="<%= escape_html(shared_documentation_url('doc/json-schema')) %>"><%= escape_html(documentation_t('articles.json_schema')) %></a></li>
|
|
22
|
+
<li><a href="<%= escape_html(shared_documentation_url('doc/create-client')) %>"><%= escape_html(documentation_t('articles.create_client')) %></a></li>
|
|
23
|
+
<li><a href="<%= escape_html(shared_documentation_url('doc/client-examples')) %>"><%= escape_html(documentation_t('articles.client_examples')) %></a></li>
|
|
24
24
|
</ul>
|
|
25
25
|
</nav>
|
|
@@ -6,31 +6,31 @@
|
|
|
6
6
|
|
|
7
7
|
<% if name == :token %>
|
|
8
8
|
<dl class="docs-metadata">
|
|
9
|
-
<dt
|
|
9
|
+
<dt><%= escape_html(documentation_t('labels.http_header')) %></dt>
|
|
10
10
|
<dd><%= info[:http_header] %></dd>
|
|
11
|
-
<dt
|
|
11
|
+
<dt><%= escape_html(documentation_t('labels.query_parameter')) %></dt>
|
|
12
12
|
<dd><%= info[:query_parameter] %></dd>
|
|
13
13
|
</dl>
|
|
14
14
|
<% elsif name == :oauth2 %>
|
|
15
15
|
<dl class="docs-metadata">
|
|
16
|
-
<dt
|
|
16
|
+
<dt><%= escape_html(documentation_t('labels.authorize_url')) %></dt>
|
|
17
17
|
<dd><%= info[:authorize_url] %></dd>
|
|
18
|
-
<dt
|
|
18
|
+
<dt><%= escape_html(documentation_t('labels.token_url')) %></dt>
|
|
19
19
|
<dd><%= info[:token_url] %></dd>
|
|
20
|
-
<dt
|
|
20
|
+
<dt><%= escape_html(documentation_t('labels.revoke_url')) %></dt>
|
|
21
21
|
<dd><%= info[:revoke_url] %></dd>
|
|
22
22
|
</dl>
|
|
23
23
|
<% end %>
|
|
24
24
|
|
|
25
25
|
<% unless (info[:resources] || {}).empty? %>
|
|
26
26
|
<% resources_target = documentation_reference_anchor(authentication: name, section: :resources) %>
|
|
27
|
-
<h2 id="<%= escape_html(resources_target) %>"
|
|
27
|
+
<h2 id="<%= escape_html(resources_target) %>"><%= escape_html(documentation_t('labels.resources')) %><%= documentation_permalink(resources_target, documentation_t('labels.resources')) %></h2>
|
|
28
28
|
<% sort_hash(info[:resources]).each do |resource, desc| %>
|
|
29
29
|
<%= erb :"version_page/resource_body", locals: {resource: resource.to_s, info: desc, path: [], prefix: 'root', name: nil, authentication_resource: true, authentication_provider: name} %>
|
|
30
30
|
<% end %>
|
|
31
31
|
<% end %>
|
|
32
32
|
|
|
33
33
|
<% examples_target = documentation_reference_anchor(authentication: name, section: :examples) %>
|
|
34
|
-
<h3 id="<%= escape_html(examples_target) %>"
|
|
34
|
+
<h3 id="<%= escape_html(examples_target) %>"><%= escape_html(documentation_t('labels.examples')) %><%= documentation_permalink(examples_target, documentation_t('labels.examples')) %></h3>
|
|
35
35
|
<%= erb :'version_page/example_panels', locals: {baseid: "auth-#{name}", kind: :auth, changes: {auth_method: name, auth_description: info}} %>
|
|
36
36
|
</section>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<h4><%= escape_html(client
|
|
1
|
+
<h4><%= escape_html(documentation_client_label(client)) %></h4>
|
|
2
2
|
<%= erb :"version_page/client_result", locals: {client: client, result: result} %>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<h6><%= escape_html(client
|
|
1
|
+
<h6><%= escape_html(documentation_client_label(client)) %></h6>
|
|
2
2
|
<%= erb :"version_page/client_result", locals: {client: client, result: result} %>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<h4><%= escape_html(client
|
|
1
|
+
<h4><%= escape_html(documentation_client_label(client)) %></h4>
|
|
2
2
|
<%= erb :"version_page/client_result", locals: {client: client, result: result} %>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<% library_clients = clients.select { |client| library_paths.has_key?(client.id) || generator_paths.has_key?(client.id) } %>
|
|
20
20
|
<% groups = library_clients.group_by { |client| client.language == 'cli' && library_clients.any? { |candidate| candidate.language == 'ruby' } ? 'ruby' : client.language } %>
|
|
21
21
|
<section id="client-libraries">
|
|
22
|
-
<h2
|
|
22
|
+
<h2><%= escape_html(documentation_t('labels.client_libraries')) %><%= documentation_permalink('client-libraries', documentation_t('labels.client_libraries')) %></h2>
|
|
23
23
|
<ul>
|
|
24
24
|
<% groups.each_value do |group| %>
|
|
25
25
|
<% variants = group.length > 1 || group.first.variant %>
|
|
@@ -27,14 +27,16 @@
|
|
|
27
27
|
<li>
|
|
28
28
|
<% if variants %><%= escape_html(group.first.language_label) %> (<% end %><% group.each_with_index do |client, index|
|
|
29
29
|
path = library_paths[client.id] || generator_paths.fetch(client.id)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
variant = documentation_client_variant(client)
|
|
31
|
+
overview_variant = variant == client.variant ? variant&.downcase&.sub(/\Aapi\b/, 'API') : variant&.sub(/\A./) { |letter| letter.downcase }
|
|
32
|
+
label = variants ? (overview_variant || (client.language == 'ruby' ? documentation_t('client.library') : client.language_label)) : client.language_label
|
|
33
|
+
separator = index.zero? ? '' : (index == group.length - 1 ? documentation_t('client.and') : ', ')
|
|
34
|
+
%><%= escape_html(separator) %><a href="<%= escape_html("https://github.com/vpsfreecz/haveapi/tree/master/#{path}") %>"><%= escape_html(label) %></a><% end %><% if variants %>)<% end %><% profiles.each do |profile| %>: <code><%= escape_html(profile.package_name) %></code><% unless profile.package_version.nil? %> <%= escape_html(profile.package_version) %><% end %><% end %>
|
|
33
35
|
</li>
|
|
34
36
|
<% end %>
|
|
35
37
|
</ul>
|
|
36
38
|
<% request_formats = clients.select { |client| %w[curl http].include?(client.language) } %>
|
|
37
39
|
<% unless request_formats.empty? %>
|
|
38
|
-
<p><% request_formats.each_with_index do |client, index| %><%= index.zero? ? '' : '
|
|
40
|
+
<p><% request_formats.each_with_index do |client, index| %><%= escape_html(index.zero? ? '' : documentation_t('client.and')) %><a href="<%= escape_html(documentation_url(page: 'resources')) %>"><%= escape_html(client.label) %></a><% end %> <%= escape_html(documentation_t('client.request_examples')) %></p>
|
|
39
41
|
<% end %>
|
|
40
42
|
</section>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<% legacy_baseid ||= nil %>
|
|
2
2
|
<% variants = documentation_example_variants(kind, **changes) %>
|
|
3
3
|
<% details_by_client = variants.group_by { |client, _detail, _result| client.id }.transform_values { |items| items.map { |_client, detail, _result| detail.to_s } } %>
|
|
4
|
+
<% selection = documentation_example_selection %>
|
|
5
|
+
<% selected_details = selection[:client] && details_by_client[selection[:client].id] %>
|
|
4
6
|
<% if legacy_baseid %><%= documentation_reference_alias("#{legacy_baseid}-examples") %><% end %>
|
|
5
7
|
<div class="docs-example" data-example data-example-details="<%= escape_html(JSON.generate(details_by_client)) %>" id="<%= escape_html("#{baseid}-examples") %>">
|
|
6
8
|
<% variants.each do |client, detail, result| %>
|
|
@@ -10,9 +12,10 @@
|
|
|
10
12
|
<%= documentation_reference_alias("#{legacy_baseid || baseid}-#{client.id}-thorough") %>
|
|
11
13
|
<% if legacy_baseid %><%= documentation_reference_alias("#{baseid}-#{client.id}-thorough") %><% end %>
|
|
12
14
|
<% end %>
|
|
13
|
-
<details data-example-panel data-client="<%= escape_html(client.id) %>" data-language="<%= escape_html(client.language) %>" data-variant="<%= escape_html(client.variant) %>" data-detail="<%= detail %>" id="<%= escape_html("#{baseid}-#{client.id}#{suffix}") %>"<% if detail ==
|
|
14
|
-
<summary><%= escape_html(client
|
|
15
|
+
<details data-example-panel data-client="<%= escape_html(client.id) %>" data-language="<%= escape_html(client.language) %>" data-variant="<%= escape_html(client.variant) %>" data-detail="<%= detail %>" id="<%= escape_html("#{baseid}-#{client.id}#{suffix}") %>"<% if selection[:client] == client && detail.to_s == documentation_example_detail(details_by_client[client.id]) %> open<% end %>>
|
|
16
|
+
<summary><%= escape_html(documentation_client_label(client)) %> · <%= escape_html(documentation_t(detail == :simple ? 'labels.simple' : 'labels.thorough')) %></summary>
|
|
15
17
|
<%= erb :'version_page/client_result', locals: {client: client, result: result} %>
|
|
16
18
|
</details>
|
|
17
19
|
<% end %>
|
|
20
|
+
<% unless selected_details %><p class="docs-notice" data-example-unavailable><%= escape_html(documentation_t('browser.example_unavailable')) %></p><% end %>
|
|
18
21
|
</div>
|
|
@@ -20,34 +20,34 @@
|
|
|
20
20
|
<<%= action_heading %>><%= escape_html(action.capitalize) %><%= documentation_permalink(action_target, action.to_s.capitalize) %></<%= action_heading %>>
|
|
21
21
|
<div class="action">
|
|
22
22
|
<dl class="docs-metadata">
|
|
23
|
-
<dt
|
|
24
|
-
<dt
|
|
25
|
-
<dt
|
|
26
|
-
<dt
|
|
27
|
-
<dt
|
|
28
|
-
<dt
|
|
23
|
+
<dt><%= escape_html(documentation_t('labels.path')) %></dt><dd><%= info[:method] %> <%= info[:path] %></dd>
|
|
24
|
+
<dt><%= escape_html(documentation_t('labels.description')) %></dt><dd><%= info[:description] %></dd>
|
|
25
|
+
<dt><%= escape_html(documentation_t('labels.authentication_required')) %></dt><dd><%= escape_html(info[:auth] ? documentation_t('labels.yes') : documentation_t('labels.no')) %></dd>
|
|
26
|
+
<dt><%= escape_html(documentation_t('labels.scope')) %></dt><dd><%= info[:scope] %></dd>
|
|
27
|
+
<dt><%= escape_html(documentation_t('labels.aliases')) %></dt><dd><%= info[:aliases].join(', ') %></dd>
|
|
28
|
+
<dt><%= escape_html(documentation_t('labels.blocking')) %></dt><dd><%= escape_html(info[:blocking] ? documentation_t('labels.yes') : documentation_t('labels.no')) %></dd>
|
|
29
29
|
</dl>
|
|
30
|
-
<<%= parameter_heading %> id="<%= escape_html(sections[0][:id]) %>"
|
|
30
|
+
<<%= parameter_heading %> id="<%= escape_html(sections[0][:id]) %>"><%= escape_html(documentation_t('labels.input_parameters')) %><%= documentation_permalink(sections[0][:id], documentation_t('labels.input_parameters')) %></<%= parameter_heading %>>
|
|
31
31
|
<% if info[:input][:parameters].empty? %>
|
|
32
|
-
<p
|
|
32
|
+
<p><%= escape_html(documentation_t('labels.no_parameters')) %></p>
|
|
33
33
|
<% else %>
|
|
34
34
|
<dl class="docs-metadata">
|
|
35
|
-
<dt
|
|
36
|
-
<dt
|
|
35
|
+
<dt><%= escape_html(documentation_t('labels.layout')) %></dt><dd><%= info[:input][:layout] %></dd>
|
|
36
|
+
<dt><%= escape_html(documentation_t('labels.namespace')) %></dt><dd><%= info[:input][:namespace] %></dd>
|
|
37
37
|
</dl>
|
|
38
|
-
<div class="docs-table-scroll" tabindex="0" role="region" aria-label="
|
|
38
|
+
<div class="docs-table-scroll" tabindex="0" role="region" aria-label="<%= escape_html(documentation_t('labels.input_parameters')) %>">
|
|
39
39
|
<table class="docs-input-parameters">
|
|
40
|
-
<thead><tr><th
|
|
40
|
+
<thead><tr><th><%= escape_html(documentation_t('labels.parameter')) %></th><th><%= escape_html(documentation_t('labels.type')) %></th><th><%= escape_html(documentation_t('labels.required')) %></th><th><%= escape_html(documentation_t('labels.details')) %></th></tr></thead>
|
|
41
41
|
<tbody>
|
|
42
42
|
<% info[:input][:parameters].each do |param, parameter| %>
|
|
43
43
|
<tr id="<%= escape_html(documentation_parameter_anchor(resource_path: resource_path, action_name: action, direction: :input, parameter_name: param, authentication: authentication_provider)) %>">
|
|
44
44
|
<td class="docs-param-name"><code><%= escape_html(param) %></code><% if parameter[:label].to_s != param.to_s %><div><%= parameter[:label] %></div><% end %></td>
|
|
45
45
|
<td><%= format_param_type(parameter) %></td>
|
|
46
|
-
<td><%= parameter[:required] ? 'yes' : 'no' %></td>
|
|
46
|
+
<td><%= escape_html(parameter[:required] ? documentation_t('labels.yes') : documentation_t('labels.no')) %></td>
|
|
47
47
|
<td class="docs-param-details">
|
|
48
48
|
<% if parameter[:description] %><p><%= escape_html(parameter[:description]) %></p><% end %>
|
|
49
49
|
<% if parameter.has_key?(:default) && parameter[:default] != :_nil %>
|
|
50
|
-
<p><strong
|
|
50
|
+
<p><strong><%= escape_html(documentation_t('labels.default')) %></strong> <code><%= escape_html(parameter[:default].nil? ? 'null' : parameter[:default] == '' ? '""' : parameter[:default]) %></code></p>
|
|
51
51
|
<% end %>
|
|
52
52
|
<%= format_validators(parameter[:validators], type: parameter[:type]) %>
|
|
53
53
|
</td>
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
</table>
|
|
58
58
|
</div>
|
|
59
59
|
<% end %>
|
|
60
|
-
<<%= parameter_heading %> id="<%= escape_html(sections[1][:id]) %>"
|
|
60
|
+
<<%= parameter_heading %> id="<%= escape_html(sections[1][:id]) %>"><%= escape_html(documentation_t('labels.output_parameters')) %><%= documentation_permalink(sections[1][:id], documentation_t('labels.output_parameters')) %></<%= parameter_heading %>>
|
|
61
61
|
<% if info[:output][:parameters].empty? && info[:output][:format].nil? %>
|
|
62
|
-
<p
|
|
62
|
+
<p><%= escape_html(documentation_t('labels.no_parameters')) %></p>
|
|
63
63
|
<% else %>
|
|
64
64
|
<dl class="docs-metadata">
|
|
65
|
-
<dt
|
|
66
|
-
<dt
|
|
65
|
+
<dt><%= escape_html(documentation_t('labels.layout')) %></dt><dd><%= info[:output][:layout] %></dd>
|
|
66
|
+
<dt><%= escape_html(documentation_t('labels.namespace')) %></dt><dd><%= info[:output][:namespace] %></dd>
|
|
67
67
|
</dl>
|
|
68
|
-
<div class="docs-table-scroll" tabindex="0" role="region" aria-label="
|
|
68
|
+
<div class="docs-table-scroll" tabindex="0" role="region" aria-label="<%= escape_html(documentation_t('labels.output_parameters')) %>">
|
|
69
69
|
<table class="docs-output-parameters">
|
|
70
|
-
<thead><tr><th
|
|
70
|
+
<thead><tr><th><%= escape_html(documentation_t('labels.parameter')) %></th><th><%= escape_html(documentation_t('labels.type')) %></th><th><%= escape_html(documentation_t('labels.description')) %></th></tr></thead>
|
|
71
71
|
<tbody>
|
|
72
72
|
<% info[:output][:parameters].each do |param, parameter| %>
|
|
73
73
|
<tr id="<%= escape_html(documentation_parameter_anchor(resource_path: resource_path, action_name: action, direction: :output, parameter_name: param, authentication: authentication_provider)) %>">
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
</div>
|
|
82
82
|
<% end %>
|
|
83
83
|
<% unless info[:examples].empty? %>
|
|
84
|
-
<<%= parameter_heading %> id="<%= escape_html(sections[2][:id]) %>"
|
|
85
|
-
<p
|
|
84
|
+
<<%= parameter_heading %> id="<%= escape_html(sections[2][:id]) %>"><%= escape_html(documentation_t('labels.examples')) %><%= documentation_permalink(sections[2][:id], documentation_t('labels.examples')) %></<%= parameter_heading %>>
|
|
85
|
+
<p><%= escape_html(documentation_t('example.initialized')) %> <%= escape_html(documentation_t('example.see')) %> <a href="<%= escape_html(documentation_url(anchor: 'initialization')) %>"><%= escape_html(documentation_t('example.initialization')) %></a> <%= escape_html(documentation_t('example.and')) %> <a href="<%= escape_html(documentation_url(page: 'authentication')) %>"><%= escape_html(documentation_t('example.authentication')) %></a>.</p>
|
|
86
86
|
<% info[:examples].each_with_index do |example, index| %>
|
|
87
|
-
<% example_title = example[:title].empty? ?
|
|
87
|
+
<% example_title = example[:title].empty? ? documentation_t('example.title', index: index) : example[:title] %>
|
|
88
88
|
<% example_target = documentation_reference_anchor(resource_path: resource_path, action_name: action, authentication: authentication_provider, section: :example_title, example_index: index) %>
|
|
89
89
|
<h4 id="<%= escape_html(example_target) %>"><%= escape_html(example_title) %><%= documentation_permalink(example_target, example_title) %></h4>
|
|
90
90
|
<p><%= example[:comment] %></p>
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
</div>
|
|
100
100
|
<% unless info[:resources].empty? %>
|
|
101
101
|
<% children_target = documentation_reference_anchor(resource_path: resource_path, authentication: authentication_provider, section: :children) %>
|
|
102
|
-
<h2 id="<%= escape_html(children_target) %>"
|
|
102
|
+
<h2 id="<%= escape_html(children_target) %>"><%= escape_html(documentation_t('labels.subresources')) %><%= documentation_permalink(children_target, documentation_t('labels.subresources')) %></h2>
|
|
103
103
|
<% if authentication_resource %>
|
|
104
104
|
<% sort_hash(info[:resources]).each do |child, child_info| %>
|
|
105
105
|
<%= erb :'version_page/resource_body', locals: {resource: child, info: child_info, path: resource_path, prefix: "#{prefix}-#{resource}", name: "#{name} / #{child.humanize}", authentication_resource: true, authentication_provider: authentication_provider} %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<section id="resources">
|
|
2
|
-
<h1
|
|
2
|
+
<h1><%= escape_html(documentation_t('labels.resources')) %><%= documentation_permalink('resources', documentation_t('labels.resources')) %></h1>
|
|
3
3
|
<% if documentation_search_query.empty? %>
|
|
4
|
-
<nav aria-label="
|
|
4
|
+
<nav aria-label="<%= escape_html(documentation_t('labels.resources')) %>" data-resource-nav>
|
|
5
5
|
<ul class="docs-resource-list docs-resource-directory">
|
|
6
6
|
<% sort_hash(@help[:resources]).each do |resource, info| %>
|
|
7
7
|
<%= erb :'version_sidebar/resource_nav', locals: {resource: resource, info: info, path: []} %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<section aria-labelledby="reference-usage">
|
|
2
|
-
<h2 id="reference-usage"
|
|
3
|
-
<p
|
|
4
|
-
<p
|
|
5
|
-
<p
|
|
6
|
-
<p
|
|
2
|
+
<h2 id="reference-usage"><%= escape_html(documentation_t('labels.usage')) %><%= documentation_permalink('reference-usage', documentation_t('labels.usage')) %></h2>
|
|
3
|
+
<p><%= escape_html(documentation_t('usage.choose')) %></p>
|
|
4
|
+
<p><%= escape_html(documentation_t('usage.start')) %> <a href="#initialization"><%= escape_html(documentation_t('labels.initialization')) %></a> <%= escape_html(documentation_t('usage.below')) %> <a href="<%= escape_html(documentation_url(page: 'authentication')) %>"><%= escape_html(documentation_t('labels.authentication')) %></a> <%= escape_html(documentation_t('usage.credentials')) %> <a href="<%= escape_html(documentation_url(page: 'resources')) %>"><%= escape_html(documentation_t('labels.resources')) %></a> <%= escape_html(documentation_t('usage.browse')) %></p>
|
|
5
|
+
<p><%= escape_html(documentation_t('usage.search')) %></p>
|
|
6
|
+
<p><%= escape_html(documentation_t('usage.signed_out')) %><% if documentation_account_context&.dig(:controls) %> <%= escape_html(documentation_t('usage.sign_in')) %><% end %></p>
|
|
7
7
|
</section>
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
<% if @documentation_page == 'overview' %>
|
|
2
2
|
<h1 id="api">API v<%= escape_html(@v) %><%= documentation_permalink('api', "API v#{@v}") %></h1>
|
|
3
3
|
<%= erb :'version_page/usage' %>
|
|
4
|
-
<p
|
|
4
|
+
<p><%= escape_html(documentation_t('overview.api_address')) %> <code><%= escape_html("#{base_url}#{root}") %></code>.</p>
|
|
5
5
|
<%= erb :'version_page/client_overview' %>
|
|
6
|
-
<p
|
|
6
|
+
<p><%= escape_html(documentation_t('overview.versions', version: @v)) %></p>
|
|
7
7
|
<section id="initialization" data-doc-section>
|
|
8
|
-
<h2
|
|
9
|
-
<p
|
|
8
|
+
<h2><%= escape_html(documentation_t('labels.initialization')) %><%= documentation_permalink('initialization', documentation_t('labels.initialization')) %></h2>
|
|
9
|
+
<p><%= escape_html(documentation_t('overview.initialize_before')) %> <a href="<%= escape_html(documentation_url(page: 'authentication')) %>"><%= escape_html(documentation_t('overview.authentication_link')) %></a> <%= escape_html(documentation_t('overview.initialize_after')) %></p>
|
|
10
10
|
<%= erb :'version_page/example_panels', locals: {baseid: 'init', kind: :init, changes: {}} %>
|
|
11
11
|
</section>
|
|
12
|
-
<p><a href="<%= escape_html(documentation_url(page: 'resources')) %>" data-resource-directory-link
|
|
12
|
+
<p><a href="<%= escape_html(documentation_url(page: 'resources')) %>" data-resource-directory-link><%= escape_html(documentation_t('overview.browse_link')) %></a> <%= escape_html(documentation_t('overview.browse_after')) %></p>
|
|
13
13
|
<% elsif @documentation_page == 'resources' %>
|
|
14
14
|
<%= erb :'version_page/resource_directory' %>
|
|
15
15
|
<% elsif @documentation_page == 'authentication' %>
|
|
16
|
-
<nav aria-label="
|
|
17
|
-
<h1 id="auth"
|
|
18
|
-
<p
|
|
19
|
-
<% if @help[:authentication].empty? %><p
|
|
16
|
+
<nav class="docs-breadcrumb" aria-label="<%= escape_html(documentation_t('accessibility.breadcrumb')) %>"><ol><li><a href="<%= escape_html(documentation_url) %>"><%= escape_html(documentation_t('labels.overview')) %></a></li><li aria-current="page"><%= escape_html(documentation_t('labels.authentication')) %></li></ol></nav>
|
|
17
|
+
<h1 id="auth"><%= escape_html(documentation_t('labels.authentication')) %><%= documentation_permalink('auth', documentation_t('labels.authentication')) %></h1>
|
|
18
|
+
<p><%= escape_html(documentation_t('authentication.initialize_before')) %> <a href="<%= escape_html(documentation_url(anchor: 'initialization')) %>"><%= escape_html(documentation_t('authentication.overview_link')) %></a><%= escape_html(documentation_t('authentication.initialize_after')) %></p>
|
|
19
|
+
<% if @help[:authentication].empty? %><p><%= escape_html(documentation_t('authentication.disabled')) %></p><% end %>
|
|
20
20
|
<% @help[:authentication].each do |name, info| %>
|
|
21
21
|
<%= erb :'version_page/auth_body', locals: {name: name, info: info} %>
|
|
22
22
|
<% end %>
|
|
23
23
|
<% else %>
|
|
24
24
|
<% entry = @documentation_resource %>
|
|
25
|
-
<nav aria-label="
|
|
25
|
+
<nav class="docs-breadcrumb" aria-label="<%= escape_html(documentation_t('accessibility.breadcrumb')) %>" data-resource-breadcrumbs>
|
|
26
26
|
<ol>
|
|
27
|
-
<li><a href="<%= escape_html(documentation_url(page: 'resources')) %>"
|
|
27
|
+
<li><a href="<%= escape_html(documentation_url(page: 'resources')) %>"><%= escape_html(documentation_t('labels.resources')) %></a></li>
|
|
28
28
|
<% entry[:path].each_with_index do |part, index| %>
|
|
29
29
|
<% if index == entry[:path].length - 1 %>
|
|
30
30
|
<li aria-current="page"><%= escape_html(part.humanize) %></li>
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
<a data-doc-primary href="#<%= escape_html(target) %>"><%= escape_html(method.to_s.humanize) %></a>
|
|
6
6
|
<ul data-doc-subnav="<%= escape_html(target) %>">
|
|
7
7
|
<% unless (info[:resources] || {}).empty? %>
|
|
8
|
-
<li><a data-doc-subsection href="#<%= escape_html(documentation_reference_anchor(authentication: method, section: :resources)) %>"
|
|
8
|
+
<li><a data-doc-subsection href="#<%= escape_html(documentation_reference_anchor(authentication: method, section: :resources)) %>"><%= escape_html(documentation_t('labels.resources')) %></a>
|
|
9
9
|
<%= erb :'version_sidebar/auth_resource_nav', locals: {resources: info[:resources], path: [], authentication_provider: method} %>
|
|
10
10
|
</li>
|
|
11
11
|
<% end %>
|
|
12
|
-
<li><a data-doc-subsection href="#<%= escape_html(documentation_reference_anchor(authentication: method, section: :examples)) %>"
|
|
12
|
+
<li><a data-doc-subsection href="#<%= escape_html(documentation_reference_anchor(authentication: method, section: :examples)) %>"><%= escape_html(documentation_t('labels.examples')) %></a></li>
|
|
13
13
|
</ul>
|
|
14
14
|
</li>
|
|
15
15
|
<% end %>
|
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
<div class="authentication">
|
|
4
4
|
<% if account[:user] && controls[:signed_in] %>
|
|
5
5
|
<div class="docs-account-content">
|
|
6
|
-
<span class="sr-only"
|
|
7
|
-
<form method="post" action="<%= escape_html(controls[:logout_url]) %>">
|
|
8
|
-
<input type="hidden" name="csrf" value="<%= escape_html(controls[:csrf_token]) %>">
|
|
9
|
-
<button type="submit">Sign out</button>
|
|
10
|
-
</form>
|
|
6
|
+
<span class="sr-only"><%= escape_html(documentation_t('labels.account')) %> </span><span class="docs-identity"><%= escape_html(account[:user].login) %></span>
|
|
11
7
|
<% if controls[:switch_user] %>
|
|
12
8
|
<form method="post" action="<%= escape_html(controls[:logout_url]) %>">
|
|
13
9
|
<input type="hidden" name="csrf" value="<%= escape_html(controls[:csrf_token]) %>">
|
|
14
10
|
<input type="hidden" name="switch_user" value="1">
|
|
15
|
-
<button type="submit"
|
|
11
|
+
<button type="submit"><%= escape_html(documentation_t('labels.switch_user')) %></button>
|
|
16
12
|
</form>
|
|
17
13
|
<% end %>
|
|
14
|
+
<form method="post" action="<%= escape_html(controls[:logout_url]) %>">
|
|
15
|
+
<input type="hidden" name="csrf" value="<%= escape_html(controls[:csrf_token]) %>">
|
|
16
|
+
<button type="submit"><%= escape_html(documentation_t('labels.sign_out')) %></button>
|
|
17
|
+
</form>
|
|
18
18
|
</div>
|
|
19
19
|
<% else %>
|
|
20
|
-
<a class="docs-sign-in" href="<%= escape_html(controls[:login_url]) %>" data-documentation-login aria-label="
|
|
20
|
+
<a class="docs-sign-in" href="<%= escape_html(controls[:login_url]) %>" data-documentation-login aria-label="<%= escape_html(documentation_t('labels.sign_in')) %>" title="<%= escape_html(documentation_t('labels.sign_in')) %>">
|
|
21
21
|
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="8" r="4"></circle><path d="M4 21v-2a8 8 0 0 1 16 0v2"></path></svg>
|
|
22
|
-
<span
|
|
22
|
+
<span><%= escape_html(documentation_t('labels.sign_in')) %></span>
|
|
23
23
|
</a>
|
|
24
24
|
<% end %>
|
|
25
25
|
</div>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<% controls = account[:controls] %>
|
|
2
|
-
<p class="docs-visibility-note"><%= account[:user] ? '
|
|
2
|
+
<p class="docs-visibility-note"><%= escape_html(documentation_t(account[:user] ? 'visibility.account' : 'visibility.all')) %></p>
|
|
3
3
|
<% if controls && controls[:message] %><p role="status"><%= escape_html(controls[:message]) %></p><% end %>
|
|
@@ -2,14 +2,25 @@
|
|
|
2
2
|
<a href="<%= escape_html(url(root, false)) %>"><%= escape_html(documentation_identity_name) %></a>
|
|
3
3
|
<% if @v %><small class="docs-api-version">API v<%= escape_html(@v) %></small><% end %>
|
|
4
4
|
<details data-documentation-menu>
|
|
5
|
-
<summary aria-label="
|
|
5
|
+
<summary aria-label="<%= escape_html(documentation_t('labels.settings')) %>" title="<%= escape_html(documentation_t('labels.settings')) %>">
|
|
6
6
|
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="2"><path d="m9.5 3-.5 2.1-1.7 1-2.1-.6-2.5 4.3 1.6 1.5v2l-1.6 1.5 2.5 4.3 2.1-.6 1.7 1 .5 2.1h5l.5-2.1 1.7-1 2.1.6 2.5-4.3-1.6-1.5v-2l1.6-1.5-2.5-4.3-2.1.6-1.7-1L14.5 3Z"></path><circle cx="12" cy="12" r="3"></circle></svg>
|
|
7
7
|
</summary>
|
|
8
8
|
<div data-documentation-menu-content>
|
|
9
|
-
<
|
|
9
|
+
<form data-documentation-language method="get" action="<%= escape_html(request.path) %>">
|
|
10
|
+
<% documentation_language_parameters.each do |key, value| %>
|
|
11
|
+
<input type="hidden" name="<%= escape_html(key) %>" value="<%= escape_html(value) %>">
|
|
12
|
+
<% end %>
|
|
13
|
+
<label for="docs-language"><%= escape_html(documentation_t('labels.language')) %></label>
|
|
14
|
+
<select id="docs-language" name="doc_lang">
|
|
15
|
+
<option value="en"<% if documentation_locale == 'en' %> selected<% end %>>English</option>
|
|
16
|
+
<option value="cs"<% if documentation_locale == 'cs' %> selected<% end %>>Česky</option>
|
|
17
|
+
</select>
|
|
18
|
+
<button type="submit" data-documentation-language-submit><%= escape_html(documentation_t('labels.apply_language')) %></button>
|
|
19
|
+
</form>
|
|
20
|
+
<span id="docs-theme-label" class="docs-theme-label"><%= escape_html(documentation_t('labels.theme')) %></span>
|
|
10
21
|
<div class="docs-theme-choices" role="group" aria-labelledby="docs-theme-label">
|
|
11
|
-
<% {auto: '
|
|
12
|
-
<button type="button" data-theme-choice="<%= choice %>" aria-label="<%= label %>" title="<%= label %>" aria-pressed="<%= choice == :auto %>">
|
|
22
|
+
<% {auto: 'labels.theme_auto', light: 'labels.theme_light', dark: 'labels.theme_dark'}.each do |choice, label| %>
|
|
23
|
+
<button type="button" data-theme-choice="<%= choice %>" aria-label="<%= escape_html(documentation_t(label)) %>" title="<%= escape_html(documentation_t(label)) %>" aria-pressed="<%= choice == :auto %>">
|
|
13
24
|
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="2">
|
|
14
25
|
<% if choice == :auto %><circle cx="12" cy="12" r="8"></circle><path d="M12 4a8 8 0 0 0 0 16Z" fill="currentColor"></path>
|
|
15
26
|
<% elsif choice == :light %><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2m0 16v2M2 12h2m16 0h2M5 5l2 2m10 10 2 2M5 19l2-2M17 7l2-2"></path>
|
|
@@ -21,7 +32,7 @@
|
|
|
21
32
|
<% if account %>
|
|
22
33
|
<%= erb :'version_sidebar/authentication_control', locals: {account: account} %>
|
|
23
34
|
<% elsif (account_url = documentation_neutral_account_url) %>
|
|
24
|
-
<a class="docs-account-link" href="<%= escape_html(account_url) %>" aria-label="
|
|
35
|
+
<a class="docs-account-link" href="<%= escape_html(account_url) %>" aria-label="<%= escape_html(documentation_t('labels.account')) %>" title="<%= escape_html(documentation_t('labels.account')) %>"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="8" r="4"></circle><path d="M4 21v-2a8 8 0 0 1 16 0v2"></path></svg><span><%= escape_html(documentation_t('labels.account')) %></span></a>
|
|
25
36
|
<% end %>
|
|
26
37
|
</div>
|
|
27
38
|
</details>
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
<% if (search_options = documentation_search_form_options(id: 'docs-search-sidebar')) %>
|
|
3
3
|
<%= erb :'documentation/search_form', locals: search_options %>
|
|
4
4
|
<% end %>
|
|
5
|
-
<nav aria-label="
|
|
5
|
+
<nav aria-label="<%= escape_html(documentation_t('accessibility.pages')) %>">
|
|
6
6
|
<ul>
|
|
7
|
-
<li><a href="<%= escape_html(documentation_url) %>"<% if @documentation_page == 'overview' %> aria-current="page"<% end
|
|
7
|
+
<li><a href="<%= escape_html(documentation_url) %>"<% if @documentation_page == 'overview' %> aria-current="page"<% end %>><%= escape_html(documentation_t('labels.overview')) %></a></li>
|
|
8
8
|
<li>
|
|
9
|
-
<a href="<%= escape_html(documentation_url(page: 'authentication')) %>"<% if @documentation_page == 'authentication' %> aria-current="page"<% end
|
|
9
|
+
<a href="<%= escape_html(documentation_url(page: 'authentication')) %>"<% if @documentation_page == 'authentication' %> aria-current="page"<% end %>><%= escape_html(documentation_t('labels.authentication')) %></a>
|
|
10
10
|
<% if @documentation_page == 'authentication' %>
|
|
11
|
-
<nav aria-label="
|
|
11
|
+
<nav aria-label="<%= escape_html(documentation_t('accessibility.authentication_methods')) %>" data-action-nav><%= erb :'version_sidebar/auth_nav', locals: {methods: @help[:authentication]} %></nav>
|
|
12
12
|
<% end %>
|
|
13
13
|
</li>
|
|
14
|
-
<li><a href="<%= escape_html(documentation_url(page: 'resources')) %>"<% if @documentation_page == 'resources' %> aria-current="page"<% end %> data-resource-directory-link
|
|
14
|
+
<li><a href="<%= escape_html(documentation_url(page: 'resources')) %>"<% if @documentation_page == 'resources' %> aria-current="page"<% end %> data-resource-directory-link><%= escape_html(documentation_t('labels.resources')) %></a></li>
|
|
15
15
|
</ul>
|
|
16
16
|
</nav>
|
|
17
17
|
<% if @documentation_resource %>
|
|
18
18
|
<p data-current-resource><a href="<%= escape_html(documentation_url(resource: @documentation_resource[:key])) %>"><strong><%= escape_html(@documentation_resource[:key]) %></strong></a></p>
|
|
19
|
-
<nav aria-label="
|
|
20
|
-
<h2
|
|
19
|
+
<nav aria-label="<%= escape_html(documentation_t('accessibility.resource_actions')) %>" data-action-nav>
|
|
20
|
+
<h2><%= escape_html(documentation_t('labels.actions')) %></h2>
|
|
21
21
|
<ul class="docs-action-list">
|
|
22
22
|
<% sort_hash(@documentation_resource[:info][:actions]).each do |action, info| %>
|
|
23
23
|
<% target = documentation_resource_target(resource_path: @documentation_resource[:path], action_name: action) %>
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
</ul>
|
|
34
34
|
</nav>
|
|
35
35
|
<% unless @documentation_resource[:info][:resources].empty? %>
|
|
36
|
-
<nav aria-label="
|
|
37
|
-
<h2
|
|
36
|
+
<nav aria-label="<%= escape_html(documentation_t('labels.subresources')) %>">
|
|
37
|
+
<h2><%= escape_html(documentation_t('labels.subresources')) %></h2>
|
|
38
38
|
<ul>
|
|
39
39
|
<% sort_hash(@documentation_resource[:info][:resources]).each do |child, _child_info| %>
|
|
40
40
|
<% child_path = @documentation_resource[:path] + [child.to_s] %>
|
|
@@ -44,17 +44,32 @@
|
|
|
44
44
|
</nav>
|
|
45
45
|
<% end %>
|
|
46
46
|
<% end %>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
<% selection = documentation_example_selection %>
|
|
48
|
+
<% if selection[:client] %>
|
|
49
|
+
<% metadata = documentation_client_metadata %>
|
|
50
|
+
<% variants = metadata.select { |entry| entry[:language] == selection[:language] } %>
|
|
51
|
+
<% levels = metadata.find { |entry| entry[:id] == selection[:client].id }.fetch(:details) %>
|
|
52
|
+
<% detail = documentation_example_detail(levels) %>
|
|
53
|
+
<form class="docs-preferences" data-example-preferences method="get" action="<%= escape_html(request.path) %>"<% if selection[:explicit] %> data-example-selection="<%= escape_html(documentation_json(language: selection[:language], client: selection[:client].id, detail:)) %>"<% end %>>
|
|
54
|
+
<% documentation_example_form_parameters.each do |key, value| %>
|
|
55
|
+
<input type="hidden" name="<%= escape_html(key) %>" value="<%= escape_html(value) %>">
|
|
56
|
+
<% end %>
|
|
57
|
+
<label><%= escape_html(documentation_t('labels.programming_language')) %> <select data-language-select name="example_language">
|
|
58
|
+
<% metadata.uniq { |entry| entry[:language] }.each do |entry| %>
|
|
59
|
+
<option value="<%= escape_html(entry[:language]) %>"<% if entry[:language] == selection[:language] %> selected<% end %>><%= escape_html(entry[:language_label]) %></option>
|
|
51
60
|
<% end %>
|
|
52
61
|
</select></label>
|
|
53
|
-
<label data-variant-control
|
|
54
|
-
<%
|
|
55
|
-
<option value="<%= escape_html(
|
|
62
|
+
<label data-variant-control><%= escape_html(documentation_t('labels.client')) %> <select data-variant-select name="example_client"<% if variants.length < 2 %> disabled<% end %>>
|
|
63
|
+
<% variants.each do |entry| %>
|
|
64
|
+
<option value="<%= escape_html(entry[:id]) %>"<% if entry[:id] == selection[:client].id %> selected<% end %>><%= escape_html(entry[:variant] || entry[:language_label]) %></option>
|
|
56
65
|
<% end %>
|
|
57
66
|
</select></label>
|
|
58
|
-
|
|
67
|
+
<% if variants.length < 2 %><input type="hidden" name="example_client" value="<%= escape_html(selection[:client].id) %>"><% end %>
|
|
68
|
+
<label data-detail-control<% if levels.length < 2 %> hidden<% end %>><%= escape_html(documentation_t('labels.examples')) %> <select data-detail-select name="example_detail"<% if levels.length < 2 %> disabled<% end %>>
|
|
69
|
+
<% levels.each do |level| %><option value="<%= escape_html(level) %>"<% if level == detail %> selected<% end %>><%= escape_html(documentation_t(level == 'thorough' ? 'labels.thorough' : 'labels.simple')) %></option><% end %>
|
|
70
|
+
</select></label>
|
|
71
|
+
<% if levels.length < 2 %><input type="hidden" name="example_detail" value="<%= escape_html(detail) %>"><% end %>
|
|
72
|
+
<button type="submit" data-apply-examples><%= escape_html(documentation_t('labels.apply_examples')) %></button>
|
|
59
73
|
<p data-preference-status role="status"></p>
|
|
60
|
-
</
|
|
74
|
+
</form>
|
|
75
|
+
<% end %>
|