diff --git a/app/client/stylesheets/style.less b/app/client/stylesheets/style.less index 30b99db..c838680 100644 --- a/app/client/stylesheets/style.less +++ b/app/client/stylesheets/style.less @@ -1,354 +1,363 @@ @import "bootstrap/custom.bootstrap.output.import.less"; @import "paper.import.less"; @import "bs_sidedanv.import.less"; @import "x_editable.import.less"; @grid-float-breakpoint: 830px; body { padding-top: 70px; } @media print { body { padding-top: 0px; } } td, th { line-height: 1.2; padding-bottom: 0.6em; } table.tight { td, th { padding-bottom: 0; } } table.collapsed { width: inherit; } .reactive-table { th { color: @text-color !important; } td.buttons { text-align: right; } .btn { width: 61px; } .btn-stack { padding: 4.5px 10px; } } .daterangepicker { color: black; } .page-header, .page-header-small { border-bottom: none; } .nav-tabs { li > form { padding-top: 6px; input:first-child { padding-bottom: 6px; } } } //////////////////////////////// // generic .valid { color: @brand-success; } .invalid { color: @brand-warning; alpha: 0.5; } //////////////////////////////// // patient .patient { .profile { .table { width: initial; //tr:first-child { // font-weight: bold; //} th { font-weight: lighter; } td { padding-left: 15px; vertical-align: top; } img { vertical-align: top; margin-bottom: 15px; } } } #visits { table .answerQuestionnaire { display: inline-block; padding: 0px 15px; line-height: 1.5em; } } #visit { .header { height: 83px; .headerRight { margin-top: 25px; table { display: inline-block; } button { margin-left: 1em; } } } .questionnaires { table { width: initial; font-size: 20px; td:not(:first-child) { padding-left: 15px; } } } .physiologicalData { .panel-heading .accordion-toggle:after { font-family: 'FontAwesome'; content: "\f078"; float: right; color: grey; } .panel-heading.collapsed .accordion-toggle:after { content: "\f054"; } } } } //////////////////////////////// // editQuestionnaire .editQuestionnaire { .markdownControls { display: none; } .question { cursor: pointer; padding: 10px 10px; &:nth-child(even) { background-color: #f5f5f5; } .af-radio-group { margin-left: 7px; .radio-inline, .fix-indent { margin-right: 40px; } } &.selectedQuestion { border: 1px solid @brand-info; border-radius: 2px; //padding: 10px 5px; } } #questionEditor { margin-bottom: 20px; } } //////////////////////////////// // questions .question { .control-label { font-weight: bold; } .question-table-polar { td:not(:first-child):not(:last-child) { text-align: center; } td:last-child { text-align: right; } } } //////////////////////////////// // editStudy .editStudyDesigns { + .panel-group { + margin-top: 1em; + .panel-heading { + cursor: pointer; + .panel-title { + font-size: 28px; + } + } + } .studyDesignTable { .visitTd { border-bottom: 1px solid #dddddd; } } .bootstrap-tagsinput { width: 400px; input { box-shadow: none; } } // th { // white-space: nowrap; // &:first-child { // width: 250px; // } // &:not(:first-child) { // text-align: center; // } // &:nth-of-type(even):not(:first-child):not(:last-child) { // border-bottom: 2px solid @brand-primary; // } // &:nth-of-type(odd):not(:first-child):not(:last-child) { // border-bottom: 2px dashed @brand-primary; // } // .text-muted { // font-weight: normal; // } // } // td { // &:not(:first-child) { // text-align: center; // } // &:last-child { // width: 200px; // } // } // } } //////////////////////////////// // questionnaireWizzard .questionnaireWizzard { .modal-dialog, .modal-content { margin: 0px; width: 100%; height: 100%; overflow-y: auto; } .questionOverview { color: white; i { color: grey; } .active { .activeCircle { color: @brand-info; font-size: 2.5em; top: -4px; left: -1.5px; } } .answered { i { color: @brand-success; } } } } //////////////////////////////// // segmentation .row-fill { overflow-y: scroll; -webkit-overflow-scrolling: touch; } .row-max-half { overflow-y: scroll; -webkit-overflow-scrolling: touch; } //////////////////////////////// // misc #spinner { height: 300px; } .label { font-size: 85%; display: inline-block; } .label-warning { background-color: rgba(243, 156, 18, 0.3); } .smallSelect { width: auto; height: auto; padding: 2px 5px; display: inline-block; border: none; margin: 3px 0px; } .smallInput { //height: auto; padding: 2px 5px; display: inline-block; border: none; margin: 3px 0px; } .btn-img { padding: 0; border: none; background: none; &:hover, &:focus, &:active { color: inherit !important; box-shadow: none; } -webkit-box-shadow: none; box-shadow: none; } .cursorPointer { cursor: pointer; } .page-header-small { &:extend(.page-header); margin: 0px; } .btn-hdr { margin-left: 15px; //vertical-align: bottom; } .btn-stack { padding: 5.5px 7px; } .hoverOpaque { opacity: 0.6; &:hover { opacity: 1.0; } } .hoverOpaqueExtreme { opacity: 0.4; &:hover { opacity: 1.0; } } .hoverOpaqueInvisible { opacity: 0.1; &:hover { opacity: 1.0; } } .brand-primary { color: @brand-primary; } .modal-content { background-color: white; } diff --git a/app/client/views/studies/edit_study_designs.coffee b/app/client/views/studies/edit_study_designs.coffee index bb91c5a..4d7b18c 100644 --- a/app/client/views/studies/edit_study_designs.coffee +++ b/app/client/views/studies/edit_study_designs.coffee @@ -1,209 +1,216 @@ listQuestionnaireIds = new ReactiveVar([]) listRecordPhysicalData = new ReactiveVar(false) remainingQuestionnaires = (design) -> qIds = design.questionnaireIds or [] qIds = _.union(qIds, (listQuestionnaireIds.get() or []) ) Questionnaires.find _id: {$nin: qIds} _bloodhound = null Template.editStudyDesignsTags.created = -> questionnaires = Questionnaires.find().fetch() questionnaires.push _id: "recordPhysicalData" title: "record physical data" _bloodhound = new Bloodhound( datumTokenizer: Bloodhound.tokenizers.obj.whitespace('title') queryTokenizer: Bloodhound.tokenizers.whitespace local: questionnaires ) _bloodhound.initialize() Template.editStudyDesignsTags.rendered = -> elt = @$('.tags') elt.tagsinput itemValue: '_id' itemText: 'title' typeaheadjs: - name: 'cities' + name: 'tags' displayKey: 'title' source: _bloodhound.ttAdapter() allowDuplicates: true visit = @data.visit elt.tagsinput('removeAll') if visit.questionnaireIds? and visit.questionnaireIds.length > 0 Questionnaires.find _id: {$in: visit.questionnaireIds} .forEach (q) -> elt.tagsinput('add', q) Template.editStudyDesignsTags.events = "itemAdded input, itemRemoved input": (evt) -> questionnaireIds = _.pluck $(evt.target).tagsinput('items'), '_id' recordPhysicalData = false questionnaireIds = _.filter questionnaireIds, (id) -> recordPhysicalData = true if id.valueOf() is "recordPhysicalData" id.valueOf() isnt "recordPhysicalData" Meteor.call "scheduleQuestionnairesAtVisit", @design._id, @visit._id, questionnaireIds, (error) -> throwError error if error? if @visit.recordPhysicalData isnt recordPhysicalData Meteor.call "scheduleRecordPhysicalDataAtVisit", @design._id, @visit._id, recordPhysicalData, (error) -> throwError error if error? return +Template.editStudyDesigns.rendered = -> + $(".panel-heading:first-child").click() + Template.editStudyDesigns.helpers designs: -> StudyDesigns.find studyId: @_id, sort: {createdAt: 1} #this design=design titleEO: -> design = @design value: design.title emptytext: "no title" success: (response, newVal) -> StudyDesigns.update design._id, $set: {title: newVal} return #this design=design hasRemainingQuestionnaires: -> remainingQuestionnaires(@design).count() #this design=design remainingQuestionnaires: -> remainingQuestionnaires(@design) #this design=design questionnaires: -> qIds = @design.questionnaireIds or [] qIds = _.union(qIds, (listQuestionnaireIds.get() or []) ) Questionnaires.find _id: {$in: qIds} listRecordPhysicalData: -> @design.recordPhysicalData || listRecordPhysicalData.get() #this design=design visits: -> @design.visits.sort (a, b)-> a.index - b.index prevDay = 0 #augment visits #http://stackoverflow.com/questions/13789622/accessing-parent-context-in-meteor-templates-and-template-helpers @design.visits.map (v)-> if v.day? daysBetween = v.day-prevDay _.extend v, daysBetween: daysBetween prevDay = v.day if daysBetween is 0 delete v.daysBetween v #this visit design visitQuestionnaires: -> #Questionnaires.find # _id: {$in: @visit.questionnaireIds} @visit.questionnaireIds #this visit design visitTitleEO: -> visit = @visit design = @design value: visit.title emptytext: "no title" success: (response, newVal) -> Meteor.call "changeStudyDesignVisitTitle", design._id, visit._id, newVal, (error) -> throwError error if error? return #this visit design visitDayEO: -> visit = @visit design = @design value: visit.day emptytext: "no day set" success: (response, newVal) -> Meteor.call "changeStudyDesignVisitDay", design._id, visit._id, newVal, (error) -> throwError error if error? return #this design:StudyDesign visit:StudyDesign.visit questionnaire:Questionnaire questionnaireIconClass: -> questionnaire = @questionnaire found = false if @visit.questionnaireIds _.some @visit.questionnaireIds, (qId)-> found = qId is questionnaire._id found if found return "fa-check-square-o brand-primary" else return "fa-square-o hoverOpaqueExtreme" #this design:StudyDesign visit:StudyDesign.visit physicalIconClass: -> if @visit.recordPhysicalData? and @visit.recordPhysicalData return "fa-check-square-o brand-primary" else return "fa-square-o hoverOpaqueExtreme" Template.editStudyDesigns.events + "click .editable-click": (evt) -> + evt.preventDefault() + evt.stopPropagation() + "click #createStudyDesign": (evt) -> Meteor.call "createStudyDesign", @_id, (error, studyDesignId) -> throwError error if error? "click #addVisit": (evt) -> evt.preventDefault() Meteor.call "addStudyDesignVisit", @design._id, (error) -> throwError error if error? "click .listQuestionnaire": (evt) -> evt.preventDefault() questionnaireId = $(evt.target).data("id") qIds = listQuestionnaireIds.get() or [] qIds.push questionnaireId listQuestionnaireIds.set qIds "click .listRecordPhysicalData": (evt) -> evt.preventDefault() listRecordPhysicalData.set !listRecordPhysicalData.get() "click .toggleQuestionnaireAtVisit": (evt) -> evt.preventDefault() doSchedule = not $(evt.target).hasClass('fa-check-square-o') #isChecked questionnaireIds = @visit.questionnaireIds || [] questionnaire = @questionnaire if doSchedule questionnaireIds.push questionnaire._id $("input.tags[data-visit-id=#{@visit._id}]").tagsinput('add', questionnaire) else questionnaireIds = _.filter questionnaireIds, (qId)-> qId isnt questionnaire._id $("input.tags[data-visit-id=#{@visit._id}]").tagsinput('remove', questionnaire) Meteor.call "scheduleQuestionnairesAtVisit", @design._id, @visit._id, questionnaireIds, (error) -> throwError error if error? "click .toggleRecordPhysicalDataAtVisit": (evt) -> evt.preventDefault() Meteor.call "scheduleRecordPhysicalDataAtVisit", @design._id, @visit._id, !@visit.recordPhysicalData, (error) -> throwError error if error? "click .moveUp": (evt) -> Meteor.call "moveStudyDesignVisit", @design._id, @visit._id, true, (error) -> throwError error if error? "click .moveDown": (evt) -> Meteor.call "moveStudyDesignVisit", @design._id, @visit._id, false, (error) -> throwError error if error? "click .remove": (evt) -> evt.preventDefault() if confirm "Are you sure?" Meteor.call "removeStudyDesignVisit", @design._id, @visit._id, (error) -> throwError error if error? diff --git a/app/client/views/studies/edit_study_designs.html b/app/client/views/studies/edit_study_designs.html index fdfb9a8..34aee1c 100644 --- a/app/client/views/studies/edit_study_designs.html +++ b/app/client/views/studies/edit_study_designs.html @@ -1,115 +1,120 @@