Skip to content

Commit

Permalink
Add an organisation Talk page
Browse files Browse the repository at this point in the history
A simple experiment in adding a Talk page for organisation. It looks for a Talk section called org-{organisation.id}.
  • Loading branch information
eatyourgreens committed Jun 20, 2019
1 parent 940a84f commit 7dad491
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
31 changes: 31 additions & 0 deletions app/pages/organization/talk/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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 section = `org-${props.organization.id}`;
const pageTitle = `${props.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`}>
{props.organization.display_name} Talk
</Link>
</h1>
<TalkBreadcrumbs {...props} />

<TalkSearchInput {...props} />

{React.cloneElement(props.children, { section, organization: props.organization, user: props.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 @@ -199,6 +199,18 @@ module.exports =
<Route path="organizations/:owner/:name" component={(require './pages/organization/organization-container').default}>
<IndexRoute component={(require './pages/organization/organization-page').default} />
<Route path="home" component={ONE_UP_REDIRECT} />
<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 7dad491

Please sign in to comment.