- {contentView != data.description &&
-
{data.description}
- }
-
- {data.lines.map((line, i) =>
-
- {line.map((tuple, j) =>
-
- {tuple[1]}
-
- )}
-
- )}
-
+ props.setContentViewDescription(props.contentView != this.data.description ? this.data.description : '')
+
+ let isFullContentShown = this.data.lines.length < this.maxLines
+ if (isFullContentShown) props.setShowFullContent(true)
+ }
+ render() {
+ const {content, contentView, message} = this.props
+
+ let lines = this.props.showFullContent ? this.data.lines : this.data.lines.slice(0, this.maxLines)
+
+ return
+
+ {lines.map((line, i) =>
+
+ {line.map((tuple, j) =>
+
+ {tuple[1]}
+
+ )}
+
+ )}
+
{ViewImage.matches(message) &&
-
+
}
+ }
+
}
-ViewServer = ContentLoader(ViewServer)
+ViewServer = connect(
+ state => ({
+ showFullContent: state.ui.flow.showFullContent
+ }),
+ {
+ setContentViewDescription,
+ setShowFullContent
+ }
+)(ContentLoader(ViewServer))
export { Edit, ViewServer, ViewImage }
diff --git a/web/src/js/components/ContentView/ShowFullContentButton.jsx b/web/src/js/components/ContentView/ShowFullContentButton.jsx
new file mode 100644
index 000000000..a0217d32b
--- /dev/null
+++ b/web/src/js/components/ContentView/ShowFullContentButton.jsx
@@ -0,0 +1,29 @@
+import React, { Component, PropTypes } from 'react'
+import { connect } from 'react-redux'
+import { render } from 'react-dom';
+import Button from '../common/Button';
+import { setShowFullContent } from '../../ducks/ui/flow'
+
+
+
+ShowFullContentButton.propTypes = {
+ setShowFullContent: PropTypes.func.isRequired,
+ showFullContent: PropTypes.bool.isRequired
+}
+
+function ShowFullContentButton ( {setShowFullContent, showFullContent} ){
+
+ return (
+ !showFullContent &&