Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Beta feedback changes #72

Merged
merged 26 commits into from
Sep 21, 2016
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4501f81
Lighten the background
eatyourgreens Jun 27, 2016
8ad9dbf
Check for selected issue text on new annotations
eatyourgreens Jun 27, 2016
bdf1fa1
Style updates
eatyourgreens Jul 6, 2016
c1de441
Generate subtask values properly
eatyourgreens Jul 13, 2016
0580d98
Nicer styles for annotation summary
eatyourgreens Jul 13, 2016
f61c69c
Grab one subject at a time from the queue
eatyourgreens Jul 13, 2016
bf6ca39
New subject viewer layout
eatyourgreens Jul 13, 2016
8914995
Check that new selections are subject text
eatyourgreens Jul 13, 2016
f7f45b0
Add a filtering step to the marking task
eatyourgreens Jul 27, 2016
2418de1
Update annotation format
eatyourgreens Aug 1, 2016
1970d30
Fix react key error on filter question
eatyourgreens Aug 1, 2016
81a0783
Use consistent names for annotations
eatyourgreens Aug 1, 2016
e29385e
Display previous and next pages during the details step
eatyourgreens Aug 5, 2016
a4fcda4
Select randomly from all subject sets
eatyourgreens Aug 5, 2016
8fd94cd
Load subject sets with subjects
eatyourgreens Aug 12, 2016
21b2468
Add a toggle for scanned image/OCR text
eatyourgreens Aug 12, 2016
469b0da
upgrade to React 14
eatyourgreens Aug 12, 2016
7592aff
Classify page rendering and links
eatyourgreens Aug 15, 2016
d6770b7
Fix sign out
eatyourgreens Aug 15, 2016
af18c4b
Colour code the marking tools
eatyourgreens Aug 24, 2016
700b466
Set the workflow ID
eatyourgreens Aug 24, 2016
34b4c15
towards a more flexible editor
eatyourgreens Aug 22, 2016
1da40c8
Tidy up the annotation summary
eatyourgreens Aug 24, 2016
41673d7
Change health to pollution
eatyourgreens Aug 24, 2016
00143ab
Comment out the Reports page
eatyourgreens Aug 24, 2016
67116c2
current annotation
eatyourgreens Aug 24, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a toggle for scanned image/OCR text
eatyourgreens committed Aug 12, 2016
commit 21b2468e5ca01c6b1b34beedca13b12482f2f229
2 changes: 1 addition & 1 deletion app/classify/subject-viewer.cjsx
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ module.exports = React.createClass

render: ->
classList=["readymade-marking-surface-container"]
classList.push 'image' if @props.task is 'filter'
classList.push @props.mode
classList.push 'active' if @props.active
image = @mediaSrcs['image/jpeg']
<div className={classList.join ' '}>
29 changes: 23 additions & 6 deletions app/classify/subject.cjsx
Original file line number Diff line number Diff line change
@@ -7,31 +7,48 @@ module.exports = React.createClass

getInitialState: ->
currentSubjects: []
mode: 'text'
viewAll: false

componentWillReceiveProps: (newProps) ->
{nextSubjectIds, prevSubjectIds} = newProps.subject.metadata
@props.api.type('subjects')
.get([nextSubjectIds[0], prevSubjectIds[0]])
.then (subjects) =>
@setState currentSubjects: [subjects[1], newProps.subject, subjects[0]]
@setState
currentSubjects: [subjects[1], newProps.subject, subjects[0]]
mode: 'text'

render: ->
console.log @props.task
console.log @props.task
mode = if @props.task == 'filter' then 'image' else @state.mode
<div className="readymade-subject-viewer-container">
{
if @state.currentSubjects.length
<div className="readymade-subject-viewer">
<SubjectTools project={@props.project} api={@props.api} talk={@props.talk} user={@props.user} subject={@props.subject} />
{if @props.task isnt 'filter'
<div style={position: 'relative'}>
<label className="readymade-clickable image-toggle">
<input type="checkbox" onChange={@toggle} />
<span className="fa fa-file-text#{if @state.mode is 'image' then '-o' else ' active'}"></span>
<span className="fa fa-file-image-o #{if @state.mode is 'image' then 'active' else ''}"></span>
</label>
</div>}
<div className="scroll-container" ref="scrollContainer">
{<SubjectViewer task={@props.task} subject={subject} key={subject.id} active={subject is @props.subject} ref="subject#{subject.id}" /> for subject in @state.currentSubjects}
{<SubjectViewer mode={mode} subject={subject} key={subject.id} active={subject is @props.subject || @state.viewAll} ref="subject#{subject.id}" /> for subject in @state.currentSubjects}
</div>
</div>
}
</div>

onChange: (annotation) ->
if annotation.issue
@refs["subject#{subject.id}"].getDOMNode().classList.add 'active' for subject in @state.currentSubjects
viewAll = true
else
@refs["subject#{subject.id}"].getDOMNode().classList.remove 'active' for subject in @state.currentSubjects
@refs["subject#{@props.subject.id}"].getDOMNode().classList.add 'active'
viewAll = false
@setState {viewAll}

toggle: (e)->
mode = if @state.mode is 'image' then 'text' else 'image'
@setState {mode}
24 changes: 24 additions & 0 deletions css/custom.styl
Original file line number Diff line number Diff line change
@@ -34,6 +34,30 @@
color: white
font-size: 1em
padding: .2em .4em

.image-toggle
background: #0b517c
border: 0
color: white
float: right
padding: 0
border: 0
border-radius: 1px
font-size: 1.2em

input[type=checkbox]
position: absolute
height: 0
width: 0
opacity: 0

span
background: rgba(0, 0, 0, 0.1)
padding: .2em .4em

&.active
background: rgba(0, 0, 0, 0.3)


.readymade-decision-tree-container
padding-left: 0