From 9023526c053529ea9e5c4898cdc577fe0e547dac Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 24 Mar 2017 12:13:29 -0500 Subject: [PATCH] move milestone due date info to sidebar --- app/assets/stylesheets/pages/milestone.scss | 4 ---- app/views/projects/milestones/show.html.haml | 2 +- .../shared/milestones/_sidebar.html.haml | 22 +++++++++++++++++++ .../shared/milestones/_summary.html.haml | 4 ---- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/pages/milestone.scss b/app/assets/stylesheets/pages/milestone.scss index efbd9365fd9..68a865200a6 100644 --- a/app/assets/stylesheets/pages/milestone.scss +++ b/app/assets/stylesheets/pages/milestone.scss @@ -62,10 +62,6 @@ } } - .remaining-days { - color: $orange-600; - } - .milestone-stats-and-buttons { display: flex; justify-content: flex-start; diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 2ebd927042e..7299f6046f4 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -58,4 +58,4 @@ = render 'shared/milestones/summary', milestone: @milestone, project: @project = render 'shared/milestones/tabs', milestone: @milestone - = render 'shared/milestones/sidebar', milestone: @milestone, affix_offset: 153 + = render 'shared/milestones/sidebar', milestone: @milestone, project: @project, affix_offset: 153 diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index d955ef52676..4f95d789942 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -1,4 +1,5 @@ - affix_offset = local_assigns.fetch(:affix_offset, "102") +- project = local_assigns[:project] %aside.right-sidebar.js-right-sidebar{ data: { "offset-top" => affix_offset, "spy" => "affix" }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' } .issuable-sidebar @@ -9,6 +10,27 @@ %span.issuable-header-text.hide-collapsed Milestone #{milestone.try(:to_reference) || milestone.title} + - if project + .block.due_date + .sidebar-collapsed-icon + = icon('calendar', 'aria-hidden': 'true') + %span.js-due-date-sidebar-value + = milestone.due_date.try(:to_s, :medium) || 'None' + .title.hide-collapsed + Due date + - if can?(current_user, :admin_milestone, @project) + = link_to 'Edit', edit_namespace_project_milestone_path(@project.namespace, @project, @milestone), class: 'edit-link pull-right' + .value.hide-collapsed + %span.value-content + - if milestone.due_date + %span.bold= milestone.due_date.to_s(:medium) + - else + %span.no-value No due date + - remaining_days = milestone_remaining_days(milestone) + - if remaining_days.present? + = surround '(', ')' do + %span.remaining-days= remaining_days + - milestone_ref = milestone.try(:to_reference, full: true) - if milestone_ref.present? .block diff --git a/app/views/shared/milestones/_summary.html.haml b/app/views/shared/milestones/_summary.html.haml index 78079f633d5..7ee7ce047b9 100644 --- a/app/views/shared/milestones/_summary.html.haml +++ b/app/views/shared/milestones/_summary.html.haml @@ -26,10 +26,6 @@ %span.milestone-stat %strong== #{milestone.percent_complete(current_user)}% complete - - remaining_days = milestone_remaining_days(milestone) - - if remaining_days.present? - %span.milestone-stat - %span.remaining-days= remaining_days .milestone-progress-buttons %span.tab-issues-buttons