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

wth - Milestones touchups #1061

Merged
merged 1 commit into from
Aug 16, 2017
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/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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding a class to do this, moving the panel and panel-default div to this would do the same thing, using the built-in bootstrap panel-group styling.

.milestones-panel.panel.panel-default
____= render "dashboard/protocols/milestone", protocol: @protocol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kyle-glick I tried that, but it didn't add the spacing.

= 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