diff --git a/app/components/BookBuilder/BookBuilder.jsx b/app/components/BookBuilder/BookBuilder.jsx index fab8ad11c629c6559cf6501856cfa6598cc1fca7..a7b2f30cd4a2de357cbbc8aaff6833d0457243c3 100644 --- a/app/components/BookBuilder/BookBuilder.jsx +++ b/app/components/BookBuilder/BookBuilder.jsx @@ -153,7 +153,7 @@ export class BookBuilder extends React.Component { const productionEditor = this.state.productionEditor || 'unassigned' return ( - <div className='bootstrap pubsweet-component pubsweet-component-scroll'> + <div className='bootstrap modal pubsweet-component pubsweet-component-scroll'> <div className={styles.bookBuilder}> <div className='col-lg-offset-2 col-lg-8 col-md-8 col-sm-12 col-xs-12' diff --git a/app/components/BookBuilder/BookBuilderModal.jsx b/app/components/BookBuilder/BookBuilderModal.jsx index dbf04de81605caf315bfa6c61c5a1e918cb56cb9..622f6ec9acbd58a13bf8356005f7d5b626225a40 100644 --- a/app/components/BookBuilder/BookBuilderModal.jsx +++ b/app/components/BookBuilder/BookBuilderModal.jsx @@ -10,7 +10,7 @@ export class BookBuilderModal extends React.Component { toggle, successText, successAction, - // container, + container, chapter, type, action, @@ -66,7 +66,7 @@ export class BookBuilderModal extends React.Component { <Modal show={show} onHide={toggle} - // container={container} + container={container} className='modal' bsSize={modalSize} > diff --git a/app/components/BookBuilder/Chapter.jsx b/app/components/BookBuilder/Chapter.jsx index 5202f5a8fd7d9d82ad3e93e267e945f1bf326189..4d0ffc8617e7b8057f8d5169072b6465694429d8 100644 --- a/app/components/BookBuilder/Chapter.jsx +++ b/app/components/BookBuilder/Chapter.jsx @@ -228,7 +228,10 @@ export class Chapter extends React.Component { _myHandler (evt) { if (evt.target.id === 'dropbutton' || evt.target.parentElement.id === 'dropbutton' || - evt.target.classList.contains('caret')) { + evt.target.classList.contains('caret') || + evt.target.classList.contains('drop-input')) { + const input = findDOMNode(this.refs.dropDownInput) + if (input) input.focus() return } this.setState({ @@ -270,7 +273,6 @@ export class Chapter extends React.Component { const { book, chapter, type, title, connectDragSource, connectDropTarget, isDragging, update, roles, outerContainer } = this.props const { isRenamingTitle, isRenameEmpty } = this.state // const { _onSaveRename } = this - const opacity = isDragging ? 0 : 1 const align = chapter.alignment @@ -292,8 +294,8 @@ export class Chapter extends React.Component { const input = ( <TextInput - className="edit" - ref="chapterInput" + className='edit' + ref='chapterInput' onSave={this._onSaveRename} value={title} /> @@ -313,7 +315,7 @@ export class Chapter extends React.Component { // could do with refs, but that would mean mounting instead of // shallow rendering to access enzyme's refs() api method renameButton = ( - <a id="bb-rename" + <a id='bb-rename' onClick={renameButtonFunction}> { renameButtonText } </a> @@ -393,7 +395,7 @@ export class Chapter extends React.Component { titleArea = ( <DropdownButton title={title} - id="dropbutton" + id='dropbutton' className={styles.dropDown} open={this.state.open} onClick={this._toggleList} @@ -401,10 +403,10 @@ export class Chapter extends React.Component { <div style={{ width: width }}> <div className={styles.dropDownInputContairer}> <TextInput - ref="dropDownInput" - className={styles.dropDownInput} + ref='dropDownInput' + className={'drop-input ' + styles.dropDownInput} onSave={this._onClickCustomTitle} - placeholder="Type a custom title" + placeholder='Type a custom title' /> </div> @@ -422,12 +424,12 @@ export class Chapter extends React.Component { { renameButton } <LinkContainer to={`/books/${book.id}/fragments/${chapter.id}`} - id="bb-edit" + id='bb-edit' > <a>{ editOrView } </a> </LinkContainer> - <a id="bb-delete" + <a id='bb-delete' onClick={this._toggleDelete}> Delete </a> @@ -442,14 +444,14 @@ export class Chapter extends React.Component { } editorArea = ( - <a id="bb-unlock" + <a id='bb-unlock' className={styles.lEditing} onClick={this._toggleUnlock}> <i className={styles.lockIcon + ' fa fa-lock'} - aria-hidden="true" - alt="unlock" + aria-hidden='true' + alt='unlock' /> <span className={styles.lockMessage}> { chapter.lock.editor.username + message} @@ -469,7 +471,7 @@ export class Chapter extends React.Component { className={styles.chapterContainer + ' col-lg-12 bb-chapter ' + (chapter.subCategory === 'chapter' ? styles.isChapter : styles.isPart)} style={{ opacity: opacity }}> <div className={styles.grabIcon + ' ' + (chapter.division === 'body' ? styles.grabIconBody : '')}> - <i className="fa fa-circle" /> + <i className='fa fa-circle' /> <div className={styles.tooltip}> Grab to sort </div> @@ -490,19 +492,19 @@ export class Chapter extends React.Component { <div className={styles.secondLineContainer}> <div className={styles.noPadding + ' col-lg-2 col-md-12 col-sm-12 col-xs-12'}> - <div id="bb-upload" className={styles.btnFile}> + <div id='bb-upload' className={styles.btnFile}> Upload Word <input - type="file" - accept=".docx" - title=" " + type='file' + accept='.docx' + title=' ' /> </div> </div> <ul className={styles.secondActions + ' col-lg-7 col-md-12 col-sm-12 col-xs-12'}> <ProgressIndicator - type="style" + type='style' book={book} chapter={chapter} update={update} @@ -513,7 +515,7 @@ export class Chapter extends React.Component { /> <ProgressIndicator - type="edit" + type='edit' book={book} chapter={chapter} update={update} @@ -524,7 +526,7 @@ export class Chapter extends React.Component { /> <ProgressIndicator - type="review" + type='review' book={book} chapter={chapter} update={update} @@ -535,7 +537,7 @@ export class Chapter extends React.Component { /> <ProgressIndicator - type="clean" + type='clean' book={book} chapter={chapter} roles={roles} @@ -576,8 +578,8 @@ export class Chapter extends React.Component { <BookBuilderModal title={'Delete ' + type} chapter={chapter} - action="delete" - successText="Delete" + action='delete' + successText='Delete' type={type} successAction={this._onClickDelete} show={this.state.showDeleteModal} @@ -588,8 +590,8 @@ export class Chapter extends React.Component { <BookBuilderModal title={'Unlock ' + type} chapter={chapter} - action="unlock" - successText="Unlock" + action='unlock' + successText='Unlock' type={type} successAction={this._onClickUnlock} show={this.state.showUnlockModal} diff --git a/app/components/BookBuilder/styles/_modal.scss b/app/components/BookBuilder/styles/_modal.scss deleted file mode 100644 index ee234d1ac8d44ad3c640a7fe084b016e5a15e851..0000000000000000000000000000000000000000 --- a/app/components/BookBuilder/styles/_modal.scss +++ /dev/null @@ -1,109 +0,0 @@ -$primary-color: #515253; - -// MODAL - -.modal, .modal-content{ - border: 2px solid grey !important; - border-radius: 0px !important; - padding: 1em!important; -} - -.modal-title { - // font-weight: 500; - // font-family: "Fira Sans", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; - font-size: 24px!important; - font-style: italic !important; - font-weight: 500; - line-height: 32px!important; - margin: 0!important; -} - -.new-chapter-input { - background: #fff; - display: block; - width: 100%; - min-height: 2.75em; - border: 1px solid #d1d2d2; - margin: 0; - padding: 8px; - border-radius: 0; - -webkit-appearance: none; - color: $primary-color; - &:focus { - outline: none !important; - box-shadow: none!important; - border: 1px solid #d1d2d2; -} -} - -.modal-body { - border: none!important; - padding: 20px 0px 20px 0px!important; -} - -.modal-footer { - text-align: center!important; - border: none!important; - padding-right:0px!important; -} - -.buttons-container { - float: right; -} - -.modal-button { - padding: 4px 40px 4px 40px; - border: none; - // font-family: "Fira Sans"; - // font-family: 'Fira Sans Light'; - text-transform: uppercase; - display: inline-block; - border: 3px solid transparent; - background-color: lightgrey; - border-radius: 3px; - margin-bottom: 0.5em; - color:#000; - text-align:center; - font-weight:600; - clear:both; - &:hover { - cursor: pointer; - background-color: #808080; - color: #fff; - text-decoration: none; - } -} - -.modal-header { - border-bottom: 0; - font-style: italic; - font-weight: 500; - padding: 0 !important; -} - -.separator { - clear:both; - height:1px; -} - -.add-chapter { - text-decoration: none!important; -} - -.discard-chapter { - margin-right:20px!important; - color: brown!important; - text-decoration: none!important; -} - -.no-chapter{ - text-align: center; - .no-chapter-error { - color: brown; - font-size: 12px; - - } -} - - -/* END MODAL*/ diff --git a/app/components/BookBuilder/styles/bookBuilder.local.scss b/app/components/BookBuilder/styles/bookBuilder.local.scss index fc424cd44ef6d57c477410b3510298b33a02d6ce..2000cee23f71cfcd4df79111447f2765ac9aea7b 100644 --- a/app/components/BookBuilder/styles/bookBuilder.local.scss +++ b/app/components/BookBuilder/styles/bookBuilder.local.scss @@ -3,6 +3,7 @@ $light-grey: #cdcdcd; $main-grey: #d8d8d8; $white: #fff; + .bookBuilder { counter-reset: chapter; font-family: 'Fira Sans'; @@ -32,7 +33,7 @@ $white: #fff; font-style: italic; font-weight: 500; margin-top: 12px; - padding: 0 30px; + padding: 4px 30px; text-align: center; transition: border .5s ease-out .2s; @@ -60,10 +61,11 @@ $white: #fff; } .menuItem { + padding-bottom: 8px; a { color: $light-grey !important; padding-left: 20px; - text-decoration: none !important; + text-decoration: none ; &:hover { color: $dark-grey !important; @@ -71,28 +73,24 @@ $white: #fff; } } - ul { - list-style-type: none; - padding-left: 0 !important; - } - .dropDown { background-color: transparent !important; - border: 0 !important; - border-color: transparent !important; + border: 0; + border-color: transparent; + -webkit-box-shadow: none !important; float: left; - padding: 0 !important; + font-size: 18px; + font-weight: 500; + padding: 0; position: relative; - -webkit-box-shadow:none !important; - span:first-child { - float: left !important; - font-size: 18px; - font-weight: 500; + button { + float: left; position: relative; } - .caret { - // margin-left:30px!important; + + span:first-child { + margin: 0 0 5px 30px; } } @@ -100,11 +98,12 @@ $white: #fff; padding: 10px; .dropDownInput { - border-left: none !important; - border-right: none !important; - border-top: none !important; - width: 100% !important; + border-left: 0; + border-right: 0; + border-top: 0; outline: none; + width: 100%; + } } @@ -142,25 +141,25 @@ $white: #fff; } .sectionBtn { - float:right; + float: right; margin-top: 28px; background-color: $dark-grey; - border: 1px solid #fff; - cursor:pointer; + border: 1px solid $white; + cursor: pointer; font-size: 16px; font-style: italic; font-weight: 500; - padding: 0px 30px; + padding: 4px 30px; text-align: center; transition:border .5s ease-out 0.2s; - color:#fff; + color: $white; &:hover { border: 1px solid $dark-grey; transition: .25s ease-in-out 0s; } a { - color: #fff; + color: $white; text-decoration: none; &:hover { text-decoration: none; @@ -174,7 +173,7 @@ $white: #fff; .chapterContainer { font-style: italic; margin-top: 2%; - padding: 0px !important; + padding: 0; } .grabIcon { @@ -189,8 +188,10 @@ $white: #fff; .grabIconBody { position: relative; - bottom: 5px !important; - top: 0 !important; + bottom: 5px; + top: 0; + font-size: 20px; + padding-bottom: 3px; } .tooltip { @@ -267,34 +268,28 @@ $white: #fff; .isPart { h3 { - // color: $dark-grey; font-size: 20px !important; - // font-style: } .leftBorderBody { border: 0 !important; } - - .grabIconBody { - font-size: 20px; - padding-bottom: 3px !important; - } } .chapterTitle { h3 { - font-family: Fira Sans !important; - font-style: italic; - margin: 0px !important; color: #333 !important; - padding-bottom: 0px; - font-size: 18px; float: left; + font-size: 18px; + font-style: italic; + margin: 0; + max-width: 80%; + padding-bottom: 0; padding-right: 1%; - max-width:80%; + } } + .chapterActions { a { bottom: 24px; @@ -304,13 +299,13 @@ $white: #fff; text-decoration: none; &:hover { - cursor: pointer; color: $dark-grey; + cursor: pointer; transition: .25s ease-in-out 0s; } } + .lEditing { - font-family: Fira Sans!important; background: $dark-grey; color: white; padding:5px; @@ -346,8 +341,10 @@ $white: #fff; background-color:$light-grey; cursor:pointer; text-align: center; - color:#fff; - width:75%; + color: #fff; + width: 75%; + padding-top: 4px; + padding-bottom: 4px; } .btnFile input[type=file] { position: absolute; @@ -361,6 +358,7 @@ $white: #fff; opacity: 0; outline: none; color:#fff; + padding: 10px; border:none!important; display: block; } @@ -373,7 +371,6 @@ $white: #fff; position:relative; top:4px; li { - //color:$light-grey; float:left; padding-right:2%; } @@ -399,31 +396,34 @@ $white: #fff; text-align: center; } .leftBox { - border-right:0px!important; + border-right: 0; } .rightBox { - border-left:0px!important; + border-left: 0; } + .boxDiver { - border-right:1px solid $dark-grey; + border-right: 1px solid $dark-grey; + bottom: 5px; height: 31px; position: relative; - bottom: 5px; right: 23px; } + .boxActive { - height:16px; - width: 16px; - margin:2px 0px 0px 2px; background-color: $dark-grey; - cursor:pointer; + cursor: pointer; + height: 16px; + margin: 2px 0 0 2px; + width: 16px; } .boxInactiveHover { - height:16px; - width: 16px; - margin:2px 0px 0px 2px; background-color: #fff; cursor: pointer; + height: 16px; + margin: 2px 0 0 2px; + width: 16px; + &:hover { background-color: $light-grey; transition: .25s ease-in-out 0s; @@ -435,7 +435,7 @@ $white: #fff; .leftBorderComponent { border-left: 2px solid $light-grey; - width:2px; + width: 2px; height: 68px; position: relative; top: 30px; diff --git a/app/components/BookBuilder/styles/bookList.local.scss b/app/components/BookBuilder/styles/bookList.local.scss index c8f50e197364ca893a9d644c2be64394a84c2727..656213a3aa4427f13e44a7acfc626e110cb4e75e 100644 --- a/app/components/BookBuilder/styles/bookList.local.scss +++ b/app/components/BookBuilder/styles/bookList.local.scss @@ -2,22 +2,19 @@ $primary-color: #515253; .bookList { .bookTitle { - border-bottom: 0.1em solid; + border-bottom: .1em solid; position: relative; } h1, .h1 { - // font-weight: 300; font-weight: 500; font-style: italic; - // font-family: "Fira Sans", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; font-size: 48px; line-height: 56px; margin: 0; } h2, .h2 { - // font-family: "Fira Sans Light Italic", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; color: $primary-color; font-size: 32px; font-style: italic; diff --git a/app/components/BookBuilder/styles/fonts/FiraSans-Light.ttf b/app/components/BookBuilder/styles/fonts/FiraSans-Light.ttf deleted file mode 100644 index 4f38cea774c0ecdcefabd1b470a0e710c320b6ae..0000000000000000000000000000000000000000 Binary files a/app/components/BookBuilder/styles/fonts/FiraSans-Light.ttf and /dev/null differ diff --git a/app/components/BookBuilder/styles/fonts/FiraSans-LightItalic.ttf b/app/components/BookBuilder/styles/fonts/FiraSans-LightItalic.ttf deleted file mode 100644 index d1ade436a9aa569b6d285ee189c2f9d5d785bfdd..0000000000000000000000000000000000000000 Binary files a/app/components/BookBuilder/styles/fonts/FiraSans-LightItalic.ttf and /dev/null differ diff --git a/app/components/BookBuilder/styles/fonts/FiraSans-MediumItalic.ttf b/app/components/BookBuilder/styles/fonts/FiraSans-MediumItalic.ttf deleted file mode 100644 index 430a2bf61ff7258b19dd277da05010bc1bbf8cd4..0000000000000000000000000000000000000000 Binary files a/app/components/BookBuilder/styles/fonts/FiraSans-MediumItalic.ttf and /dev/null differ diff --git a/app/components/Navigation/Navigation.jsx b/app/components/Navigation/Navigation.jsx index 3286d6c2a6a6755f3229e737f4ecafefa56f3ee8..679ae431bde7bf04b211a02ddd95270096761cad 100644 --- a/app/components/Navigation/Navigation.jsx +++ b/app/components/Navigation/Navigation.jsx @@ -15,7 +15,7 @@ export default class Navigation extends React.Component { logout () { const { logoutUser } = this.props.actions logoutUser() - browserHistory.push('/') + browserHistory.push('/login') } render () { diff --git a/app/routes.jsx b/app/routes.jsx index 9edbfd2ec8d3686cbbae10fced3f8feae6c7b162..7d5edb4b1547c963d2bca1ef47b7bd2d8d6dffa3 100644 --- a/app/routes.jsx +++ b/app/routes.jsx @@ -7,7 +7,7 @@ import { requireAuthentication } from 'pubsweet-frontend/src/components/Authenti import Manage from 'pubsweet-component-manage/Manage' import UsersManager from 'pubsweet-component-users-manager/UsersManager' import TeamsManager from 'pubsweet-component-teams-manager/TeamsManager' - +import Blog from 'pubsweet-component-blog/Blog' // Editoria import BookBuilder from './components/BookBuilder/BookBuilder' import BookList from './components/BookBuilder/BookList' @@ -25,7 +25,7 @@ export default ( <Route> <Route path='/' component={AuthenticatedManage}> <Route path='books' component={BookList} /> - + <Route path='/blog' component={Blog} /> <Route path='books/:id/book-builder' component={BookBuilder} /> <Route path='books/:bookId/fragments/:fragmentId' component={SimpleEditorWrapper} /> diff --git a/config/dev.js b/config/dev.js index 52ffaf0d5c913abd80da89a80f12f596b5667424..b87f36a6136391f383b54920e1cd909b58cf6dfa 100644 --- a/config/dev.js +++ b/config/dev.js @@ -9,7 +9,7 @@ module.exports = { API_ENDPOINT: '/api' }, 'pubsweet-frontend': { - theme: 'PepperTheme', + theme: 'EditoriaTheme', routes: 'app/routes.jsx', navigation: 'app/components/Navigation/Navigation.jsx' }, diff --git a/webpack/babel-includes.js b/webpack/babel-includes.js index 709ed365ac32d83ce5f5d6154fc944237538ed6d..fa7953efcc11538df9cc2b40a309b2d0bba195f3 100644 --- a/webpack/babel-includes.js +++ b/webpack/babel-includes.js @@ -3,6 +3,7 @@ const fs = require('fs') var babelIncludes = [ new RegExp(path.join(__dirname, '../node_modules/pubsweet-frontend/src')), + new RegExp(path.join(__dirname, '../node_modules/substance')), new RegExp(path.join(__dirname, '../app')), new RegExp(path.join(__dirname, '../node_modules/pubsweet-.*')) ]