aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/admin-dashboard/category-management/category-management-view.html
blob: 30b71f28e210c8ae9cef6794d17730e85b0afea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!--
  ~ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<div data-ng-controller="Sdc.ViewModels.CategoryManagementViewModel" class="category-management">

    <loader data-display="isLoading"></loader>

    <div class="row">

        <div class="col-sm-6">

            <h4>
                <span class="hand selected" data-ng-click="selectType(SERVICE)" data-tests-id="servicecategoryheader"
                      data-ng-class="{'selected': type === SERVICE}" translate="SERVICE_CATEGORY_HEADER"></span>
                <span class="hand" data-ng-click="selectType(RESOURCE)" data-tests-id="resourcecategoryheader"
                      data-ng-class="{'selected': type === RESOURCE}" translate="RESOURCE_CATEGORY_HEADER"></span>
            </h4>
            <span data-ng-click="createCategoryModal(null)" translate="ADD_CATEGORY" data-tests-id="newcategory"></span>

            <perfect-scrollbar class="perfect-scrollbar">
                <ul>
                    <li data-ng-repeat="category in categoriesToShow"
                        data-ng-class="{'selected': selectedCategory === category, 'gray': selectedSubCategory}"
                        data-ng-click="selectCategory(category)"
                        data-tests-id="{{ type === SERVICE ? 'servicecategory' : 'resourcecategory' }}">
                        {{category.name}}
                    </li>
                </ul>
            </perfect-scrollbar>
        </div>

        <div class="col-sm-6">

            <h4><span translate="SUBCATEGORY_HEADER" data-tests-id="subcategoryheader"></span></h4>
            <span data-ng-if="type === RESOURCE && selectedCategory" data-ng-click="selectedCategory ? createCategoryModal(selectedCategory) : ''" translate="ADD_SUBCATEGORY" data-tests-id="newsubcategory"></span>

            <perfect-scrollbar class="perfect-scrollbar">
                <ul>
                    <li data-ng-repeat="subcategory in selectedCategory.subcategories"
                        data-ng-class="{'selected': selectedSubCategory === subcategory}"
                        data-ng-click="selectSubCategory(subcategory)"
                        data-tests-id="subcategory">
                        {{subcategory.name}}
                    </li>
                </ul>
            </perfect-scrollbar>
        </div>

    </div>
</div>