Skip to content

Commit

Permalink
Merge pull request #870 from steemit/0.1.161214-merge-for-master
Browse files Browse the repository at this point in the history
0.1.161214 release into master
  • Loading branch information
roadscape authored Dec 16, 2016
2 parents 60526bd + 65bd357 commit c42fe05
Show file tree
Hide file tree
Showing 81 changed files with 2,442 additions and 1,681 deletions.
2 changes: 1 addition & 1 deletion .deployignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ coverage
node_modules
*.log
vendor
config
config/*.json
.git
18 changes: 18 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
This file contains a list of people who have made
large contributions to the Steemit.com codebase.



(not complete)



## Internationalization
- @hipster
- @ekitcho
- @heimindanger
- @fernando-sanz
- @jza
- @cheftony
- @jumpeiyamane
* Japanese
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,19 @@ npm install -g babel-cli

#### Create config file


```bash
cd config
cp steem-example.json steem-dev.json
```

Generate a new crypto_key and save under server_session_secret in ./steem-dev.json.

```bash
node
> crypto.randomBytes(32).toString('base64')
```

(note: it's steem.json in production)

#### Install mysql server
Expand Down
17 changes: 14 additions & 3 deletions app/ResolveRoute.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export const routeRegex = {
PostsIndex: /^\/(@[\w\.\d-]+)\/feed\/?$/,
UserProfile1: /^\/(@[\w\.\d-]+)\/?$/,
UserProfile2: /^\/(@[\w\.\d-]+)\/(blog|posts|comments|recommended|transfers|curation-rewards|author-rewards|permissions|created|recent-replies|feed|password|followed|followers|settings)\/?$/,
PostNoCategory: /^\/(@[\w\.\d-]+)\/([\w\d-]+)/
}

export default function resolveRoute(path)
{
if (path === '/') {
Expand Down Expand Up @@ -54,16 +61,20 @@ export default function resolveRoute(path)
if (path === '/submit.html') {
return {page: 'SubmitPost'};
}
let match = path.match(/^\/(@[\w\.\d-]+)\/feed\/?$/);
let match = path.match(routeRegex.PostsIndex);
if (match) {
return {page: 'PostsIndex', params: ['home', match[1]]};
}
match = path.match(/^\/(@[\w\.\d-]+)\/?$/) ||
match = path.match(routeRegex.UserProfile1) ||
// @user/"posts" is deprecated in favor of "comments" as of oct-2016 (#443)
path.match(/^\/(@[\w\.\d-]+)\/(blog|posts|comments|recommended|transfers|curation-rewards|author-rewards|permissions|created|recent-replies|feed|password|followed|followers|settings)\/?$/);
path.match(routeRegex.UserProfile2);
if (match) {
return {page: 'UserProfile', params: match.slice(1)};
}
match = path.match(routeRegex.PostNoCategory);
if (match) {
return {page: 'PostNoCategory', params: match.slice(1)};
}
match = path.match(/^\/(\@[\w\d-]+)\/([\w\d-]+)\/?$/) ||
path.match(/^\/([\w\d\-\/]+)\/(\@[\w\d\.-]+)\/([\w\d-]+)\/?$/) ||
path.match(/^\/([\w\d\-\/]+)\/(\@[\w\d\.-]+)\/([\w\d-]+)\/?\?sort=(\w+)$/);
Expand Down
2 changes: 2 additions & 0 deletions app/RootRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export default {
//require.ensure([], (require) => {
cb(null, [require('app/components/pages/PostPage')]);
//});
} else if (route.page === 'PostNoCategory') {
cb(null, [require('app/components/pages/PostPageNoCategory')]);
} else if (route.page === 'PostsIndex') {
//require.ensure([], (require) => {
//cb(null, [require('app/components/pages/PostsIndex')]);
Expand Down
3 changes: 1 addition & 2 deletions app/components/cards/CategorySelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export function validateCategory(category, required = true) {
)
}
export default connect((state, ownProps) => {
// TODO: use 'tag_idx' after shared-db upgrade
const trending = state.global.getIn(['category_idx', 'trending']) || state.global.getIn(['tag_idx', 'trending'])
const trending = state.global.getIn(['tag_idx', 'trending'])
// apply translations
// they are used here because default prop can't acces intl property
const placeholder = translate('tag_your_story');
Expand Down
7 changes: 5 additions & 2 deletions app/components/cards/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,11 @@ const Comment = connect(
}
const current = state.user.get('current')
const username = current ? current.get('username') : null
const key = ['follow', 'get_following', username, 'result', c.get('author')]
const ignore = username ? state.global.getIn(key, List()).contains('ignore') : false

const key = ['follow', 'get_following', username, 'ignore_result', c.get('author')]
const ignore = username ? state.global.hasIn(key) : false
// if(ignore) console.log(username, 'ignored comment by', c.get('author'), '\t', comment_link)

return {
...ownProps,
comment_link,
Expand Down
10 changes: 6 additions & 4 deletions app/components/cards/Comment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@
}

.Comment__header_collapse {
visibility: hidden;
//width: 1rem;
float: right;
> a {
color: $dark-gray;
color: $medium-gray;
letter-spacing: 0.1rem;
padding: 0 0.5rem;
}
Expand All @@ -85,7 +83,11 @@
}
}

.Comment:hover .Comment__header .Comment__header_collapse {
.Comment > div > .Comment__header > .Comment__header_collapse > .Voting {
visibility: hidden;
}

.Comment:hover > div > .Comment__header > .Comment__header_collapse > .Voting {
visibility: visible;
}

Expand Down
40 changes: 20 additions & 20 deletions app/components/cards/PostFull.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ class PostFull extends React.Component {
}

const readonly = post_content.get('mode') === 'archived' || $STM_Config.read_only_mode
//const showPromote = username && post_content.get('mode') === "first_payout" && post_content.get('depth') == 0
const showPromote = false // TODO: revert when nodes are updated with https://github.com/steemit/steem/pull/550
const showPromote = username && post_content.get('mode') === "first_payout" && post_content.get('depth') == 0
const showReplyOption = post_content.get('depth') < 6
const showEditOption = username === author
const authorRepLog10 = repLog10(content.author_reputation)
const isPreViewCount = Date.parse(post_content.get('created')) < 1480723200000 // check if post was created before view-count tracking began (2016-12-03)

return (
<article className="PostFull hentry" itemScope itemType="http://schema.org/blogPost">
Expand All @@ -262,28 +262,28 @@ class PostFull extends React.Component {

{showPromote && <button className="float-right button hollow tiny" onClick={this.showPromotePost}>Promote</button>}
<TagList post={content} horizontal />
<div className="PostFull__footer row align-middle">
<div className="PostFull__footer row">
<div className="column">
<TimeAuthorCategory content={content} authorRepLog10={authorRepLog10} />
<Voting post={post} />
</div>
<div className="column shrink">
{!readonly && <Reblog author={author} permlink={permlink} />}
{!readonly &&
<span className="PostFull__reply">
{showReplyOption && <a onClick={onShowReply}>Reply</a>}
{' '}{showEditOption && !showEdit && <a onClick={onShowEdit}>Edit</a>}
{' '}{showDeleteOption && !showReply && <a onClick={onDeletePost}>Delete</a>}
</span>}
<span className="PostFull__responses">
<Link to={link} title={pluralize('Responses', content.children, true)}>
<Icon name="chatboxes" className="space-right" />{content.children}
</Link>
</span>
<span className="PostFull__views">
<PageViewsCounter hidden={false} />
</span>
<ShareMenu menu={share_menu} />
<div className="right-sub-menu small-10 medium-5 large-5 columns text-right">
{!readonly && <Reblog author={author} permlink={permlink} />}
{!readonly &&
<span className="PostFull__reply">
{showReplyOption && <a onClick={onShowReply}>Reply</a>}
{' '}{showEditOption && !showEdit && <a onClick={onShowEdit}>Edit</a>}
{' '}{showDeleteOption && !showReply && <a onClick={onDeletePost}>Delete</a>}
</span>}
<span className="PostFull__responses">
<Link to={link} title={pluralize('Responses', content.children, true)}>
<Icon name="chatboxes" className="space-right" />{content.children}
</Link>
</span>
<span className="PostFull__views">
<PageViewsCounter hidden={false} sinceDate={isPreViewCount ? 'Dec 2016' : null} />
</span>
<ShareMenu menu={share_menu} />
</div>
</div>
<div className="row">
Expand Down
21 changes: 12 additions & 9 deletions app/components/cards/PostFull.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
color: $dark-gray;
font-weight: 400;
border-right: 1px solid $medium-gray;
padding-right: 1rem;
margin-right: 1rem;
padding-right: .6rem;
margin-right: .6rem;
> span {
white-space: nowrap;
}
Expand Down Expand Up @@ -78,30 +78,30 @@
}

.Reblog__button {
padding-right: 1rem;
margin-right: 1rem;
padding-right: .6rem;
margin-right: .6rem;
border-right: 1px solid $medium-gray;
}
}

.PostFull__responses {
padding-right: 1rem;
padding-right: .6rem;
//margin-right: 1rem;
//border-right: 1px solid $medium-gray;
}

.PostFull__views {
padding-right: 1rem;
margin-right: 1rem;
padding-right: .6rem;
margin-right: .6rem;
color: $dark-gray;
font-size: 94%;
font-weight: 600;
border-right: 1px solid $medium-gray;
}

.PostFull__reply {
padding-right: 1rem;
margin-right: 1rem;
padding-right: .6rem;
margin-right: .6rem;
border-right: 1px solid $medium-gray;
a {margin: 0 0.15rem;}
}
Expand Down Expand Up @@ -129,4 +129,7 @@
-ms-flex: 0 0 100%;
flex: 0 0 100%;
}
.PostFull__footer > .right-sub-menu {
text-align: left;
}
}
17 changes: 10 additions & 7 deletions app/components/cards/PostsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import debounce from 'lodash.debounce';
import CloseButton from 'react-foundation-components/lib/global/close-button';
import {findParent} from 'app/utils/DomUtils';
import Icon from 'app/components/elements/Icon';
import {List} from "immutable";
import shouldComponentUpdate from 'app/utils/shouldComponentUpdate';

function topPosition(domElt) {
Expand Down Expand Up @@ -151,13 +150,14 @@ class PostsList extends React.Component {
onPostClick(post, url) {
this.post_url = url;
this.props.fetchState(url);
this.props.removeHighSecurityKeys();
this.setState({showPost: post, prevTitle: window.document.title});
window.history.pushState({}, '', url);
}

render() {
const {posts, showSpam, loading, category, content,
follow, account} = this.props;
ignore_result, account} = this.props;
const {thumbSize, showPost} = this.state
const postsInfo = [];
posts.forEach(item => {
Expand All @@ -166,13 +166,13 @@ class PostsList extends React.Component {
console.error('PostsList --> Missing cont key', item)
return
}
const key = [cont.get('author')]
const ignore = follow ? follow.getIn(key, List()).contains('ignore') : false
const ignore = ignore_result && ignore_result.has(cont.get('author'))
// if(ignore) console.log('ignored post by', cont.get('author'), '\t', item)

const {hide, netVoteSign, authorRepLog10} = cont.get('stats').toJS()
if(!(ignore || hide) || showSpam) // rephide
postsInfo.push({item, ignore, netVoteSign, authorRepLog10})
});

const renderSummary = items => items.map(item => <li key={item.item}>
<PostSummary
account={account}
Expand Down Expand Up @@ -219,12 +219,15 @@ export default connect(
const current = state.user.get('current')
const username = current ? current.get('username') : null
const content = state.global.get('content');
const follow = state.global.getIn(['follow', 'get_following', username, 'result']);
return {...props, username, content, follow, pathname};
const ignore_result = state.global.getIn(['follow', 'get_following', username, 'ignore_result']);
return {...props, username, content, ignore_result, pathname};
},
dispatch => ({
fetchState: (pathname) => {
dispatch({type: 'FETCH_STATE', payload: {pathname}})
},
removeHighSecurityKeys: () => {
dispatch({type: 'user/REMOVE_HIGH_SECURITY_KEYS'})
}
})
)(PostsList)
3 changes: 1 addition & 2 deletions app/components/cards/PostsList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
width: 100%;
height: 100%;
z-index: 300;

overflow: scroll;
background-color: $white;
// padding: 0 .9rem;
}
Expand Down Expand Up @@ -47,7 +47,6 @@
}

.PostsList__post_container {
overflow: hidden;
position: relative;
background-color: $white;
margin: 1rem auto;
Expand Down
3 changes: 1 addition & 2 deletions app/components/cards/TransferHistoryRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ class TransferHistoryRow extends React.Component {
description_start += "Start power down of " + data.vesting_shares;
} else if( type === 'curation_reward' ) {
description_start += `${curation_reward} STEEM POWER for `;
other_account = data.comment_author;
description_end = `/${data.comment_permlink}`;
other_account = data.comment_author + "/" + data.comment_permlink;
} else if (type === 'author_reward') {
let steem_payout = ""
if(data.steem_payout !== '0.000 STEEM') steem_payout = ", " + data.steem_payout;
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/UserListRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UserListRow extends React.Component {
return(
<tr>
{loggedIn && <td width="250">
<Follow following={user} what="blog" />
<Follow following={user} />
</td>}
<td>
<Link to={'/@' + user}><strong>{user}</strong></Link>
Expand Down
2 changes: 2 additions & 0 deletions app/components/elements/Author.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
}

.Author__bio {
clear: both;
font-size: 90%;
padding-top: 5px;
}
}
Loading

0 comments on commit c42fe05

Please sign in to comment.