summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-05-12 11:28:39 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-05-12 11:28:39 +0000
commitb0b25e37c9fee9a0eda1d87e418b2e4794742659 (patch)
treee11b1374a29fadf181834742297156e237987220
parent474023b71a4aaf2a9072a94cf9f5018d7d9bc2ba (diff)
parentb0af379a22efff12a7561d7b89ce85105169a5cc (diff)
downloadgitlab-ce-b0b25e37c9fee9a0eda1d87e418b2e4794742659.tar.gz
Merge branch 'note-role' into 'master'
Show user roles by comments. I think it would be useful to show the user's role (Owner/Master/Developer/Reporter) by comments on GitLab.com (like GitHub does with Owner/Collaborator). That way people will know that when someone from the project's core team comments, they're not just some random user, but they're actually on the team. Currently they have the gather this from context. ![Screen_Shot_2015-05-12_at_12.15.45](https://gitlab.com/gitlab-org/gitlab-ce/uploads/0da0eea2087d6d3b14a2c0c594575c8a/Screen_Shot_2015-05-12_at_12.15.45.png) On hover, the note actions replace the role: ![Screen_Shot_2015-05-12_at_12.17.32](https://gitlab.com/gitlab-org/gitlab-ce/uploads/54a83c2f5047ea3ce0387f6692b14fe5/Screen_Shot_2015-05-12_at_12.17.32.png) --- Addresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2321. cc @sytses See merge request !639
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/stylesheets/pages/notes.scss11
-rw-r--r--app/views/projects/notes/_note.html.haml26
3 files changed, 29 insertions, 9 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 6c544fc9398..7330f23501c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -53,6 +53,7 @@ v 7.11.0 (unreleased)
- Add current_sign_in_at to UserFull REST api.
- Make Sidekiq MemoryKiller shutdown signal configurable
- Add "Create Merge Request" buttons to commits and branches pages and push event.
+ - Show user roles by comments.
v 7.10.2
- Fix CI links on MR page
diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss
index 589a43c4264..61b907e39be 100644
--- a/app/assets/stylesheets/pages/notes.scss
+++ b/app/assets/stylesheets/pages/notes.scss
@@ -44,6 +44,14 @@ ul.notes {
}
.author-username {
}
+
+ .note-role {
+ float: right;
+ margin-top: 2px;
+ border: 1px solid #bbb;
+ background-color: transparent;
+ color: #999;
+ }
}
.discussion {
@@ -136,6 +144,7 @@ ul.notes {
.note {
&.note:hover {
.note-actions { display: block; }
+ .note-actions + .note-role { display: none; }
}
.discussion-header:hover {
.discussion-actions { display: block; }
@@ -153,6 +162,8 @@ ul.notes {
}
a {
+ margin-left: 5px;
+
@extend .cgray;
&:hover {
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index 4d26b52df01..2f3c407d6e9 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -9,22 +9,30 @@
.timeline-content
.note-header
.note-actions
- = link_to "##{dom_id(note)}", name: dom_id(note) do
- = icon('link')
+ = link_to "##{dom_id(note)}", name: dom_id(note), title: "Link here" do
+ = icon('link fw')
Link here
- &nbsp;
+
- if note_editable?(note)
= link_to '#', title: 'Edit comment', class: 'js-note-edit' do
- = icon('pencil-square-o')
+ = icon('pencil-square-o fw')
Edit
- &nbsp;
- = link_to namespace_project_note_path(@project.namespace, @project, note), title: 'Remove comment', method: :delete, data: { confirm: 'Are you sure you want to remove this comment?' }, remote: true, class: 'danger js-note-delete' do
- = icon('trash-o', class: 'cred')
+
+ = link_to namespace_project_note_path(note.project.namespace, note.project, note), title: 'Remove comment', method: :delete, data: { confirm: 'Are you sure you want to remove this comment?' }, remote: true, class: 'danger js-note-delete' do
+ = icon('trash-o fw', class: 'cred')
Remove
+
+ - unless note.system
+ - member = note.project.team.find_member(note.author.id)
+ - if member
+ %span.note-role.label
+ = member.human_access
+
- if note.system
= link_to user_path(note.author) do
= image_tag avatar_icon(note.author_email), class: 'avatar s16', alt: ''
- = link_to_member(@project, note.author, avatar: false)
+
+ = link_to_member(note.project, note.author, avatar: false)
%span.author-username
= '@' + note.author.username
%span.note-last-update
@@ -65,7 +73,7 @@
= link_to note.attachment.url, target: '_blank' do
= icon('paperclip')
= note.attachment_identifier
- = link_to delete_attachment_namespace_project_note_path(@project.namespace, @project, note),
+ = link_to delete_attachment_namespace_project_note_path(note.project.namespace, note.project, note),
title: 'Delete this attachment', method: :delete, remote: true, data: { confirm: 'Are you sure you want to remove the attachment?' }, class: 'danger js-note-attachment-delete' do
= icon('trash-o', class: 'cred')
.clear