mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-22 20:51:58 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c73571c2b7 | ||
|
|
db52ca8aad | ||
|
|
21b67cb3e0 | ||
|
|
f22e62dfb0 | ||
|
|
8eb5152963 | ||
|
|
a8a4aab191 | ||
|
|
2815c35590 | ||
|
|
fc13dc8228 | ||
|
|
2290dbe3cb | ||
|
|
15f4d5fce3 | ||
|
|
b76f27c037 | ||
|
|
4aa72c003b | ||
|
|
fb906bda72 | ||
|
|
808aca3f60 | ||
|
|
5f49389fb1 | ||
|
|
4930e78c3a | ||
|
|
1ad73cc001 | ||
|
|
7623af2fb1 | ||
|
|
b05d9cbf97 |
@@ -1,528 +0,0 @@
|
||||
// This file is part of InvenioRDM
|
||||
// Copyright (C) 2020 CERN.
|
||||
// Copyright (C) 2020 Northwestern University.
|
||||
// Copyright (C) 2021 Graz University of Technology.
|
||||
//
|
||||
// Invenio App RDM is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the MIT License; see LICENSE file for more details.
|
||||
|
||||
import _get from "lodash/get";
|
||||
import React, { Component, createRef, Fragment } from "react";
|
||||
import {
|
||||
AccessRightField,
|
||||
CreatibutorsField,
|
||||
DatesField,
|
||||
DeleteButton,
|
||||
DepositFormApp,
|
||||
DepositFormTitle,
|
||||
DescriptionsField,
|
||||
FileUploader,
|
||||
FormFeedback,
|
||||
IdentifiersField,
|
||||
LanguagesField,
|
||||
LicenseField,
|
||||
PIDField,
|
||||
PreviewButton,
|
||||
PublicationDateField,
|
||||
PublishButton,
|
||||
PublisherField,
|
||||
RelatedWorksField,
|
||||
ResourceTypeField,
|
||||
SaveButton,
|
||||
TitlesField,
|
||||
VersionField,
|
||||
} from "react-invenio-deposit";
|
||||
import { AccordionField } from "react-invenio-forms";
|
||||
import { Card, Container, Divider, Grid, Ref, Sticky } from "semantic-ui-react";
|
||||
|
||||
export class RDMDepositForm extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.config = props.config || {};
|
||||
// TODO: retrieve from backend
|
||||
this.config["canHaveMetadataOnlyRecords"] = true;
|
||||
|
||||
// TODO: Make ALL vocabulary be generated by backend.
|
||||
// Currently, some vocabulary is generated by backend and some is
|
||||
// generated by frontend here. Iteration is faster and abstractions can be
|
||||
// discovered by generating vocabulary here. Once happy with vocabularies,
|
||||
// then we can generate it in the backend.
|
||||
this.vocabularies = {
|
||||
metadata: {
|
||||
...this.config.vocabularies,
|
||||
|
||||
titles: {
|
||||
...this.config.vocabularies.titles,
|
||||
},
|
||||
|
||||
descriptions: {
|
||||
type: [
|
||||
{ text: "Abstract", value: "abstract" },
|
||||
{ text: "Methods", value: "methods" },
|
||||
{ text: "Series Information", value: "seriesinformation" },
|
||||
{ text: "Table of Contents", value: "tableofcontents" },
|
||||
{ text: "Technical Info", value: "technicalinfo" },
|
||||
{ text: "Other", value: "other" },
|
||||
],
|
||||
},
|
||||
|
||||
creators: {
|
||||
type: [
|
||||
{ text: "Person", value: "personal" },
|
||||
{ text: "Organization", value: "organizational" },
|
||||
],
|
||||
role: [
|
||||
{ text: "Editor", value: "editor" },
|
||||
{ text: "Data Curator", value: "datacurator" },
|
||||
{ text: "Data Manager", value: "datamanager" },
|
||||
{ text: "Project Manager", value: "projectmanager" },
|
||||
],
|
||||
},
|
||||
|
||||
contributors: {
|
||||
type: [
|
||||
{ text: "Person", value: "personal" },
|
||||
{ text: "Organization", value: "organizational" },
|
||||
],
|
||||
role: [
|
||||
{ text: "Editor", value: "editor" },
|
||||
{ text: "Data Curator", value: "datacurator" },
|
||||
{ text: "Data Manager", value: "datamanager" },
|
||||
{ text: "Project Manager", value: "projectmanager" },
|
||||
],
|
||||
},
|
||||
|
||||
dates: {
|
||||
type: [
|
||||
{ text: "Accepted", value: "accepted" },
|
||||
{ text: "Available", value: "available" },
|
||||
{ text: "Copyrighted", value: "copyrighted" },
|
||||
{ text: "Collected", value: "collected" },
|
||||
{ text: "Created", value: "created" },
|
||||
{ text: "Issued", value: "issued" },
|
||||
{ text: "Submitted", value: "submitted" },
|
||||
{ text: "Updated", value: "updated" },
|
||||
{ text: "Valid", value: "valid" },
|
||||
{ text: "Withdrawn", value: "withdrawn" },
|
||||
{ text: "Other", value: "other" },
|
||||
],
|
||||
},
|
||||
|
||||
// TODO: Replace with an API backend
|
||||
funding: {
|
||||
funder: [
|
||||
{
|
||||
name: "National Institutes of Health (US)",
|
||||
identifier: "funder1",
|
||||
scheme: "funderScheme1",
|
||||
},
|
||||
{
|
||||
name: "European Commission (EU)",
|
||||
identifier: "funder2",
|
||||
scheme: "funderScheme2",
|
||||
},
|
||||
],
|
||||
award: [
|
||||
{
|
||||
title: "CANCER &AIDS DRUGS--PRECLIN PHARMACOL/TOXICOLOGY",
|
||||
number: "N01CM037835-016",
|
||||
identifier: "awardA",
|
||||
scheme: "awardSchemeA",
|
||||
parentScheme: "funderScheme1",
|
||||
parentIdentifier: "funder1",
|
||||
},
|
||||
{
|
||||
title:
|
||||
"Beyond the Standard Model at the LHC and with Atom Interferometers.",
|
||||
number: "228169",
|
||||
identifier: "awardB1",
|
||||
scheme: "awardSchemeB",
|
||||
parentScheme: "funderScheme2",
|
||||
parentIdentifier: "funder2",
|
||||
},
|
||||
{
|
||||
title: "ENvironmental COnditions in GLAucoma Patients",
|
||||
number: "747441",
|
||||
identifier: "awardB2",
|
||||
scheme: "awardSchemeB",
|
||||
parentScheme: "funderScheme2",
|
||||
parentIdentifier: "funder2",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
identifiers: {
|
||||
resource_type: this.config.vocabularies.resource_type,
|
||||
scheme: [
|
||||
{ text: "ARK", value: "ark" },
|
||||
{ text: "ARXIV", value: "arxiv" },
|
||||
{ text: "BIBCODE", value: "bibcode" },
|
||||
{ text: "DOI", value: "doi" },
|
||||
{ text: "EAN13", value: "ean13" },
|
||||
{ text: "EISSN", value: "eissn" },
|
||||
{ text: "HANDLE", value: "handle" },
|
||||
{ text: "IGSN", value: "igsn" },
|
||||
{ text: "ISBN", value: "isbn" },
|
||||
{ text: "ISSN", value: "issn" },
|
||||
{ text: "ISTC", value: "istc" },
|
||||
{ text: "LISSN", value: "lissn" },
|
||||
{ text: "LSID", value: "lsid" },
|
||||
{ text: "PMID", value: "pmid" },
|
||||
{ text: "PURL", value: "purl" },
|
||||
{ text: "UPC", value: "upc" },
|
||||
{ text: "URL", value: "url" },
|
||||
{ text: "URN", value: "urn" },
|
||||
{ text: "W3ID", value: "w3id" },
|
||||
],
|
||||
relations: [
|
||||
{ text: "Is cited by", value: "iscitedby" },
|
||||
{ text: "Cites", value: "cites" },
|
||||
{ text: "Is supplement to", value: "issupplementto" },
|
||||
{ text: "Is supplemented by", value: "issupplementedby" },
|
||||
{ text: "Is continued by", value: "iscontinuedby" },
|
||||
{ text: "Continues", value: "continues" },
|
||||
{ text: "Is described by", value: "isdescribedby" },
|
||||
{ text: "Describes", value: "describes" },
|
||||
{ text: "Has metadata", value: "hasmetadata" },
|
||||
{ text: "Is metadata for", value: "ismetadatafor" },
|
||||
{ text: "Has version", value: "hasversion" },
|
||||
{ text: "Is version of", value: "isversionof" },
|
||||
{ text: "Is new version of", value: "isnewversionof" },
|
||||
{ text: "Is previous version of", value: "ispreviousversionof" },
|
||||
{ text: "Is part of", value: "ispartof" },
|
||||
{ text: "Has part", value: "haspart" },
|
||||
{ text: "Is referenced by", value: "isreferencedby" },
|
||||
{ text: "References", value: "references" },
|
||||
{ text: "Is documented by", value: "isdocumentedby" },
|
||||
{ text: "Documents", value: "documents" },
|
||||
{ text: "Is compiled by", value: "iscompiledby" },
|
||||
{ text: "Compiles", value: "compiles" },
|
||||
{ text: "Is variant form of", value: "isvariantformof" },
|
||||
{ text: "Is original form of", value: "isoriginalformof" },
|
||||
{ text: "Is identical to", value: "isidenticalto" },
|
||||
{ text: "Is reviewed by", value: "isreviewedby" },
|
||||
{ text: "Reviews", value: "reviews" },
|
||||
{ text: "Is derived from", value: "isderivedfrom" },
|
||||
{ text: "Is source of", value: "issourceof" },
|
||||
{ text: "Is required by", value: "isrequiredby" },
|
||||
{ text: "Requires", value: "requires" },
|
||||
{ text: "Is obsoleted by", value: "isobsoletedby" },
|
||||
{ text: "Obsoletes", value: "obsoletes" },
|
||||
],
|
||||
},
|
||||
subjects: {
|
||||
options: [
|
||||
{
|
||||
text: "Deep Learning",
|
||||
value: {
|
||||
subject: "Deep Learning",
|
||||
scheme: "user",
|
||||
identifier: "U1",
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "MeSH: Cognitive Neuroscience",
|
||||
value: {
|
||||
subject: "Cognitive Neuroscience",
|
||||
scheme: "mesh",
|
||||
identifier: "D000066494",
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "FAST: Glucagonoma",
|
||||
value: {
|
||||
subject: "Glucagonoma",
|
||||
scheme: "fast",
|
||||
identifier: "943672",
|
||||
},
|
||||
},
|
||||
],
|
||||
limitToOptions: [
|
||||
{ text: "All", value: "all" },
|
||||
{ text: "MeSH", value: "mesh" },
|
||||
{ text: "FAST", value: "fast" },
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// check if files are present
|
||||
this.noFiles = false;
|
||||
if (
|
||||
!Array.isArray(this.props.files.entries) ||
|
||||
(!this.props.files.entries.length && this.props.record.is_published)
|
||||
) {
|
||||
this.noFiles = true;
|
||||
}
|
||||
}
|
||||
|
||||
formFeedbackRef = createRef();
|
||||
sidebarRef = createRef();
|
||||
|
||||
accordionStyle = {
|
||||
header: { className: "inverted brand", style: { cursor: "pointer" } },
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<DepositFormApp
|
||||
config={this.config}
|
||||
record={this.props.record}
|
||||
files={this.props.files}
|
||||
permissions={this.props.permissions}
|
||||
>
|
||||
<FormFeedback fieldPath="message" />
|
||||
<Container style={{ marginTop: "10px" }}>
|
||||
<DepositFormTitle />
|
||||
<Grid>
|
||||
<Grid.Row>
|
||||
<Grid.Column width={11}>
|
||||
<AccordionField
|
||||
fieldPath=""
|
||||
active={true}
|
||||
label={"Files"}
|
||||
ui={this.accordionStyle}
|
||||
>
|
||||
{this.noFiles && this.props.record.is_published && (
|
||||
<p
|
||||
style={{
|
||||
textAlign: "center",
|
||||
opacity: "0.5",
|
||||
cursor: "default !important",
|
||||
}}
|
||||
>
|
||||
<em>The record has no files.</em>
|
||||
</p>
|
||||
)}
|
||||
<FileUploader
|
||||
isDraftRecord={!this.props.record.is_published}
|
||||
quota={{
|
||||
maxFiles: 100,
|
||||
maxStorage: 10 ** 10,
|
||||
}}
|
||||
/>
|
||||
</AccordionField>
|
||||
|
||||
<AccordionField
|
||||
fieldPath=""
|
||||
active={true}
|
||||
label={"Basic information"}
|
||||
ui={this.accordionStyle}
|
||||
>
|
||||
{this.config.pids.map((pid) => (
|
||||
<Fragment key={pid.scheme}>
|
||||
<PIDField
|
||||
btnLabelGetPID={pid.btn_label_get_pid}
|
||||
canBeManaged={pid.can_be_managed}
|
||||
canBeUnmanaged={pid.can_be_unmanaged}
|
||||
fieldPath={`pids.${pid.scheme}`}
|
||||
isEditingPublishedRecord={
|
||||
this.props.record.is_published === true // is_published is `null` at first upload
|
||||
}
|
||||
managedHelpText={pid.managed_help_text}
|
||||
pidLabel={pid.pid_label}
|
||||
pidPlaceholder={pid.pid_placeholder}
|
||||
pidType={pid.scheme}
|
||||
unmanagedHelpText={pid.unmanaged_help_text}
|
||||
/>
|
||||
<Divider />
|
||||
</Fragment>
|
||||
))}
|
||||
|
||||
<ResourceTypeField
|
||||
options={this.vocabularies.metadata.resource_type}
|
||||
required
|
||||
/>
|
||||
<TitlesField
|
||||
options={this.vocabularies.metadata.titles}
|
||||
required
|
||||
/>
|
||||
<PublicationDateField required />
|
||||
<CreatibutorsField
|
||||
label={"Creators"}
|
||||
labelIcon={"user"}
|
||||
fieldPath={"metadata.creators"}
|
||||
roleOptions={this.vocabularies.metadata.creators.role}
|
||||
schema="creators"
|
||||
required
|
||||
/>
|
||||
<DescriptionsField
|
||||
options={this.vocabularies.metadata.descriptions}
|
||||
editorConfig={{
|
||||
removePlugins: [
|
||||
"Image",
|
||||
"ImageCaption",
|
||||
"ImageStyle",
|
||||
"ImageToolbar",
|
||||
"ImageUpload",
|
||||
"MediaEmbed",
|
||||
"Table",
|
||||
"TableToolbar",
|
||||
"TableProperties",
|
||||
"TableCellProperties",
|
||||
],
|
||||
}}
|
||||
/>
|
||||
<LicenseField
|
||||
fieldPath="metadata.rights"
|
||||
searchConfig={{
|
||||
searchApi: {
|
||||
axios: {
|
||||
headers: {
|
||||
Accept: "application/vnd.inveniordm.v1+json",
|
||||
},
|
||||
url: "/api/vocabularies/licenses",
|
||||
withCredentials: false,
|
||||
},
|
||||
},
|
||||
initialQueryState: {
|
||||
filters: [["tags", "recommended"]],
|
||||
},
|
||||
}}
|
||||
serializeLicenses={(result) => ({
|
||||
title: result.title_l10n,
|
||||
description: result.description_l10n,
|
||||
id: result.id,
|
||||
link: result.props.url,
|
||||
})}
|
||||
/>
|
||||
<br />
|
||||
</AccordionField>
|
||||
|
||||
<AccordionField
|
||||
fieldPath=""
|
||||
active={true}
|
||||
label={"Recommended information"}
|
||||
ui={this.accordionStyle}
|
||||
>
|
||||
<CreatibutorsField
|
||||
addButtonLabel={"Add contributor"}
|
||||
label={"Contributors"}
|
||||
labelIcon={"user plus"}
|
||||
fieldPath={"metadata.contributors"}
|
||||
roleOptions={this.vocabularies.metadata.contributors.role}
|
||||
schema="contributors"
|
||||
modal={{
|
||||
addLabel: "Add contributor",
|
||||
editLabel: "Edit contributor",
|
||||
}}
|
||||
/>
|
||||
{/**TODO: uncomment to use Subjects*/}
|
||||
{/* <SubjectsField
|
||||
initialOptions={_get(
|
||||
this.props.record,
|
||||
"metadata.subjects",
|
||||
null
|
||||
)}
|
||||
limitToOptions={
|
||||
this.vocabularies.metadata.subjects.limitToOptions
|
||||
}
|
||||
/>
|
||||
<ComingSoonField
|
||||
fieldPath="metadata.subjects"
|
||||
label="Subjects"
|
||||
labelIcon="tag"
|
||||
/> */}
|
||||
|
||||
<LanguagesField
|
||||
initialOptions={_get(
|
||||
this.props.record,
|
||||
"ui.languages",
|
||||
[]
|
||||
).filter((lang) => lang !== null)} // needed because dumped empty record from backend gives [null]
|
||||
serializeSuggestions={(suggestions) =>
|
||||
suggestions.map((item) => ({
|
||||
text: item.title_l10n,
|
||||
value: item.id,
|
||||
key: item.id,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<DatesField options={this.vocabularies.metadata.dates} />
|
||||
<VersionField />
|
||||
<PublisherField />
|
||||
<br />
|
||||
</AccordionField>
|
||||
{/**TODO: uncomment to use FundingField*/}
|
||||
{/* <AccordionField
|
||||
fieldPath=""
|
||||
active={true}
|
||||
label={"Funding"}
|
||||
ui={this.accordionStyle}
|
||||
>
|
||||
<FundingField options={this.vocabularies.metadata.funding} />
|
||||
<ComingSoonField
|
||||
fieldPath="metadata.funding"
|
||||
label="Awards"
|
||||
labelIcon="money bill alternate outline"
|
||||
/>
|
||||
|
||||
<br />
|
||||
</AccordionField> */}
|
||||
|
||||
<AccordionField
|
||||
fieldPath=""
|
||||
active={true}
|
||||
label={"Alternate identifiers"}
|
||||
ui={this.accordionStyle}
|
||||
>
|
||||
<IdentifiersField
|
||||
fieldPath="metadata.identifiers"
|
||||
label="Alternate identifier(s)"
|
||||
labelIcon="barcode"
|
||||
schemeOptions={
|
||||
this.vocabularies.metadata.identifiers.scheme
|
||||
}
|
||||
/>
|
||||
</AccordionField>
|
||||
|
||||
<AccordionField
|
||||
fieldPath=""
|
||||
active={true}
|
||||
label={"Related works"}
|
||||
ui={this.accordionStyle}
|
||||
>
|
||||
<RelatedWorksField
|
||||
options={this.vocabularies.metadata.identifiers}
|
||||
/>
|
||||
<br />
|
||||
</AccordionField>
|
||||
</Grid.Column>
|
||||
<Ref innerRef={this.sidebarRef}>
|
||||
<Grid.Column width={5} className="deposit-sidebar">
|
||||
<Sticky context={this.sidebarRef} offset={20}>
|
||||
<Card className="actions">
|
||||
<Card.Content>
|
||||
<div className="sidebar-buttons">
|
||||
<SaveButton fluid className="save-button" />
|
||||
<PreviewButton fluid className="preview-button" />
|
||||
</div>
|
||||
<PublishButton fluid />
|
||||
</Card.Content>
|
||||
</Card>
|
||||
|
||||
<Card className="actions">
|
||||
<Card.Content>
|
||||
<DeleteButton
|
||||
fluid
|
||||
// TODO: make is_published part of the API response
|
||||
// so we don't have to do this
|
||||
isPublished={this.props.record.is_published}
|
||||
/>
|
||||
</Card.Content>
|
||||
</Card>
|
||||
|
||||
<AccessRightField
|
||||
label={"Visibility"}
|
||||
labelIcon={"shield"}
|
||||
/>
|
||||
</Sticky>
|
||||
</Grid.Column>
|
||||
</Ref>
|
||||
</Grid.Row>
|
||||
</Grid>
|
||||
</Container>
|
||||
</DepositFormApp>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// This file is part of InvenioRDM
|
||||
// Copyright (C) 2020 CERN.
|
||||
// Copyright (C) 2020 Northwestern University.
|
||||
//
|
||||
// Invenio App RDM is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the MIT License; see LICENSE file for more details.
|
||||
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import "semantic-ui-css/semantic.min.css";
|
||||
|
||||
import { getInputFromDOM } from "react-invenio-deposit";
|
||||
import { RDMDepositForm } from "./RDMDepositForm";
|
||||
|
||||
ReactDOM.render(
|
||||
<RDMDepositForm
|
||||
record={getInputFromDOM("deposits-record")}
|
||||
files={getInputFromDOM("deposits-record-files")}
|
||||
config={getInputFromDOM("deposits-config")}
|
||||
permissions={getInputFromDOM("deposits-record-permissions")}
|
||||
/>,
|
||||
document.getElementById("deposit-form")
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.
|
||||
*/
|
||||
|
||||
// deposit form segment styling
|
||||
.ui.inverted.brand.segment {
|
||||
background-color: @greyLight !important;
|
||||
color: @tugrazBlack !important;
|
||||
label {
|
||||
color: @tugrazBlack;
|
||||
}
|
||||
}
|
||||
@@ -27,13 +27,13 @@
|
||||
display: inline;
|
||||
}
|
||||
|
||||
// align badges to the right
|
||||
.ui.items > .item .extra.labels-actions {
|
||||
float: right;
|
||||
width: auto;
|
||||
// // align badges to the right
|
||||
// .ui.items > .item .extra.labels-actions {
|
||||
// float: right;
|
||||
// width: auto;
|
||||
|
||||
// remove action buttons from search results
|
||||
.ui.small.compact.right.floated.button {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
// // remove action buttons from search results
|
||||
// .ui.small.compact.right.floated.button {
|
||||
// display: none;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
@import "search";
|
||||
@import "macros";
|
||||
@import "login";
|
||||
@import "deposit";
|
||||
@import (css)
|
||||
url("https://fonts.googleapis.com/css?family=Source+Sans+Pro&display=swap");
|
||||
|
||||
|
||||
@@ -17,16 +17,20 @@
|
||||
|
||||
// badge colors, accessibility
|
||||
@accessRight : #e9711c;
|
||||
@accessRightOpen : #e9711c;
|
||||
@accessRightOpen : @accessRight;
|
||||
@accessRightRestricted: #fbbd08;
|
||||
@accessRightEmbargoed : #db2828;
|
||||
@accessRightClosed : #db2828;
|
||||
@accessRightClosed : @accessRightEmbargoed;
|
||||
@accessRightMetadata : #2185D0;
|
||||
|
||||
// primary colors TU Graz
|
||||
@tugrazBlack: #231f20;
|
||||
@tugrazRed : #e4154b;
|
||||
|
||||
// general
|
||||
@primaryBackground: #fff;
|
||||
@primaryText : #000;
|
||||
|
||||
|
||||
// accent colors
|
||||
@greyDark : #777;
|
||||
@@ -36,24 +40,19 @@
|
||||
|
||||
|
||||
// link and button colors
|
||||
@primaryLinkInverted : #000;
|
||||
@primaryLinkBackgroundInverted: #fff;
|
||||
@primaryLink : #fff;
|
||||
@primaryLinkHoverBackground : #000;
|
||||
@primaryButton : #fff;
|
||||
@primaryButtonHoverBackground : #000;
|
||||
@primaryLinkInverted : @primaryText;
|
||||
@primaryLinkBackgroundInverted: @primaryBackground;
|
||||
@primaryLink : @primaryBackground;
|
||||
@primaryLinkHoverBackground : @primaryText;
|
||||
@primaryButton : @primaryBackground;
|
||||
@primaryButtonHoverBackground : @primaryText;
|
||||
@primaryButtonInverted : #000f;
|
||||
|
||||
|
||||
|
||||
// general
|
||||
@primaryBackground: #fff;
|
||||
@primaryText : #000;
|
||||
|
||||
|
||||
|
||||
// account (signin, signup) specific
|
||||
@primaryFormAccounts : #fff;
|
||||
@primaryFormAccounts : @primaryBackground;
|
||||
@formAccountsInputPlaceholder : silver;
|
||||
@fieldInputSelectionBackground: #50a2ce;
|
||||
@signInBackground : #245b78;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
"""invenio module for TUGRAZ theme."""
|
||||
|
||||
from flask_babelex import gettext as _
|
||||
from invenio_app_rdm.config import RECORDS_UI_ENDPOINTS
|
||||
|
||||
INVENIO_THEME_TUGRAZ_DEFAULT_VALUE = _("TU Graz Repository")
|
||||
"""Default value for the application."""
|
||||
@@ -81,15 +80,6 @@ SECURITY_REGISTER_USER_TEMPLATE = (
|
||||
)
|
||||
"""Sigup template"""
|
||||
|
||||
# Invenio-I18N
|
||||
# ============
|
||||
# See https://invenio-i18n.readthedocs.io/en/latest/configuration.html
|
||||
BABEL_DEFAULT_LOCALE = "en"
|
||||
# Default time zone
|
||||
BABEL_DEFAULT_TIMEZONE = "Europe/Vienna"
|
||||
# Other supported languages (do not include BABEL_DEFAULT_LOCALE in list).
|
||||
I18N_LANGUAGES = [("de", _("German"))]
|
||||
|
||||
# Invenio-app-rdm
|
||||
# =============
|
||||
# See https://invenio-app-rdm.readthedocs.io/en/latest/configuration.html
|
||||
@@ -119,7 +109,4 @@ DEPOSITS_HEADER_TEMPLATE = "invenio_theme_tugraz/header.html"
|
||||
TUG_ROUTES = {
|
||||
"index": "/",
|
||||
"comingsoon": "/comingsoon",
|
||||
"guide": "/guide",
|
||||
"terms": "/terms",
|
||||
"gdpr": "/gdpr",
|
||||
}
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2019-2021 CERN.
|
||||
# Copyright (C) 2019-2021 Northwestern University.
|
||||
# Copyright (C) 2021 TU Wien.
|
||||
# Copyright (C) 2021 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.
|
||||
# https://github.com/inveniosoftware/invenio-app-rdm/blob/master/invenio_app_rdm/records_ui/views/deposits.py
|
||||
"""Routes for record-related pages provided by Invenio-App-RDM."""
|
||||
|
||||
|
||||
from flask import render_template
|
||||
from flask_login import login_required
|
||||
from invenio_app_rdm.records_ui.utils import set_default_value
|
||||
from invenio_app_rdm.records_ui.views.decorators import pass_draft, pass_draft_files
|
||||
from invenio_app_rdm.records_ui.views.deposits import (
|
||||
get_form_config,
|
||||
get_search_url,
|
||||
new_record,
|
||||
)
|
||||
from invenio_rdm_records.resources.serializers import UIJSONSerializer
|
||||
|
||||
|
||||
@login_required
|
||||
def deposit_create():
|
||||
"""Create a new deposit."""
|
||||
return render_template(
|
||||
"invenio_theme_tugraz/deposit/deposit.html",
|
||||
forms_config=get_form_config(createUrl=("/api/records")),
|
||||
searchbar_config=dict(searchUrl=get_search_url()),
|
||||
record=new_record(),
|
||||
files=dict(
|
||||
default_preview=None, entries=[], links={}
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@login_required
|
||||
@pass_draft
|
||||
@pass_draft_files
|
||||
def deposit_edit(draft=None, draft_files=None, pid_value=None):
|
||||
"""Edit an existing deposit."""
|
||||
serializer = UIJSONSerializer()
|
||||
record = serializer.serialize_object_to_dict(draft.to_dict())
|
||||
|
||||
return render_template(
|
||||
"invenio_theme_tugraz/deposit/deposit.html",
|
||||
forms_config=get_form_config(apiUrl=f"/api/records/{pid_value}/draft"),
|
||||
record=record,
|
||||
files=draft_files.to_dict(),
|
||||
searchbar_config=dict(searchUrl=get_search_url()),
|
||||
permissions=draft.has_permissions_to(['new_version'])
|
||||
)
|
||||
@@ -9,8 +9,7 @@
|
||||
"""invenio module for TUGRAZ theme."""
|
||||
|
||||
from . import config
|
||||
from .deposits import deposit_create, deposit_edit
|
||||
from .views import index, record_detail
|
||||
from .views import index
|
||||
|
||||
|
||||
class InvenioThemeTugraz(object):
|
||||
@@ -26,9 +25,6 @@ class InvenioThemeTugraz(object):
|
||||
# add index route rule
|
||||
# https://flask.palletsprojects.com/en/1.1.x/api/#flask.Flask.add_url_rule
|
||||
app.add_url_rule("/", "index", index)
|
||||
app.add_url_rule("/records/<pid_value>", "record_detail", record_detail)
|
||||
app.add_url_rule("/uploads/new", "deposit_create", deposit_create)
|
||||
app.add_url_rule("/uploads/<pid_value>", "deposit_edit", deposit_edit)
|
||||
self.init_config(app)
|
||||
app.extensions["invenio-theme-tugraz"] = self
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,6 +10,7 @@
|
||||
|
||||
|
||||
{% from "invenio_accounts/_macros.html" import render_field, form_errors %}
|
||||
{%- from "invenio_oauthclient/_macros.html" import oauth_button %}
|
||||
{% block page_body %}
|
||||
<div class="spacer-long"></div>
|
||||
<div class="spacer-long"></div>
|
||||
@@ -24,16 +25,31 @@
|
||||
{%- endblock form_header %}
|
||||
<div class="ui divider"></div>
|
||||
<!--Log in with SSO-->
|
||||
{%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH %}
|
||||
<a href="{{ url_for('sso_saml.sso', idp='idp') }}" class="login-page-button ui fluid large button">
|
||||
{% trans type='TUGRAZ' %} Log in with {{ type }}{% endtrans %}
|
||||
<img src="{{ url_for('static', filename=config.INVENIO_THEME_TUGRAZ_ICON)}}" height="20px" />
|
||||
</a>
|
||||
<div class="spacer-long"></div>
|
||||
<div class="ui inverted horizontal divider"><span class="text-color">{{_ ("Or")}}</span></div>
|
||||
{%- endif %}
|
||||
{% if config.OAUTHCLIENT_REMOTE_APPS or config.SSO_SAML_IDPS %}
|
||||
<div class="ui form">
|
||||
{% for name in config.OAUTHCLIENT_REMOTE_APPS.keys() %}
|
||||
{{ oauth_button(name, next=request.args.get('next')) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% for name in config.SSO_SAML_IDPS.keys() %}
|
||||
<div class="field">
|
||||
<a class="login-page-button ui fluid large button" href="{{ url_for('sso_saml.sso', idp=name) }}">
|
||||
{{
|
||||
_('Sign in with %(title)s', title=config.SSO_SAML_IDPS[name]['title']|default("SAML", true))
|
||||
}}
|
||||
<img src="{{ url_for('static', filename=config.INVENIO_THEME_TUGRAZ_ICON)}}" height="20px" />
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{%- if config.ACCOUNTS_LOCAL_LOGIN_ENABLED %}
|
||||
<div class="ui horizontal divider">
|
||||
{{ _("Or") }}
|
||||
</div>
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
|
||||
{%- block form_outer %}
|
||||
{%- if config.ACCOUNTS_LOCAL_LOGIN_ENABLED %}
|
||||
{%- with form = login_user_form %}
|
||||
<div style="padding-bottom: 20px;padding-top: 6px;">
|
||||
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form" class="ui big form">
|
||||
@@ -47,6 +63,7 @@
|
||||
</form>
|
||||
</div>
|
||||
{%- endwith %}
|
||||
{%- endif %}
|
||||
{%- endblock form_outer %}
|
||||
<div class="divider hidden"></div>
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
{#
|
||||
Copyright (C) 2020 CERN.
|
||||
Copyright (C) 2020 Northwestern University.
|
||||
Copyright (C) 2021 Graz University of Technology.
|
||||
|
||||
Invenio App RDM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the MIT License; see LICENSE file for more details.
|
||||
#}
|
||||
{%- if not record.is_published and record.versions.index and record.versions.index > 1%}
|
||||
{%- set title = _("New version") %}
|
||||
{%- elif not record.is_published %}
|
||||
{%- set title = _("New upload") %}
|
||||
{% else %}
|
||||
{%- set title = _("Edit upload") %}
|
||||
{%- endif %}
|
||||
{%- extends config.BASE_TEMPLATE %}
|
||||
|
||||
{%- block page_body %}
|
||||
{%- if record %}
|
||||
<input id="deposits-record" type="hidden" name="deposits-record" value='{{record | tojson }}'></input>
|
||||
{%- endif %}
|
||||
{%- if files %}
|
||||
<input id="deposits-record-files" type="hidden" name="deposits-record-files" value='{{files | tojson }}'></input>
|
||||
{%- endif %}
|
||||
{%- if forms_config %}
|
||||
<input type="hidden" name="deposits-config" value='{{forms_config | tojson }}'></input>
|
||||
{%- endif %}
|
||||
{%- if permissions %}
|
||||
<input id="deposits-record-permissions" type="hidden" name="deposits-record-permissions" value='{{permissions | tojson }}'></input>
|
||||
{%- endif %}
|
||||
<div id="deposit-form"></div>
|
||||
{%- endblock page_body %}
|
||||
|
||||
{%- block javascript %}
|
||||
{{ super() }}
|
||||
{{ webpack['invenio-theme-tugraz-rdm-deposit.js'] }}
|
||||
{%- endblock %}
|
||||
@@ -34,7 +34,7 @@ details.
|
||||
{{_ ("Documentation")}} <i class="external alternate icon"></i>
|
||||
</a>
|
||||
<br>
|
||||
<a href="{{ url_for('invenio_theme_tugraz.guide') }}"
|
||||
<a href="{{ url_for('invenio_config_tugraz.guide') }}"
|
||||
title="Quick guide" target="_blank">
|
||||
{{_ ("Reference Guide")}} <i class="download icon"></i>
|
||||
</a>
|
||||
@@ -44,12 +44,12 @@ details.
|
||||
{{_ ("Search Guide")}}<i class="angle right icon"></i>
|
||||
</a>
|
||||
<br>
|
||||
<a href="{{ url_for('invenio_theme_tugraz.gdpr') }}"
|
||||
<a href="{{ url_for('invenio_config_tugraz.gdpr') }}"
|
||||
title="General Data Protection Rights" target="_blank">
|
||||
{{_ ("Data Protection")}} <i class="download icon"></i>
|
||||
</a>
|
||||
<br>
|
||||
<a href="{{ url_for('invenio_theme_tugraz.terms') }}"
|
||||
<a href="{{ url_for('invenio_config_tugraz.terms') }}"
|
||||
title="Terms and Conditions" target="_blank">
|
||||
{{_ ("Terms and Conditions")}} <i class="download icon"></i>
|
||||
</a>
|
||||
|
||||
@@ -58,15 +58,15 @@
|
||||
-->
|
||||
<div class="badges">
|
||||
<!--Publication date/Version badge-->
|
||||
<span class="ui label blue" title="{{_('Publication date')}}">
|
||||
<span class="ui label blue" data-tooltip="{{_('Publication date')}}" data-inverted="">
|
||||
{{ r.metadata.publication_date }} {{ '(' ~ r.metadata.version ~ ')' if r.metadata.version }}
|
||||
</span>
|
||||
|
||||
<!--Resource type badge-->
|
||||
<span class="ui label grey" title="{{_('Resource type')}}">
|
||||
{{r.metadata.resource_type | cast_to_dict | vocabulary_title('resource_type') }}
|
||||
<span class="ui label grey" data-tooltip="{{_('Resource type')}}" data-inverted>
|
||||
{{ r.ui.resource_type.title_l10n }}
|
||||
</span>
|
||||
|
||||
|
||||
<span class="ui label access-status {{ r.ui.access_status.id }}" data-tooltip="{{ r.ui.access_status.description_l10n }}" data-inverted="">
|
||||
{% if r.ui.access_status.icon %}<i class="icon {{ r.ui.access_status.icon }}"></i>{% endif %}
|
||||
{{ r.ui.access_status.title_l10n }}
|
||||
@@ -108,22 +108,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Disabled on feb-relase - enable when stable-->
|
||||
<!-- <div class="right floated column">
|
||||
<span class="access-right">
|
||||
<i class="icon lock open"></i>
|
||||
{{ r.access.access_right | make_dict_like('access_right') | vocabulary_title('access_right') }}
|
||||
{%- for right in r.metadata.rights %}
|
||||
<a target="_blank" href="{{right.url}}">{{ '(' ~ right.identifier ~ ')' }}</a>
|
||||
{%- endfor %}
|
||||
|
||||
</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<!----TODO: more versions
|
||||
-->
|
||||
|
||||
{%- endfor %}
|
||||
{% if records %}
|
||||
|
||||
@@ -1,205 +0,0 @@
|
||||
{#
|
||||
Copyright (C) 2020-2021 CERN.
|
||||
Copyright (C) 2020-2021 Northwestern University.
|
||||
Copyright (C) 2021 TU Wien.
|
||||
Copyright (C) 2021 Graz University of Technology.
|
||||
|
||||
Invenio RDM Records is free software; you can redistribute it and/or modify
|
||||
it under the terms of the MIT License; see LICENSE file for more details.
|
||||
#}
|
||||
|
||||
{%- extends config.BASE_TEMPLATE %}
|
||||
|
||||
{%- from "invenio_app_rdm/records/macros/files.html" import file_list_box, preview_file_box %}
|
||||
{%- from "invenio_app_rdm/records/macros/detail.html" import show_detail %}
|
||||
|
||||
{%- set title = record.metadata.title -%}
|
||||
{%- set metadata = record.metadata %}
|
||||
|
||||
{%- block page_body %}
|
||||
<div class="banners">
|
||||
{% if is_preview %}
|
||||
<div class="ui info flashed top-attached manage message">
|
||||
<div class="ui container">
|
||||
<div class="ui relaxed grid">
|
||||
<div class="column">
|
||||
<div class="row">
|
||||
<div class="header">
|
||||
<i class="eye icon"></i> Preview
|
||||
</div>
|
||||
<p>
|
||||
{% if record.is_published %}
|
||||
You are previewing changes that have not yet been published.
|
||||
{% endif %}
|
||||
|
||||
{% if not record.is_published and record.versions.index == 1 %}
|
||||
You are previewing a new record that has not yet been published.
|
||||
{% endif %}
|
||||
|
||||
{% if not record.is_published and record.versions.index > 1 %}
|
||||
You are previewing a new record version that has not yet been published.
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if permissions is defined and permissions.can_edit and not is_preview %}
|
||||
<div class="ui warning flashed top-attached manage message">
|
||||
<div class="ui container">
|
||||
<div id="recordManagement" data-record='{{ record | tojson }}' data-permissions='{{ permissions | tojson }}'></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if (not record.versions.is_latest and not is_preview) or (is_preview and not record.versions.is_latest_draft) %}
|
||||
<div class="ui warning flashed top-attached manage message">
|
||||
<div class="ui container">
|
||||
<div class="ui relaxed grid">
|
||||
<div class="column">
|
||||
<div class="row">
|
||||
<p>
|
||||
{% trans link_start=('<a href="' + record.links.latest_html + '"><b>')|safe, link_end='</b></a>'|safe %}
|
||||
There is a {{ link_start }}newer version{{ link_end }} of the record available.
|
||||
{% endtrans %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ui container">
|
||||
<div class="ui relaxed grid">
|
||||
<div class="two column row top-padded">
|
||||
<div class="eleven wide column">
|
||||
{% if record.access.record == 'restricted' %}
|
||||
<div class="ui {{ record.ui.access_status.message_class }} message">
|
||||
<strong><i class="{{ record.ui.access_status.icon }} icon"></i>{{ record.ui.access_status.title_l10n }}</strong> {{ record.ui.access_status.description_l10n }}
|
||||
{% if record.access.embargo.reason %}
|
||||
<p>Reason: {{ record.access.embargo.reason }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- block record_body -%}
|
||||
{%- block record_header -%}
|
||||
<div class="ui grid middle aligned">
|
||||
<div class="two column row">
|
||||
<div class="left floated left aligned column">
|
||||
<span class="ui" title="Publication date">{{ record.ui.publication_date_l10n_long }}</span>
|
||||
<span class="label text-muted"> | Version {{ record.ui.version }}</span>
|
||||
</div>
|
||||
<div class="right floated right aligned column">
|
||||
<span class="ui label small grey">{{ record.ui.resource_type }}</span>
|
||||
<span class="ui label small access-status {{ record.ui.access_status.id }}" data-tooltip="{{ record.ui.access_status.description_l10n }}" data-inverted="">
|
||||
{% if record.ui.access_status.icon %}<i class="icon {{ record.ui.access_status.icon }}"></i>{% endif %}
|
||||
{{ record.ui.access_status.title_l10n }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endblock record_header -%}
|
||||
{%- block record_title -%}
|
||||
<h1>{{ metadata.title }}</h1>
|
||||
<p>{%- include "invenio_app_rdm/records/details/creators.html" %}</p>
|
||||
{%- endblock record_title -%}
|
||||
{%- block record_content -%}
|
||||
<p>{%- include "invenio_app_rdm/records/details/contributors.html" %}</p>
|
||||
<p>{%- include "invenio_app_rdm/records/details/doi.html" %}</p>
|
||||
{%- include "invenio_app_rdm/records/details/subjects.html" %}
|
||||
<div class="top-padded">
|
||||
{%- include "invenio_app_rdm/records/details/description.html" %}
|
||||
</div>
|
||||
<div class="top-padded">
|
||||
{%- include "invenio_app_rdm/records/details/licenses.html" %}
|
||||
</div>
|
||||
{%- endblock record_content -%}
|
||||
|
||||
{# files #}
|
||||
{%- block record_files -%}
|
||||
{%- if record.files.enabled -%}
|
||||
{%- if permissions.can_read_files -%}
|
||||
{# record has files AND user can see files #}
|
||||
{%- set files = files|order_entries %}
|
||||
{%- if files|has_previewable_files -%}
|
||||
{%-set preview_file = files|select_preview_file(default_preview=record.files.default_preview) %}
|
||||
{{ preview_file_box(preview_file, pid, is_preview, record) }}
|
||||
{%- endif -%}
|
||||
{{ file_list_box(files, pid, is_preview, record) }}
|
||||
{% else %}
|
||||
{# record has files BUT user cannot see files #}
|
||||
<div class="panel-spacing">
|
||||
<div class="ui accordion panel {{ record.ui.access_status.id }}" id="preview" href="#collapsablePreview">
|
||||
<div class="active title panel-heading {{ record.ui.access_status.id }}">
|
||||
{{ _("Files") }}
|
||||
<i class="angle down icon"></i>
|
||||
</div>
|
||||
<div id="collapsablePreview" class="active content">
|
||||
<div class="ui {{ record.ui.access_status.message_class }} message file-box-message">
|
||||
<i class="ui {{ record.ui.access_status.icon }} icon"></i><b>{{ record.ui.access_status.title_l10n }}</b>
|
||||
<p>{{ record.ui.access_status.description_l10n }}</p>
|
||||
{% if record.access.embargo.reason %}
|
||||
<p>{{_("Reason")}}: {{record.access.embargo.reason}}</p>
|
||||
{% endif%}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- endblock record_files -%}
|
||||
|
||||
{%- block record_details -%}
|
||||
{# More details #}
|
||||
<div class="top-padded">
|
||||
{%- include "invenio_app_rdm/records/details/details.html" %}
|
||||
</div>
|
||||
{%- endblock record_details -%}
|
||||
{%- block record_footer -%}
|
||||
<div class="ui grid">
|
||||
<div class="two column row top-bottom-padded font-small">
|
||||
<div class="four wide column">
|
||||
<p><b>Upload information</b></p>
|
||||
</div>
|
||||
<div class="twelve wide column">
|
||||
<span class="label text-muted">
|
||||
<b>Created:</b> {{ record.ui.created_date_l10n_long }} | <b>Modified:</b> {{ record.ui.updated_date_l10n_long }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endblock record_footer -%}
|
||||
{%- block jump -%}
|
||||
<div class="ui grid">
|
||||
<div class="centered row" id="jump-btn">
|
||||
<a style="cursor: pointer;">
|
||||
<span class="ui button">
|
||||
<i class="arrow alternate circle up outline icon"></i>Jump up</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{%- endblock jump -%}
|
||||
{%- endblock record_body %}
|
||||
</div>
|
||||
<div class="five wide column">
|
||||
{% block record_sidebar %}
|
||||
{%- include "invenio_app_rdm/records/details/side_bar.html" %}
|
||||
{% endblock record_sidebar %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{%- endblock page_body %}
|
||||
|
||||
{%- block javascript %}
|
||||
{{ super() }}
|
||||
{{ webpack['invenio-app-rdm-landing-page.js'] }}
|
||||
{# Communities management -- TODO include again when communities are ready #}
|
||||
{# {{ webpack['invenio-communities-records.js'] }} #}
|
||||
{{ webpack['previewer_theme.js'] }}
|
||||
{%- endblock javascript %}
|
||||
@@ -15,7 +15,7 @@
|
||||
<a href="{{creators.identifiers.orcid|pid_url('orcid')}}" target="_blank" ><img class="inline-orcid" src="{{ url_for('static', filename='extra/orcid.png')}}" /></a>
|
||||
{%- endif %}
|
||||
|
||||
<span class="text-muted" {% if creators.affiliations %} {% for affiliation in creators.affiliations %} data-toggle="tooltip" title="{{affiliation.name}}" {%- endfor %} {% endif %}>{{creators.person_or_org.name}}</span>
|
||||
<span class="text-muted" {% if creators.affiliations %} {% for affiliation in creators.affiliations %} data-tooltip="{{affiliation.name}}" data-inverted="" {%- endfor %} {% endif %}>{{creators.person_or_org.name}}</span>
|
||||
{% if not loop.last %}; {% endif %}
|
||||
|
||||
{%- endfor %}
|
||||
|
||||
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: invenio-theme-tugraz 1.0.4\n"
|
||||
"Report-Msgid-Bugs-To: mojib.wali@tugraz.at\n"
|
||||
"POT-Creation-Date: 2021-05-10 10:36+0200\n"
|
||||
"POT-Creation-Date: 2021-06-22 10:21+0200\n"
|
||||
"PO-Revision-Date: 2020-10-06 10:27+0200\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language: de\n"
|
||||
@@ -198,22 +198,36 @@ msgid "to change the font size."
|
||||
msgstr "Um die Schriftgröße zu ändern."
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:117
|
||||
#, python-format
|
||||
#, fuzzy, python-format
|
||||
msgid ""
|
||||
"<strong>Powered by</strong>\n"
|
||||
" <a href=\"%(invenio_rdm)s\" target=\"_blank\">"
|
||||
msgstr ""
|
||||
"<strong>Powered by</strong> <a href=\"%(invenio_rdm)s\" "
|
||||
"target=\"_blank\">"
|
||||
" <a href=\"%(invenio_rdm)s\" target=\"_blank\" "
|
||||
"title=\"invenioRDM\">"
|
||||
msgstr "<strong>Powered by</strong> <a href=\"%(invenio_rdm)s\" target=\"_blank\">"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:127
|
||||
#, python-format
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:126
|
||||
#, fuzzy, python-format
|
||||
msgid ""
|
||||
"<strong>Enabled by</strong>\n"
|
||||
" <a href=\"%(fair_data)s\" target=\"_blank\">"
|
||||
" <a href=\"%(fair_data)s\" target=\"_blank\" title=\"Fair Data"
|
||||
" Austria\">"
|
||||
msgstr "<strong>Enabled by</strong> <a href=\"%(fair_data)s\" target=\"_blank\">"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:140
|
||||
#, python-format
|
||||
msgid ""
|
||||
"\n"
|
||||
" <a href=\"%(oea)s\" target=\"_blank\" title=\"Open Education "
|
||||
"Austria\">"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:157
|
||||
#, python-format
|
||||
msgid ""
|
||||
"\n"
|
||||
" <a href=\"%(re3data)s\" target=\"_blank\" title=\"Registry of "
|
||||
"Research Data Repositories\">"
|
||||
msgstr ""
|
||||
"<strong>Enabled by</strong> <a href=\"%(fair_data)s\" "
|
||||
"target=\"_blank\">"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html:61
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html:11
|
||||
@@ -323,7 +337,7 @@ msgid "TECHNOLOGY"
|
||||
msgstr "LEIDENSCHAFT"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/header_login.html:8
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:59
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:76
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/register_user.html:78
|
||||
msgid "Sign up"
|
||||
msgstr "Registrierung"
|
||||
@@ -336,30 +350,30 @@ msgstr "Einloggen"
|
||||
msgid "Sign out"
|
||||
msgstr "Ausloggen"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:23
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:24
|
||||
msgid "Log in to Repository"
|
||||
msgstr "Anmelden"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:29
|
||||
#, python-format
|
||||
msgid " Log in with %(type)s"
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:38
|
||||
#, fuzzy, python-format
|
||||
msgid "Sign in with %(title)s"
|
||||
msgstr "Einloggen mit"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:33
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:46
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/register_user.html:52
|
||||
msgid "Or"
|
||||
msgstr "Oder"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:45
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:61
|
||||
msgid "Log In"
|
||||
msgstr "Einloggen"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:58
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:75
|
||||
#, python-format
|
||||
msgid "New to %(sitename)s?"
|
||||
msgstr "Neu im %(sitename)s?"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:68
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:85
|
||||
msgid "Forgot password?"
|
||||
msgstr "Passwort vergessen"
|
||||
|
||||
@@ -436,10 +450,6 @@ msgstr ""
|
||||
msgid "Reason"
|
||||
msgstr "Grund"
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html:52
|
||||
msgid "Uploads"
|
||||
msgstr "Hochladen"
|
||||
|
||||
#~ msgid "Version"
|
||||
#~ msgstr "Version"
|
||||
|
||||
@@ -452,7 +462,6 @@ msgstr "Hochladen"
|
||||
#~ msgid "Handbook"
|
||||
#~ msgstr "Handbuch"
|
||||
|
||||
|
||||
#~ msgid "RDM DOI Badge"
|
||||
#~ msgstr "RDM DOI Abzeichen"
|
||||
|
||||
@@ -470,3 +479,6 @@ msgstr "Hochladen"
|
||||
#~ " <a href=\"%(fair_data)s\" target=\"_blank\">"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid "Uploads"
|
||||
#~ msgstr "Hochladen"
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: invenio-theme-tugraz 3.0.1\n"
|
||||
"Project-Id-Version: invenio-theme-tugraz 3.4.1\n"
|
||||
"Report-Msgid-Bugs-To: mojib.wali@tugraz.at\n"
|
||||
"POT-Creation-Date: 2021-05-10 10:36+0200\n"
|
||||
"POT-Creation-Date: 2021-06-22 10:21+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -190,14 +190,32 @@ msgstr ""
|
||||
#, python-format
|
||||
msgid ""
|
||||
"<strong>Powered by</strong>\n"
|
||||
" <a href=\"%(invenio_rdm)s\" target=\"_blank\">"
|
||||
" <a href=\"%(invenio_rdm)s\" target=\"_blank\" "
|
||||
"title=\"invenioRDM\">"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:127
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:126
|
||||
#, python-format
|
||||
msgid ""
|
||||
"<strong>Enabled by</strong>\n"
|
||||
" <a href=\"%(fair_data)s\" target=\"_blank\">"
|
||||
" <a href=\"%(fair_data)s\" target=\"_blank\" title=\"Fair Data"
|
||||
" Austria\">"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:140
|
||||
#, python-format
|
||||
msgid ""
|
||||
"\n"
|
||||
" <a href=\"%(oea)s\" target=\"_blank\" title=\"Open Education "
|
||||
"Austria\">"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/footer.html:157
|
||||
#, python-format
|
||||
msgid ""
|
||||
"\n"
|
||||
" <a href=\"%(re3data)s\" target=\"_blank\" title=\"Registry of "
|
||||
"Research Data Repositories\">"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html:61
|
||||
@@ -307,7 +325,7 @@ msgid "TECHNOLOGY"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/header_login.html:8
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:59
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:76
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/register_user.html:78
|
||||
msgid "Sign up"
|
||||
msgstr ""
|
||||
@@ -320,30 +338,30 @@ msgstr ""
|
||||
msgid "Sign out"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:23
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:24
|
||||
msgid "Log in to Repository"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:29
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:38
|
||||
#, python-format
|
||||
msgid " Log in with %(type)s"
|
||||
msgid "Sign in with %(title)s"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:33
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:46
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/register_user.html:52
|
||||
msgid "Or"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:45
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:61
|
||||
msgid "Log In"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:58
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:75
|
||||
#, python-format
|
||||
msgid "New to %(sitename)s?"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:68
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login_user.html:85
|
||||
msgid "Forgot password?"
|
||||
msgstr ""
|
||||
|
||||
@@ -414,6 +432,3 @@ msgstr ""
|
||||
msgid "Reason"
|
||||
msgstr ""
|
||||
|
||||
#: invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html:52
|
||||
msgid "Uploads"
|
||||
msgstr ""
|
||||
@@ -12,4 +12,4 @@ This file is imported by ``invenio_theme_tugraz.__init__``,
|
||||
and parsed by ``setup.py``.
|
||||
"""
|
||||
|
||||
__version__ = "3.0.2"
|
||||
__version__ = "3.6.0"
|
||||
|
||||
@@ -12,17 +12,8 @@ import binascii
|
||||
from os import environ
|
||||
from typing import Dict
|
||||
|
||||
import requests
|
||||
from elasticsearch_dsl.utils import AttrDict
|
||||
from flask import Blueprint, current_app, g, redirect, render_template, request, url_for
|
||||
from flask_babelex import get_locale
|
||||
from flask_login import login_required
|
||||
from flask_menu import current_menu
|
||||
from invenio_app_rdm.records_ui.views.decorators import (
|
||||
pass_is_preview,
|
||||
pass_record_files,
|
||||
pass_record_or_draft,
|
||||
)
|
||||
from flask import Blueprint, render_template
|
||||
from invenio_rdm_records.resources.serializers import UIJSONSerializer
|
||||
|
||||
from .search import FrontpageRecordsSearch
|
||||
@@ -41,9 +32,6 @@ def ui_blueprint(app):
|
||||
|
||||
blueprint.add_url_rule(routes["index"], view_func=index)
|
||||
blueprint.add_url_rule(routes["comingsoon"], view_func=comingsoon)
|
||||
blueprint.add_url_rule(routes["guide"], view_func=guide)
|
||||
blueprint.add_url_rule(routes["terms"], view_func=terms)
|
||||
blueprint.add_url_rule(routes["gdpr"], view_func=gdpr)
|
||||
|
||||
@blueprint.app_template_filter("make_dict_like")
|
||||
def make_dict_like(value: str, key: str) -> Dict[str, str]:
|
||||
@@ -61,60 +49,24 @@ def ui_blueprint(app):
|
||||
return blueprint
|
||||
|
||||
|
||||
def records_serializer(records=None):
|
||||
"""Serialize list of records."""
|
||||
record_list = []
|
||||
for record in records:
|
||||
record_list.append(UIJSONSerializer().serialize_object_to_dict(record.to_dict()))
|
||||
return record_list
|
||||
|
||||
|
||||
def index():
|
||||
"""Frontpage."""
|
||||
records = FrontpageRecordsSearch()[:5].sort("-created").execute()
|
||||
for r in records:
|
||||
r = UIJSONSerializer().serialize_object_to_dict(r.to_dict())
|
||||
|
||||
return render_template(
|
||||
"invenio_theme_tugraz/index.html",
|
||||
records=records
|
||||
records=records_serializer(records)
|
||||
)
|
||||
|
||||
|
||||
def comingsoon():
|
||||
"""Comingsoon."""
|
||||
return render_template("invenio_theme_tugraz/comingsoon.html")
|
||||
|
||||
|
||||
def guide():
|
||||
"""TUGraz_Repository_Guide."""
|
||||
locale = get_locale()
|
||||
return redirect(url_for('static',
|
||||
filename=f'documents/TUGraz_Repository_Guide_01_{locale}.pdf',
|
||||
_external=True))
|
||||
|
||||
|
||||
def terms():
|
||||
"""Terms_And_Conditions."""
|
||||
locale = get_locale()
|
||||
return redirect(url_for('static',
|
||||
filename=f'documents/TUGraz_Repository_Terms_And_Conditions_{locale}.pdf',
|
||||
_external=True))
|
||||
|
||||
|
||||
def gdpr():
|
||||
"""General_Data_Protection_Rights."""
|
||||
locale = get_locale()
|
||||
return redirect(url_for('static',
|
||||
filename=f'documents/TUGraz_Repository_General_Data_Protection_Rights_{locale}.pdf',
|
||||
_external=True))
|
||||
|
||||
|
||||
@pass_is_preview
|
||||
@pass_record_or_draft
|
||||
@pass_record_files
|
||||
def record_detail(record=None, files=None, pid_value=None, is_preview=False):
|
||||
"""Record detail page (aka landing page)."""
|
||||
files_dict = None if files is None else files.to_dict()
|
||||
|
||||
return render_template(
|
||||
"invenio_theme_tugraz/landingpage/detail.html",
|
||||
record=UIJSONSerializer().serialize_object_to_dict(record.to_dict()),
|
||||
pid=pid_value,
|
||||
files=files_dict,
|
||||
permissions=record.has_permissions_to(['edit', 'new_version', 'manage',
|
||||
'update_draft', 'read_files']),
|
||||
is_preview=is_preview,
|
||||
)
|
||||
|
||||
@@ -17,25 +17,9 @@ theme = WebpackThemeBundle(
|
||||
entry={
|
||||
"invenio-theme-tugraz-theme": "./less/invenio_theme_tugraz/theme.less",
|
||||
"invenio-theme-tugraz-js": "./js/invenio_theme_tugraz/theme.js",
|
||||
# overrides RDM deposit form
|
||||
'invenio-theme-tugraz-rdm-deposit': './js/invenio_theme_tugraz/deposit/index.js',
|
||||
},
|
||||
dependencies={
|
||||
# add any additional npm dependencies here...
|
||||
# Keep these dep: in sync with releases
|
||||
"@babel/runtime": "^7.9.0",
|
||||
'formik': '^2.1.4',
|
||||
'luxon': '^1.23.0',
|
||||
'path': '^0.12.7',
|
||||
'prop-types': '^15.7.2',
|
||||
'react-dnd': '^11.1.3',
|
||||
'react-dnd-html5-backend': '^11.1.3',
|
||||
'react-invenio-deposit': '^0.13.5',
|
||||
'react-invenio-forms': '^0.7.0',
|
||||
'react-dropzone': "^11.0.3",
|
||||
'yup': '^0.27.0',
|
||||
'@ckeditor/ckeditor5-build-classic': '^16.0.0',
|
||||
'@ckeditor/ckeditor5-react': '^2.1.0',
|
||||
},
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user