Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KG - Collapse Step 2 Protocol Info If Returning #1710

Merged
merged 1 commit into from Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/service_request.rb
Expand Up @@ -473,6 +473,10 @@ def ensure_ssr_ids
end
end

def previously_submitted?
self.submitted_at.present?
end

def should_push_to_epic?
return self.line_items.any? { |li| li.should_push_to_epic? }
end
Expand Down
53 changes: 27 additions & 26 deletions app/views/associated_users/_table.html.haml
Expand Up @@ -20,29 +20,30 @@
.panel.panel-primary#authorized-users-panel
.panel-heading
%h4.panel-title
= t(:authorized_users)[:header]
.panel-body
.bootstrap-table-dropdown-overflow
#associated-users-custom-toolbar
%button.btn.btn-success#new-associated-user-button{ data: { protocol_id: protocol.id } }
= t(:authorized_users)[:add_user]
%table#associated-users-table{ data: { toggle: 'table', search: 'true', 'show-columns' => 'true', 'show-refresh' => 'true', 'show-toggle' => 'true', url: associated_users_path(format: :json, protocol_id: protocol.id, service_request_id: service_request.id), striped: 'true', toolbar: '#associated-users-custom-toolbar' } }
%thead.primary-header
%tr
%th.col-sm-2{ data: { field: 'name', align: 'left', sortable: 'true' } }
= t(:authorized_users)[:table_fields][:name]
%th.col-sm-2{ data: { field: 'role', align: 'left', sortable: 'true' } }
= t(:authorized_users)[:table_fields][:role]
%th.col-sm-2.break-all{ data: { field: 'email', align: 'left', sortable: 'false' } }
= t(:authorized_users)[:table_fields][:email]
%th.col-sm-2.break-all{ data: { field: 'phone', align: 'left', sortable: 'false' } }
= t(:authorized_users)[:table_fields][:phone]
%th.col-sm-2{ data: { field: 'proxy_rights', align: 'left', sortable: 'true' } }
= t(:authorized_users)[:table_fields][:rights]
- if Setting.get_value('use_epic') && protocol.selected_for_epic?
%th{ data: { field: 'epic_emr_access', align: 'center', sortable: 'true' } }
= raw(t(:authorized_users)[:table_fields][:epic_emr_access])
%th.edit-delete-col{ data: { field: 'edit', align: 'center', sortable: 'false' } }
= t(:actions)[:edit]
%th.edit-delete-col{ data: { field: 'delete', align: 'center', sortable: 'false' } }
= t(:actions)[:delete]
= link_to t(:authorized_users)[:header], '#authorized-users', data: { toggle: 'collapse' }
.collapse#authorized-users{ class: service_request.previously_submitted? ? '' : 'in' }
.panel-body
.bootstrap-table-dropdown-overflow
#associated-users-custom-toolbar
%button.btn.btn-success#new-associated-user-button{ data: { protocol_id: protocol.id } }
= t(:authorized_users)[:add_user]
%table#associated-users-table{ data: { toggle: 'table', search: 'true', 'show-columns' => 'true', 'show-refresh' => 'true', 'show-toggle' => 'true', url: associated_users_path(format: :json, protocol_id: protocol.id, service_request_id: service_request.id), striped: 'true', toolbar: '#associated-users-custom-toolbar' } }
%thead.primary-header
%tr
%th.col-sm-2{ data: { field: 'name', align: 'left', sortable: 'true' } }
= t(:authorized_users)[:table_fields][:name]
%th.col-sm-2{ data: { field: 'role', align: 'left', sortable: 'true' } }
= t(:authorized_users)[:table_fields][:role]
%th.col-sm-2.break-all{ data: { field: 'email', align: 'left', sortable: 'false' } }
= t(:authorized_users)[:table_fields][:email]
%th.col-sm-2.break-all{ data: { field: 'phone', align: 'left', sortable: 'false' } }
= t(:authorized_users)[:table_fields][:phone]
%th.col-sm-2{ data: { field: 'proxy_rights', align: 'left', sortable: 'true' } }
= t(:authorized_users)[:table_fields][:rights]
- if Setting.get_value('use_epic') && protocol.selected_for_epic?
%th{ data: { field: 'epic_emr_access', align: 'center', sortable: 'true' } }
= raw(t(:authorized_users)[:table_fields][:epic_emr_access])
%th.edit-delete-col{ data: { field: 'edit', align: 'center', sortable: 'false' } }
= t(:actions)[:edit]
%th.edit-delete-col{ data: { field: 'delete', align: 'center', sortable: 'false' } }
= t(:actions)[:delete]
69 changes: 35 additions & 34 deletions app/views/protocols/_summary.html.haml
Expand Up @@ -20,48 +20,49 @@
.panel.panel-primary#summary-panel
.panel-heading
%h1.panel-title.pull-left
= I18n.t('protocols.summary.header', protocol_type: protocol_type)
= link_to I18n.t('protocols.summary.header', protocol_type: protocol_type), '#protocol-summary', data: { toggle: 'collapse' }
.pull-right
%button.btn.btn-info.view-protocol-details-button{ data: { protocol_id: protocol.id } }
= I18n.t('protocols.view_details.button', protocol_type: protocol_type)
- if action_name == 'protocol'
= link_to I18n.t('protocols.edit', protocol_type: protocol_type), edit_protocol_path(protocol, srid: service_request.id, sub_service_request_id: sub_service_request_id), class: 'btn btn-warning edit-protocol-information-button'
.clearfix
.panel-body#protocol-summary.text-left
- if Setting.get_value("research_master_enabled") && protocol.is_study?
.collapse#protocol-summary{ class: service_request.previously_submitted? ? '' : 'in' }
.panel-body
- if Setting.get_value("research_master_enabled") && protocol.is_study?
.row
%label.col-sm-3
= I18n.t('protocols.summary.research_master_id')
.col-sm-9
- if protocol.research_master_id.nil?
= I18n.t('protocols.summary.na_research_master_id')
- else
= protocol.research_master_id
.row
%label.col-sm-3
= I18n.t('protocols.summary.research_master_id')
= I18n.t('protocols.summary.id', protocol_type: protocol_type)
.col-sm-9
- if protocol.research_master_id.nil?
= I18n.t('protocols.summary.na_research_master_id')
- else
= protocol.research_master_id
.row
%label.col-sm-3
= I18n.t('protocols.summary.id', protocol_type: protocol_type)
.col-sm-9
= protocol.try(:id)
.row
%label.col-sm-3{ title: t(:protocols)[:tooltips][:title], data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' } }
= t(:protocols)[:summary][:title]
.col-sm-9
= protocol.try(:title)
= display_rmid_validated_protocol(protocol, t('protocols.summary.rmid_title'))
.row
%label.col-sm-3{ title: t(:protocols)[:tooltips][:short_title], data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' } }
= t(:protocols)[:summary][:short_title]
.col-sm-9
= protocol.try(:short_title)
= display_rmid_validated_protocol(protocol, t('protocols.summary.rmid_short_title'))
- if protocol_type == 'Study'
= protocol.try(:id)
.row
%label.col-sm-3{ title: t(:protocols)[:tooltips][:sponsor_name], data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' } }
= t(:protocols)[:summary][:sponsor]
%label.col-sm-3{ title: t(:protocols)[:tooltips][:title], data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' } }
= t(:protocols)[:summary][:title]
.col-sm-9
= protocol.try(:sponsor_name)
.row
%label.col-sm-3{ title: protocol.funding_status == "funded" ? t(:protocols)[:tooltips][:funding_source] : t(:protocols)[:tooltips][:potential_funding_source], data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' } }
= display_funding_source_title(protocol)
.col-sm-9
= display_funding_source(protocol)
= protocol.try(:title)
= display_rmid_validated_protocol(protocol, t('protocols.summary.rmid_title'))
.row
%label.col-sm-3{ title: t(:protocols)[:tooltips][:short_title], data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' } }
= t(:protocols)[:summary][:short_title]
.col-sm-9
= protocol.try(:short_title)
= display_rmid_validated_protocol(protocol, t('protocols.summary.rmid_short_title'))
- if protocol_type == 'Study'
.row
%label.col-sm-3{ title: t(:protocols)[:tooltips][:sponsor_name], data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' } }
= t(:protocols)[:summary][:sponsor]
.col-sm-9
= protocol.try(:sponsor_name)
.row
%label.col-sm-3{ title: protocol.funding_status == "funded" ? t(:protocols)[:tooltips][:funding_source] : t(:protocols)[:tooltips][:potential_funding_source], data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' } }
= display_funding_source_title(protocol)
.col-sm-9
= display_funding_source(protocol)