archives.tpl 3.82 KB
Newer Older
Naomi Guyer's avatar
Naomi Guyer committed
1
{include file="header.tpl"}
2
<div class="panel panel-body">
Naomi Guyer's avatar
Naomi Guyer committed
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
    <form action="{$WWWROOT}admin/groups/archive.php" method="post">
        {if $search->sortby}
        <input type="hidden" name="sortby" id="sortby" value="{$search->sortby}">
        {/if}
        {if $search->sortdir}
        <input type="hidden" name="sortdir" id="sortdir" value="{$search->sortdir}">
        {/if}
        {if $limit}
        <input type="hidden" name="limit" id="limit" value="{$limit}">
        {/if}
        <div class="fr">
            <a id="csvlink" href="{$WWWROOT}admin/groups/archivescsvdownload.php{if $.request.institution}?institution={$.request.institution}{/if}" target="_blank">{str tag=exportdataascsv section=admin}</a>
        </div>
        <div class="usersearchform">
            <label for="query">{str tag='usersearch' section='admin'}:</label>
            <input type="text" name="query" id="query"{if $search->query} value="{$search->query}"{/if}>
            {if count($institutions) > 1}
            <span class="institutions">
                <label for="institution">{str tag='Institution' section='admin'}:</label>
                <select name="institution" id="institution">
                    <option value="all"{if !$.request.institution} selected="selected"{/if}>{str tag=All}</option>
                    {foreach from=$institutions item=i}
                    <option value="{$i->name}"{if $i->name == $.request.institution}" selected="selected"{/if}>{$i->displayname}</option>
                    {/foreach}
                </select>
            </span>
            {/if}
            <button id="query-button" class="btn-search" type="submit">{str tag="go"}</button>
        </div>
32
        <script type="application/javascript">
Naomi Guyer's avatar
Naomi Guyer committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
        $j(function() {
            var csvlink = '{$WWWROOT}admin/groups/archivescsvdownload.php';
            $j('#institution').on('change', function() {
                if ($j(this).val() != 'all') {
                    $j('#csvlink').attr('href', csvlink + '?institution=' + $j(this).val());
                }
                else {
                    $j('#csvlink').attr('href', csvlink);
                }
            });
        });
        </script>
    </form>
    <div id="results" class="section">
        <h2 id="resultsheading">{str tag="Results"}</h2>
        {if $results}
        <table id="searchresults" class="tablerenderer fullwidth listing">
            <thead>
                <tr>
                    {foreach from=$columns key=f item=c}
                    <th class="{if $c.sort}search-results-sort-column{if $f == $sortby} {$sortdir}{/if}{/if}{if $c.class} {$c.class}{/if}">
                        {if $c.sort}
                            <a href="{$searchurl}&sortby={$f}&sortdir={if $f == $sortby && $sortdir == 'asc'}desc{else}asc{/if}">
                                {$c.name}
Naomi Guyer's avatar
Naomi Guyer committed
57
                                <span class="accessible-hidden sr-only">({str tag=sortby} {if $f == $sortby && $sortdir == 'asc'}{str tag=descending}{else}{str tag=ascending}{/if})</span>
Naomi Guyer's avatar
Naomi Guyer committed
58
59
60
61
                            </a>
                        {else}
                            {$c.name}
                            {if $c.accessible}
Naomi Guyer's avatar
Naomi Guyer committed
62
                                <span class="accessible-hidden sr-only">{$c.accessible}</span>
Naomi Guyer's avatar
Naomi Guyer committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
                            {/if}
                        {/if}
                        {if $c.help}
                            {$c.helplink|safe}
                        {/if}
                        {if $c.headhtml}<div class="headhtml">{$c.headhtml|safe}</div>{/if}
                    </th>
                    {/foreach}
                </tr>
            </thead>
            <tbody>
                {$results|safe}
            </tbody>
        </table>
        {$pagination|safe}
        {else}
            <div>{str tag="noresultsfound"}</div>
        {/if}
    </div>
82
</div>
Naomi Guyer's avatar
Naomi Guyer committed
83
{include file="footer.tpl"}