summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/layers.html
blob: e6861c270862778f5ef728a000303507e24b2787 (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
{% extends "baseprojectpage.html" %}
{% load projecttags %}
{% load humanize %}
{% load static %}

{% block localbreadcrumb %}
<li>All compatible layers</li>
{% endblock %}


{% block projectinfomain %}

<script src="{% static 'js/layerBtn.js' %}"></script>
<script>

  $(document).ready(function (){
    var ctx = {
      projectLayers : {{projectlayerset}},
    };

    try {
      layerBtnsInit(ctx);
    } catch (e) {
      document.write("Sorry, An error has occurred loading this page");
      console.warn(e);
    }
  });
</script>

                <div class="page-header">
                    <h1>
  {% if request.GET.filter and objects.paginator.count >  0 or request.GET.search and objects.paginator.count >  0 %}
      {{objects.paginator.count}} layer{{objects.paginator.count|pluralize}} found
  {% elif request.GET.filter and objects.paginator.count ==  0 or request.GET.search and objects.paginator.count == 0 %}
      No layers found
  {%else%}
      All compatible layers
  {%endif%}
                        <i class="icon-question-sign get-help heading-help" title="This page lists all the layers compatible with the release selected for this project, which is {{project.release.description}}"></i>
                     </h1>
                </div>

  <div id="zone1alerts" style="display:none">
    <div class="alert alert-info lead">
      <button type="button" class="close" id="hide-alert">&times;</button>
      <span id="alert-msg"></span>
    </div>
  </div>

{% if objects.paginator.count == 0 %}
  {% if request.GET.filter or request.GET.search %}
  <div class="row-fluid">
      <div class="alert">
        <form class="no-results input-append" id="searchform">
            <input id="search" name="search" class="input-xxlarge" type="text" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{% endif %}
            <button class="btn" type="submit" value="Search">Search</button>
            <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all layers</button>
        </form>
      </div>
  </div>
  {% else %}
    <div class="alert alert-info lead">
      <p>Toaster has no layer information. To generate layer information you can:</p>
      <ul>
       <li><a href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#layer-source">Configure a layer source</a></li>
       <li><a href="{% url 'importlayer' %}">Import a layer</a></li>
      </ul>
    </div>
  {% endif %}

{% else %}

{% include "basetable_top_layers.html" %}
    {% for o in objects %}
    <tr class="data">
            <td class="layer"><a href="{% url 'layerdetails' project.id o.id %}">{{o.layer.name}}</a></td>
            <td class="description">{% if o.layer.summary %}{{o.layer.summary}}{%endif%}</td>
            <td class="git-repo"><a href="{% url 'layerdetails' project.id o.pk %}"><code>{{o.layer.vcs_url}}</code></a>
            {% if o.get_vcs_link_url %}
            <a target="_blank" href="{{ o.get_vcs_link_url }}"><i class="icon-share get-info"></i></a>
        {% endif %}
        </td>
            <td class="git-subdir" style="display: table-cell;"><a href="{% url 'layerdetails' project.id o.pk %}"><code>{{o.dirpath}}</code></a>
                {% if o.dirpath and o.get_vcs_dirpath_link_url %}
            <a target="_blank" href="{{ o.get_vcs_dirpath_link_url }}"><i class="icon-share get-info"></i></a>
                {% endif %}
        </td>
            <td class="branch">
                {% with vcs_ref=o.get_vcs_reference %}
                  {% if vcs_ref|is_shaid %}
                    <a class="btn" data-content="<ul class='unstyled'> <li>{{vcs_ref}}</li> </ul>">
                      {{vcs_ref|truncatechars:10}}
                    </a>
                  {% else %}
                    {{vcs_ref}}
                  {% endif %}
                {% endwith %}
            </td>
            <td class="dependencies">
        {% with ods=o.dependencies.all%}
            {% if ods.count %}
                    <a class="btn"
                        title="<a href='{% url "layerdetails" project.id o.pk %}'>{{o.layer.name}}</a> dependencies"
                        data-content="<ul class='unstyled'>
                          {% for i in ods%}
                            <li><a href='{% url "layerdetails" project.id i.depends_on.pk %}'>{{i.depends_on.layer.name}}</a></li>
                          {% endfor %}
                        </ul>">
                        {{ods.count}}
                    </a>
            {% endif %}
        {% endwith %}
            </td>
            {% if project %}
            <td class="add-del-layers" data-value="{{o.pk}}">
                <button class="btn btn-danger btn-block layer-exists-{{o.pk}} layerbtn" style="display:none;" data-layer='{ "id": {{o.pk}}, "name":  "{{o.layer.name}}", "url": "{%url 'layerdetails' project.id o.pk%}"}' data-directive="remove" >
                    <i class="icon-trash"></i>
                    Delete layer
                </button>
                <button class="btn btn-block layer-add-{{o.pk}} layerbtn" data-layer='{ "id": {{o.pk}}, "name":  "{{o.layer.name}}", "url": "{%url 'layerdetails' project.id o.pk%}"}' data-directive="add">
                    <i class="icon-plus"></i>
                    Add layer
                </button>
            </td>
            {% endif %}
     </tr>
    {% endfor %}
{% include "basetable_bottom.html" %}

{%endif%}

{% endblock %}