mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +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) {
|
||||
if (dragAndDropAvailable) {
|
||||
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>
|
||||
];
|
||||
} else {
|
||||
@ -46,6 +46,8 @@ let FileDragAndDropDialog = React.createClass({
|
||||
if (hasFiles) {
|
||||
return null;
|
||||
} else {
|
||||
let dialogElement;
|
||||
|
||||
if (enableLocalHashing && !uploadMethod) {
|
||||
const currentQueryParams = getCurrentQueryParams();
|
||||
|
||||
@ -55,9 +57,9 @@ let FileDragAndDropDialog = React.createClass({
|
||||
const queryParamsUpload = Object.assign({}, currentQueryParams);
|
||||
queryParamsUpload.method = 'upload';
|
||||
|
||||
return (
|
||||
<div className="file-drag-and-drop-dialog present-options">
|
||||
<p>{getLangText('Would you rather')}</p>
|
||||
dialogElement = (
|
||||
<div className="present-options">
|
||||
<p className="file-drag-and-drop-dialog-title">{getLangText('Would you rather')}</p>
|
||||
{/*
|
||||
The frontend in live is hosted under /app,
|
||||
Since `Link` is appending that base url, if its defined
|
||||
@ -85,32 +87,40 @@ let FileDragAndDropDialog = React.createClass({
|
||||
);
|
||||
} else {
|
||||
if (multipleFiles) {
|
||||
return (
|
||||
<span className="file-drag-and-drop-dialog">
|
||||
{this.getDragDialog(fileClassToUpload.plural)}
|
||||
<span
|
||||
className="btn btn-default"
|
||||
onClick={onClick}>
|
||||
{getLangText('choose %s to upload', fileClassToUpload.plural)}
|
||||
</span>
|
||||
dialogElement = [
|
||||
this.getDragDialog(fileClassToUpload.plural),
|
||||
<span
|
||||
className="btn btn-default"
|
||||
onClick={onClick}>
|
||||
{getLangText('choose %s to upload', fileClassToUpload.plural)}
|
||||
</span>
|
||||
);
|
||||
];
|
||||
} else {
|
||||
const dialog = uploadMethod === 'hash' ? getLangText('choose a %s to hash', fileClassToUpload.singular)
|
||||
: getLangText('choose a %s to upload', fileClassToUpload.singular);
|
||||
|
||||
return (
|
||||
<span className="file-drag-and-drop-dialog">
|
||||
{this.getDragDialog(fileClassToUpload.singular)}
|
||||
<span
|
||||
className="btn btn-default"
|
||||
onClick={onClick}>
|
||||
{dialog}
|
||||
</span>
|
||||
dialogElement = [
|
||||
this.getDragDialog(fileClassToUpload.singular),
|
||||
<span
|
||||
className="btn btn-default"
|
||||
onClick={onClick}>
|
||||
{dialog}
|
||||
</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>
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -49,7 +49,7 @@ const FileDragAndDropPreviewImage = React.createClass({
|
||||
};
|
||||
|
||||
let actionSymbol;
|
||||
|
||||
|
||||
// only if assets are actually downloadable, there should be a download icon if the process is already at
|
||||
// 100%. If not, no actionSymbol should be displayed
|
||||
if(progress === 100 && areAssetsDownloadable) {
|
||||
@ -68,7 +68,7 @@ const FileDragAndDropPreviewImage = React.createClass({
|
||||
|
||||
return (
|
||||
<div
|
||||
className="file-drag-and-drop-preview-image"
|
||||
className="file-drag-and-drop-preview-image hidden-print"
|
||||
style={imageStyle}>
|
||||
<AclProxy
|
||||
show={showProgress}>
|
||||
|
@ -25,6 +25,17 @@
|
||||
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
|
||||
.ascribe-coa-print-placeholder {
|
||||
padding: 0 1.5em 1em 1.5em;
|
||||
|
Loading…
Reference in New Issue
Block a user