aboutsummaryrefslogtreecommitdiffstats
path: root/templates/layerindex/duplicates.html
blob: 0ebfe1185aeee6c8e73f96c67f8c99d06ef40076 (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
{% extends "base_toplevel.html" %}
{% load i18n %}

{% comment %}

  layerindex-web - duplicates page template

  Copyright (C) 2013-2014 Intel Corporation
  Licensed under the MIT license, see COPYING.MIT for details

{% endcomment %}


<!--
{% block title_append %} - duplicates{% endblock %}
-->

{% block content %}
{% autoescape on %}

        <div class="row-fluid">
            <div class="span12">

    <div class="btn-group pull-right">
        <a href="#" class="btn dropdown-toggle" data-toggle="dropdown">
        Branch: <b>{{ url_branch }}</b>
        <b class="caret"></b>
        </a>
        <ul class="dropdown-menu">
            {% for branch in all_branches %}
                <li><a href="{% url this_url_name branch.name %}">
                    {% if branch.name = url_branch %}<b>{% endif %}
                    {{ branch.name }}
                    {% if branch.short_description %}
                    ({{ branch.short_description }})
                    {% endif %}
                    {% if branch.name = url_branch %}</b>{% endif %}
                </a></li>
            {% endfor %}
        </ul>

        <div id="layerDialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="layerDialogLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="layerDialogLabel">Select layers to include</h3>
            </div>
            <form action="" method="get">
                <div class="modal-body">
                    <div class="scrolling">
                        <table><tbody>
                            {% for layerbranch in layers %}
                                <tr>
                                    <td class="checkboxtd"><input
                                        type="checkbox"
                                        class="filterlayercheckbox"
                                        name="l"
                                        value="{{ layerbranch.layer.id }}" id="id_layer_{{layerbranch.layer.id}}"
                                        {% if showlayers and layerbranch.layer.id in showlayers %}
                                            checked
                                        {% endif %}
                                        />
                                    </td>
                                    <td><label for="id_layer_{{layerbranch.layer.id}}">{{ layerbranch.layer.name }}</label></td>
                                </tr>
                            {% endfor %}
                        </tbody></table>
                    </div>
                    <div class="buttonblock">
                    <button type="button" class="btn" id="id_select_all">Select all</button>
                    <button type="button" class="btn buttonblock-btn" id="id_select_none">Select none</button>
                    </div>
                </div>
                <div class="modal-footer">
                    <input type="submit" value="Filter" class='btn btn-primary' />
                    <button class="btn" id="id_cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
                </div>
            </form>
        </div>

        <a href="#layerDialog" role="button" class="btn nav-spacer" data-toggle="modal">Filter layers {% if showlayers %}<span class="badge badge-success">{{ showlayers|length }}</span>{% endif %}</a>

    </div>

                <h2>Duplicate recipes</h2>
{% if recipes %}
                <p>Recipes with the same name in different layers:</p>
                <table class="table table-striped table-bordered recipestable">
                    <thead>
                        <tr>
                            <th>Recipe name</th>
                            <th>Version</th>
                            <th class="span9">Description</th>
                            <th>Layer</th>
                        </tr>
                    </thead>

                    <tbody>
                        {% for recipe in recipes %}
                            <tr {% if recipe.preferred_count > 0 %}class="muted"{% endif %}>
                                <td><a href="{% url 'recipe' recipe.id %}">{{ recipe.name }}</a></td>
                                <td>{{ recipe.pv }}</td>
                                <td>{{ recipe.short_desc }}</td>
                                <td><a href="{% url 'layer_item' url_branch recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
{% else %}
    <p>No duplicate recipes in database.</p>
{% endif %}
            </div>
        </div>


        <div class="row-fluid">
            <div class="span12">
                <h2>Duplicate classes</h2>
{% if classes %}
                <p>Classes with the same name in different layers:</p>
                <table class="table table-striped table-bordered recipestable">
                    <thead>
                        <tr>
                            <th>Class name</th>
                            <th>Layer</th>
                        </tr>
                    </thead>

                    <tbody>
                        {% for class in classes %}
                            <tr>
                                <td><a href="{{ class.vcs_web_url }}">{{ class.name }}</a></td>
                                <td><a href="{% url 'layer_item' 'master' class.layerbranch.layer.name %}">{{ class.layerbranch.layer.name }}</a></td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
{% else %}
    <p>No duplicate classes in database.</p>
{% endif %}
            </div>
        </div>


{% endautoescape %}

{% endblock %}


{% block scripts %}
<script>
    $(document).ready(function() {
        firstfield = $("#filter-form input:text").first()
        if( ! firstfield.val() )
            firstfield.focus()
    });
    $('#id_select_all').click(function (e) {
        $('.filterlayercheckbox').attr('checked', true);
    });
    $('#id_select_none').click(function (e) {
        $('.filterlayercheckbox').attr('checked', false);
    });
    $('#id_cancel').click(function (e) {
        $('.filterlayercheckbox').attr('checked', false);
        showlayers = {{ showlayers }}
        for(i in showlayers) {
            $('#id_layer_' + showlayers[i]).attr('checked', true);
        }
    });
</script>
{% endblock %}