[ADD] doc: port the searchbar from user to dev docs

The developer documentation already has a search functionality via Sphinx if
you use the right URL, but it was not exposed in the frontend. This commit ports
 the search bar from the user documentation.

Original commits: 17fc4219bd24e8993fc5ab3c00d9979f87a45e84 (rim) and
52e49eda472963e929ec7b004eae20c514364403 (kts) from
https://github.com/odoo/documentation-user/

closes odoo/odoo#58213

X-original-commit: b38059caf59a3fbd67989d89317cfdc9f3be35a3
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
This commit is contained in:
Raf Geens
2020-09-22 11:42:36 +00:00
parent 46c3a9670d
commit cfe2d22999
3 changed files with 38 additions and 0 deletions
+12
View File
@@ -11772,6 +11772,18 @@ aside {
background-color: #282F33;
color: #F2F2F2;
}
.o_main_header > .o_sub_nav #o_sub-menu #searchbox {
display: flex;
align-items: center;
justify-content: center;
}
.o_main_header > .o_sub_nav #o_sub-menu #searchbox > form {
display: flex;
flex-grow: 1;
}
.o_main_header > .o_sub_nav #o_sub-menu #searchbox > form > .form-control {
border-radius: 0;
}
@media screen and (min-width: 768px) {
.o_main_header > .o_sub_nav #o_sub-menu .o_breadcrumb {
background-color: transparent;
@@ -30,6 +30,20 @@
color: @gray-lighter;
}
> .o_sub_nav #o_sub-menu #searchbox {
display: flex;
align-items: center;
justify-content: center;
> form {
display: flex;
flex-grow: 1;
> .form-control {
border-radius: 0;
}
}
}
> .o_sub_nav #o_sub-menu .o_breadcrumb {
@media screen and (min-width: @screen-sm-min) {
@@ -6,3 +6,15 @@
<li><a href="https://odoo.com/slides">eLearning</a></li>
<li><a href="https://www.odoo.com/page/odoo-white-paper">White Papers</a></li>
<li><a href="https://www.odoo.com/page/legal">Legal</a></li>
{%- if pagename != "search" and builder != "singlehtml" %}
<li id="searchbox" style="display: none; margin: 0 0 0 10px;" role="search">
<form class="search form-inline input-group-sm" action="{{ pathto('search') }}" method="get">
<input type="text" class="form-control" name="q" id="q" placeholder="Search..." />
<input type="hidden" name="area" value="default" />
<input type="hidden" name="check_keywords" value="yes" />
<button type="submit" value="Go" class="btn btn-default btn-sm">Go</button>
</form>
</li>
<script type="text/javascript">$('#searchbox').show(0);</script>
{%- endif %}