diff --git a/js/app.js b/js/app.js
index dc8e3d62..b93a1e87 100644
--- a/js/app.js
+++ b/js/app.js
@@ -55,7 +55,7 @@ const AppGateway = {
if (subdomain) {
// Some whitelabels have landing pages so we should not automatically redirect from / to /collection.
// Only www and cc do not have a landing page.
- if (subdomain !== 'cc') {
+ if (subdomain !== 'cc' || subdomain === 'bokk') {
redirectRoute = null;
}
diff --git a/js/components/ascribe_accordion_list/accordion_list_item_wallet.js b/js/components/ascribe_accordion_list/accordion_list_item_wallet.js
index e752451e..804bf193 100644
--- a/js/components/ascribe_accordion_list/accordion_list_item_wallet.js
+++ b/js/components/ascribe_accordion_list/accordion_list_item_wallet.js
@@ -114,7 +114,7 @@ let AccordionListItemWallet = React.createClass({
const { content, whitelabel } = this.props;
// convert this to acl_view_licences later
- if (whitelabel.name === 'Creative Commons France') {
+ if (whitelabel.subdomain === 'cc' || whitelabel.subdomain === 'bokk') {
return (
,
diff --git a/js/components/whitelabel/wallet/components/bokk/bokk_register_piece.js b/js/components/whitelabel/wallet/components/bokk/bokk_register_piece.js
new file mode 100644
index 00000000..6353a555
--- /dev/null
+++ b/js/components/whitelabel/wallet/components/bokk/bokk_register_piece.js
@@ -0,0 +1,105 @@
+'use strict';
+
+import React from 'react';
+import RegisterPiece from '../../../../register_piece';
+import Property from '../../../../ascribe_forms/property';
+
+import LicenseActions from '../../../../../actions/license_actions';
+import LicenseStore from '../../../../../stores/license_store';
+
+import { getLangText } from '../../../../../utils/lang_utils';
+import { setDocumentTitle } from '../../../../../utils/dom_utils';
+import { mergeOptions } from '../../../../../utils/general_utils';
+
+
+let BokkRegisterPiece = React.createClass({
+ propTypes: {
+ // Provided from AscribeApp
+ currentUser: React.PropTypes.object,
+ whitelabel: React.PropTypes.object,
+
+ // Provided from router
+ location: React.PropTypes.object
+ },
+
+ getInitialState() {
+ return mergeOptions(
+ LicenseStore.getState(),
+ {
+ selectedLicense: 0
+ }
+ );
+ },
+
+ componentDidMount() {
+ LicenseStore.listen(this.onChange);
+ LicenseActions.fetchLicense();
+ },
+
+ componentWillUnmount() {
+ LicenseStore.unlisten(this.onChange);
+ },
+
+ onChange(state) {
+ this.setState(state);
+ },
+
+ onLicenseChange(event){
+ this.setState({selectedLicense: event.target.selectedIndex});
+ },
+
+ getLicenses() {
+ if (this.state.licenses && this.state.licenses.length > 1) {
+ return (
+
+
+ {getLangText('Learn more about ') + this.state.licenses[this.state.selectedLicense].code}
+
+ (
+
+ {getLangText('ascribe faq')}
+ )
+
+ }>
+
+ );
+ }
+ return null;
+ },
+
+ render() {
+ setDocumentTitle(getLangText('Register a new piece'));
+ return (
+
+ {this.getLicenses()}
+
+ );
+ }
+});
+
+export default BokkRegisterPiece;
diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js
index 2e0e9a10..1bea27db 100644
--- a/js/components/whitelabel/wallet/wallet_routes.js
+++ b/js/components/whitelabel/wallet/wallet_routes.js
@@ -20,6 +20,7 @@ import ErrorNotFoundPage from '../../../components/error_not_found_page';
import Footer from '../../../components/footer.js';
import CCRegisterPiece from './components/cc/cc_register_piece';
+import BokkRegisterPiece from './components/bokk/bokk_register_piece';
import CylandLanding from './components/cyland/cyland_landing';
import CylandPieceContainer from './components/cyland/cyland_detail/cyland_piece_container';
@@ -448,7 +449,50 @@ let ROUTES = {
- )
+ ),
+ 'bokk': (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ),
};
function getRoutes(commonRoutes, subdomain) {
diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js
index 83b5a374..1c5b32f4 100644
--- a/js/constants/application_constants.js
+++ b/js/constants/application_constants.js
@@ -77,7 +77,12 @@ const constants = {
'subdomain': 'portfolioreview',
'name': 'Portfolio Review',
'type': 'prize'
- }
+ },
+ {
+ 'subdomain': 'bokk',
+ 'name': 'bokk Creative Commons France',
+ 'type': 'wallet'
+ },
],
'defaultDomain': {
'type': 'default',
diff --git a/js/fetchers/license_fetcher.js b/js/fetchers/license_fetcher.js
index d5b296be..cb5e9224 100644
--- a/js/fetchers/license_fetcher.js
+++ b/js/fetchers/license_fetcher.js
@@ -10,7 +10,7 @@ let LicenseFetcher = {
* Fetch the available licenses from the API (might be bound to the subdomain e.g. cc.ascribe.io).
*/
fetch() {
- return requests.get('licenses', {'subdomain': getSubdomain()});
+ return requests.get('licenses', {'subdomain': getSubdomain() });
}
};