Skip to content

Commit

Permalink
Merge pull request #1061 from sparc-request/wth-milestone-touchups
Browse files Browse the repository at this point in the history
wth - Milestones touchups
  • Loading branch information
Stuart-Johnson committed Aug 16, 2017
2 parents 76eb403 + dc7f8ac commit 7cd6fa6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/dashboard/milestone.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ $ ->

$(document).on 'dp.change', '.recruitment-end-date-picker', (e) ->
$('.recruitment-end-date-setter').val(e.date)

$(document).on 'dp.hide', '.start-date-picker, .end-date-picker, .recruitment-start-date-picker, .recruitment-end-date-picker', ->
$('.milestone-form').submit()

4 changes: 4 additions & 0 deletions app/assets/stylesheets/dashboard/protocol.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,7 @@ textarea {
.filter-identifier {
margin-left: 10px;
}

.spacing-above {
margin-top: 5px;
}
13 changes: 5 additions & 8 deletions app/views/dashboard/protocols/_milestone.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
= t(:dashboard)[:protocols][:milestones][:title]
.panel-body
.date-details
= form_for(protocol, url: dashboard_protocol_milestones_path(protocol), method: :patch, remote: true) do |f|
= form_for(protocol, url: dashboard_protocol_milestones_path(protocol), method: :patch, remote: true, html: { class: 'milestone-form' }) do |f|
.form-group.col-lg-12
= f.label :start_date,
t('dashboard.protocols.milestones.start_date', type: protocol.type),
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' },
title: t('dashboard.protocols.milestones.tooltips.start_date', type: protocol.type)
title: t('dashboard.protocols.milestones.tooltips.start_date')
.col-lg-10
= text_field_tag 'start_date', nil,
class: 'datetimepicker form-control start-date-picker',
Expand All @@ -21,7 +21,7 @@
t('dashboard.protocols.milestones.end_date', type: protocol.type),
class: 'col-lg-2 control-label required',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' },
title: t('dashboard.protocols.milestones.tooltips.end_date', type: protocol.type)
title: t('dashboard.protocols.milestones.tooltips.end_date')
.col-lg-10
= text_field_tag 'end_date', nil,
class: 'datetimepicker form-control end-date-picker',
Expand All @@ -34,7 +34,7 @@
t('dashboard.protocols.milestones.recruitment_start', type: protocol.type),
class: 'col-lg-2 control-label',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' },
title: t('dashboard.protocols.milestones.tooltips.recruitment_start_date', type: protocol.type)
title: t('dashboard.protocols.milestones.tooltips.recruitment_start_date')
.col-lg-10
= text_field_tag 'recruitment_start_date', nil,
class: 'datetimepicker form-control recruitment-start-date-picker',
Expand All @@ -45,13 +45,10 @@
t('dashboard.protocols.milestones.recruitment_end', type: protocol.type),
class: 'col-lg-2 control-label',
data: { toggle: 'tooltip', placement: 'right', delay: '{"show":"500"}' },
title: t('dashboard.protocols.milestones.tooltips.recruitment_end_date', type: protocol.type)
title: t('dashboard.protocols.milestones.tooltips.recruitment_end_date')
.col-lg-10
= text_field_tag 'recruitment_end_date', nil,
class: 'datetimepicker form-control recruitment-end-date-picker',
value: (protocol.recruitment_end_date.strftime('%_m/%d/%Y') rescue nil)
= f.hidden_field :recruitment_end_date, value: nil,
class: 'recruitment-end-date-setter'
.form-group
.col-sm-offset-3.col-sm-6
= f.submit t('dashboard.protocols.milestones.update_button'), class: 'btn btn-primary btn-block'
2 changes: 1 addition & 1 deletion app/views/dashboard/protocols/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
= render 'dashboard/service_requests/service_requests', protocol: @protocol, super_user_orgs: @super_user_orgs, permission_to_edit: @permission_to_edit, user: @user, view_only: false, show_view_ssr_back: @show_view_ssr_back, statuses_hidden: %(first_draft)
.additional-details-submissions-panel
= render "additional_details/submissions/submissions_panel", protocol: @protocol, submissions: @submissions
.milestones-panel
.milestones-panel.spacing-above
= render "dashboard/protocols/milestone", protocol: @protocol

= render 'additional_details/submissions/submission_modal'
Expand Down
16 changes: 8 additions & 8 deletions config/locales/dashboard.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,16 @@ en:
consolidated_exclude_drafts: "Exclude Drafts"
milestones:
title: 'Milestones (Timeline)'
start_date: "%{type} Start Date"
end_date: "%{type} End Date"
recruitment_start: "%{type} Estimated Recruitment Start Date"
recruitment_end: "%{type} Estimated Recruitment End Date"
start_date: "Start Date"
end_date: "End Date"
recruitment_start: "Estimated Recruitment Start Date"
recruitment_end: "Estimated Recruitment End Date"
update_button: 'Update Milestones'
tooltips:
start_date: "%{type} estimated start date (used by service providers to prioritize)"
end_date: "%{type} estimated end date (used by service providers to prioritize)"
recruitment_start_date: "When your %{type} is estimated to start recruiting participants"
recruitment_end_date: "When your %{type} is estimated to stop recruiting participants"
start_date: "Project/Study estimated start date (used by service providers to prioritize)"
end_date: "Project/Study estimated end date (used by service providers to prioritize)"
recruitment_start_date: "When your Project/Study is estimated to start recruiting participants"
recruitment_end_date: "When your Project/Study is estimated to stop recruiting participants"
#####################
# SERVICE CALENDARS #
#####################
Expand Down

0 comments on commit 7cd6fa6

Please sign in to comment.