summaryrefslogtreecommitdiff
path: root/app/views/shared/projects/_project.html.haml
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-12-07 09:11:41 +0000
committerPhil Hughes <me@iamphill.com>2017-12-07 09:11:41 +0000
commit2c569be63b3275c311606e4afcfb8311e810401f (patch)
treecbad93902334c10575d3e6ad1cd1f8903fa8c6f4 /app/views/shared/projects/_project.html.haml
parent61bd5b2cdb19e78e5f3f5688dc6fc2668e8a5608 (diff)
downloadgitlab-ce-2c569be63b3275c311606e4afcfb8311e810401f.tar.gz
Resolve "Display member role per project"
Diffstat (limited to 'app/views/shared/projects/_project.html.haml')
-rw-r--r--app/views/shared/projects/_project.html.haml11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
index 98bfc7c4d36..003f5fa52eb 100644
--- a/app/views/shared/projects/_project.html.haml
+++ b/app/views/shared/projects/_project.html.haml
@@ -3,6 +3,8 @@
- forks = false unless local_assigns[:forks] == true
- ci = false unless local_assigns[:ci] == true
- skip_namespace = false unless local_assigns[:skip_namespace] == true
+- user = local_assigns[:user]
+- access = user&.max_member_access_for_project(project.id) unless user.nil?
- css_class = '' unless local_assigns[:css_class]
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && project.commit
- css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
@@ -21,14 +23,19 @@
.project-details
%h3.prepend-top-0.append-bottom-0
= link_to project_path(project), class: 'text-plain' do
- %span.project-full-name
+ %span.project-full-name><
%span.namespace-name
- if project.namespace && !skip_namespace
= project.namespace.human_name
\/
- %span.project-name
+ %span.project-name<
= project.name
+ - if access&.nonzero?
+ -# haml-lint:disable UnnecessaryStringOutput
+ = ' ' # prevent haml from eating the space between elements
+ %span.user-access-role= Gitlab::Access.human_access(access)
+
- if show_last_commit_as_description
.description.prepend-top-5
= link_to_markdown(project.commit.title, project_commit_path(project, project.commit), class: "commit-row-message")