From e69262c665026df947120aaec1519a202c406396 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Fri, 13 Jan 2017 17:11:46 -0300 Subject: [PATCH] Community Section Ready --- .../coral-admin/src/components/ui/Layout.css | 1 + .../src/containers/Community/Community.css | 92 +++++++++++++++-- .../src/containers/Community/Community.js | 21 ++-- .../src/containers/Community/Table.js | 2 + .../containers/Configure/CommentSettings.js | 99 +++++++++---------- .../src/containers/Configure/Configure.css | 35 +++++-- .../src/containers/Configure/EmbedLink.js | 16 ++- .../src/containers/Configure/Wordlist.js | 8 +- .../src/containers/Streams/Streams.css | 42 ++++++-- .../src/containers/Streams/Streams.js | 92 ++++++++--------- client/coral-ui/components/Card.css | 35 +++++++ client/coral-ui/components/Card.js | 8 ++ client/coral-ui/components/Pager.css | 19 +++- client/coral-ui/components/Pager.js | 6 +- client/coral-ui/index.js | 2 + views/admin.ejs | 2 +- 16 files changed, 318 insertions(+), 162 deletions(-) create mode 100644 client/coral-ui/components/Card.css create mode 100644 client/coral-ui/components/Card.js diff --git a/client/coral-admin/src/components/ui/Layout.css b/client/coral-admin/src/components/ui/Layout.css index 71518b82d..792440d97 100644 --- a/client/coral-admin/src/components/ui/Layout.css +++ b/client/coral-admin/src/components/ui/Layout.css @@ -2,4 +2,5 @@ max-width: 1280px; margin: 0 auto; overflow: hidden; + background-color: #FAFAFA; } diff --git a/client/coral-admin/src/containers/Community/Community.css b/client/coral-admin/src/containers/Community/Community.css index cb6d408ee..7cd88a299 100644 --- a/client/coral-admin/src/containers/Community/Community.css +++ b/client/coral-admin/src/containers/Community/Community.css @@ -1,16 +1,49 @@ +.container { + padding: 10px; + display: flex; + padding-bottom: 200px; +} + +.leftColumn { + padding: 42px 56px; + width: 234px; +} + +.mainContent { + width: calc(100% - 300px); + padding: 34px 14px; + box-sizing: border-box; +} + .roleButton { display: block; } -.searchInput { - display: block; - padding-left: 40px; - width: 100% -} - .searchBox { + width: 100%; + padding: 9px; + border: 1px solid #ccc; + border-radius: 2px; + display: -webkit-box; + display: -ms-flexbox; + display: flex; background: white; - max-width: 150px; + box-sizing: border-box; + height: 40px; + + i { + color: #A1A1A1 + } + + input { + display: block; + width: 100%; + height: 100%; + border: none; + font-size: 16px; + padding: 0 2px 0 15px; + box-sizing: border-box; + } } .email { @@ -18,5 +51,48 @@ } .dataTable { - white-space: normal; + width: 100%; + border-left: none; + border-right: none; + + th { + font-size: 1.1em; + } + + th:nth-child(2), th:nth-child(3) { + width: 100px; + } +} + +.selectField { + position: relative; + width: 150px; + height: 36px; + background: #2c2c2c; + padding: 10px 15px; + box-sizing: border-box; + color: white; + border-radius: 2px; + box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12); + + > div { + padding: 0; + } + + i { + position: absolute; + top: 7px; + right: 7px; + } + + input { + padding: 0; + font-size: 13px; + letter-spacing: 0.7px; + font-weight: 400; + } + + &:hover { + cursor: pointer; + } } diff --git a/client/coral-admin/src/containers/Community/Community.js b/client/coral-admin/src/containers/Community/Community.js index 0c725ed49..d63dd1e96 100644 --- a/client/coral-admin/src/containers/Community/Community.js +++ b/client/coral-admin/src/containers/Community/Community.js @@ -1,13 +1,12 @@ import React from 'react'; import I18n from 'coral-framework/modules/i18n/i18n'; import translations from '../../translations.json'; -import {Grid, Cell} from 'react-mdl'; import styles from './Community.css'; import Table from './Table'; import Loading from './Loading'; import NoResults from './NoResults'; -import Pager from 'coral-ui/components/Pager'; +import {Pager} from 'coral-ui'; const lang = new I18n(translations); @@ -33,17 +32,17 @@ const tableHeaders = [ const Community = ({isFetching, commenters, ...props}) => { const hasResults = !isFetching && !!commenters.length; return ( - - +
+
-
-
+
{ isFetching && } { !hasResults && } { hasResults && @@ -68,8 +67,8 @@ const Community = ({isFetching, commenters, ...props}) => { page={props.page} onNewPageHandler={props.onNewPageHandler} /> - - +
+
); }; diff --git a/client/coral-admin/src/containers/Community/Table.js b/client/coral-admin/src/containers/Community/Table.js index 1d81b1b2e..c146e564a 100644 --- a/client/coral-admin/src/containers/Community/Table.js +++ b/client/coral-admin/src/containers/Community/Table.js @@ -52,6 +52,7 @@ class Table extends Component { this.onCommenterStatusChange(row.id, status)}> @@ -60,6 +61,7 @@ class Table extends Component { this.onRoleChange(row.id, role)}> diff --git a/client/coral-admin/src/containers/Configure/CommentSettings.js b/client/coral-admin/src/containers/Configure/CommentSettings.js index 6000c1d43..a0c1177c2 100644 --- a/client/coral-admin/src/containers/Configure/CommentSettings.js +++ b/client/coral-admin/src/containers/Configure/CommentSettings.js @@ -3,15 +3,8 @@ import {SelectField, Option} from 'react-mdl-selectfield'; import I18n from 'coral-framework/modules/i18n/i18n'; import translations from '../../translations.json'; import styles from './Configure.css'; -import { - List, - ListItem, - ListItemContent, - ListItemAction, - Textfield, - Checkbox, - Icon -} from 'react-mdl'; +import {Textfield, Checkbox} from 'react-mdl'; +import {Card, Icon, Spinner} from 'coral-ui'; const TIMESTAMPS = { weeks: 60 * 60 * 24 * 7, @@ -71,35 +64,32 @@ const updateClosedTimeout = (updateSettings, ts, isMeasure) => (event) => { const CommentSettings = ({fetchingSettings, title, updateSettings, settingsError, settings, errors}) => { if (fetchingSettings) { - - /* maybe a spinner here at some point */ - return

Loading settings...

; + return Loading settings...; } return ( -
+

{title}

- - - + +
- - +
+
{lang.t('configure.enable-pre-moderation')}

{lang.t('configure.enable-pre-moderation-text')}

- - - - +
+
+ +
- - +
+
{lang.t('configure.comment-count-header')}

{lang.t('configure.comment-count-text-pre')} @@ -118,32 +108,44 @@ const CommentSettings = ({fetchingSettings, title, updateSettings, settingsError }

- - - - +
+
+ +
- - +
+
{lang.t('configure.include-comment-stream')}

{lang.t('configure.include-comment-stream-desc')}

- - - - +
+
+ +
+
+
+
+ +
+ {lang.t('configure.closed-comments-desc')} +

- - - - +

+
+
+ +
{lang.t('configure.close-after')}
{lang.t('configure.weeks')}
- -
- - - {lang.t('configure.closed-comments-desc')} - - - -
+
+
); }; diff --git a/client/coral-admin/src/containers/Configure/Configure.css b/client/coral-admin/src/containers/Configure/Configure.css index 9615311f0..1f23af30b 100644 --- a/client/coral-admin/src/containers/Configure/Configure.css +++ b/client/coral-admin/src/containers/Configure/Configure.css @@ -21,11 +21,9 @@ } .configSetting { - border: 1px solid #ccc; - border-radius: 4px; - height: 95px; - margin-bottom: 10px; + margin-bottom: 20px; align-items: flex-start; + min-height: 100px; } .settingsError { @@ -47,13 +45,13 @@ } .configSettingInfoBox { - border: 1px solid #ccc; - border-radius: 4px; - margin-bottom: 10px; + min-height: 100px; + margin-bottom: 20px; cursor: pointer; width: auto; height: auto; text-align: left; + overflow: visible; } .configSettingInfoBox p { @@ -82,7 +80,7 @@ } .charCountTexfieldEnabled { - border-color: #4caf50; + border-color: #00796b; } .charCountTexfield:focus { @@ -95,7 +93,7 @@ } .copiedText { - color: #008000; + color: #00796b; float: right; padding: 12px; font-size: 14px; @@ -103,6 +101,7 @@ .copyButton { float: right; + width: 200px; } .embedInput { @@ -134,7 +133,7 @@ } .enabledSetting { - border-left-color: #4caf50; + border-left-color: #00796b; border-left-style: solid; border-left-width: 7px; } @@ -150,3 +149,19 @@ .saveBox { margin-top: 38px; } + +.commentSettingsSection { + padding-bottom: 200px; + .action { + display: inline-block; + position: absolute; + top: 0; + left: 0; + padding: 20px; + } + + .content { + display: inline-block; + padding-left: 30px; + } +} diff --git a/client/coral-admin/src/containers/Configure/EmbedLink.js b/client/coral-admin/src/containers/Configure/EmbedLink.js index 374d78ea3..105b531c5 100644 --- a/client/coral-admin/src/containers/Configure/EmbedLink.js +++ b/client/coral-admin/src/containers/Configure/EmbedLink.js @@ -2,11 +2,7 @@ import React, {Component} from 'react'; import I18n from 'coral-framework/modules/i18n/i18n'; import translations from '../../translations.json'; import styles from './Configure.css'; -import { - List, - ListItem, - Button -} from 'react-mdl'; +import {Button, Card} from 'coral-ui'; class EmbedLink extends Component { @@ -34,16 +30,16 @@ class EmbedLink extends Component { return (

{this.props.title}

- - +
+

{lang.t('configure.copy-and-paste')}