Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d0552ade
Commit
d0552ade
authored
Nov 18, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to use slots
parent
120c53cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
24 deletions
+29
-24
app/assets/javascripts/environments/components/environment_actions.js.es6
...cripts/environments/components/environment_actions.js.es6
+21
-22
app/assets/stylesheets/pages/environments.scss
app/assets/stylesheets/pages/environments.scss
+4
-0
app/views/projects/environments/index.html.haml
app/views/projects/environments/index.html.haml
+4
-2
No files found.
app/assets/javascripts/environments/components/environment_actions.js.es6
View file @
d0552ade
...
@@ -23,39 +23,38 @@
...
@@ -23,39 +23,38 @@
*
*
*/
*/
mounted() {
mounted() {
const playIcon = document.querySelector('.play-icon-svg.hidden svg');
//
const playIcon = document.querySelector('.play-icon-svg.hidden svg');
//
const dropdownContainer = this.$el.querySelector('.dropdown-play-icon-container');
//
const dropdownContainer = this.$el.querySelector('.dropdown-play-icon-container');
const actionContainers = this.$el.querySelectorAll('.action-play-icon-container');
//
const actionContainers = this.$el.querySelectorAll('.action-play-icon-container');
// Phantomjs does not have support to iterate a nodelist.
//
//
Phantomjs does not have support to iterate a nodelist.
const actionsArray = [].slice.call(actionContainers);
//
const actionsArray = [].slice.call(actionContainers);
//
if (playIcon && actionsArray && dropdownContainer) {
//
if (playIcon && actionsArray && dropdownContainer) {
dropdownContainer.appendChild(playIcon.cloneNode(true));
//
dropdownContainer.appendChild(playIcon.cloneNode(true));
//
actionsArray.forEach((element) => {
//
actionsArray.forEach((element) => {
element.appendChild(playIcon.cloneNode(true));
//
element.appendChild(playIcon.cloneNode(true));
});
//
});
}
//
}
},
},
template: `
template: `
<div class="inline">
<div class="inline">
<div class="dropdown">
<div class="dropdown">
<a class="dropdown-new btn btn-default" data-toggle="dropdown">
<a class="dropdown-new btn btn-default" data-toggle="dropdown">
<span class="dropdown-play-icon-container">
<slot name="actionplayicon"></slot>
<!-- svg goes here -->
</span>
<i class="fa fa-caret-down"></i>
<i class="fa fa-caret-down"></i>
</a>
</a>
<ul class="dropdown-menu dropdown-menu-align-right">
<ul class="dropdown-menu dropdown-menu-align-right">
<li v-for="action in actions">
<li v-for="action in actions">
<a :href="action.play_path" data-method="post" rel="nofollow" class="js-manual-action-link">
<a :href="action.play_path"
<span class="action-play-icon-container">
data-method="post"
<!-- svg goes here -->
rel="nofollow"
</span>
class="js-manual-action-link">
<span v-html="action.name"></span>
<slot name="actionplayicon"></slot>
<span v-html="action.name"></span>
</a>
</a>
</li>
</li>
</ul>
</ul>
...
...
app/assets/stylesheets/pages/environments.scss
View file @
d0552ade
...
@@ -15,6 +15,10 @@
...
@@ -15,6 +15,10 @@
}
}
}
}
.play-icon-svg
span
{
display
:
inline-block
;
}
.environments
{
.environments
{
table-layout
:
fixed
;
table-layout
:
fixed
;
...
...
app/views/projects/environments/index.html.haml
View file @
d0552ade
...
@@ -6,8 +6,10 @@
...
@@ -6,8 +6,10 @@
=
page_specific_javascript_tag
(
"environments/environments_bundle.js"
)
=
page_specific_javascript_tag
(
"environments/environments_bundle.js"
)
.commit-icon-svg.hidden
.commit-icon-svg.hidden
=
custom_icon
(
"icon_commit"
)
=
custom_icon
(
"icon_commit"
)
.play-icon-svg.hidden
=
custom_icon
(
"icon_play"
)
.play-icon-svg
{
slot:
"actionplayicon"
}
%span
.hide
=
custom_icon
(
"icon_play"
)
#environments-list-view
{
data:
{
environments_data:
environments_list_data
,
#environments-list-view
{
data:
{
environments_data:
environments_list_data
,
"can-create-deployment"
=>
can?
(
current_user
,
:create_deployment
,
@project
).
to_s
,
"can-create-deployment"
=>
can?
(
current_user
,
:create_deployment
,
@project
).
to_s
,
...
...
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