Skip to content

Commit

Permalink
Merge pull request #2826 from steemit/unlimited-editing
Browse files Browse the repository at this point in the history
unlimited comment/post editing
  • Loading branch information
relativityboy committed Oct 24, 2018
2 parents f9689e7 + 4a5f9cd commit 22e6518
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 28 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -18,7 +18,7 @@ applications.

#### Docker

We highly recommend using docker to run condenser. This is how we run the
We highly recommend using docker to run condenser in production. This is how we run the
live steemit.com site and it is the most supported (and fastest) method of
both building and running condenser. We will always have the latest version
of condenser (master branch) available on Docker Hub. Configuration settings
Expand Down Expand Up @@ -50,6 +50,7 @@ docker run -it -p 8080:8080 myname/condenser:mybranch
```

## Building from source without docker (the 'traditional' way):
(better if you're planning to do condenser development)

#### Clone the repository and make a tmp folder

Expand Down
20 changes: 9 additions & 11 deletions src/app/components/cards/Comment.jsx
Expand Up @@ -300,11 +300,11 @@ class CommentImpl extends React.Component {
// hide images if author is in blacklist
const hideImages = ImageUserBlockList.includes(author);

const showDeleteOption = username === author && allowDelete;
const _isPaidout = comment.cashout_time === '1969-12-31T23:59:59'; // TODO: audit after HF19. #1259
const showEditOption = username === author;
const showDeleteOption =
username === author && allowDelete && !_isPaidout;
const showReplyOption = comment.depth < 255;
const archived = comment.cashout_time === '1969-12-31T23:59:59'; // TODO: audit after HF19. #1259
const readonly = archived || $STM_Config.read_only_mode;

let body = null;
let controls = null;
Expand All @@ -326,14 +326,12 @@ class CommentImpl extends React.Component {
{showReplyOption && (
<a onClick={onShowReply}>{tt('g.reply')}</a>
)}{' '}
{!readonly &&
showEditOption && (
<a onClick={onShowEdit}>{tt('g.edit')}</a>
)}{' '}
{!readonly &&
showDeleteOption && (
<a onClick={onDeletePost}>{tt('g.delete')}</a>
)}
{showEditOption && (
<a onClick={onShowEdit}>{tt('g.edit')}</a>
)}{' '}
{showDeleteOption && (
<a onClick={onDeletePost}>{tt('g.delete')}</a>
)}
</span>
</div>
);
Expand Down
7 changes: 2 additions & 5 deletions src/app/components/cards/MarkdownViewer.jsx
Expand Up @@ -31,8 +31,6 @@ class MarkdownViewer extends Component {
text: PropTypes.string,
className: PropTypes.string,
large: PropTypes.bool,
// formId: PropTypes.string, // This is unique for every editor of every post (including reply or edit)
canEdit: PropTypes.bool,
jsonMetadata: PropTypes.object,
highQualityPost: PropTypes.bool,
noImage: PropTypes.bool,
Expand All @@ -59,8 +57,6 @@ class MarkdownViewer extends Component {
return (
np.text !== this.props.text ||
np.large !== this.props.large ||
// np.formId !== this.props.formId ||
np.canEdit !== this.props.canEdit ||
ns.allowNoImage !== this.state.allowNoImage
);
}
Expand All @@ -76,7 +72,8 @@ class MarkdownViewer extends Component {
if (!text) text = ''; // text can be empty, still view the link meta data
const {
large,
/*formId, canEdit, jsonMetadata,*/ highQualityPost,
highQualityPost,
//jsonMetadata,
} = this.props;

let html = false;
Expand Down
16 changes: 7 additions & 9 deletions src/app/components/cards/PostFull.jsx
Expand Up @@ -404,15 +404,15 @@ class PostFull extends React.Component {
);
}

const archived =
const _isPaidout =
post_content.get('cashout_time') === '1969-12-31T23:59:59'; // TODO: audit after HF19. #1259
const readonly = archived || $STM_Config.read_only_mode;
const showReblog = !_isPaidout;
const showPromote =
username && !archived && post_content.get('depth') == 0;
username && !_isPaidout && post_content.get('depth') == 0;
const showReplyOption = post_content.get('depth') < 255;
const showEditOption = username === author;
const showDeleteOption =
username === author && content.stats.allowDelete;
username === author && content.stats.allowDelete && !_isPaidout;

const authorRepLog10 = repLog10(content.author_reputation);
const isPreViewCount =
Expand Down Expand Up @@ -481,20 +481,18 @@ class PostFull extends React.Component {
<Voting post={post} />
</div>
<div className="RightShare__Menu small-11 medium-12 large-5 columns">
{!readonly && (
{showReblog && (
<Reblog author={author} permlink={permlink} />
)}
<span className="PostFull__reply">
{showReplyOption && (
<a onClick={onShowReply}>{tt('g.reply')}</a>
)}{' '}
{!readonly &&
showEditOption &&
{showEditOption &&
!showEdit && (
<a onClick={onShowEdit}>{tt('g.edit')}</a>
)}{' '}
{!readonly &&
showDeleteOption &&
{showDeleteOption &&
!showReply && (
<a onClick={onDeletePost}>
{tt('g.delete')}
Expand Down
2 changes: 0 additions & 2 deletions src/app/components/elements/ReplyEditor.jsx
Expand Up @@ -704,9 +704,7 @@ class ReplyEditor extends React.Component {
)}
<h6>{tt('g.preview')}</h6>
<MarkdownViewer
formId={formId}
text={body.value}
canEdit
jsonMetadata={jsonMetadata}
large={isStory}
noImage={noImage}
Expand Down

0 comments on commit 22e6518

Please sign in to comment.