mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
Substitute upload button for placeholder text in print
This commit is contained in:
parent
1eea6c2cb2
commit
2dc036047f
@ -26,7 +26,7 @@ let FileDragAndDropDialog = React.createClass({
|
|||||||
getDragDialog(fileClass) {
|
getDragDialog(fileClass) {
|
||||||
if (dragAndDropAvailable) {
|
if (dragAndDropAvailable) {
|
||||||
return [
|
return [
|
||||||
<p>{getLangText('Drag %s here', fileClass)}</p>,
|
<p className="file-drag-and-drop-dialog-title">{getLangText('Drag %s here', fileClass)}</p>,
|
||||||
<p>{getLangText('or')}</p>
|
<p>{getLangText('or')}</p>
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
@ -46,6 +46,8 @@ let FileDragAndDropDialog = React.createClass({
|
|||||||
if (hasFiles) {
|
if (hasFiles) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
|
let dialogElement;
|
||||||
|
|
||||||
if (enableLocalHashing && !uploadMethod) {
|
if (enableLocalHashing && !uploadMethod) {
|
||||||
const currentQueryParams = getCurrentQueryParams();
|
const currentQueryParams = getCurrentQueryParams();
|
||||||
|
|
||||||
@ -55,9 +57,9 @@ let FileDragAndDropDialog = React.createClass({
|
|||||||
const queryParamsUpload = Object.assign({}, currentQueryParams);
|
const queryParamsUpload = Object.assign({}, currentQueryParams);
|
||||||
queryParamsUpload.method = 'upload';
|
queryParamsUpload.method = 'upload';
|
||||||
|
|
||||||
return (
|
dialogElement = (
|
||||||
<div className="file-drag-and-drop-dialog present-options">
|
<div className="present-options">
|
||||||
<p>{getLangText('Would you rather')}</p>
|
<p className="file-drag-and-drop-dialog-title">{getLangText('Would you rather')}</p>
|
||||||
{/*
|
{/*
|
||||||
The frontend in live is hosted under /app,
|
The frontend in live is hosted under /app,
|
||||||
Since `Link` is appending that base url, if its defined
|
Since `Link` is appending that base url, if its defined
|
||||||
@ -85,34 +87,42 @@ let FileDragAndDropDialog = React.createClass({
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if (multipleFiles) {
|
if (multipleFiles) {
|
||||||
return (
|
dialogElement = [
|
||||||
<span className="file-drag-and-drop-dialog">
|
this.getDragDialog(fileClassToUpload.plural),
|
||||||
{this.getDragDialog(fileClassToUpload.plural)}
|
|
||||||
<span
|
<span
|
||||||
className="btn btn-default"
|
className="btn btn-default"
|
||||||
onClick={onClick}>
|
onClick={onClick}>
|
||||||
{getLangText('choose %s to upload', fileClassToUpload.plural)}
|
{getLangText('choose %s to upload', fileClassToUpload.plural)}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
];
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
const dialog = uploadMethod === 'hash' ? getLangText('choose a %s to hash', fileClassToUpload.singular)
|
const dialog = uploadMethod === 'hash' ? getLangText('choose a %s to hash', fileClassToUpload.singular)
|
||||||
: getLangText('choose a %s to upload', fileClassToUpload.singular);
|
: getLangText('choose a %s to upload', fileClassToUpload.singular);
|
||||||
|
|
||||||
return (
|
dialogElement = [
|
||||||
<span className="file-drag-and-drop-dialog">
|
this.getDragDialog(fileClassToUpload.singular),
|
||||||
{this.getDragDialog(fileClassToUpload.singular)}
|
|
||||||
<span
|
<span
|
||||||
className="btn btn-default"
|
className="btn btn-default"
|
||||||
onClick={onClick}>
|
onClick={onClick}>
|
||||||
{dialog}
|
{dialog}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="file-drag-and-drop-dialog">
|
||||||
|
<div className="hidden-print">
|
||||||
|
{dialogElement}
|
||||||
|
</div>
|
||||||
|
{/* Hide the uploader and just show that there's been on files uploaded yet when printing */}
|
||||||
|
<p className="text-align-center visible-print">
|
||||||
|
{getLangText('No files uploaded')}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default FileDragAndDropDialog;
|
export default FileDragAndDropDialog;
|
||||||
|
@ -68,7 +68,7 @@ const FileDragAndDropPreviewImage = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="file-drag-and-drop-preview-image"
|
className="file-drag-and-drop-preview-image hidden-print"
|
||||||
style={imageStyle}>
|
style={imageStyle}>
|
||||||
<AclProxy
|
<AclProxy
|
||||||
show={showProgress}>
|
show={showProgress}>
|
||||||
|
@ -25,6 +25,17 @@
|
|||||||
float: right !important;
|
float: right !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restyle file uploader dialogs
|
||||||
|
.file-drag-and-drop {
|
||||||
|
padding-top: 0;
|
||||||
|
outline-width: 0;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-drag-and-drop-position {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Restyle COA
|
// Restyle COA
|
||||||
.ascribe-coa-print-placeholder {
|
.ascribe-coa-print-placeholder {
|
||||||
padding: 0 1.5em 1em 1.5em;
|
padding: 0 1.5em 1em 1.5em;
|
||||||
|
Loading…
Reference in New Issue
Block a user