summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-07 12:45:35 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-16 11:58:07 +0000
commit8d171f0a5fbd920b25b5012526e3cdb2c3aee623 (patch)
treea02fc6dbe651458fc1068c7fb38c88e02fb162f7
parent4388d90370310a570c5450b6c10eba7533ce1827 (diff)
downloadgitlab-ce-8d171f0a5fbd920b25b5012526e3cdb2c3aee623.tar.gz
Fix commit column with correct data
-rw-r--r--app/views/projects/environments/components/_commit.html.haml33
-rw-r--r--app/views/projects/environments/index.html.haml4
2 files changed, 17 insertions, 20 deletions
diff --git a/app/views/projects/environments/components/_commit.html.haml b/app/views/projects/environments/components/_commit.html.haml
index 1f923a2d0d6..17bc3dcb379 100644
--- a/app/views/projects/environments/components/_commit.html.haml
+++ b/app/views/projects/environments/components/_commit.html.haml
@@ -1,30 +1,27 @@
.branch-commit{"v-if" => "!isFolder && model.last_deployment"}
+ .icon-container{ "v-if" => "model.last_deployment.ref && model.last_deployment.tag" }
+ =icon("tag")
- %div{ "v-if" => "model.last_deployment.ref" }
+ .icon-container{ "v-if" => "model.last_deployment.ref && !model.last_deployment.tag" }
+ =icon("code-fork")
- .icon-container{ "v-if" => "model.last_deployment.tag" }
- =icon("tag")
-
- .icon-container{ "v-if" => "!model.last_deployment.tag" }
- =icon("code-fork")
-
- %a.monospace.branch-name{":href" => "'/' + model.project.namespace.name + '/' + model.project.name + '/commits/' +model.last_deployment.ref"}
- {{model.last_deployment.ref}}
+ %a.monospace.branch-name{"v-if" => "model.last_deployment.ref", ":href" => "model.last_deployment.ref.ref_url"}
+ {{model.last_deployment.ref.name}}
.icon-container.commit-icon
= custom_icon("icon_commit")
- %a.commit-id.monospace{":href" => "'/' + model.project.namespace.name + '/' + model.project.name + '/commit/' +model.last_deployment.sha"}
- {{model.last_deployment.short_sha}}
+ %a.commit-id.monospace{":href" => "model.last_deployment.commit.commit_url"}
+ {{model.last_deployment.commit.short_id}}
%p.commit-title
- %span{ "v-if" => "model.last_deployment.commit_title"}
-
- -# need commit author username and avatar_url
- commit author goes here
- %a.commit-row-message{":href" => "'/' + model.project.namespace.name + '/' + model.project.name + '/commit/' +model.last_deployment.sha"}
- {{model.last_deployment.commit_title}}
+ %span{ "v-if" => "model.last_deployment.commit && model.last_deployment.commit.title"}
+ %a{"v-if" => "model.last_deployment.commit.author", ":href" => "model.last_deployment.commit.author.web_url"}
+ %img.avatar.has-tooltip.s20{":title" => "model.last_deployment.commit.author.username",
+ ":src" => "model.last_deployment.commit.author.avatar_url"}
+ %a.commit-row-message{":href" => "model.last_deployment.commit.commit_url"}
+ {{model.last_deployment.commit.title}}
- %span{ "v-if" => "!model.last_deployment.commit_title"}
+ %span{ "v-if" => "!model.last_deployment.commit.title"}
Cant find HEAD commit for this branch
diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml
index 81c8fd9d9db..fa88d59e3ca 100644
--- a/app/views/projects/environments/index.html.haml
+++ b/app/views/projects/environments/index.html.haml
@@ -20,8 +20,8 @@
%span.badge.js-stopped-environments-count
{{state.stoppedCounter}}
- - if can?(current_user, :create_environment, @project) && !@all_environments.blank?
- .nav-controls
+ - if can?(current_user, :create_environment, @project)
+ .nav-controls{ "v-if" => "!loading" }
= link_to new_namespace_project_environment_path(@project.namespace, @project), class: "btn btn-create" do
New environment