Skip to content

Commit

Permalink
wth - (SPARCRequest & SPARCDashboard) Tooltips: Step 1 Study Information
Browse files Browse the repository at this point in the history
Put the tooltips on the labels instead, and set a delay
timer on the tooltip hover-over. [#140086745]
  • Loading branch information
William Holt committed Feb 27, 2017
1 parent f18b767 commit aa58044
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@
.form-group.row
= form.label :selected_for_epic, t(:protocols)[:studies][:information][:push_to_epic], class: 'col-lg-2 control-label required'
= form.label :selected_for_epic,
t(:protocols)[:studies][:information][:push_to_epic],
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"1500"}' },
title: t(:protocols)[:tooltips][:epic]
.col-lg-10
= link_to 'javascript:void(0)',
data: { toggle: 'tooltip', placement: 'right' },
title: t(:protocols)[:tooltips][:epic] do
.btn-group#selected_for_epic_button{data: { toggle: "labels" } }
%label.radio-inline.btn.btn-default#study_selected_for_epic_true_button{ class: protocol.selected_for_epic? ? 'active' : ''}
= form.radio_button :selected_for_epic, 'true', id: "study_selected_for_epic_true", class: 'hidden'
= t(:constants)[:yes_select]
%label.radio-inline.btn.btn-default#study_selected_for_epic_false_button{ class: protocol.selected_for_epic == false ? 'active' : ''}
= form.radio_button :selected_for_epic, 'false', id: "study_selected_for_epic_false", class: 'hidden'
= t(:constants)[:no_select]
.btn-group#selected_for_epic_button{data: { toggle: "labels" } }
%label.radio-inline.btn.btn-default#study_selected_for_epic_true_button{ class: protocol.selected_for_epic? ? 'active' : ''}
= form.radio_button :selected_for_epic, 'true', id: "study_selected_for_epic_true", class: 'hidden'
= t(:constants)[:yes_select]
%label.radio-inline.btn.btn-default#study_selected_for_epic_false_button{ class: protocol.selected_for_epic == false ? 'active' : ''}
= form.radio_button :selected_for_epic, 'false', id: "study_selected_for_epic_false", class: 'hidden'
= t(:constants)[:no_select]
.form-group.row.selected_for_epic_dependent{ display_if(protocol.selected_for_epic) }
= form.label :study_type_questions,
t(:protocols)[:studies][:information][:study_type_questions],
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right' },
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"1500"}' },
title: t(:protocols)[:tooltips][:study_type_questions]
.col-lg-10
- action_name == 'update_protocol_type' ? protocol.setup_study_type_answers : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,61 @@
= form.hidden_field :has_human_subject_info, value: false, class: 'has-human-subject-info'

.form-group.row
= form.label :short_title, t(:protocols)[:studies][:information][:short_title], class: 'col-lg-2 control-label required'
= form.label :short_title, t(:protocols)[:studies][:information][:short_title],
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"1500"}' },
title: t(:protocols)[:tooltips][:short_title]
.col-lg-10
= form.text_field :short_title,
class: [('form-control'), (RESEARCH_MASTER_ENABLED ? 'rm-id-dependent rm-locked-fields' : '')],
disabled: @protocol.research_master_id,
data: { toggle: 'tooltip', placement: 'bottom' },
title: t(:protocols)[:tooltips][:short_title]
disabled: @protocol.research_master_id

.form-group.row
= form.label :title, t(:protocols)[:studies][:information][:title], class: 'col-lg-2 control-label required'
= form.label :title,
t(:protocols)[:studies][:information][:title],
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"1500"}' },
title: t(:protocols)[:tooltips][:title]
.col-lg-10
= form.text_field :title,
class: [('form-control'), (RESEARCH_MASTER_ENABLED ? 'rm-id-dependent rm-locked-fields' : '')],
disabled: @protocol.research_master_id,
data: { toggle: 'tooltip', placement: 'bottom' },
title: t(:protocols)[:tooltips][:title]
disabled: @protocol.research_master_id

