From 28b956cfaa5d2d787fa493c37bded0d1f7006cbb Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Tue, 19 Jul 2022 23:43:45 +0200 Subject: [PATCH] change searchbar layout and use invenio-app-rdm searchbar the searchbar is now on the top of the header, left of the language switch. the new searchbar introduced a new feature, it could handle different indices like all repository or communities. But the problem is where to place the new search bar. for the moment the compromise is to put it on the top right. this position may not be compatible with tugraz layout. --- .../js/invenio_theme_tugraz/theme.js | 15 +++++++++++++ .../invenio_theme_tugraz/header.html | 19 ---------------- .../invenio_theme_tugraz/navbar.html | 22 +++++-------------- 3 files changed, 20 insertions(+), 36 deletions(-) diff --git a/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/theme.js b/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/theme.js index 0191d6b..1ff4b72 100644 --- a/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/theme.js +++ b/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/theme.js @@ -1,5 +1,9 @@ import $ from "jquery"; import "semantic-ui-css"; +import { MultipleOptionsSearchBar } from "@js/invenio_search_ui/components"; +import { i18next } from "@translations/invenio_app_rdm/i18next"; +import ReactDOM from "react-dom"; +import React from "react"; // called on document ready $(function () { @@ -37,3 +41,14 @@ export function toggleVisibility(id) { } window.toggleVisibility = toggleVisibility; + +const headerSearchbar = document.getElementById("header-search-bar"); +const searchBarOptions = JSON.parse(headerSearchbar.dataset.options); + +ReactDOM.render( + , + headerSearchbar +); diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html index 36922e5..51bb619 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html @@ -79,23 +79,4 @@ {%- include "invenio_theme/breadcrumbs.html" %} {%- endblock breadcrumbs %} #} - -
- {% include "invenio_app_rdm/searchbar.html" %} -
- -
-
-
- -
-
-
diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/navbar.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/navbar.html index 4248fa2..e4247f1 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/navbar.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/navbar.html @@ -11,8 +11,11 @@