table.html 4.59 KB
Newer Older
André Anjos's avatar
André Anjos committed
1
2
3
{% comment %}
 * Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
 * Contact: beat.support@idiap.ch
4
 *
André Anjos's avatar
André Anjos committed
5
 * This file is part of the beat.web module of the BEAT platform.
6
 *
André Anjos's avatar
André Anjos committed
7
8
9
10
 * Commercial License Usage
 * Licensees holding valid commercial BEAT licenses may use this file in
 * accordance with the terms contained in a written agreement between you
 * and Idiap. For further information contact tto@idiap.ch
11
 *
André Anjos's avatar
André Anjos committed
12
13
14
15
16
17
 * Alternatively, this file may be used under the terms of the GNU Affero
 * Public License version 3 as published by the Free Software and appearing
 * in the file LICENSE.AGPL included in the packaging of this file.
 * The BEAT platform is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.
18
 *
André Anjos's avatar
André Anjos committed
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
 * You should have received a copy of the GNU Affero Public License along
 * with the BEAT platform. If not, see http://www.gnu.org/licenses/.
{% endcomment %}
{% load ui_tags %}
{% load search_tags %}

<div class="row filter">

  <div class="col-sm-10 vertical-center">

    {% if objects %}
    <div id="filters" class="form-inline">

      <div class="form-group form-group-sm">
        <div class="input-group input-group-sm">
          <span class="input-group-addon" id="basic-addon1"><i class="fa fa-search"></i></span>
          <input type="text" tabindex="2" id="text-filter" class="form-control" placeholder="Filter rows..." aria-describedby="basic-addon1">
        </div>
      </div>

      <div class="form-group form-group-sm">
        <label for="privacy-filter" class="control-label">Privacy:</label>
          <select id="privacy-filter" class="form-control">
            <option selected>All</option>
            <option>Public</option>
            <option>Shared</option>
            <option>Usable</option>
            {% if owner %}<option>Private</option>{% endif %}
          </select>
      </div>

    </div>
    {% endif %}

    <!-- Notice there can be no div space if vertical-center is used -->
  </div><div class="col-sm-2 vertical-center">

    {% if owner %}
    <a class="btn btn-success btn-sm pull-right" href="{% url 'search:search' %}?query="><i class="fa fa-plus fa-lg"></i> New</a>
    {% endif %}

  </div><!-- col -->

</div><!-- row -->

<div class="row">

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

    {% if objects %}
    <div class="scrollable table-responsive">
      <table id="{{ panel_id }}" class="table table-hover table-condensed object-list search-list">
        <thead>
          <tr>
            <th class="privacy"></th>
            <th class="leaderboard"></th>
            <th class="date">Updated</th>
            <th>Name</th>
            <th class="actions">Actions</th>
          </tr>
        </thead>
        <tbody>
          {% for obj in objects %}
          <tr>
            <td class="privacy">
              {% if obj.get_sharing_display == 'Private' %}
              <i title="{{ obj.get_sharing_display }}" data-toggle="tooltip" data-placement="top" class="fa fa-user fa-2x"></i>
              {% elif obj.get_sharing_display == 'Shared' %}
              <i title="{{ obj.get_sharing_display }}" data-toggle="tooltip" data-placement="top" class="fa fa-users fa-2x"></i>
              {% elif obj.get_sharing_display == 'Usable' %}
              <i title="{{ obj.get_sharing_display }}" data-toggle="tooltip" data-placement="top" class="fa fa-cog fa-2x"></i>
              {% else %}
              <i title="{{ obj.get_sharing_display }}" data-toggle="tooltip" data-placement="top" class="fa fa-globe fa-2x"></i>
              {% endif %}
            </td>
            <td class="leaderboard">
              {% if obj.has_leaderboard %}
              <i data-toggle="tooltip" data-placement="top" title="Leaderboard enabled" class="fa fa-table fa-2x"></i>
              {% endif %}
            </td>
            <td class="date">{{ obj.creation_date|date }}</td>
            <td class="name"><a href="{% url 'search:view' obj.author.username obj.name %}" data-toggle="tooltip" data-placement="top" title="Click to view">{{ obj.fullname }} {% if obj.short_description %}<span class='help'>({{ obj.short_description }})</span>{% endif %}</a></td>
            <td class="actions">
              {% search_actions obj True %}
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
    {% endif %}

  </div><!-- col -->

</div><!-- row -->
{% if not objects %}
<div class="row">

  <div class="col-sm-12 not-found">
    No search found
  </div>

</div><!-- row -->
{% endif %} <!-- if not objects -->

{% filter_script panel_id "text-filter" "privacy-filter" %}