.form-group.row#funding-status
= form.label :funding_status, t(:protocols)[:studies][:information][:funding_status], class: 'col-lg-2 control-label required'
= form.label :funding_status,
t(:protocols)[:studies][:information][:funding_status],
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"1500"}' },
title: t(:protocols)[:tooltips][:funding_status]
.col-lg-10
= link_to 'javascript:void(0)', data: { toggle: 'tooltip', placement: 'right' }, title: t(:protocols)[:tooltips][:funding_status] do
= form.select :funding_status, options_for_select(FUNDING_STATUSES, protocol.funding_status), { include_blank: t(:protocols)[:prompts][:status] }, class: 'selectpicker study'
= form.select :funding_status,
options_for_select(FUNDING_STATUSES, protocol.funding_status),
{ include_blank: t(:protocols)[:prompts][:status] },
class: 'selectpicker study'

.form-group.row.funding_status_dependent.funded{ display_if(protocol.funding_status, "funded") }
= form.label :funding_source, t(:protocols)[:studies][:information][:funding_source], class: 'col-lg-2 control-label required'
= form.label :funding_source,
t(:protocols)[:studies][:information][:funding_source],
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"1500"}' },
title: t(:protocols)[:tooltips][:funding_source]
.col-lg-10
= link_to 'javascript:void(0)', class: 'funding-source-tooltip', data: { toggle: 'tooltip', placement: 'right' }, title: t(:protocols)[:tooltips][:funding_source] do
= form.select :funding_source, options_for_select(FUNDING_SOURCES, protocol.funding_source), { include_blank: t(:protocols)[:prompts][:source] }, class: 'selectpicker'
= form.select :funding_source,
options_for_select(FUNDING_SOURCES, protocol.funding_source),
{ include_blank: t(:protocols)[:prompts][:source] },
class: 'selectpicker'

.form-group.row.funding_status_dependent.pending_funding{ display_if(protocol.funding_status, "pending_funding") }
= form.label :potential_funding_source, t(:protocols)[:studies][:information][:potential_funding_source], class: 'col-lg-2 control-label required'
= form.label :potential_funding_source,
t(:protocols)[:studies][:information][:potential_funding_source],
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"1500"}' },
title: t(:protocols)[:tooltips][:potential_funding_source]
.col-lg-10
= link_to 'javascript:void(0)', class: 'funding-source-tooltip', data: { toggle: 'tooltip', placement: 'right' }, title: t(:protocols)[:tooltips][:potential_funding_source] do
= form.select :potential_funding_source, options_for_select(POTENTIAL_FUNDING_SOURCES, protocol.potential_funding_source), { include_blank: t(:protocols)[:prompts][:potential_source] }, class: 'selectpicker'
= form.select :potential_funding_source,
options_for_select(POTENTIAL_FUNDING_SOURCES, protocol.potential_funding_source),
{ include_blank: t(:protocols)[:prompts][:potential_source] },
class: 'selectpicker'

/ Internal Funded Pilot Project selected
.form-group.row.funding_status_dependent.funding_source_dependent.internal{ display_if(protocol.funding_source, "internal") }
Expand Down Expand Up @@ -109,11 +130,13 @@
/ Federal selected end
.form-group.row
= form.label :sponsor_name, t(:protocols)[:studies][:information][:sponsor], class: 'col-lg-2 control-label required'
= form.label :sponsor_name,
t(:protocols)[:studies][:information][:sponsor],
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"1500"}' },
title: t(:protocols)[:tooltips][:sponsor_name]
.col-lg-10
= form.text_field :sponsor_name, class: 'form-control',
data: { toggle: 'tooltip', placement: 'bottom' },
title: t(:protocols)[:tooltips][:sponsor_name]
= form.text_field :sponsor_name, class: 'form-control'
- if USE_EPIC
= render partial: 'protocols/form/study_form_sections/interactive_form', locals: { protocol: protocol, form: form }
= render partial: 'protocols/form/study_form_sections/study_type_note', locals: { protocol: protocol, form: form }

0 comments on commit aa58044

Please sign in to comment.