Commit 4508f85a authored by Filipa Lacerda's avatar Filipa Lacerda

Adds user column with avatar url

parent c02a4f38
...@@ -73,8 +73,11 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -73,8 +73,11 @@ class Projects::EnvironmentsController < Projects::ApplicationController
def serialize_as_json(resource) def serialize_as_json(resource)
resource.as_json( resource.as_json(
include: { include: {
last_deployment: { last_deployment: {
include: [:deployable, :user] include: {
user: { only: [:id, :name, :username], methods: [:avatar_url] },
deployable: { only: [:id, :name] }
}
} }
} }
) )
......
...@@ -18,9 +18,15 @@ ...@@ -18,9 +18,15 @@
%span{ "v-if" => "!isFolder && model.last_deployment && model.last_deployment.iid" } %span{ "v-if" => "!isFolder && model.last_deployment && model.last_deployment.iid" }
{{model.last_deployment.iid}} {{model.last_deployment.iid}}
by
%span{ "v-if" => "model.last_deployment.user" } %span{ "v-if" => "model.last_deployment.user" }
{{model.last_deployment.user.name}} by
%a{":href" => "'/' + model.last_deployment.user.username"}
%img.avatar.has-tooltip.s20{ ":src" => "model.last_deployment.user.avatar_url",
":alt" => "model.last_deployment.user.username + ' avatar'",
":title" => "model.last_deployment.user.username",
data: { container: 'body'},
width: 20, height: 20 }
%td %td
%a{ "v-if" => "!isFolder && model.last_deployment && model.last_deployment.deployable", %a{ "v-if" => "!isFolder && model.last_deployment && model.last_deployment.deployable",
...@@ -30,7 +36,7 @@ ...@@ -30,7 +36,7 @@
%td %td
%a{ "v-if" => "!isFolder && model.last_deployment" } %a{ "v-if" => "!isFolder && model.last_deployment" }
column 4 / = render "projects/deployments/commit", deployment: "{{model.last_deployment}}"
%p.commit-title{ "v-if" => "!isFolder && !model.last_deployment"} %p.commit-title{ "v-if" => "!isFolder && !model.last_deployment"}
No deployments yet No deployments yet
...@@ -40,7 +46,10 @@ ...@@ -40,7 +46,10 @@
%td.hidden-xs %td.hidden-xs
.pull-right{ "v-if" => "!isFolder"} .pull-right{ "v-if" => "!isFolder"}
actions -# = render "projects/environments/external_url", environment: "{{model}}"
-# = render "projects/deployments/actions", deployment: "{{model.last_deployment}}"
-# = render "projects/environments/stop", environment: "{{model}}"
-# = render "projects/deployments/rollback", deployment: "{{model.last_deployment}}"
%tr.environment-children{ "v-show" => "open", %tr.environment-children{ "v-show" => "open",
"v-if"=>"isFolder", "v-if"=>"isFolder",
...@@ -55,19 +64,25 @@ ...@@ -55,19 +64,25 @@
%span{ "v-if" => "child.last_deployment && child.last_deployment.iid" } %span{ "v-if" => "child.last_deployment && child.last_deployment.iid" }
{{child.last_deployment.iid}} {{child.last_deployment.iid}}
by %span{ "v-if" => "child.last_deployment.user" }
%span{ "v-if" => "model.last_deployment.user" } by
{{child.last_deployment.user.name}} %a{":href" => "'/' + child.last_deployment.user.username"}
%img.avatar.has-tooltip.s20{ ":src" => "child.last_deployment.user.avatar_url",
":alt" => "child.last_deployment.user.username + ' avatar'",
":title" => "child.last_deployment.user.username",
data: { container: 'body'},
width: 20, height: 20 }
%td %td
%a{ "v-if" => " child.last_deployment && child.last_deployment.deployable", %a{ "v-if" => " child.last_deployment && child.last_deployment.deployable",
":class" => "build-link", ":class" => "build-link",
":href" => "" } ":href" => "" }
{{model.last_deployment.deployable.name}} (## {{model.last_deployment.deployable.id}}) {{chil.last_deployment.deployable.name}} (## {{child.last_deployment.deployable.id}})
%td %td
%a{ "v-if" => "child.last_deployment" } %a{ "v-if" => "child.last_deployment" }
column 4 / = render "projects/deployments/commit", deployment: "{{child.last_deployment}}"
%p.commit-title{ "v-if" => "!child.last_deployment"} %p.commit-title{ "v-if" => "!child.last_deployment"}
No deployments yet No deployments yet
...@@ -76,5 +91,8 @@ ...@@ -76,5 +91,8 @@
{{child.last_deployment.created_at}} {{child.last_deployment.created_at}}
%td.hidden-xs %td.hidden-xs
.pull-right{ "v-if" => "!isFolder"} .pull-right
actions -# = render "projects/environments/external_url", environment: "{{child}}"
\ No newline at end of file -# = render "projects/deployments/actions", deployment: "{{child.last_deployment}}"
-# = render "projects/environments/stop", environment: "{{child}}"
-# = render "projects/deployments/rollback", deployment: "{{child.last_deployment}}"
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment