From 9a3e4ce4fe3beb8ef047eb9e574c972e38d535f5 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 5 Aug 2015 11:48:35 +0930 Subject: [PATCH] Rename user page components for consistency --- .../{UserDiscussionsPage.js => DiscussionsUserPage.js} | 8 ++++---- .../components/{UserPostsPage.js => PostsUserPage.js} | 10 +++++----- framework/core/js/forum/src/initializers/routes.js | 10 +++++----- framework/core/less/forum/ActivityPage.less | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) rename framework/core/js/forum/src/components/{UserDiscussionsPage.js => DiscussionsUserPage.js} (67%) rename framework/core/js/forum/src/components/{UserPostsPage.js => PostsUserPage.js} (91%) diff --git a/framework/core/js/forum/src/components/UserDiscussionsPage.js b/framework/core/js/forum/src/components/DiscussionsUserPage.js similarity index 67% rename from framework/core/js/forum/src/components/UserDiscussionsPage.js rename to framework/core/js/forum/src/components/DiscussionsUserPage.js index c739615fa..ca42cb2d5 100644 --- a/framework/core/js/forum/src/components/UserDiscussionsPage.js +++ b/framework/core/js/forum/src/components/DiscussionsUserPage.js @@ -2,10 +2,10 @@ import UserPage from 'flarum/components/UserPage'; import DiscussionList from 'flarum/components/DiscussionList'; /** - * The `UserDiscussionsPage` component shows a user's activity feed inside of their - * profile. + * The `DiscussionsUserPage` component shows a discussion list inside of a user + * page. */ -export default class UserDiscussionsPage extends UserPage { +export default class DiscussionsUserPage extends UserPage { constructor(...args) { super(...args); @@ -14,7 +14,7 @@ export default class UserDiscussionsPage extends UserPage { content() { return ( -
+
{DiscussionList.component({ params: { q: 'author:' + this.user.username() diff --git a/framework/core/js/forum/src/components/UserPostsPage.js b/framework/core/js/forum/src/components/PostsUserPage.js similarity index 91% rename from framework/core/js/forum/src/components/UserPostsPage.js rename to framework/core/js/forum/src/components/PostsUserPage.js index 4209ddfe3..2349418d8 100644 --- a/framework/core/js/forum/src/components/UserPostsPage.js +++ b/framework/core/js/forum/src/components/PostsUserPage.js @@ -4,10 +4,10 @@ import Button from 'flarum/components/Button'; import PostedActivity from 'flarum/components/PostedActivity'; /** - * The `UserPostsPage` component shows a user's activity feed inside of their + * The `PostsUserPage` component shows a user's activity feed inside of their * profile. */ -export default class UserPostsPage extends UserPage { +export default class PostsUserPage extends UserPage { constructor(...args) { super(...args); @@ -49,7 +49,7 @@ export default class UserPostsPage extends UserPage { footer = LoadingIndicator.component(); } else if (this.moreResults) { footer = ( -
+
{Button.component({ children: app.trans('core.load_more'), className: 'Button', @@ -60,8 +60,8 @@ export default class UserPostsPage extends UserPage { } return ( -
-
    +
    +
      {this.posts.map(post => { return
    • {PostedActivity.component({post})}
    • ; })} diff --git a/framework/core/js/forum/src/initializers/routes.js b/framework/core/js/forum/src/initializers/routes.js index 517289702..0a075ce74 100644 --- a/framework/core/js/forum/src/initializers/routes.js +++ b/framework/core/js/forum/src/initializers/routes.js @@ -1,7 +1,7 @@ import IndexPage from 'flarum/components/IndexPage'; import DiscussionPage from 'flarum/components/DiscussionPage'; -import UserPostsPage from 'flarum/components/UserPostsPage'; -import UserDiscussionsPage from 'flarum/components/UserDiscussionsPage'; +import PostsUserPage from 'flarum/components/PostsUserPage'; +import DiscussionsUserPage from 'flarum/components/DiscussionsUserPage'; import SettingsPage from 'flarum/components/SettingsPage'; import NotificationsPage from 'flarum/components/NotificationsPage'; @@ -19,9 +19,9 @@ export default function(app) { 'discussion': {path: '/d/:id/:slug', component: DiscussionPage.component()}, 'discussion.near': {path: '/d/:id/:slug/:near', component: DiscussionPage.component()}, - 'user': {path: '/u/:username', component: UserPostsPage.component()}, - 'user.posts': {path: '/u/:username', component: UserPostsPage.component()}, - 'user.discussions': {path: '/u/:username/discussions', component: UserDiscussionsPage.component()}, + 'user': {path: '/u/:username', component: PostsUserPage.component()}, + 'user.posts': {path: '/u/:username', component: PostsUserPage.component()}, + 'user.discussions': {path: '/u/:username/discussions', component: DiscussionsUserPage.component()}, 'settings': {path: '/settings', component: SettingsPage.component()}, 'notifications': {path: '/notifications', component: NotificationsPage.component()} diff --git a/framework/core/less/forum/ActivityPage.less b/framework/core/less/forum/ActivityPage.less index a36ca63a9..a1655d219 100644 --- a/framework/core/less/forum/ActivityPage.less +++ b/framework/core/less/forum/ActivityPage.less @@ -1,4 +1,4 @@ -.UserPostsPage-loadMore { +.PostsUserPage-loadMore { text-align: center; .LoadingIndicator {