Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LabelsTower
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MaitresNageurs
README
LabelsTower
Commits
c3540b43
Commit
c3540b43
authored
6 years ago
by
Deleted User
Browse files
Options
Downloads
Patches
Plain Diff
Try to create a hierarchy for add label.
parent
20b081ff
No related branches found
No related tags found
2 merge requests
!16
Correction Push
,
!15
correction
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/templates/add_new_tuto.html
+28
-4
28 additions, 4 deletions
app/templates/add_new_tuto.html
with
28 additions
and
4 deletions
app/templates/add_new_tuto.html
+
28
−
4
View file @
c3540b43
...
@@ -14,6 +14,11 @@
...
@@ -14,6 +14,11 @@
<br>
<br>
</span>
</span>
{{ labels_add }}
{{ labels_add }}
<br>
<span
v-for=
'(value, index) in all_labels'
>
<span
v-if=
"value[2] == 1"
><ul>
{{ value[1] }}
</span>
<span
v-else
></span></ul><li>
{{ value[1] }}
</li></span>
</span>
</div>
</div>
<div
id=
'form'
>
<div
id=
'form'
>
...
@@ -42,13 +47,28 @@
...
@@ -42,13 +47,28 @@
return
(
result
);
return
(
result
);
}
}
function
get_all_childs_of_father
(
tab_labels
,
father_id
)
{
/**
* Gets all the childs (label id) from a father.
*/
var
childs
=
[];
for
(
var
i
=
0
;
tab_labels
[
i
];
i
++
)
{
if
(
tab_labels
[
i
][
2
]
==
father_id
)
{
childs
.
push
(
tab_labels
[
i
][
0
])
childs
=
childs
.
concat
(
get_all_childs_of_father
(
tab_labels
,
tab_labels
[
i
][
0
]));
}
}
return
(
childs
);
}
var
hierarchy
=
new
Vue
({
var
hierarchy
=
new
Vue
({
el
:
'
#hierarchy
'
,
el
:
'
#hierarchy
'
,
data
:
{
data
:
{
all_labels
:
[],
all_labels
:
[],
table
:
order_intent_labels_tab
(),
table
:
order_intent_labels_tab
(),
is_active
:
create_empty_tab
(
40
),
is_active
:
create_empty_tab
(
40
),
labels_add
:
[]
labels_add
:
[],
ok
:
[
1
,
0
,
1
,
0
,
0
,
1
,
0
,
0
]
},
},
methods
:
{
methods
:
{
activate_lo
:
function
(
index
)
{
activate_lo
:
function
(
index
)
{
...
@@ -61,14 +81,18 @@
...
@@ -61,14 +81,18 @@
document
.
form1
.
labels
.
value
=
this
.
labels_add
;
document
.
form1
.
labels
.
value
=
this
.
labels_add
;
},
},
get_all_labels
:
function
()
{
get_all_labels
:
function
()
{
this
.
all_labels
=
JSON
.
parse
(
request_ajax
(
"
labels
"
));
return
(
JSON
.
parse
(
request_ajax
(
"
labels
"
))
)
;
}
}
}
}
});
});
/*
hierarchy.all_labels = hierarchy.get_all_labels();
hierarchy
.
all_labels
=
hierarchy
.
get_all_labels
();
for
(
var
i
=
0
;
hierarchy
.
all_labels
[
i
];
i
++
)
{
for
(
var
i
=
0
;
hierarchy
.
all_labels
[
i
];
i
++
)
{
console
.
log
(
get_all_childs_of_father
(
hierarchy
.
all_labels
,
hierarchy
.
all_labels
[
i
][
0
]));
console
.
log
(
get_all_childs_of_father
(
hierarchy
.
all_labels
,
hierarchy
.
all_labels
[
i
][
0
]));
}*/
}
for
(
var
i
=
0
;
hierarchy
.
all_labels
[
i
];
i
++
)
{
hierarchy
.
all_labels
[
i
][
2
]
=
hierarchy
.
ok
[
i
];
}
</script>
</script>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment