summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-02-03 10:27:46 -0500
committerRubén Dávila <rdavila84@gmail.com>2016-02-03 10:27:46 -0500
commit31e1a38b63e7ecd555d09c5a5e34107d50a6a73c (patch)
treea2bee8ad17d6678621f9e5031d7a4d98b3d80dac /app
parent5bad3516d4bfac6d3445c06f5dc105ebe36c5c11 (diff)
downloadgitlab-ce-31e1a38b63e7ecd555d09c5a5e34107d50a6a73c.tar.gz
Some refactor for CSS after code review.
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/pages/milestone.scss43
-rw-r--r--app/models/milestone.rb3
-rw-r--r--app/views/projects/milestones/_issues.html.haml4
-rw-r--r--app/views/projects/milestones/show.html.haml2
4 files changed, 30 insertions, 22 deletions
diff --git a/app/assets/stylesheets/pages/milestone.scss b/app/assets/stylesheets/pages/milestone.scss
index f9a1470a7cf..79fda5ee63a 100644
--- a/app/assets/stylesheets/pages/milestone.scss
+++ b/app/assets/stylesheets/pages/milestone.scss
@@ -12,35 +12,40 @@ li.milestone {
}
}
-.time-elapsed {
- color: #F14539;
-}
+.milestone-content {
+ .issues-count {
+ margin-right: 17px;
+ float: right;
+ width: 105px;
+ }
-.issue-row .assignee-icon {
- .color-label {
- float: left;
- padding: 8px;
- margin-left: 10px;
+ .panel-heading {
+ font-weight: bold;
}
- img {
- margin-left: 8px;
+ .issue-row .assignee-icon {
+ .color-label {
+ float: left;
+ padding: 8px;
+ margin-left: 10px;
+ }
+
+ img {
+ margin-left: 8px;
+ }
}
}
.milestone-summary {
margin-bottom: 25px;
-}
-
-.milestone-stat {
- margin-right: 10px;
-}
+ .milestone-stat {
+ margin-right: 10px;
+ }
-#tab-labels .issues-count {
- margin-right: 17px;
- float: right;
- width: 105px;
+ .time-elapsed {
+ color: $orange-light;
+ }
}
.issues-sortable-list {
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index e75a2f89d90..4b8034b6f5b 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -110,6 +110,9 @@ class Milestone < ActiveRecord::Base
0
end
+ # Returns the elapsed time (in percent) since the Milestone creation date until today.
+ # If the Milestone doesn't have a due_date then returns 0 since we can't calculate the elapsed time.
+ # If the Milestone is overdue then it returns 100%.
def percent_time_used
return 0 unless due_date
return 100 if expired?
diff --git a/app/views/projects/milestones/_issues.html.haml b/app/views/projects/milestones/_issues.html.haml
index e0c9aa0548c..6f8a341e478 100644
--- a/app/views/projects/milestones/_issues.html.haml
+++ b/app/views/projects/milestones/_issues.html.haml
@@ -1,7 +1,7 @@
.panel.panel-default
.panel-heading
- %strong= title
- %strong.pull-right= issues.size
+ = title
+ .pull-right= issues.size
%ul{ class: "well-list issues-sortable-list", id: "issues-list-#{id}", "data-state" => id }
- issues.sort_by(&:position).each do |issue|
= render 'issue', issue: issue
diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml
index 1cf5f54e9ed..631bc8c3e9d 100644
--- a/app/views/projects/milestones/show.html.haml
+++ b/app/views/projects/milestones/show.html.haml
@@ -94,7 +94,7 @@
Labels
%span.badge= @labels.count
-.tab-content
+.tab-content.milestone-content
.tab-pane.active#tab-issues
.row.prepend-top-default
.col-md-4