Skip to content

Commit 2f85bcf

Browse files
committed
use templates
1 parent 2cedd4a commit 2f85bcf

3 files changed

Lines changed: 57 additions & 56 deletions

File tree

client/directives/components/newContainer/forms/configureNewServiceView.jade

Lines changed: 13 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,23 @@ header.grid-block.vertical.align-center.modal-header(
1212
xlink:href = "#icons-close"
1313
)
1414

15-
.row.modal-tabs.tabs-all.grid-block.clearfix
16-
button.btn.btn-radio.grid-block.vertical(
17-
ng-class = "{'active': state.selectedTab === 'compose'}"
18-
ng-click = "state.selectedTab = 'compose'"
19-
)
20-
svg.iconnables.grid-content
21-
use(
22-
xlink:href = "#icons-compose"
23-
)
24-
.btn-text.grid-content Compose Files
15+
.row.modal-tabs.tabs-all.grid-block.clearfix(
16+
ng-init = "tabs = [\
17+
{name: 'compose', iconName: 'icons-compose', label: 'Compose Files'},\
18+
{name: 'env', iconName: 'icons-environment-variable', label: 'Environment Variables'}\
19+
];"
20+
)
2521
button.btn.btn-radio.grid-block.vertical(
26-
ng-class = "{'active': state.selectedTab === 'env'}"
27-
ng-click = "state.selectedTab = 'env'"
22+
ng-class = "{'active': state.selectedTab === '{{tab.name}}'}"
23+
ng-click = "state.selectedTab = tab.name"
24+
ng-repeat = "tab in tabs"
2825
)
2926
svg.iconnables.grid-content
3027
use(
31-
xlink:href = "#icons-environment-variable"
28+
ng-attr-xlink:href = "{{'#' + $sce.trustAs($sce.HTML, tab.iconName)}}"
29+
xlink:href = ""
3230
)
33-
.btn-text.grid-content Environment Variables
31+
.btn-text.grid-content {{tab.label}}
3432

3533
section.grid-block.vertical.modal-body(
3634
ng-init = "state.selectedTab = 'compose'"
@@ -49,49 +47,8 @@ section.grid-block.vertical.modal-body(
4947
)
5048
.label-tabs.grid-block(
5149
ng-if = "!$root.featureFlags.composeEditing"
50+
ng-include = "'setupMethodView'"
5251
)
53-
label.grid-block.align-center.btn.btn-radio(
54-
ng-class = "{'active': NCC.state.dockerFileTab === 'kubernetes'}"
55-
ng-click = "\
56-
NCC.state.dockerFileTab = 'kubernetes';\
57-
NCC.state.configurationMethod = 'dockerComposeFile'\
58-
"
59-
ng-if = "$root.featureFlags.kubernetes"
60-
)
61-
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
62-
use(
63-
xlink:href = "#icons-check"
64-
)
65-
.grid-block.vertical.text-left
66-
p.p.weight-strong Use Kubernetes
67-
small.small Set up from Kubernetes files in your repo.
68-
69-
label.grid-block.align-center.btn.btn-radio(
70-
data-event-name = "Selected Compose Setup"
71-
ng-class = "{'active': NCC.state.dockerFileTab === 'compose'}"
72-
ng-click = "NCC.state.dockerFileTab = 'compose'; NCC.state.configurationMethod = 'dockerComposeFile'"
73-
)
74-
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
75-
use(
76-
xlink:href = "#icons-check"
77-
)
78-
.grid-block.vertical.text-left
79-
p.p.weight-strong Use a Compose File
80-
small.small Set up from a Compose file in your repo.
81-
82-
label.grid-block.align-center.btn.btn-radio(
83-
data-event-name = "Selected Dockerfile Setup"
84-
ng-class = "{'active': NCC.state.dockerFileTab === 'dockerfile'}"
85-
ng-click = "NCC.state.dockerFileTab = 'dockerfile'; NCC.state.configurationMethod = 'dockerfile'"
86-
ng-if = "!$root.featureFlags.kubernetes"
87-
)
88-
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
89-
use(
90-
xlink:href = "#icons-check"
91-
)
92-
.grid-block.vertical.text-left
93-
p.p.weight-strong No Compose File
94-
small.small Set up from scratch or from a Dockerfile.
9552

9653
//- form for naming the environment
9754
form.grid-block.vertical.label(
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
label.grid-block.align-center.btn.btn-radio(
2+
ng-class = "{'active': NCC.state.dockerFileTab === 'kubernetes'}"
3+
ng-click = "\
4+
NCC.state.dockerFileTab = 'kubernetes';\
5+
NCC.state.configurationMethod = 'dockerComposeFile'\
6+
"
7+
ng-if = "$root.featureFlags.kubernetes"
8+
)
9+
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
10+
use(
11+
xlink:href = "#icons-check"
12+
)
13+
.grid-block.vertical.text-left
14+
p.p.weight-strong Use Kubernetes
15+
small.small Set up from Kubernetes files in your repo.
16+
17+
label.grid-block.align-center.btn.btn-radio(
18+
data-event-name = "Selected Compose Setup"
19+
ng-class = "{'active': NCC.state.dockerFileTab === 'compose'}"
20+
ng-click = "NCC.state.dockerFileTab = 'compose'; NCC.state.configurationMethod = 'dockerComposeFile'"
21+
)
22+
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
23+
use(
24+
xlink:href = "#icons-check"
25+
)
26+
.grid-block.vertical.text-left
27+
p.p.weight-strong Use a Compose File
28+
small.small Set up from a Compose file in your repo.
29+
30+
label.grid-block.align-center.btn.btn-radio(
31+
data-event-name = "Selected Dockerfile Setup"
32+
ng-class = "{'active': NCC.state.dockerFileTab === 'dockerfile'}"
33+
ng-click = "NCC.state.dockerFileTab = 'dockerfile'; NCC.state.configurationMethod = 'dockerfile'"
34+
ng-if = "!$root.featureFlags.kubernetes"
35+
)
36+
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
37+
use(
38+
xlink:href = "#icons-check"
39+
)
40+
.grid-block.vertical.text-left
41+
p.p.weight-strong No Compose File
42+
small.small Set up from scratch or from a Dockerfile.

client/directives/components/newContainer/newContainerController.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require('app')
66
function NewContainerController(
77
$q,
88
$rootScope,
9+
$sce,
910
$scope,
1011
$state,
1112
$timeout,
@@ -27,6 +28,7 @@ function NewContainerController(
2728
loading,
2829
ModalService
2930
) {
31+
$scope.$sce = $sce;
3032
var NCC = this;
3133
var defaultState = this.state || {};
3234
var defaultTab = 'dockerfile';

0 commit comments

Comments
 (0)