Compare commits

..

11 Commits

Author SHA1 Message Date
Christoph Ladurner
3a500543c6 release v4.0.0 2022-07-29 13:27:53 +02:00
Christoph Ladurner
e310a4ca38 remove unnecessary html code for header-search-bar
unnecessary because the react component which is handling this id is generating
the html code.
2022-07-29 13:22:52 +02:00
Christoph Ladurner
c3f55030dc fix warning from semantic-ui-react Search component 2022-07-29 13:22:52 +02:00
Christoph Ladurner
95d27fdd8c add marc21 and lom to the searchbar
copy pasted code from invenio_app_rdm/searchbar. it was necessary to
do that to configure the shown list.
2022-07-29 13:22:52 +02:00
Christoph Ladurner
28b956cfaa 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.
2022-07-29 13:22:52 +02:00
Christoph Ladurner
5ac2a68848 remove grey color of community block and reduce size 2022-07-29 13:22:52 +02:00
Christoph Ladurner
0399814fe0 migrate js to use prettier 2022-07-29 13:22:52 +02:00
Christoph Ladurner
f11facc9d6 release v3.9.3 2022-07-17 20:55:54 +02:00
Christoph Ladurner
c9bc56e168 fix broken search page
the invenioRDM version v9.1 introduced a new search feature. the implementation
assumes that the id header-search-bar exists on the page. if that is not the
case the page will not be rendered.

this fix adds a hidden search element as invenioRDM v9.1 introduced. the page is
not using this at the moment because it would need some further layout
adjustments.

further moves this fix the local search element to the header to be existent on
the index and search page. for the future this should be undone and the new
invenioRDM search should be used.
2022-07-17 20:55:12 +02:00
Mojib Wali
cb9b80668c release: v3.9.2 2022-06-28 15:48:50 +02:00
David
5bf5ce4268 fix: adopt renaming of serialize function (#269) 2022-06-28 15:39:44 +02:00
8 changed files with 93 additions and 60 deletions

View File

@@ -7,6 +7,20 @@
Changes Changes
======= =======
Version v4.0.0 (release 2022-07-29)
- remove unnecessary html code for header-search-bar
- fix warning from semantic-ui-react Search component
- add marc21 and lom to the searchbar
- change searchbar layout and use invenio-app-rdm searchbar
- remove grey color of community block and reduce size
- migrate js to use prettier
Version 3.9.2 (released 2022-06-28)
- fix: adopt renaming of serialize function (#269)
Version 3.9.1 (released 2022-06-02) Version 3.9.1 (released 2022-06-02)
- fix: add trigger to accordion (#265) - fix: add trigger to accordion (#265)

View File

@@ -10,6 +10,6 @@
from .ext import InvenioThemeTugraz from .ext import InvenioThemeTugraz
__version__ = "3.9.1" __version__ = "4.0.0"
__all__ = ("__version__", "InvenioThemeTugraz") __all__ = ("__version__", "InvenioThemeTugraz")

View File

@@ -1,8 +1,12 @@
import $ from 'jquery'; import $ from "jquery";
import 'semantic-ui-css'; 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 // called on document ready
$(function() { $(function () {
importZammadScript(); importZammadScript();
}); });
@@ -13,23 +17,21 @@ function importZammadScript() {
document.head.appendChild(scriptNode); document.head.appendChild(scriptNode);
$.getScript("https://ub-support.tugraz.at/assets/form/form.js", () => { $.getScript("https://ub-support.tugraz.at/assets/form/form.js", () => {
$('#feedback-form').ZammadForm({ $("#feedback-form").ZammadForm({
messageTitle: 'Contact us', messageTitle: "Contact us",
showTitle: true, showTitle: true,
messageSubmit: 'Submit', messageSubmit: "Submit",
messageThankYou: 'Thank you for your message, (#%s). We will get back to you as quickly as possible!', messageThankYou:
modal: true "Thank you for your message, (#%s). We will get back to you as quickly as possible!",
modal: true,
}); });
}); });
} }
// used for sticky test instance notification // used for sticky test instance notification
$('.ui.sticky.test-instance') $(".ui.sticky.test-instance").sticky({
.sticky({ context: "body",
context: 'body' });
})
;
export function toggleVisibility(id) { export function toggleVisibility(id) {
var element = document.getElementById(id); var element = document.getElementById(id);
@@ -39,3 +41,14 @@ export function toggleVisibility(id) {
} }
window.toggleVisibility = toggleVisibility; window.toggleVisibility = toggleVisibility;
const headerSearchbar = document.getElementById("header-search-bar");
const searchBarOptions = JSON.parse(headerSearchbar.dataset.options);
ReactDOM.render(
<MultipleOptionsSearchBar
options={searchBarOptions}
placeholder={i18next.t("Search records...")}
/>,
headerSearchbar
);

View File

@@ -0,0 +1,14 @@
/*
* Copyright (C) 2022 Graz University of Technology.
*
* invenio-theme-tugraz is free software; you can redistribute it and/or modify it
* under the terms of the MIT License; see LICENSE file for more details.
*/
.ui.container.page-subheader-outer {
background-color: unset;
}
.ui.fluid.container {
width: fit-content;
}

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2021 Graz University of Technology. * Copyright (C) 2020-2022 Graz University of Technology.
* *
* invenio-theme-tugraz is free software; you can redistribute it and/or modify it * invenio-theme-tugraz is free software; you can redistribute it and/or modify it
* under the terms of the MIT License; see LICENSE file for more details. * under the terms of the MIT License; see LICENSE file for more details.
@@ -15,6 +15,7 @@
@import "macros"; @import "macros";
@import "login"; @import "login";
@import "deposit"; @import "deposit";
@import "communities";
/*** /***
**TODO: **TODO:

View File

@@ -17,25 +17,8 @@
{%- block page_body %} {%- block page_body %}
<div class="ui container"> <div class="ui container">
{%- block frontpage_search %}
{%- block frontpage_form %}
<div class="ui center aligned grid">
<div class="sixteen wide column">
<form action="{{config.THEME_SEARCH_ENDPOINT}}" class="ui form" role="search">
<div class="ui fluid big action icon input">
<input type="text" name="q" autofocus="autofocus" placeholder="{{ _("Type and press enter to search") }}">
<button type="submit" class="ui icon search button">
<i class="icon search"></i>
</button>
</div>
</form>
</div>
</div>
<div class="ui divider hidden"></div> <div class="ui divider hidden"></div>
{%- endblock frontpage_form %}
{%- endblock frontpage_search %}
<div class="ui stackable grid"> <div class="ui stackable grid">
<!---Recent uploads--> <!---Recent uploads-->

View File

@@ -1,18 +1,43 @@
{# {#
Copyright (C) 2020-2021 Graz University of Technology. Copyright (C) 2020-2022 Graz University of Technology.
invenio-theme-tugraz is free software; you can redistribute it and/or invenio-theme-tugraz is free software; you can redistribute it and/or
modify it under the terms of the MIT License; see LICENSE file for more modify it under the terms of the MIT License; see LICENSE file for more
details. details.
#} #}
{% set options = [
{
"key": "records",
"text": _("All") + " " + config.THEME_SITENAME,
"value": url_for("invenio_search_ui.search"),
"title": "repo",
},{
"key": "marc21",
"text": _("search publications (thesis, books, papers, etc)"),
"value": url_for("invenio_records_marc21.search"),
"title": "publication",
},{
"key": "lom",
"text": _("search open educational resources"),
"value": url_for("invenio_records_lom.search"),
"title": "oer",
}
]
%}
<div class="ui container"> <div class="ui container">
<div class="short-menu" id="all-menu-top-table"> <div class="short-menu" id="all-menu-top-table">
<div class="short-menu-left"> <div class="short-menu-left">
<div id="all-menu-top-left-item"> <div id="all-menu-top-left-item">
<div class="short-menu-left-search"> <div class="short-menu-left-search">
{%- if config.I18N_LANGUAGES %} <div style="display: inline-block;">
<div class="short-menu-left-lang" style="margin-right:10px; font-size:18px;"> <div class="item p-0 search-bar rel-mr-1">
<div id="header-search-bar" data-options='{{ options | tojson }}'></div>
</div>
</div>
<div class="short-menu-left-lang">
{%- for l in current_i18n.get_locales() %} {%- for l in current_i18n.get_locales() %}
{%- if current_i18n.language != l.language %} {%- if current_i18n.language != l.language %}
<a <a
@@ -20,21 +45,6 @@
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
</div> </div>
{%- endif %}
<div class="search-icon-header">
<a href="{{url_for('invenio_search_ui.search')}}" class="no-decoration">
<svg class="short-menu-icon" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/2000/svg" height="26.015" width="26.015" version="1.1"
xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
viewBox="0 0 26.01515 26.01515">
<g stroke-miterlimit="10" transform="translate(1,1)">
<circle cy="8.5" cx="8.5" r="8" style="stroke-miterlimit:10;stroke-width:2"></circle>
<path style="stroke-width:2;stroke-miterlimit:10;stroke-linecap:round" d="m14.156 14.156 9.344 9.344">
</path>
</g>
</svg>
</a>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -53,9 +53,7 @@ def records_serializer(records=None):
"""Serialize list of records.""" """Serialize list of records."""
record_list = [] record_list = []
for record in records: for record in records:
record_list.append( record_list.append(UIJSONSerializer().dump_obj(record.to_dict()))
UIJSONSerializer().serialize_object_to_dict(record.to_dict())
)
return record_list return record_list