|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
|
|
|
import { withTranslation } from 'react-i18next';
|
|
|
|
|
|
+import { isTrashPage, userPageRoot } from '../../../../lib/util/path-utils';
|
|
|
import { createSubscribedElement } from '../UnstatedUtils';
|
|
|
import AppContainer from '../../services/AppContainer';
|
|
|
import RevisionPath from '../Page/RevisionPath';
|
|
|
@@ -10,11 +11,13 @@ import PageContainer from '../../services/PageContainer';
|
|
|
import TagLabels from '../Page/TagLabels';
|
|
|
import LikeButton from '../LikeButton';
|
|
|
import BookmarkButton from '../BookmarkButton';
|
|
|
+import UserPicture from '../User/UserPicture';
|
|
|
|
|
|
const GrowiSubNavigation = (props) => {
|
|
|
const { appContainer, pageContainer } = props;
|
|
|
- const { isTrashPage } = pageContainer;
|
|
|
-
|
|
|
+ const path = pageContainer.path || '';
|
|
|
+ const { createdAt, creator } = pageContainer.state;
|
|
|
+ console.log(creator);
|
|
|
|
|
|
return (
|
|
|
<div className="d-flex align-items-center">
|
|
|
@@ -25,7 +28,7 @@ const GrowiSubNavigation = (props) => {
|
|
|
<RevisionPath behaviorType={appContainer.config.behaviorType} pageId={pageContainer.state.pageId} pagePath={pageContainer.state.path} />
|
|
|
</h1>
|
|
|
{/* TODO hide this component at forbidden page */}
|
|
|
- {!isTrashPage && <TagLabels />}
|
|
|
+ {!isTrashPage(path) && <TagLabels />}
|
|
|
</div>
|
|
|
|
|
|
{/* Header Button */}
|
|
|
@@ -35,6 +38,22 @@ const GrowiSubNavigation = (props) => {
|
|
|
<div>
|
|
|
<BookmarkButton pageId={pageContainer.state.pageId} crowi={appContainer} />
|
|
|
</div>
|
|
|
+ <ul className="authors hidden-sm hidden-xs text-nowrap">
|
|
|
+ {creator != null
|
|
|
+ && (
|
|
|
+ <li>
|
|
|
+ <div className="d-flex align-items-center">
|
|
|
+ <a className="mr-2" href={userPageRoot(creator)} data-toggle="tooltip" data-placement="bottom" title={creator.name}>
|
|
|
+ <UserPicture user={creator} size="sm" />
|
|
|
+ </a>
|
|
|
+ <div>
|
|
|
+ <div>Created by <a href={creator.name}>{creator.name}</a></div>
|
|
|
+ <div className="text-muted">{createdAt}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ )}
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
);
|
|
|
|