Story: {comment.asset.title}
diff --git a/client/coral-admin/src/containers/UserDetailComment.js b/client/coral-admin/src/containers/UserDetailComment.js
index a70a9394d..9f0e3a793 100644
--- a/client/coral-admin/src/containers/UserDetailComment.js
+++ b/client/coral-admin/src/containers/UserDetailComment.js
@@ -9,6 +9,7 @@ export default withFragments({
body
created_at
status
+ hasParent
asset {
id
title
diff --git a/client/coral-admin/src/routes/Moderation/components/Comment.js b/client/coral-admin/src/routes/Moderation/components/Comment.js
index 1335a8c52..c73d15eaa 100644
--- a/client/coral-admin/src/routes/Moderation/components/Comment.js
+++ b/client/coral-admin/src/routes/Moderation/components/Comment.js
@@ -2,6 +2,7 @@ import React, {PropTypes} from 'react';
import {Link} from 'react-router';
import {Icon} from 'coral-ui';
+import ReplyBadge from 'coral-admin/src/components/ReplyBadge';
import FlagBox from 'coral-admin/src/components/FlagBox';
import styles from './styles.css';
import CommentType from 'coral-admin/src/components/CommentType';
@@ -107,6 +108,7 @@ class Comment extends React.Component {
}
+ {comment.hasParent &&
}
(
+
+ {icon && }
+ {children}
+
+);
+
+export default Badge;
diff --git a/client/coral-ui/index.js b/client/coral-ui/index.js
index 8a538d120..8f261bcca 100644
--- a/client/coral-ui/index.js
+++ b/client/coral-ui/index.js
@@ -26,3 +26,4 @@ export {default as Option} from './components/Option';
export {default as SnackBar} from './components/SnackBar';
export {default as TextArea} from './components/TextArea';
export {default as Drawer} from './components/Drawer';
+export {default as Badge} from './components/Badge';
diff --git a/client/talk-plugin-moderation/ModerationLink.js b/client/talk-plugin-moderation/ModerationLink.js
index 020b8c345..1a10160ee 100644
--- a/client/talk-plugin-moderation/ModerationLink.js
+++ b/client/talk-plugin-moderation/ModerationLink.js
@@ -2,10 +2,11 @@ import React, {PropTypes} from 'react';
import styles from './styles.css';
import t from 'coral-framework/services/i18n';
+import {BASE_PATH} from 'coral-framework/constants/url';
const ModerationLink = (props) => props.isAdmin ? (
diff --git a/graph/resolvers/comment.js b/graph/resolvers/comment.js
index 0fd3a730c..57ebc4d56 100644
--- a/graph/resolvers/comment.js
+++ b/graph/resolvers/comment.js
@@ -1,6 +1,9 @@
const {decorateWithTags} = require('./util');
const Comment = {
+ hasParent({parent_id}) {
+ return !!parent_id;
+ },
parent({parent_id}, _, {loaders: {Comments}}) {
if (parent_id == null) {
return null;
diff --git a/graph/subscriptions.js b/graph/subscriptions.js
index f89b41d3a..71b8abc6a 100644
--- a/graph/subscriptions.js
+++ b/graph/subscriptions.js
@@ -26,6 +26,8 @@ const {
SUBSCRIBE_ALL_USERNAME_REJECTED,
} = require('../perms/constants');
+const {BASE_PATH} = require('../url');
+
/**
* Plugin support requires that we merge in existing setupFunctions with our new
* plugin based ones. This allows plugins to extend existing setupFunctions as well
@@ -170,7 +172,7 @@ const createSubscriptionManager = (server) => new SubscriptionServer({
keepAlive: ms(KEEP_ALIVE)
}, {
server,
- path: '/api/v1/live'
+ path: `${BASE_PATH}api/v1/live`
});
module.exports = {
diff --git a/graph/typeDefs.graphql b/graph/typeDefs.graphql
index d2c1ffe1f..d83d9f75f 100644
--- a/graph/typeDefs.graphql
+++ b/graph/typeDefs.graphql
@@ -339,6 +339,9 @@ type Comment {
# describes how the comment can be edited
editing: EditInfo
+
+ # Indicates if it has a parent
+ hasParent: Boolean
}
# CommentConnection represents a paginable subset of a comment list.
diff --git a/locales/en.yml b/locales/en.yml
index 54d5315d5..2ec0c816c 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -281,6 +281,7 @@ en:
prev_comment: "Go to the previous comment"
reject: "Reject"
rejected: "Rejected"
+ reply: "Reply"
select_stream: "Select Stream"
shift_key: "⇧"
shortcuts: "Shortcuts"
diff --git a/locales/es.yml b/locales/es.yml
index 8c3e7927b..877a42841 100644
--- a/locales/es.yml
+++ b/locales/es.yml
@@ -272,6 +272,7 @@ es:
prev_comment: "Ir al comentario anterior"
reject: "Rechazar"
rejected: "rechazado"
+ reply: "Respuesta"
select_stream: "Seleccionar hilo de comentarios"
shift_key: ⇧
shortcuts: Atajos
diff --git a/url.js b/url.js
new file mode 100644
index 000000000..1def7a707
--- /dev/null
+++ b/url.js
@@ -0,0 +1,19 @@
+const {ROOT_URL, ROOT_URL_MOUNT_PATH} = require('./config');
+const {URL} = require('url');
+
+// Set the BASE_URL as the ROOT_URL, here we derive the root url by ensuring
+// that it ends in a `/`.
+const BASE_URL = ROOT_URL && ROOT_URL.length > 0 && ROOT_URL[ROOT_URL.length - 1] === '/' ? ROOT_URL : `${ROOT_URL}/`;
+
+// The BASE_PATH is simply the path component of the BASE_URL.
+const BASE_PATH = new URL(BASE_URL).pathname;
+
+// The MOUNT_PATH is derived from the BASE_PATH, if it is provided and enabled.
+// This will mount all the application routes onto it.
+const MOUNT_PATH = ROOT_URL_MOUNT_PATH ? BASE_PATH : '/';
+
+module.exports = {
+ BASE_URL: BASE_URL,
+ BASE_PATH: BASE_PATH,
+ MOUNT_PATH: MOUNT_PATH,
+};
diff --git a/views/article.ejs b/views/article.ejs
index f0a3dad98..0f8c75594 100644
--- a/views/article.ejs
+++ b/views/article.ejs
@@ -22,7 +22,7 @@
<%= title %>
<%= body %>
- Admin - All Assets
+ Admin - All Assets