From 2bbb5ef74e43c30c4a3648adab0d1420d07a87b3 Mon Sep 17 00:00:00 2001 From: Rokt33r Date: Sun, 29 Nov 2015 18:57:49 +0900 Subject: [PATCH] =?UTF-8?q?article=E3=81=AE=E3=82=BF=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E5=9F=BA=E6=9C=AC=E3=82=BF=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=83=AB=E8=BF=BD=E5=8A=A0=20/=20=E4=BD=95=E3=82=82=E6=9B=B8?= =?UTF-8?q?=E3=81=8B=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E6=99=82?= =?UTF-8?q?=E3=81=ABUntitled=20label=E3=82=92=E3=81=A0=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser/main/HomePage/ArticleDetail.js | 13 ++++++++++++- browser/main/HomePage/ArticleList.js | 8 +++++++- .../main/HomeContainer/components/ArticleList.styl | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/browser/main/HomePage/ArticleDetail.js b/browser/main/HomePage/ArticleDetail.js index c7daaa9e..60d51433 100644 --- a/browser/main/HomePage/ArticleDetail.js +++ b/browser/main/HomePage/ArticleDetail.js @@ -267,6 +267,9 @@ export default class ArticleDetail extends React.Component { newArticle.updatedAt = new Date() if (newArticle.createdAt == null) { newArticle.createdAt = new Date() + if (newArticle.title.trim().length === 0) { + newArticle.title = `Created at ${moment(newArticle.createdAt).format('YYYY/MM/DD HH:mm')}` + } activityRecord.emit('ARTICLE_CREATE') } else { activityRecord.emit('ARTICLE_UPDATE') @@ -464,7 +467,15 @@ export default class ArticleDetail extends React.Component {
- this.handleTitleKeyDown(e)} placeholder='Title' ref='title' value={this.state.article.title} onChange={e => this.handleTitleChange(e)}/> + this.handleTitleKeyDown(e)} + placeholder={this.state.article.createdAt == null + ? `Created at ${moment().format('YYYY/MM/DD HH:mm')}` + : 'Title'} + ref='title' + value={this.state.article.title} + onChange={e => this.handleTitleChange(e)} + />
Not tagged yet) let folder = _.findWhere(folders, {key: article.FolderKey}) + let title = article.status !== NEW + ? article.title.trim().length === 0 + ? (Untitled) + : article.title + : '(New article)' + return (
this.handleArticleClick(article)(e)} className={'articleItem' + (activeArticle.key === article.key ? ' active' : '')}> @@ -91,7 +97,7 @@ export default class ArticleList extends React.Component { {article.status != null ? article.status : moment(article.updatedAt).fromNow()}
-
{article.status !== NEW ? article.title : '(New article)'}
+
{title}
{tagElements}
diff --git a/browser/styles/main/HomeContainer/components/ArticleList.styl b/browser/styles/main/HomeContainer/components/ArticleList.styl index 6617773a..7d406c25 100644 --- a/browser/styles/main/HomeContainer/components/ArticleList.styl +++ b/browser/styles/main/HomeContainer/components/ArticleList.styl @@ -48,6 +48,8 @@ articleItemColor = #777 left 19px right 0 overflow ellipsis + small + color #AAA .bottom padding 5px 0 overflow-x auto