Clearly indicate pending files in My Files
This commit is contained in:
parent
c1185b3c9d
commit
5ece0111df
1 changed files with 31 additions and 14 deletions
|
@ -94,23 +94,31 @@ var MyFilesRow = React.createClass({
|
||||||
return (
|
return (
|
||||||
<div className="row-fluid">
|
<div className="row-fluid">
|
||||||
<div className="span3">
|
<div className="span3">
|
||||||
<img src={this.props.imgUrl} alt={'Photo for ' + this.props.title} style={artStyle} />
|
{this.props.imgUrl ? <img src={this.props.imgUrl} alt={'Photo for ' + this.props.title} style={artStyle} /> : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="span6">
|
<div className="span6">
|
||||||
<h2><a href={'/?show=' + this.props.lbryUri}>{this.props.title}</a></h2>
|
<h2>{this.props.pending ? this.props.title : <a href={'/?show=' + this.props.lbryUri}>{this.props.title}</a>}</h2>
|
||||||
<div className={this.props.completed ? 'hidden' : ''} style={curProgressBarStyle}></div>
|
{this.props.pending ? <em>This file is pending confirmation</em>
|
||||||
{ ' ' }
|
: (
|
||||||
{this.props.completed ? 'Download complete' : (parseInt(this.props.ratioLoaded * 100) + '%')}
|
<div>
|
||||||
<div>{ pauseLink }</div>
|
<div className={this.props.completed ? 'hidden' : ''} style={curProgressBarStyle}></div>
|
||||||
<div>{ watchButton }</div>
|
{ ' ' }
|
||||||
|
{this.props.completed ? 'Download complete' : (parseInt(this.props.ratioLoaded * 100) + '%')}
|
||||||
|
<div>{ pauseLink }</div>
|
||||||
|
<div>{ watchButton }</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="span1" style={moreButtonColumnStyle}>
|
<div className="span1" style={moreButtonColumnStyle}>
|
||||||
<div style={moreButtonContainerStyle}>
|
{this.props.pending ? null :
|
||||||
<Link style={moreButtonStyle} ref="moreButton" icon="icon-ellipsis-h" title="More Options" />
|
<div style={moreButtonContainerStyle}>
|
||||||
<MyFilesRowMoreMenu toggleButton={this.refs.moreButton} title={this.props.title}
|
<Link style={moreButtonStyle} ref="moreButton" icon="icon-ellipsis-h" title="More Options" />
|
||||||
lbryUri={this.props.lbryUri} fileName={this.props.fileName}
|
<MyFilesRowMoreMenu toggleButton={this.refs.moreButton} title={this.props.title}
|
||||||
path={this.props.path}/>
|
lbryUri={this.props.lbryUri} fileName={this.props.fileName}
|
||||||
</div>
|
path={this.props.path}/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -155,12 +163,21 @@ var MyFilesPage = React.createClass({
|
||||||
|
|
||||||
let {title, thumbnail} = metadata;
|
let {title, thumbnail} = metadata;
|
||||||
|
|
||||||
|
if (!fileInfo.pending && typeof metadata == 'object') {
|
||||||
|
var {title, thumbnail} = metadata;
|
||||||
|
var pending = false;
|
||||||
|
} else {
|
||||||
|
var title = null;
|
||||||
|
var thumbnail = null;
|
||||||
|
var pending = true;
|
||||||
|
}
|
||||||
|
|
||||||
var ratioLoaded = written_bytes / total_bytes;
|
var ratioLoaded = written_bytes / total_bytes;
|
||||||
var showWatchButton = (lbry.getMediaType(file_name) == 'video' || lbry.getMediaType(file_name) == 'audio');
|
var showWatchButton = (lbry.getMediaType(file_name) == 'video' || lbry.getMediaType(file_name) == 'audio');
|
||||||
|
|
||||||
content.push(<MyFilesRow lbryUri={lbry_uri} title={title || ('lbry://' + lbry_uri)} completed={completed} stopped={stopped}
|
content.push(<MyFilesRow lbryUri={lbry_uri} title={title || ('lbry://' + lbry_uri)} completed={completed} stopped={stopped}
|
||||||
ratioLoaded={ratioLoaded} imgUrl={thumbnail} path={download_path}
|
ratioLoaded={ratioLoaded} imgUrl={thumbnail} path={download_path}
|
||||||
showWatchButton={showWatchButton}/>);
|
showWatchButton={showWatchButton} pending={pending} />);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Reference in a new issue