web: add content download

This commit is contained in:
Maximilian Hils 2015-03-22 15:29:55 +01:00
parent 39a8ac7e2a
commit 2acd77dea0
4 changed files with 13 additions and 5 deletions

View File

@ -294,7 +294,7 @@ header .menu {
.flow-detail hr { .flow-detail hr {
margin: 0 0 5px; margin: 0 0 5px;
} }
.view-selector { .view-options {
margin-top: 10px; margin-top: 10px;
} }
.flow-detail table { .flow-detail table {

View File

@ -1416,10 +1416,14 @@ var ContentView = React.createClass({displayName: "ContentView",
return React.createElement(TooLarge, React.__spread({}, this.props, {onClick: this.displayLarge})); return React.createElement(TooLarge, React.__spread({}, this.props, {onClick: this.displayLarge}));
} }
var downloadUrl = MessageUtils.getContentURL(this.props.flow, message);
return React.createElement("div", null, return React.createElement("div", null,
React.createElement(this.state.View, React.__spread({}, this.props)), React.createElement(this.state.View, React.__spread({}, this.props)),
React.createElement("div", {className: "text-center"}, React.createElement("div", {className: "view-options text-center"},
React.createElement(ViewSelector, {selectView: this.selectView, active: this.state.View, message: message}) React.createElement(ViewSelector, {selectView: this.selectView, active: this.state.View, message: message}),
" ",
React.createElement("a", {className: "btn btn-default btn-xs", href: downloadUrl}, React.createElement("i", {className: "fa fa-download"}))
) )
); );
} }

View File

@ -34,7 +34,7 @@
} }
.view-selector { .view-options {
margin-top: 10px; margin-top: 10px;
} }

View File

@ -219,10 +219,14 @@ var ContentView = React.createClass({
return <TooLarge {...this.props} onClick={this.displayLarge}/>; return <TooLarge {...this.props} onClick={this.displayLarge}/>;
} }
var downloadUrl = MessageUtils.getContentURL(this.props.flow, message);
return <div> return <div>
<this.state.View {...this.props} /> <this.state.View {...this.props} />
<div className="text-center"> <div className="view-options text-center">
<ViewSelector selectView={this.selectView} active={this.state.View} message={message}/> <ViewSelector selectView={this.selectView} active={this.state.View} message={message}/>
&nbsp;
<a className="btn btn-default btn-xs" href={downloadUrl}><i className="fa fa-download"/></a>
</div> </div>
</div>; </div>;
} }