File size: 871 Bytes
c1a5b70
0ec8914
c1a5b70
0ec8914
c1a5b70
 
0ec8914
c1a5b70
 
 
 
 
 
 
0ec8914
 
 
 
33846ce
 
 
0ec8914
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//! A module that handles `bar` partial for the `search_bar` partial and the home/index/main page in the `websurfx` frontend.

use maud::{html, Markup, PreEscaped};

/// A functions that handles the html code for the bar for the `search_bar` partial and the
/// home/index/main page in the search engine frontend.
///
/// # Arguments
///
/// * `query` - It takes the current search query provided by user as an argument.
///
/// # Returns
///
/// It returns the compiled html code for the search bar as a result.
pub fn bar(query: &str) -> Markup {
    html!(
        (PreEscaped("<div class=\"search_bar\">"))
            input type="search" name="search-box" value=(query) placeholder="Type to search";
            button type="submit" onclick="searchWeb()" {
                img src="./images/magnifying_glass.svg" alt="Info icon for error box";
            }
    )
}