summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/layers.html
blob: 281b72aec57fb5c5cf305b5db3bf4768d04aa5cb (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{% extends "baseprojectpage.html" %}
{% load projecttags %}
{% load humanize %}

{% block localbreadcrumb %}
<li>Layers</li>
{% endblock %}

{% block projectinfomain %}
                <div class="page-header">
                    <h1>
                        All layers
                        <i class="icon-question-sign get-help heading-help" title="This page lists all the layers compatible with Yocto Project 1.7 'Dxxxx' that Toaster knows about. They include community-created layers suitable for use on top of OpenEmbedded Core and any layers you have imported"></i>
                     </h1>
                </div>
                <!--div class="alert">
                    <div class="input-append" style="margin-bottom:0px;">
                        <input class="input-xxlarge" type="text" placeholder="Search layers" value="browser" />
                        <a class="add-on btn">
                            <i class="icon-remove"></i>
                        </a>
                        <button class="btn" type="button">Search</button>
                        <a class="btn btn-link" href="#">Show all layers</a>
                    </div>
                </div-->
                <div id="layer-added" class="alert alert-info lead" style="display:none;"></div>
                <div id="layer-removed" class="alert alert-info lead" style="display:none;">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <strong>1</strong> layer deleted from <a href="project-with-targets.html">your project</a>: <a href="#">meta-aarch64</a>
                </div>


{% include "basetable_top.html" %}
    {% for lv in objects %}
    <tr class="data">
            <td class="layer"><a href="{% url 'layerdetails' lv.id %}">{{lv.layer.name}}</a></td>
            <td class="description">{{lv.layer.summary}}</td>
            <td class="source"><a href="{% url 'layerdetails' lv.pk %}">{{lv.layer_source.name}}</a></td>
            <td class="git-repo"><a href="{% url 'layerdetails' lv.pk %}"><code>{{lv.layer.layer_index_url}}</code></a></td>
            <td class="git-subdir" style="display: table-cell;"><a href="{% url 'layerdetails' lv.pk %}"><code>{{lv.dirpath}}</code></a></td>
            <td class="branch">{% if lv.branch %}{{lv.branch}}{% else %}{{lv.up_branch.name}}{% endif %}</td>
            <td class="dependencies">{% for lvs in lv.dependencies.all %}{{lvs.layer.name}}<br/>{%endfor%}</td>
            <td class="add-layers">
                <button id="remove-layer-{{lv.pk}}" class="btn btn-danger btn-block remove-layer" title="1 layer deleted" style="display:none;">
                    <i class="icon-trash"></i>
                    Delete layer
                </button>
                <button id="add-layer-{{lv.pk}}" class="btn  btn-block add-layer" title="1 layer added">
                    <i class="icon-plus"></i>
                    Add layer
                </button>
            </td>
     </tr>
    {% endfor %}
{% include "basetable_bottom.html" %}

    <!-- Modals -->

    <!-- 'Layer dependencies modal' -->
    <div id="dependencies-message" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
            <h3>meta-acer dependencies</h3>
        </div>
        <div class="modal-body">
            <p><strong>meta-acer</strong> depends on some layers that are not added to your project. Select the ones you want to add:</p>
            <ul class="unstyled">
                <li>
                    <label class="checkbox">
                        <input type="checkbox" checked="checked">
                        meta-android
                    </label>
                </li>
                <li>
                    <label class="checkbox">
                        <input type="checkbox" checked="checked">
                        meta-oe
                    </label>
                </li>
            </ul>
        </div>
        <div class="modal-footer">
            <button id="add-layer-dependencies" type="submit" class="btn btn-primary" data-dismiss="modal" >Add layers</button>
            <button class="btn" data-dismiss="modal">Cancel</button>
        </div>
    </div>

    <script src="assets/js/jquery-1.9.1.min.js" type='text/javascript'></script>
    <script src="assets/js/jquery.tablesorter.min.js" type='text/javascript'></script>
    <script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="assets/js/bootstrap.min.js" type='text/javascript'></script>
    <script src="assets/js/prettify.js" type='text/javascript'></script>
    <script src="assets/js/jit.js" type='text/javascript'></script>
    <script src="assets/js/main.js" type='text/javascript'></script>

    <script>
     $(document).ready(function() {

        //show or hide selected columns on load
        $("input:checkbox").each(function(){
            var selectedType = $(this).val();
            if($(this).is(":checked")){
                $("."+selectedType).show();
            }
            else{
                $("."+selectedType).hide();
            }
        });

        // enable add layer button
        $('#add-layer-with-deps').removeAttr('disabled');

        //edit columns functionality (show / hide table columns)
        $("input:checkbox").change();
            $("input:checkbox").change(function(){
                var selectedType = $(this).val();
                    if($(this).is(":checked")){
                        $("."+selectedType).show();
                    }
                    else{
                        $("."+selectedType).hide();
                    }
            });

        //turn edit columns dropdown into a multi-select menu
        $('.dropdown-menu input, .dropdown-menu label').click(function(e) {
            e.stopPropagation();
        });

        //show tooltip with applied filter
        $('#filtered').tooltip({container:'table', placement:'bottom', delay:{hide:1500}, html:true});

        $('#filtered').click(function() {
            $(this).tooltip('hide');
        });

        //show layer added tooltip
        $("#remove-layer, #add-layer, #add-layer-with-deps2").tooltip({ trigger: 'manual' });

        // add layer without dependencies
        $("#add-layer").click(function(){
            $('#layer-removed').hide();
            $('#layer-added').html('<button type="button" class="close" data-dismiss="alert">&times;</button><strong>1</strong> layer added to <a href="project-with-targets.html">your project</a>: <a href="#">meta-aarch64</a>').fadeIn();
            $('#add-layer').tooltip('show');
            $("#add-layer").hide();
            $(".add-layers .tooltip").delay(2000).fadeOut(function(){
                $("#remove-layer").delay(300).fadeIn();
            });
        });

        // add layer with dependencies
        $(document).on("click", "#add-layer-dependencies", function() {
            $('#layer-removed').hide();
            $('#layer-added').html('<button type="button" class="close" data-dismiss="alert">&times;</button><strong>3</strong> layers added to <a href="project-with-targets.html">your project</a>: <a href="#">meta-acer</a> and its dependencies <a href="#">meta-android</a> and <a href="#">meta-oe</a>').delay(400).fadeIn(function(){
                $('#add-layer-with-deps').tooltip('show');
                $("#add-layer-with-deps, #add-layer-with-deps").hide();
                $(".add-layers .tooltip").delay(2000).fadeOut(function(){
                    $("#remove-layer-with-deps").delay(300).fadeIn();
                });
            });
        });

        // delete layer
        $("#remove-layer").click(function(){
            $('#layer-added').hide();
            $('#layer-removed').show();
            $('#remove-layer').tooltip('show');
            $("#remove-layer").hide();
            $(".add-layers .tooltip").delay(2000).fadeOut(function(){
                $("#add-layer").delay(300).fadeIn();
            });
        });

     });

</script>

{% endblock %}