1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

add custom submit button to piece list

This commit is contained in:
Tim Daubenschütz 2015-07-14 21:13:15 +02:00
parent b52d000ac7
commit d2b2bdf7d5
3 changed files with 20 additions and 11 deletions

View File

@ -4,16 +4,17 @@ import React from 'react';
import Input from 'react-bootstrap/lib/Input';
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';
import { getLangText } from '../../utils/lang_utils';
let PieceListToolbar = React.createClass({
propTypes: {
className: React.PropTypes.string,
searchFor: React.PropTypes.func
searchFor: React.PropTypes.func,
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
])
},
searchFor() {
@ -29,6 +30,9 @@ let PieceListToolbar = React.createClass({
<div className="row">
<div className="col-xs-12 col-sm-10 col-md-8 col-lg-8 col-sm-offset-1 col-md-offset-2 col-lg-offset-2">
<div className="row">
<span className="pull-left">
{this.props.children}
</span>
<span className="pull-right search-bar">
<Input
type='text'

View File

@ -20,7 +20,8 @@ import AppConstants from '../constants/application_constants';
let PieceList = React.createClass({
propTypes: {
redirectTo: React.PropTypes.string
redirectTo: React.PropTypes.string,
customSubmitButton: React.PropTypes.element
},
mixins: [Router.Navigation, Router.State],
@ -93,7 +94,9 @@ let PieceList = React.createClass({
<div>
<PieceListToolbar
className="ascribe-piece-list-toolbar"
searchFor={this.searchFor} />
searchFor={this.searchFor}>
{this.props.customSubmitButton}
</PieceListToolbar>
<PieceListBulkModal className="ascribe-piece-list-bulk-modal" />
<AccordionList
className="ascribe-accordion-list"

View File

@ -10,11 +10,13 @@ let PrizePieceList = React.createClass({
render() {
return (
<div>
<ButtonLink to="register_piece">
Submit a new artwork to the prize
</ButtonLink>
<PieceList redirectTo="register_piece" />
<PieceList
redirectTo="register_piece"
customSubmitButton={
<ButtonLink to="register_piece">
Submit a new artwork to the prize
</ButtonLink>
}/>
</div>
);
}