mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +01:00
adjust register piece form
This commit is contained in:
parent
27c1b390ea
commit
22629ac09d
@ -17,13 +17,14 @@ let Property = React.createClass({
|
|||||||
React.PropTypes.element
|
React.PropTypes.element
|
||||||
]),
|
]),
|
||||||
footer: React.PropTypes.element,
|
footer: React.PropTypes.element,
|
||||||
handleChange: React.PropTypes.func
|
handleChange: React.PropTypes.func,
|
||||||
|
ignoreFocus: React.PropTypes.bool
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
return {
|
return {
|
||||||
editable: true,
|
editable: true,
|
||||||
hidden: false,
|
hidden: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -62,6 +63,9 @@ let Property = React.createClass({
|
|||||||
this.setState({value: event.target.value});
|
this.setState({value: event.target.value});
|
||||||
},
|
},
|
||||||
handleFocus() {
|
handleFocus() {
|
||||||
|
if(this.props.ignoreFocus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.refs.input.getDOMNode().focus();
|
this.refs.input.getDOMNode().focus();
|
||||||
this.setState({
|
this.setState({
|
||||||
isFocused: true
|
isFocused: true
|
||||||
@ -134,7 +138,8 @@ let Property = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={'ascribe-settings-wrapper ' + this.getClassName()}
|
className={'ascribe-settings-wrapper ' + this.getClassName()}
|
||||||
onClick={this.handleFocus} onfocus={this.handleFocus}>
|
onClick={this.handleFocus}
|
||||||
|
onfocus={this.handleFocus}>
|
||||||
<OverlayTrigger
|
<OverlayTrigger
|
||||||
delay={500}
|
delay={500}
|
||||||
placement="top"
|
placement="top"
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import FileDragAndDropDialog from './file_drag_and_drop_dialog';
|
||||||
import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator';
|
import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator';
|
||||||
|
|
||||||
|
|
||||||
@ -140,7 +142,6 @@ let FileDragAndDrop = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={className}
|
className={className}
|
||||||
onClick={this.handleOnClick}
|
|
||||||
onDragStart={this.handleDragStart}
|
onDragStart={this.handleDragStart}
|
||||||
onDrag={this.handleDrop}
|
onDrag={this.handleDrop}
|
||||||
onDragEnter={this.handleDragEnter}
|
onDragEnter={this.handleDragEnter}
|
||||||
@ -148,7 +149,11 @@ let FileDragAndDrop = React.createClass({
|
|||||||
onDragOver={this.handleDragOver}
|
onDragOver={this.handleDragOver}
|
||||||
onDrop={this.handleDrop}
|
onDrop={this.handleDrop}
|
||||||
onDragEnd={this.handleDragEnd}>
|
onDragEnd={this.handleDragEnd}>
|
||||||
{hasFiles ? null : this.props.multiple ? <span className="file-drag-and-drop-dialog">Click or drag to add files</span> : <span className="file-drag-and-drop-dialog">Click or drag to add a file</span>}
|
<FileDragAndDropDialog
|
||||||
|
multipleFiles={this.props.multiple}
|
||||||
|
hasFiles={hasFiles}
|
||||||
|
onClick={this.handleOnClick}
|
||||||
|
/>
|
||||||
<FileDragAndDropPreviewIterator
|
<FileDragAndDropPreviewIterator
|
||||||
files={this.props.filesToUpload}
|
files={this.props.filesToUpload}
|
||||||
handleDeleteFile={this.handleDeleteFile}
|
handleDeleteFile={this.handleDeleteFile}
|
||||||
|
37
js/components/ascribe_uploader/file_drag_and_drop_dialog.js
Normal file
37
js/components/ascribe_uploader/file_drag_and_drop_dialog.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
let FileDragAndDropDialog = React.createClass({
|
||||||
|
propTypes: {
|
||||||
|
hasFiles: React.PropTypes.bool,
|
||||||
|
multipleFiles: React.PropTypes.bool,
|
||||||
|
onClick: React.PropTypes.func
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if(this.props.hasFiles) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
if(this.props.multipleFiles) {
|
||||||
|
return (
|
||||||
|
<span className="file-drag-and-drop-dialog">Click or drag to add files</span>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<span className="file-drag-and-drop-dialog">
|
||||||
|
<p>Drag a file here</p>
|
||||||
|
<p>or</p>
|
||||||
|
<button
|
||||||
|
className="btn btn-default"
|
||||||
|
onClick={this.props.onClick}>
|
||||||
|
choose a file to upload
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default FileDragAndDropDialog;
|
@ -72,7 +72,11 @@ let FileDragAndDropPreview = React.createClass({
|
|||||||
|
|
||||||
if(this.props.areAssetsEditable) {
|
if(this.props.areAssetsEditable) {
|
||||||
removeBtn = (<div className="delete-file">
|
removeBtn = (<div className="delete-file">
|
||||||
<span className="glyphicon glyphicon-remove text-center" aria-hidden="true" title="Remove file" onClick={this.handleDeleteFile}/>
|
<span
|
||||||
|
className="glyphicon glyphicon-remove text-center"
|
||||||
|
aria-hidden="true"
|
||||||
|
title="Remove file"
|
||||||
|
onClick={this.handleDeleteFile}/>
|
||||||
</div>);
|
</div>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,19 +165,8 @@ let RegisterPiece = React.createClass( {
|
|||||||
onClick={this.changeSlide}
|
onClick={this.changeSlide}
|
||||||
onFocus={this.changeSlide}>
|
onFocus={this.changeSlide}>
|
||||||
<Row className="no-margin">
|
<Row className="no-margin">
|
||||||
<Col sm={4}>
|
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
||||||
<div style={{'marginTop': 0, 'marginLeft': '1em'}}>
|
<h3 style={{'marginTop': 0, 'marginLeft': '1em'}}>Register your work</h3>
|
||||||
<FileUploader
|
|
||||||
submitKey={this.submitKey}
|
|
||||||
setIsUploadReady={this.setIsUploadReady}
|
|
||||||
isReadyForFormSubmission={this.isReadyForFormSubmission}
|
|
||||||
editable={this.state.isFineUploaderEditable}/>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</Col>
|
|
||||||
<Col sm={8}>
|
|
||||||
<h3 style={{'marginTop': 0, 'marginLeft': '1em'}} onClick={this.changePage}>Lock down title</h3>
|
|
||||||
<Form
|
<Form
|
||||||
ref='form'
|
ref='form'
|
||||||
url={apiUrls.pieces_list}
|
url={apiUrls.pieces_list}
|
||||||
@ -194,7 +183,13 @@ let RegisterPiece = React.createClass( {
|
|||||||
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" />
|
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" />
|
||||||
</button>
|
</button>
|
||||||
}>
|
}>
|
||||||
|
<Property>
|
||||||
|
<FileUploader
|
||||||
|
submitKey={this.submitKey}
|
||||||
|
setIsUploadReady={this.setIsUploadReady}
|
||||||
|
isReadyForFormSubmission={this.isReadyForFormSubmission}
|
||||||
|
editable={this.state.isFineUploaderEditable}/>
|
||||||
|
</Property>
|
||||||
<Property
|
<Property
|
||||||
name='artist_name'
|
name='artist_name'
|
||||||
label="Artist Name">
|
label="Artist Name">
|
||||||
|
@ -23,6 +23,10 @@ $break-small: 764px;
|
|||||||
background-color: rgba(2, 182, 163, 0.6);
|
background-color: rgba(2, 182, 163, 0.6);
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
opacity: .3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ascribe-btn-login-spinner{
|
.ascribe-btn-login-spinner{
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
.file-drag-and-drop {
|
.file-drag-and-drop {
|
||||||
display: block;
|
display: block;
|
||||||
outline: 1px dashed #616161;
|
outline: 1px dashed #9E9E9E;
|
||||||
cursor: pointer;
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: auto;
|
height: auto;
|
||||||
@ -9,43 +8,28 @@
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
|
|
||||||
padding: 3em;
|
cursor: default !important;
|
||||||
|
|
||||||
|
padding: 1.5em 1.5em 1.5em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inactive-dropzone {
|
.inactive-dropzone {
|
||||||
cursor: default !important;
|
cursor: default !important;
|
||||||
|
background-color: rgba(0,0,0,0) !important;
|
||||||
|
outline: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inactive-dropzone:hover {
|
.file-drag-and-drop .file-drag-and-drop-dialog > p:first-child {
|
||||||
background-color: #FAFAFA !important;
|
font-size: 1.5em !important;
|
||||||
}
|
|
||||||
|
|
||||||
.file-drag-and-drop:hover {
|
margin-top: 0;
|
||||||
background-color: rgba(72, 218, 203, 0.2);
|
margin-bottom: 0;
|
||||||
}
|
padding-bottom: 0;
|
||||||
|
|
||||||
.file-drag-and-drop .file-drag-and-drop-dialog {
|
|
||||||
font-size: 1.25em !important;
|
|
||||||
|
|
||||||
margin-top: 1em;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: ' ';
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle; /* vertical alignment of the inline element */
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-files {
|
|
||||||
text-align: left;
|
|
||||||
padding: 4% 0 0 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-drag-and-drop-position {
|
.file-drag-and-drop-position {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 0 0 4% 4%;
|
|
||||||
float:left;
|
float:left;
|
||||||
|
|
||||||
.delete-file {
|
.delete-file {
|
||||||
@ -64,14 +48,21 @@
|
|||||||
|
|
||||||
span {
|
span {
|
||||||
color: white;
|
color: white;
|
||||||
|
top: 1;
|
||||||
|
left: 0;
|
||||||
|
font-size: .8em;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: $brand-danger;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-drag-and-drop-preview-table-wrapper {
|
.file-drag-and-drop-preview-table-wrapper {
|
||||||
display: table;
|
display: table;
|
||||||
height:64px;
|
height:74px;
|
||||||
width:74px;
|
width:84px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-drag-and-drop-preview {
|
.file-drag-and-drop-preview {
|
||||||
@ -83,8 +74,8 @@
|
|||||||
|
|
||||||
.file-drag-and-drop-preview-image {
|
.file-drag-and-drop-preview-image {
|
||||||
display: table;
|
display: table;
|
||||||
height:74px;
|
height:84px;
|
||||||
width:74px;
|
width:84px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
border: 1px solid #616161;
|
border: 1px solid #616161;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
Loading…
Reference in New Issue
Block a user