Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-06-21 09:29:53 +0400
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-06-21 09:29:53 +0400
commit75cf927d3b1f31c7c19ce08d34bce4bf15f21608 (patch)
tree36ad7fbf3f089eeb5f199a1d189dba3a9023c7ea /app
parentb64ceadbf273c0b99072b3eb124deb51b7e80f27 (diff)
Issues & MR legend
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/common.scss89
-rw-r--r--app/assets/stylesheets/sections/issues.scss2
-rw-r--r--app/helpers/issues_helper.rb8
-rw-r--r--app/helpers/merge_requests_helper.rb8
-rw-r--r--app/models/merge_request.rb4
-rw-r--r--app/views/dashboard/issues.html.haml9
-rw-r--r--app/views/issues/_show.html.haml10
-rw-r--r--app/views/issues/index.html.haml15
-rw-r--r--app/views/merge_requests/_merge_request.html.haml6
-rw-r--r--app/views/merge_requests/index.html.haml16
10 files changed, 158 insertions, 9 deletions
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index 0888b6db1f5..a00c6fdba1c 100644
--- a/app/assets/stylesheets/common.scss
+++ b/app/assets/stylesheets/common.scss
@@ -606,3 +606,92 @@ li.note {
.mr_show_all_commits {
cursor:pointer;
}
+
+/**
+ * Issues, MRs legend
+ *
+ */
+
+.list_legend {
+ float:left;
+ margin-right:20px;
+ .icon {
+ width:16px;
+ height:16px;
+ float:left;
+ margin-right:5px;
+ @include border-radius(4px);
+ &.critical {
+ background: #EAA;
+ border:1px solid #B88;
+ }
+ &.today{
+ background: #ADA;
+ border:1px solid #8B8;
+ }
+ &.closed {
+ background: #DDD;
+ border:1px solid #BBB;
+ }
+ &.yours {
+ background: #AAD;
+ border:1px solid #88B;
+ }
+ &.merged {
+ background: #DAD;
+ border:1px solid #B8B;
+ }
+ }
+ .text {
+ padding-bottom: 10px;
+ float:left;
+ }
+}
+
+.merge_request,
+.issue {
+ .list_legend {
+ margin-right: 5px;
+ margin-top: 10px;
+ .icon {
+ width:16px;
+ height:16px;
+ float:left;
+ margin-right:5px;
+ @include border-radius(4px);
+ border:1px solid #ddd;
+ }
+ }
+
+ &.critical {
+ .icon {
+ background: #EAA;
+ border:1px solid #B88;
+ }
+ }
+ &.today{
+ .icon {
+ background: #ADA;
+ border:1px solid #8B8;
+ }
+ }
+ &.closed {
+ .icon {
+ background: #DDD;
+ border:1px solid #BBB;
+ }
+ }
+ &.yours {
+ .icon {
+ background: #AAD;
+ border:1px solid #88B;
+ }
+ }
+ &.merged {
+ .icon {
+ background: #DAD;
+ border:1px solid #B8B;
+ }
+ }
+}
+
diff --git a/app/assets/stylesheets/sections/issues.scss b/app/assets/stylesheets/sections/issues.scss
index cbaca760bd7..a3bd408bb7e 100644
--- a/app/assets/stylesheets/sections/issues.scss
+++ b/app/assets/stylesheets/sections/issues.scss
@@ -25,3 +25,5 @@
@extend .bottom_box_content;
}
}
+
+
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index ba953ed3c64..31d862ef725 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -25,4 +25,12 @@ module IssuesHelper
issue.author_name
end
end
+
+ def issue_css_classes issue
+ classes = "issue"
+ classes << " critical" if issue.critical
+ classes << " closed" if issue.closed
+ classes << " today" if issue.today?
+ classes
+ end
end
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb
index 96e0ab4dd5a..29e7c6f745f 100644
--- a/app/helpers/merge_requests_helper.rb
+++ b/app/helpers/merge_requests_helper.rb
@@ -31,4 +31,12 @@ module MergeRequestsHelper
}
)
end
+
+ def mr_css_classes mr
+ classes = "merge_request"
+ classes << " closed" if mr.closed
+ classes << " merged" if mr.merged?
+ classes << " today" if mr.today?
+ classes
+ end
end
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index d532373f1b2..12365b03059 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -93,6 +93,10 @@ class MergeRequest < ActiveRecord::Base
self.save
end
+ def today?
+ Date.today == created_at.to_date
+ end
+
def new?
today? && created_at == updated_at
end
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index b794e634bf8..b6bcdf8d8fb 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -4,6 +4,15 @@
%small.right #{@issues.total_count} issues
%br
+.issues_legend
+ .list_legend
+ .icon.critical
+ .text Critical
+
+ .list_legend
+ .icon.today
+ .text Today
+.clearfix
- if @issues.any?
- @issues.group_by(&:project).each do |group|
%div.ui-box
diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml
index bb7c81f9a8e..e7dc3f835b2 100644
--- a/app/views/issues/_show.html.haml
+++ b/app/views/issues/_show.html.haml
@@ -1,4 +1,6 @@
-%li.wll{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(issue.project, issue) }
+%li.wll{ :id => dom_id(issue), :class => issue_css_classes(issue), :url => project_issue_path(issue.project, issue) }
+ .list_legend
+ .icon
.right
- if issue.notes.any?
%span.btn.small.disabled.padded= pluralize issue.notes.count, 'note'
@@ -15,12 +17,8 @@
%span.update-author
assigned to
%strong= issue.assignee_name
- - if issue.critical
- %span.label.important critical
- - if issue.today?
- %span.label.success today
- if issue.upvotes > 0
- %span.label.success= "+#{issue.upvotes}"
+ %span.badge.badge-success= "+#{issue.upvotes}"
= link_to project_issue_path(issue.project, issue) do
%p.row_title= truncate(issue.title, :length => 100)
diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml
index 1a321e6f8e0..ade80dade8f 100644
--- a/app/views/issues/index.html.haml
+++ b/app/views/issues/index.html.haml
@@ -14,6 +14,21 @@
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search span3 right neib' }
%br
+
+ .issues_legend
+ .list_legend
+ .icon.critical
+ .text Critical
+
+ .list_legend
+ .icon.closed
+ .text Closed
+
+ .list_legend
+ .icon.today
+ .text Today
+ .clearfix
+
%div#issues-table-holder.ui-box
.title
.row
diff --git a/app/views/merge_requests/_merge_request.html.haml b/app/views/merge_requests/_merge_request.html.haml
index 54300fae0d5..e744a9617c8 100644
--- a/app/views/merge_requests/_merge_request.html.haml
+++ b/app/views/merge_requests/_merge_request.html.haml
@@ -1,4 +1,6 @@
-%li.wll
+%li.wll{ :class => mr_css_classes(merge_request) }
+ .list_legend
+ .icon
.right
.left
- if merge_request.notes.any?
@@ -14,6 +16,6 @@
= time_ago_in_words(merge_request.created_at)
ago
- if merge_request.upvotes > 0
- %span.label.success= "+#{merge_request.upvotes}"
+ %span.badge.badge-success= "+#{merge_request.upvotes}"
= link_to project_merge_request_path(merge_request.project, merge_request) do
%p.row_title= truncate(merge_request.title, :length => 80)
diff --git a/app/views/merge_requests/index.html.haml b/app/views/merge_requests/index.html.haml
index 3ec2b10bf7b..d98e52b9346 100644
--- a/app/views/merge_requests/index.html.haml
+++ b/app/views/merge_requests/index.html.haml
@@ -6,6 +6,20 @@
%br
+.mrs_legend
+ .list_legend
+ .icon.today
+ .text Today
+
+ .list_legend
+ .icon.merged
+ .text Merged
+
+ .list_legend
+ .icon.closed
+ .text Closed
+.clearfix
+
.ui-box
.title
%ul.nav.nav-pills
@@ -26,7 +40,7 @@
= render @merge_requests
- if @merge_requests.blank?
%li
- %p.padded Nothing to show here
+ %h4.nothing_here_message Nothing to show here
- if @merge_requests.present?
%li.bottom
.row