BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2a40dec1
Commit
2a40dec1
authored
Oct 19, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Serialize all needed data
parent
234c0415
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
environments_controller.rb
app/controllers/projects/environments_controller.rb
+11
-1
environments_helper.rb
app/helpers/environments_helper.rb
+1
-1
_environment.html.haml
...s/projects/environments/components/_environment.html.haml
+12
-6
No files found.
app/controllers/projects/environments_controller.rb
View file @
2a40dec1
...
...
@@ -19,7 +19,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
@environments
render
json:
serialize_as_json
(
@environments
)
end
end
end
...
...
@@ -69,4 +69,14 @@ class Projects::EnvironmentsController < Projects::ApplicationController
def
environment
@environment
||=
project
.
environments
.
find
(
params
[
:id
])
end
def
serialize_as_json
(
resource
)
resource
.
as_json
(
include:
{
last_deployment:
{
include:
[
:deployable
,
:user
]
}
}
)
end
end
app/helpers/environments_helper.rb
View file @
2a40dec1
module
EnvironmentsHelper
def
environments_list_data
def
environments_list_data
()
{
endpoint:
namespace_project_environments_path
(
@project
.
namespace
,
@project
)
}
...
...
app/views/projects/environments/components/_environment.html.haml
View file @
2a40dec1
...
...
@@ -12,23 +12,27 @@
%i
{
"v-show"
=>
"!open"
}
=
icon
(
"caret-right"
)
{{model.name}}
%td
.deployment-column
%span
{
"v-if"
=>
"model.last_deployment && model.last_deployment.iid"
}
%span
{
"v-if"
=>
"
!isFolder &&
model.last_deployment && model.last_deployment.iid"
}
{{model.last_deployment.iid}}
by
%span
{
"v-if"
=>
"model.last_deployment.user"
}
{{model.last_deployment.user}}
{{model.last_deployment.user
.name
}}
%td
%a
{
"v-if"
=>
"!isFolder"
}
column 3
%td
column 4
%a
{
"v-if"
=>
"!isFolder"
}
column 3
%td
column 5
%span
{
"v-if"
=>
"!isFolder && model.last_deployment"
}
{{last_deployment.created_at}}
%td
.hidden-xs
.pull-right
...
...
@@ -55,7 +59,9 @@
/= user_avatar(user: "child.last_deployment.user", size: 20)
%td
column 3
%a
.build-link
{
"v-if"
=>
"child.last_deployment && child.last_deployment.deployable"
,
":href"
=>
""
}
{{child.last_deployment}}
%td
column 4
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment