-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
global: apply changes for Invenio 3.4
- Loading branch information
Showing
14 changed files
with
92 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...e}}/records/assets/semantic-ui/{{cookiecutter.package_name}}/search_app_customizations.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react"; | ||
import { overrideStore } from "react-overridable"; | ||
import { Card, Item, List } from "semantic-ui-react"; | ||
|
||
const {{datamodel_extension_class}}ResultsListItem = ({ result, index }) => { | ||
const contributors = result.metadata.contributors || []; | ||
return ( | ||
<Item key={index} href={`/records/{{ result.id }}`}> | ||
<Item.Content> | ||
<Item.Header>{result.metadata.title}</Item.Header> | ||
<Item.Description> | ||
{contributorsList && ( | ||
<List horizontal relaxed> | ||
{contributors.map((contributor) => ( | ||
<List.Item>{contributor.name}</List.Item> | ||
))} | ||
</List> | ||
)} | ||
</Item.Description> | ||
</Item.Content> | ||
</Item> | ||
); | ||
}; | ||
|
||
overrideStore.add("ResultsList.item", {{datamodel_extension_class}}ResultsListItem); | ||
|
||
const {{datamodel_extension_class}}ResultsGridItem = ({ result, index }) => { | ||
const contributors = result.metadata.contributors || []; | ||
return ( | ||
<Card fluid key={index} href={`/records/{{ result.id }}`}> | ||
<Card.Content> | ||
<Card.Header>{result.metadata.title}</Card.Header> | ||
<Card.Description> | ||
{contributorsList && ( | ||
<List horizontal relaxed> | ||
{contributors.map((contributor) => ( | ||
<List.Item>{contributor.name}</List.Item> | ||
))} | ||
</List> | ||
)} | ||
</Card.Description> | ||
</Card.Content> | ||
</Card> | ||
); | ||
}; | ||
|
||
overrideStore.add("ResultsGrid.item", {{datamodel_extension_class}}ResultsGridItem); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...t_shortname}}/{{cookiecutter.package_name}}/records/static/templates/records/results.html
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...e}}/records/templates/records/record.html → ...templates/semantic-ui/records/record.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ortname}}/{{cookiecutter.package_name}}/records/templates/semantic-ui/records/search.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "semantic-ui/invenio_search_ui/search.html" %} | ||
|
||
{%- block javascript_override_searchapp %} | ||
{{ webpack['{%- endraw %}{{cookiecutter.project_shortname}}{%- raw %}-search-app.js'] }} | ||
{%- endblock javascript_override_searchapp %} |
18 changes: 18 additions & 0 deletions
18
{{cookiecutter.project_shortname}}/{{cookiecutter.package_name}}/records/webpack.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% include 'misc/header.py' %} | ||
"""JS/CSS Webpack bundle to override search results template.""" | ||
|
||
from invenio_assets.webpack import WebpackThemeBundle | ||
|
||
search_app = WebpackThemeBundle( | ||
__name__, | ||
'assets', | ||
default='semantic-ui', | ||
themes={ | ||
'semantic-ui': dict( | ||
entry={ | ||
'{{ cookiecutter.project_shortname }}-search-app': './js/{{ cookiecutter.package_name }}/records/search_app_customizations.js', | ||
}, | ||
dependencies={} | ||
) | ||
} | ||
) |
21 changes: 0 additions & 21 deletions
21
.../{{cookiecutter.package_name}}/theme/assets/scss/{{cookiecutter.package_name}}/theme.scss
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ookiecutter.package_name}}/theme/assets/scss/{{cookiecutter.package_name}}/variables.scss
This file was deleted.
Oops, something went wrong.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ookiecutter.package_name}}/frontpage.html → ...ookiecutter.package_name}}/frontpage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...s/{{cookiecutter.package_name}}/page.html → ...i/{{cookiecutter.package_name}}/page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 13 additions & 10 deletions
23
{{cookiecutter.project_shortname}}/{{cookiecutter.package_name}}/theme/webpack.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
{% include 'misc/header.py' %} | ||
"""JS/CSS Webpack bundles for theme.""" | ||
|
||
from __future__ import absolute_import, print_function | ||
from invenio_assets.webpack import WebpackThemeBundle | ||
|
||
from flask_webpackext import WebpackBundle | ||
|
||
theme = WebpackBundle( | ||
theme = WebpackThemeBundle( | ||
__name__, | ||
'assets', | ||
entry={ | ||
'{{ cookiecutter.project_shortname }}-theme': './scss/{{ cookiecutter.package_name }}/theme.scss', | ||
'{{ cookiecutter.project_shortname }}-preview': './js/{{ cookiecutter.package_name }}/previewer.js', | ||
}, | ||
dependencies={ | ||
# add any additional npm dependencies here... | ||
default='semantic-ui', | ||
themes={ | ||
'semantic-ui': dict( | ||
entry={ | ||
# CHANGE ME TO LESS '{{ cookiecutter.project_shortname }}-theme': './less/{{ cookiecutter.package_name }}/theme.less', | ||
'{{ cookiecutter.project_shortname }}-preview': './js/{{ cookiecutter.package_name }}/previewer.js', | ||
}, | ||
dependencies={ | ||
# add any additional npm dependencies here... | ||
} | ||
) | ||
} | ||
) |