File tree Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 7
7
{%- endblock body_classes -%}
8
8
9
9
{%- block topbar -%}
10
- {% set search_query = Some(String::new()) %}
11
10
{%- include "header/topbar.html" -%}
12
11
{%- endblock topbar -%}
13
12
Original file line number Diff line number Diff line change @@ -10,6 +10,5 @@ <h1 id="crate-title">{{ title }}</h1>
10
10
{%- endblock header -%}
11
11
12
12
{%- block topbar -%}
13
- {% set search_query = Some(String::new()) %}
14
13
{%- include "header/topbar.html" -%}
15
14
{%- endblock topbar -%}
Original file line number Diff line number Diff line change 66
66
{# If there is a search query, put it in the search bar #}
67
67
{# The tabindex="-1" is used to prevent it to be the first input focused on the page when using the browser shortcut #}
68
68
< input id ="nav-search " name ="query " type ="text " aria-label ="Find crate by search query " tabindex ="-1 "
69
- placeholder ="Find crate " {%- if let Some(query) = search_query %}{% if !query.is_empty() %} value ="{{ query }} " {%- endif %}{% endif %} >
69
+ placeholder ="Find crate "
70
+ {% if search_query is defined %}
71
+ {%- if let Some(query) = search_query %}
72
+ {%- if !query.is_empty() +%}
73
+ value ="{{ query }} "
74
+ {%- endif %}
75
+ {%- endif %}
76
+ {%- endif %} >
70
77
</ div >
71
78
</ form>
72
79
</ div>
Original file line number Diff line number Diff line change 16
16
{%- endblock header -%}
17
17
18
18
{%- block topbar -%}
19
- {% set search_query = Some(String::new()) %}
20
19
{%- include "header/topbar.html" -%}
21
20
{%- endblock topbar -%}
22
21
Original file line number Diff line number Diff line change 1
1
{# The url of the current release, `/crate/:name/:version` #}
2
2
{%- import "macros.html" as macros -%}
3
3
4
- {% set search_query = Some(String::new()) %}
5
4
{%- include "header/topbar_begin.html" -%}
6
5
{%- set crate_url = "/crate/{}/{}"|format(metadata.name, metadata.req_version) -%}
7
6
{%- set rest_menu_url -%}
You can’t perform that action at this time.
0 commit comments