diff --git a/docs/customise-client/api.md b/docs/customise-client/api.md index 14c26404b..47648220f 100644 --- a/docs/customise-client/api.md +++ b/docs/customise-client/api.md @@ -27,6 +27,9 @@ A useful reference may be the [customisation JSON file](https://github.com/nexts * `googleAnalyticsKey` You can specify a Google Analytics key to enable (some) analytics functionality. More documentation to come. * `serverAddress` Specify the address / prefix which the auspice client uses for API requests. + +> Please remember to make any modifications, including customisations described here, publicly available. See [the previous page](./index.rst) for more details. + --- ### Sidebar Theme diff --git a/docs/customise-client/index.rst b/docs/customise-client/index.rst index 44f0b5491..8db31355d 100644 --- a/docs/customise-client/index.rst +++ b/docs/customise-client/index.rst @@ -23,6 +23,12 @@ This is achieved by providing a JSON at build time to Auspice which defines the See the `client customisation API `_ for the available options. +AGPL Source Code Requirement +============================ + +Auspice is distributed under `AGPL 3.0 `_. +Any modifications made to the auspice source code, including build-time customisations as described here, must be made publicly available. +We ask that the "Powered by Nextstrain" text and link, rendered below the data visualisations, be maintained in all customised versions of auspice, in keeping with the spirit of scientific citations. .. toctree:: diff --git a/docs/server/index.rst b/docs/server/index.rst index d9ac68649..cbf05a808 100644 --- a/docs/server/index.rst +++ b/docs/server/index.rst @@ -48,6 +48,12 @@ You can customise the default Auspice server by supplying your own handlers for See `the API documentation <../server/api.html#suppling-custom-handlers-to-the-auspice-server>`_ for how to define these and provide them to `auspice view`. +AGPL Source Code Requirement +============================ + +Auspice is distributed under `AGPL 3.0 `_. +Any modifications made to the auspice source code, including the auspice server, must be made publicly available. + Writing Your Own Custom Server ====================================== diff --git a/src/components/framework/fine-print.js b/src/components/framework/fine-print.js new file mode 100644 index 000000000..9ba35ed8a --- /dev/null +++ b/src/components/framework/fine-print.js @@ -0,0 +1,129 @@ +import React from "react"; +import { connect } from "react-redux"; +import styled from 'styled-components'; +import { withTranslation } from "react-i18next"; +import { FaDownload } from "react-icons/fa"; +import { dataFont, medGrey, materialButton } from "../../globalStyles"; +import { TRIGGER_DOWNLOAD_MODAL } from "../../actions/types"; +import Flex from "./flex"; +import { version } from "../../version"; +import { publications } from "../download/downloadModal"; + +const logoPNG = require("../../images/favicon.png"); + +const dot = ( + + • + +); + +export const FinePrintStyles = styled.div` + margin-left: 30px; + padding-bottom: 30px; + font-family: ${dataFont}; + font-size: 15px; + font-weight: 300; + color: rgb(136, 136, 136); + line-height: 1.4; + + .line { + margin-top: 20px; + margin-bottom: 20px; + border-bottom: 1px solid #CCC; + } + + .finePrint { + font-size: 14px; + } + + .logoContainer { + padding: 1px 1px; + margin-right: 5px; + width: 24px; + cursor: pointer; + } + + .logo { + margin-left: 1px; + margin-right: 1px; + margin-top: 1px; + margin-bottom: 3px; + } + +`; + +@connect((state) => { + return { + tree: state.tree, + metadata: state.metadata, + browserDimensions: state.browserDimensions.browserDimensions + }; +}) +class FinePrint extends React.Component { + shouldComponentUpdate(nextProps) { + if (this.props.browserDimensions !== nextProps.browserDimensions) { + return true; + } + return false; + } + + getUpdated() { + const { t } = this.props; + if (this.props.metadata.updated) { + return ({t("Data updated")} {this.props.metadata.updated}); + } + return null; + } + downloadDataButton() { + const { t } = this.props; + return ( + + ); + } + + render() { + if (!this.props.metadata || !this.props.tree.nodes) return null; + const width = this.props.width - 30; // need to subtract margin when calculating div width + return ( + +
+ + {this.getUpdated()} + {dot} + {this.downloadDataButton()} + {dot} + {"Auspice v" + version} + +
+ + {getCitation()} + +
+ + ); + } +} + +const WithTranslation = withTranslation()(FinePrint); +export default WithTranslation; + +export function getCitation() { + return ( + + + nextstrain.org + + {"Powered by Nextstrain ("} + + {publications.nextstrain.author} {publications.nextstrain.journal} + + {")"} + + ); +} diff --git a/src/components/framework/footer.js b/src/components/framework/footer.js index e935af4bd..a1672ac61 100644 --- a/src/components/framework/footer.js +++ b/src/components/framework/footer.js @@ -2,28 +2,18 @@ import React, { Suspense, lazy } from "react"; import { connect } from "react-redux"; import styled from 'styled-components'; import { withTranslation } from "react-i18next"; -import { FaDownload } from "react-icons/fa"; -import { dataFont, medGrey, materialButton } from "../../globalStyles"; -import { TRIGGER_DOWNLOAD_MODAL } from "../../actions/types"; +import { dataFont } from "../../globalStyles"; import Flex from "./flex"; import { applyFilter } from "../../actions/tree"; -import { version } from "../../version"; -import { publications } from "../download/downloadModal"; import { isValueValid } from "../../util/globals"; import hardCodedFooters from "./footer-descriptions"; import { SimpleFilter } from "../info/filterBadge"; const MarkdownDisplay = lazy(() => import("../markdownDisplay")); -const dot = ( - - • - -); - const FooterStyles = styled.div` margin-left: 30px; - padding-bottom: 30px; + padding-bottom: 0px; font-family: ${dataFont}; font-size: 15px; font-weight: 300; @@ -103,10 +93,6 @@ const FooterStyles = styled.div` border-bottom: 1px solid #CCC; } - .finePrint { - font-size: 14px; - } - .acknowledgments { margin-top: 10px; } @@ -235,36 +221,6 @@ class Footer extends React.Component { ); } - getUpdated() { - const { t } = this.props; - if (this.props.metadata.updated) { - return ({t("Data updated")} {this.props.metadata.updated}); - } - return null; - } - downloadDataButton() { - const { t } = this.props; - return ( - - ); - } - getCitation() { - return ( - - {"Nextstrain: "} - - {publications.nextstrain.author}, {publications.nextstrain.journal}{` (${publications.nextstrain.year})`} - - - ); - } - render() { if (!this.props.metadata || !this.props.tree.nodes) return null; const width = this.props.width - 30; // need to subtract margin when calculating div width @@ -284,25 +240,11 @@ class Footer extends React.Component {
); })} - - {this.getUpdated()} - {dot} - {this.downloadDataButton()} - {dot} - {"Auspice v" + version} - -
- - {this.getCitation()} -
); } } -// {dot} -// - const WithTranslation = withTranslation()(Footer); export default WithTranslation; diff --git a/src/components/main/index.js b/src/components/main/index.js index 74eae38d5..a61f10627 100644 --- a/src/components/main/index.js +++ b/src/components/main/index.js @@ -8,6 +8,7 @@ import Tree from "../tree"; import Map from "../map/map"; import { controlsHiddenWidth } from "../../util/globals"; import Footer from "../framework/footer"; +import FinePrint from "../framework/fine-print"; import DownloadModal from "../download/downloadModal"; import { analyticsNewPage } from "../../util/googleAnalytics"; import handleFilesDropped from "../../actions/filesDropped"; @@ -155,7 +156,8 @@ class Main extends React.Component { ) : null } - {this.props.displayNarrative|| this.props.showOnlyPanels ? null :