diff --git a/invenio_search_ui/config.py b/invenio_search_ui/config.py index c05dfb6f..ed2e08b2 100644 --- a/invenio_search_ui/config.py +++ b/invenio_search_ui/config.py @@ -10,7 +10,7 @@ from __future__ import absolute_import, print_function -SEARCH_UI_JS_FRAMEWORK = 'react' +SEARCH_UI_APP_THEME = ['react', 'angular'] SEARCH_UI_SEARCH_API = '/api/records/' """Configure the search engine endpoint.""" diff --git a/invenio_search_ui/templates/invenio_search_ui/react_search.html b/invenio_search_ui/templates/invenio_search_ui/react_search.html index 3b63d515..930c3142 100644 --- a/invenio_search_ui/templates/invenio_search_ui/react_search.html +++ b/invenio_search_ui/templates/invenio_search_ui/react_search.html @@ -3,6 +3,10 @@ {%- block css %} {{ super() }} {{ webpack['vendor.css'] }} + + {% block css_render %} + {{ webpack.render('.css') }} + {% endblock css_render %} {%- endblock css %} @@ -10,6 +14,9 @@ {{ super() }} {{ webpack['search_ui_app.js'] }} + {% block javascript_render %} + {{ webpack.render('.js') }} + {% endblock javascript_render %} {%- endblock javascript %} diff --git a/invenio_search_ui/templates/invenio_search_ui/search.html b/invenio_search_ui/templates/invenio_search_ui/search.html index d4254649..68276012 100644 --- a/invenio_search_ui/templates/invenio_search_ui/search.html +++ b/invenio_search_ui/templates/invenio_search_ui/search.html @@ -11,14 +11,21 @@ {%- block css %} {{ super() }} - {{ webpack['search_ui_theme.css'] }} + {{ webpack['search_ui_theme'] }} {# assets "invenio_search_ui_search_css" %}{% endassets #} + + {% block css_render %} + {{ webpack.render('.css') }} + {% endblock css_render %} {%- endblock css %} {%- block javascript %} {{ super() }} - {{ webpack['search_ui_app.js'] }} + {{ webpack['search_ui_app'] }} {# assets "invenio_search_ui_search_js" %}{% endassets #} + {% block javascript_render %} + {{ webpack.render('.js') }} + {% endblock javascript_render %} {%- endblock javascript %} {%- block body_inner %} diff --git a/invenio_search_ui/webpack.py b/invenio_search_ui/webpack.py index 8a70270c..26957eb2 100644 --- a/invenio_search_ui/webpack.py +++ b/invenio_search_ui/webpack.py @@ -63,3 +63,45 @@ def search_ui(): 'invenio-search-js': '^1.3.1', 'jquery': '~3.2.1', }) + + +# search_ui = WebpackBundle( +# __name__, +# 'assets', +# themes={ +# 'react': dict( +# entry={ +# 'search_ui_app': './js/invenio_react_search_ui/index.js', +# }, +# dependencies={ +# "axios": "^0.19.0", +# "lodash": "^4.17.15", +# "node-sass": "^4.12.0", +# "qs": "^6.8.0", +# "react": "^16.9.0", +# "react-dom": "^16.9.0", +# "react-redux": "^7.1", +# "react-scripts": "3.1.1", +# "redux": "^4.0.4", +# "redux-thunk": "^2.3.0", +# 'react-searchkit': '^0.19.0', +# "semantic-ui-css": "^2.4.1", +# "semantic-ui-react": "^0.88.0" +# } +# ), +# 'angular': dict( +# entry={ +# 'search_ui_app': './js/invenio_search_ui/app.js', +# 'search_ui_theme': './scss/invenio_search_ui/search.scss', +# }, +# dependencies={ +# 'almond': '~0.3.1', +# 'angular': '~1.4.10', +# 'angular-loading-bar': '~0.9.0', +# 'd3': '^3.5.17', +# 'invenio-search-js': '^1.3.1', +# 'jquery': '~3.2.1', +# } +# ) +# } +# )