summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-10-12 17:42:56 -0500
committerMike Greiling <mike@pixelcog.com>2016-10-12 17:42:56 -0500
commit5c36905a75e621669ced3c9bf850294855c563bb (patch)
treec40531bad9de53a889bb1e5b5dd8c9d1b4002bb6
parent16e6431c83af0a3c862a0e306f1810774033a6bb (diff)
downloadgitlab-ce-5c36905a75e621669ced3c9bf850294855c563bb.tar.gz
de-duplicate project namespace markup
-rw-r--r--app/views/notify/pipeline_failed_email.html.haml10
-rw-r--r--app/views/notify/pipeline_success_email.html.haml10
2 files changed, 8 insertions, 12 deletions
diff --git a/app/views/notify/pipeline_failed_email.html.haml b/app/views/notify/pipeline_failed_email.html.haml
index e76411755e7..7c95ea699a2 100644
--- a/app/views/notify/pipeline_failed_email.html.haml
+++ b/app/views/notify/pipeline_failed_email.html.haml
@@ -76,12 +76,10 @@
%tr
%td{style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;"} Project
%td{style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;color:#333333;font-weight:400;width:75%;padding-left:5px;"}
- - if @project.group
- %a.muted{href: group_url(@project.group), style: "color:#333333;text-decoration:none;"}
- = @project.group.name
- - else
- %a.muted{href: user_url(@project.namespace.owner), style: "color:#333333;text-decoration:none;"}
- = @project.namespace.owner.name
+ - namespace_name = @project.group ? @project.group.name : @project.namespace.owner.name
+ - namespace_url = @project.group ? group_url(@project.group) : user_url(@project.namespace.owner)
+ %a.muted{href: namespace_url, style: "color:#333333;text-decoration:none;"}
+ = namespace_name
\/
%a.muted{href: project_url(@project), style: "color:#333333;text-decoration:none;"}
= @project.name
diff --git a/app/views/notify/pipeline_success_email.html.haml b/app/views/notify/pipeline_success_email.html.haml
index 4696726b75e..23b4f645d78 100644
--- a/app/views/notify/pipeline_success_email.html.haml
+++ b/app/views/notify/pipeline_success_email.html.haml
@@ -76,12 +76,10 @@
%tr
%td{style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;"} Project
%td{style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;color:#333333;font-weight:400;width:75%;padding-left:5px;"}
- - if @project.group
- %a.muted{href: group_url(@project.group), style: "color:#333333;text-decoration:none;"}
- = @project.group.name
- - else
- %a.muted{href: user_url(@project.namespace.owner), style: "color:#333333;text-decoration:none;"}
- = @project.namespace.owner.name
+ - namespace_name = @project.group ? @project.group.name : @project.namespace.owner.name
+ - namespace_url = @project.group ? group_url(@project.group) : user_url(@project.namespace.owner)
+ %a.muted{href: namespace_url, style: "color:#333333;text-decoration:none;"}
+ = namespace_name
\/
%a.muted{href: project_url(@project), style: "color:#333333;text-decoration:none;"}
= @project.name