summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-01-28 20:36:48 -0500
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-01-28 20:36:48 -0500
commit541fcc37bf0c8979cc1495b63ac71912cc28f825 (patch)
tree4e47c7e1ac9b24adaa5f5eb41f6fb1d47151b6ea
parent1bba15589a6c8b349bf235058c13120618d516b6 (diff)
downloadgitlab-ce-541fcc37bf0c8979cc1495b63ac71912cc28f825.tar.gz
Add detail to collapsed icons
-rw-r--r--app/assets/stylesheets/pages/issuable.scss25
-rw-r--r--app/helpers/projects_helper.rb6
-rw-r--r--app/views/shared/issuable/_participants.html.haml2
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml14
4 files changed, 44 insertions, 3 deletions
diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss
index 5d1a488d377..16429e01e0a 100644
--- a/app/assets/stylesheets/pages/issuable.scss
+++ b/app/assets/stylesheets/pages/issuable.scss
@@ -169,10 +169,28 @@
&.right-sidebar-expanded {
width: $gutter_width;
+
+ hr {
+ display: none;
+ }
}
&.right-sidebar-collapsed {
width: $sidebar_collapsed_width;
+ padding-top: 0;
+
+ hr {
+ margin: 0;
+ color: $gray-normal;
+ border-color: $gray-normal;
+ width: 62px;
+ margin-left: -20px
+ }
+
+ .block {
+ border-bottom: none;
+ padding: 15px 0 0 0;
+ }
}
.btn {
@@ -202,7 +220,12 @@
width: 62px;
text-align: center;
margin-left: -19px;
-}
+ padding-bottom: 10px;
+
+ span {
+ display: block;
+ margin-top: 0;
+ }
}
}
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 77ba612548a..9215f29209c 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -20,6 +20,12 @@ module ProjectsHelper
end
end
+ def link_to_member_avatar(author, opts = {})
+ default_opts = { avatar: true, name: true, size: 16, author_class: 'author', title: ":name" }
+ opts = default_opts.merge(opts)
+ image_tag(avatar_icon(author, opts[:size]), width: opts[:size], class: "avatar avatar-inline #{"s#{opts[:size]}" if opts[:size]}", alt:'') if opts[:avatar]
+ end
+
def link_to_member(project, author, opts = {})
default_opts = { avatar: true, name: true, size: 16, author_class: 'author', title: ":name" }
opts = default_opts.merge(opts)
diff --git a/app/views/shared/issuable/_participants.html.haml b/app/views/shared/issuable/_participants.html.haml
index ed34b6d0aef..ea61935487c 100644
--- a/app/views/shared/issuable/_participants.html.haml
+++ b/app/views/shared/issuable/_participants.html.haml
@@ -1,6 +1,8 @@
.block.participants
.sidebar-collapsed-icon
= icon('users')
+ %span
+ = participants.count
.title
= pluralize participants.count, "participant"
- participants.each do |participant|
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index 123eba5f1cf..f4f04a42196 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -26,7 +26,10 @@
= form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-issuable-update'} do |f|
.block.assignee
.sidebar-collapsed-icon
- = icon('user')
+ - if issuable.assignee
+ = link_to_member_avatar(issuable.assignee, size: 24)
+ - else
+ = icon('user')
.title
%label
Assignee
@@ -48,6 +51,11 @@
.block.milestone
.sidebar-collapsed-icon
= icon('balance-scale')
+ %span
+ - if issuable.milestone
+ = issuable.milestone.title
+ - else
+ No
.title
%label
Milestone
@@ -72,6 +80,8 @@
.block.labels
.sidebar-collapsed-icon
= icon('tags')
+ %span
+ = issuable.labels.count
.title
%label Labels
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
@@ -88,7 +98,7 @@
{ selected: issuable.label_ids }, multiple: true, class: 'select2 js-select2', data: { placeholder: "Select labels" }
= render "shared/issuable/participants", participants: issuable.participants(current_user)
-
+ %hr
- if current_user
- subscribed = issuable.subscribed?(current_user)
.block.light