Skip to content

Commit

Permalink
Merge pull request #2252 from sparc-request/kg-funding_lock
Browse files Browse the repository at this point in the history
KG - Add Funding Lock
  • Loading branch information
Stuart-Johnson committed Mar 13, 2020
2 parents e79a424 + 8a04dbc commit 6434132
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions app/views/protocols/form/_financial_information.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@
.form-row
.form-group.col-3
= f.label :funding_status, class: 'required', title: t('protocols.tooltips.funding_status'), data: { toggle: 'tooltip', placement: 'right' }
= f.select :funding_status,options_for_select(PermissibleValue.get_inverted_hash('funding_status'), protocol.funding_status), { include_blank: true }, class: 'selectpicker'
.tooltip-wrapper{ title: protocol.locked? ? t('calendar_structure.funding_locked', protocol_type: protocol.model_name.human) : "", data: { toggle: 'tooltip' } }
= f.select :funding_status,options_for_select(PermissibleValue.get_inverted_hash('funding_status'), protocol.funding_status), { include_blank: true }, class: 'selectpicker', disabled: protocol.locked?
.form-group.col-3#fundingSourceContainer{ class: protocol.new_record? || protocol.funded? ? '' : 'd-none' }
= f.label :funding_source, class: 'required', title: t('protocols.tooltips.funding_source'), data: { toggle: 'tooltip', placement: 'right' }
= f.select :funding_source,options_for_select(PermissibleValue.get_inverted_hash('funding_source'), protocol.funding_source), { include_blank: true }, class: 'selectpicker', disabled: protocol.new_record?
.tooltip-wrapper{ title: protocol.locked? ? t('calendar_structure.funding_locked', protocol_type: protocol.model_name.human) : "", data: { toggle: 'tooltip' } }
= f.select :funding_source, options_for_select(PermissibleValue.get_inverted_hash('funding_source'), protocol.funding_source), { include_blank: true }, class: 'selectpicker', disabled: protocol.new_record? || protocol.locked?
.form-group.col-3#potentialFundingSourceContainer{ class: protocol.pending_funding? ? '' : 'd-none' }
= f.label :potential_funding_source, class: 'required', title: t('protocols.tooltips.potential_funding_source'), data: { toggle: 'tooltip', placement: 'right' }
= f.select :potential_funding_source, options_for_select(PermissibleValue.get_inverted_hash('potential_funding_source'), protocol.potential_funding_source), { include_blank: true }, class: 'selectpicker', disabled: protocol.new_record?
.tooltip-wrapper{ title: protocol.locked? ? t('calendar_structure.funding_locked', protocol_type: protocol.model_name.human) : "", data: { toggle: 'tooltip' } }
= f.select :potential_funding_source, options_for_select(PermissibleValue.get_inverted_hash('potential_funding_source'), protocol.potential_funding_source), { include_blank: true }, class: 'selectpicker', disabled: protocol.new_record? || protocol.locked?
.form-group.col-3#fundingSourceOtherContainer{ class: protocol.internally_funded? ? '' : 'd-none' }
= f.label :funding_source_other, t('constants.prompts.please_specify'), class: 'required'
= f.text_field :funding_source_other, class: 'form-control'
Expand Down
7 changes: 4 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,15 @@ en:

calendar_structure:
header: "Calendar Structure"
lock_calendar: "Lock Calendar"
unlock_calendar: "Unlock Calendar"
lock_calendar: "Lock Calendar & Funding"
unlock_calendar: "Unlock Calendar & Funding"
funding_locked: "Funding for this %{protocol_type} has been locked by an administrator. No funding changes may be made at this time."
table_fields:
arm_name: "Arm Name"
subject_count: "Subject Count"
visit_count: "Visit Count"
tooltips:
lock_calendar: 'Locking the calendar will prevent users from making changes to arm, subject, and visit information.'
lock_calendar: 'Prevent users from making changes to arm, subject, visit, and funding information.'
arm_info: 'The calendar has been locked by an administrator. No changes to the stucture may be made at this time.'

##############################
Expand Down

0 comments on commit 6434132

Please sign in to comment.