Skip to content

Commit

Permalink
Merge pull request #362 from E8y2FqZE/main
Browse files Browse the repository at this point in the history
Added `search_value` to shell component.
  • Loading branch information
lovasoa authored Jun 1, 2024
2 parents ce20a1f + ab4d489 commit f55a194
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
('icon', 'Name of an icon (from tabler-icons.io) to display next to the title in the navigation bar.', 'ICON', TRUE, TRUE),
('menu_item', 'Adds a menu item in the navigation bar at the top of the page. The menu item will have the specified name, and will link to as .sql file of the same name. A dropdown can be generated by passing a json object with a `title` and `submenu` properties.', 'TEXT', TRUE, TRUE),
('search_target', 'When this is set, a search field will appear in the top navigation bar, and load the specified sql file with an URL parameter named "search" when the user searches something.', 'TEXT', TRUE, TRUE),
('search_value', 'This value will be placed in the search field when "search_target" is set. Using the "$search" query parameter value will mirror the value that the user has searched for.', 'TEXT', TRUE, TRUE),
('norobot', 'Forbids robots to save this page in their database and follow the links on this page. This will prevent this page to appear in Google search results for any query, for instance.', 'BOOLEAN', TRUE, TRUE),
('font', 'Name of a font to display the text in. This has to be a valid font name from fonts.google.com.', 'TEXT', TRUE, TRUE),
('font_size', 'Font size on the page, in pixels. Set to 18 by default.', 'INTEGER', TRUE, TRUE),
Expand Down Expand Up @@ -892,4 +893,4 @@ so you can also [create your own shell component](custom_components.sql#custom-s
If you generate your own HTML from a SQL query, you can also use the `shell-empty` component to include it in a page.
Make sure you know what you are doing, and be careful to escape the HTML properly,
as you are stepping out of the safe SQLPage framework and into the wild world of HTML.',
json('[{"component":"shell-empty", "html": "<!DOCTYPE html>\n<html>\n<head>\n <title>My page</title>\n</head>\n<body>\n <h1>My page</h1>\n</body>\n</html>"}]'));
json('[{"component":"shell-empty", "html": "<!DOCTYPE html>\n<html>\n<head>\n <title>My page</title>\n</head>\n<body>\n <h1>My page</h1>\n</body>\n</html>"}]'));
2 changes: 1 addition & 1 deletion sqlpage/templates/shell.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
{{#if search_target}}
<form class="d-flex" role="search" action="{{search_target}}">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"
name="search">
name="search" value="{{search_value}}">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
{{/if}}
Expand Down

0 comments on commit f55a194

Please sign in to comment.