Skip to content

Commit

Permalink
Add an organisation Talk page
Browse files Browse the repository at this point in the history
An experiment in adding a Talk page for organisation. It looks for a Talk section called org-{organisation.id}.
  • Loading branch information
eatyourgreens committed Mar 23, 2020
1 parent f483263 commit 91857dd
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/pages/organization/organization-container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class OrganizationContainer extends React.Component {
}

render() {
const { user } = this.context;
const { children, params } = this.props;
const {
collaboratorView,
Expand Down Expand Up @@ -256,7 +257,8 @@ class OrganizationContainer extends React.Component {
organizationProjects,
projectAvatars,
quoteObject,
toggleCollaboratorView: this.toggleCollaboratorView
toggleCollaboratorView: this.toggleCollaboratorView,
user
});
} else if (fetchingOrganization) {
return (
Expand Down
32 changes: 32 additions & 0 deletions app/pages/organization/talk/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react';
import { Helmet } from 'react-helmet';
import { Link } from 'react-router';
import counterpart from 'counterpart';
import TalkBreadcrumbs from '../../../talk/breadcrumbs';
import TalkSearchInput from '../../../talk/search-input';
import TalkFootnote from '../../../talk/footnote';

export default function OrgTalkPage(props) {
const { organization, user } = props;
const section = `org-${organization.id}`;
const pageTitle = `${organization.display_name} » ${counterpart('orgTalk.title')}`;
return (
<div className="project-text-content talk project">
<Helmet title={pageTitle} />
<div className="content-container">
<h1 className="talk-main-link">
<Link to={`/organizations/${props.organization.slug}/talk`}>
{organization.display_name} Talk
</Link>
</h1>
<TalkBreadcrumbs {...props} />

<TalkSearchInput {...props} />

{React.cloneElement(props.children, { section, organization, user })}

<TalkFootnote />
</div>
</div>
);
}
12 changes: 12 additions & 0 deletions app/router.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,18 @@ module.exports =
<IndexRoute component={(require './pages/organization/organization-page').default} />
<Route path="home" component={ONE_UP_REDIRECT} />
<Route path="stats" component={(require './pages/organization/stats').default} />
<Route path="talk" component={require('./pages/organization/talk').default}>
<IndexRoute component={require './talk/init'} />
<Route path="recents" component={require './talk/recents'} />
<Route path="not-found" component={NotFoundPage} />
<Route path="search" component={require './talk/search'} />
<Route path="moderations" component={require './talk/moderations'} />
<Route path="subjects/:id" component={SubjectPageController} />
<Route path="recents/:board" component={require './talk/recents'} />
<Route path="tags/:tag" component={require './talk/tags'} />
<Route path=":board" component={require './talk/board'} />
<Route path=":board/:discussion" component={require './talk/discussion'} />
</Route>
</Route>

<Route path="notifications" component={NotificationsPage} />
Expand Down

0 comments on commit 91857dd

Please sign in to comment.