diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-03-27 13:14:27 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-03-27 13:14:27 -0500 |
commit | 3671437769e41b2f1a6260c66a6cbcea990598c2 (patch) | |
tree | 83251281f93eac7104675b0051be597a63714009 | |
parent | 3b513675d0bfdf10725d5eed421d39ca66aebad5 (diff) | |
download | gitlab-ce-3671437769e41b2f1a6260c66a6cbcea990598c2.tar.gz |
combine milestone start and end dates in collapsed sidebar
-rw-r--r-- | app/assets/stylesheets/pages/milestone.scss | 12 | ||||
-rw-r--r-- | app/views/shared/milestones/_sidebar.html.haml | 28 |
2 files changed, 31 insertions, 9 deletions
diff --git a/app/assets/stylesheets/pages/milestone.scss b/app/assets/stylesheets/pages/milestone.scss index a1c6179840a..335e587b8f4 100644 --- a/app/assets/stylesheets/pages/milestone.scss +++ b/app/assets/stylesheets/pages/milestone.scss @@ -68,6 +68,18 @@ } } + .collapsed-milestone-date { + font-size: 12px; + } + + .milestone-date { + display: block; + } + + .date-separator { + line-height: 5px; + } + .remaining-days strong { font-weight: normal; } diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index 2de7308ebc2..6430c5f6352 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -17,16 +17,12 @@ .value.hide-collapsed = milestone_progress_bar(milestone) - .block.start_date - .sidebar-collapsed-icon - = icon('calendar', 'aria-hidden': 'true') - %span.js-due-date-sidebar-value - = milestone.start_date.try(:to_s, :medium) || 'None' - .title.hide-collapsed + .block.start_date.hide-collapsed + .title Start date - if @project && 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 + .value %span.value-content - if milestone.start_date %span.bold= milestone.start_date.to_s(:medium) @@ -36,8 +32,22 @@ .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' + %span.collapsed-milestone-date + - if milestone.start_date && milestone.due_date + - if milestone.start_date.year == milestone.due_date.year + .milestone-date= milestone.start_date.strftime('%b %-d') + - else + .milestone-date= milestone.start_date.strftime('%b %-d %Y') + .date-separator - + .due_date= milestone.due_date.strftime('%b %-d %Y') + - elsif milestone.start_date + From + .milestone-date= milestone.start_date.strftime('%b %-d %Y') + - elsif milestone.due_date + Until + .milestone-date= milestone.due_date.strftime('%b %-d %Y') + - else + None .title.hide-collapsed Due date - if @project && can?(current_user, :admin_milestone, @project) |