Adding seed tags and css tweaks

This commit is contained in:
Alex Hunt 2018-11-28 22:43:46 -08:00
parent 63f2fe8f41
commit 0860d6f0d1
5 changed files with 64 additions and 16 deletions

View File

@ -95,6 +95,14 @@ def build_es_note_op(id, title, text):
}
}
def build_es_tag_op(id, title, text, color):
return {'_op_type': 'index', '_id': id, '_source': {
'title': title,
'html_source': text,
'color': color
}
}
SAMPLE_CHAPTERS = [
build_es_chapter_op('AWNM3N3mxgFi4og697un', 1, 'Telemachus', 'telem'),
build_es_chapter_op('AWNmqpdHxgFi4og697vA', 2, 'Nestor', 'nestor'),
@ -121,6 +129,15 @@ SAMPLE_NOTES = [
build_es_note_op('AWNmqpdHxgFi4og697vS', 'Lighthouse', 'A lighthouse'),
]
SAMPLE_TAGS = [
build_es_tag_op('fZT4XWcBokFjIT8Zihhg', 'The Writer', 'These links address narrative styles, techniques, revisions, and effects, as well as textual variants, aesthetic theories, and the shaping of real lives into fictional ones.', '307EE3'),
build_es_tag_op('fpT4XWcBokFjIT8Zihhg', 'The Body', 'These links encompass anatomy, sexuality, childbirth, eating, drinking, excretion, clothes, personal accessories, disease, death, medicines, poisons, the physiology of emotion, the vagaries of memory, mental illness, and dreams.', 'CF2929'),
build_es_tag_op('f5T4XWcBokFjIT8Zihhg', 'Performances', 'Indicates notes about songs, operas, oratorios, stage plays, nursery rhymes, speeches, recitations, advertising pitches, prayers, liturgical rites, performative social gestures, and impromptu clowning.', 'AB59C2'),
build_es_tag_op('gJT4XWcBokFjIT8Zihhg', 'Dublin', 'These notes point to landforms like the river and bay, the built environment such as streets, canals, buildings, bridges, trams, and statues, cultural ephemera such as money, and civic institutions.', '9C632A'),
build_es_tag_op('gZT4XWcBokFjIT8Zihhg', 'Literature', 'These links signal allusions to published texts including poetry, fiction, drama, critical essays, history, philosophy, scripture, theology, science, biography, hagiography, travelogues, and newspapers.', 'F59627'),
build_es_tag_op('gpT4XWcBokFjIT8Zihhg', 'Ireland', 'These notes refer to Irish history, politics, customs, language, humor, religion, mythology, economics, geography, modes of transportation, flora, fauna, and weather. ', '40B324'),
]
# Manipulate Indices
def delete_index(index):
@ -145,6 +162,7 @@ def refresh_all_indices():
def refresh_seed_data():
index_seed_docs('chapters', SAMPLE_CHAPTERS)
index_seed_docs('notes', SAMPLE_NOTES)
index_seed_docs('tags', SAMPLE_TAGS)
print 'Successfully loaded sample data!'
def es_setup():

View File

@ -6,18 +6,18 @@ import { ReaderAnnotateButton, ReaderEditButton, EditorToolButton, EditorDeleteT
export const ReadModeTopBar = ({docType, setMode}) =>
<div className='row'>
{['chapters', 'notes'].indexOf(docType) >= 0 &&
<div className='col-sm-5'>
<div className='col-5'>
<ReaderAnnotateButton onClick={()=>setMode('ANNOTATE_MODE')}/>
</div>
}
<div className='col-sm-5 ml-auto'>
<div className='col-5 ml-auto'>
<ReaderEditButton onClick={()=>setMode('EDIT_MODE')} />
</div>
</div>
export const EditModeTopBar = ({editorState, onToolButtonClick, disabled}) =>
<div className='row'>
<div className='col-md-5'>
<div className='col-5'>
<div className='btn-group' role='group'>
<EditorToolButton glyph='bold' onClick={()=>onToolButtonClick(editorState, 'BOLD')}/>
<EditorToolButton glyph='italic' onClick={()=>onToolButtonClick(editorState, 'ITALIC')}/>
@ -25,7 +25,7 @@ export const EditModeTopBar = ({editorState, onToolButtonClick, disabled}) =>
<EditorToolButton glyph='header' onClick={()=>onToolButtonClick(editorState, 'header-two')}/>
</div>
</div>
<div className='col-md-5 offset-md-2'>
<div className='col-5 offset-2'>
<EditorDeleteToolButton disabled={disabled}/>
</div>
</div>

View File

@ -1,15 +1,6 @@
import React from 'react'
// import defaultTagColors from '../modules/editorSettings'
const defaultTagColors = [
'307EE3',
'CF2929',
'AB59C2',
'9C632A',
'F59627',
'40b324'
]
import defaultTagColors from '../modules/editorSettings'
const TagColorPicker = ({colorPickerInput, onChange, onColorSwatchClick}) =>
<div className='input-group'>

View File

@ -35,12 +35,12 @@ const ReaderPage = ({
onHighlightClick={onHighlightClick}
onDocumentClick={onDocumentClick}
/>
<div id='content_window' className='row'>
<div id='content_container' className='row'>
<ReaderSidebarContainer />
<Content>
{loadingToggle === true &&
<LoadingSpinner size={4} />
}
}
{(Object.keys(currentDocument).length > 0 && loadingToggle === false) &&
<ReaderContentContainer />
}

View File

@ -22,6 +22,45 @@ $fa-font-path: "../../node_modules/font-awesome/fonts";
border-right: 1px solid $border_color;
}
@include respond-below(sm) {
#joyce_reader {
width: 100%;
}
#content_container {
margin-top: 0 !important;
}
#content_window {
margin-left: 0;
margin-right: 0;
padding: 0;
box-shadow: none;
border: none;
}
#page {
border: none;
}
#mobile_reader_sidebar {
background-color: rgba(255, 255, 255, 0.8);
margin-top: 0 !important;
padding-top: 1em;
padding-bottom: .5em;
}
#editor_metadata {
width: 95%;
margin: 0 auto;
}
#editor_topbar {
width: 95%;
margin: 0 auto;
}
}
#joyce_reader > div {
margin-top: 0.5em;
}