Browse Source

missing js files, updated readme

Rafał Pitoń 8 years ago
parent
commit
f8b1072bdb

+ 1 - 1
README.rst

@@ -57,10 +57,10 @@ As of now Misago implements all features considered "must have" on live internet
 * Rich polls  system, allowing polls with public and private voters, single and multiple choices as well as ones that allow vote change or limit voting tp limited period of time.
 * Rich polls  system, allowing polls with public and private voters, single and multiple choices as well as ones that allow vote change or limit voting tp limited period of time.
 * Post attachments complete thumbnailing and gif's animation removal.
 * Post attachments complete thumbnailing and gif's animation removal.
 * Posts edits log allowing you to see how user messages used to look in past as well as revert function protecting you from malignant users emptying their posts contents.
 * Posts edits log allowing you to see how user messages used to look in past as well as revert function protecting you from malignant users emptying their posts contents.
+* Moderation queue for users and categories allowing you to moderate content before it becomes visible to other members of the community.
 
 
 Even more features will follow in future releases:
 Even more features will follow in future releases:
 
 
-* moderation queue
 * content reporting
 * content reporting
 * warning system
 * warning system
 * notifications
 * notifications

+ 40 - 0
frontend/src/components/search/threads/footer.js

@@ -0,0 +1,40 @@
+// jshint ignore:start
+import React from 'react';
+import MisagoMarkup from 'misago/components/misago-markup';
+import escapeHtml from 'misago/utils/escape-html';
+
+const CATEGORY_SPAN = '<span class="category-name">%(name)s</span>';
+const ITEM_SPAN = '<span class="item-title">%(name)s</span>';
+
+export default function(props) {
+  const template = gettext('%(user)s, %(posted_on)s in "%(thread)s", %(category)s');
+
+  let username = null;
+  if (props.post.poster) {
+    username = props.post.poster.username;
+  } else {
+    username = props.post.poster_name;
+  }
+
+  const message = interpolate(escapeHtml(template), {
+    category: interpolate(CATEGORY_SPAN, {
+      name: escapeHtml(props.category.name)
+    }, true),
+    thread: interpolate(ITEM_SPAN, {
+      name: escapeHtml(props.thread.title)
+    }, true),
+    user: interpolate(ITEM_SPAN, {
+      name: escapeHtml(username)
+    }, true),
+    posted_on: escapeHtml(props.post.hidden_on.fromNow()),
+  }, true);
+
+  return (
+    <div className="panel-footer post-infeed-footer">
+      <a
+        dangerouslySetInnerHTML={{__html: message}}
+        href={props.post.url.index}
+      />
+    </div>
+  );
+}

+ 40 - 0
frontend/src/components/search/threads/post.js

@@ -0,0 +1,40 @@
+// jshint ignore:start
+import React from 'react';
+import PostFooter from './footer';
+import MisagoMarkup from 'misago/components/misago-markup';
+
+export default function(props) {
+  return (
+    <li id={'post-' + props.post.id} className="post post-infeed">
+      <div className="post-border">
+        <div className="post-body">
+          <div className="panel panel-default panel-post">
+            <PostBody content={props.post.content} />
+            <PostFooter
+              category={props.post.category}
+              post={props.post}
+              thread={props.post.thread}
+            />
+          </div>
+        </div>
+      </div>
+    </li>
+  );
+}
+
+export function PostBody(props) {
+  if (props.content) {
+    return (
+      <div className="panel-body">
+        <MisagoMarkup markup={props.content} />
+      </div>
+    );
+  }
+
+  return (
+    <div className="panel-body panel-body-invalid">
+      <p className="lead">{gettext("This post's contents cannot be displayed.")}</p>
+      <p className="text-muted">{gettext("This error is caused by invalid post content manipulation.")}</p>
+    </div>
+  );
+}