content.tpl 1.56 KB
Newer Older
1
<div class="blockinstance-content">
2
{if $tasks.data}
3
<table id="tasktable_{$blockid}">
4
5
6
    <colgroup width="50%" span="2"></colgroup>
    <thead>
        <tr>
7
8
9
            <th class="c1">{str tag='completiondate' section='artefact.plans'}</th>
            <th class="c2">{str tag='title' section='artefact.plans'}</th>
            <th class="c3">{str tag='completed' section='artefact.plans'}</th>
10
11
12
        </tr>
    </thead>
    <tbody>
13
    {$tasks.tablerows|safe}
14
15
    </tbody>
</table>
16
{if $tasks.pagination}
17
<div id="plans_page_container">{$tasks.pagination|safe}</div>
18
19
{/if}
{if $tasks.pagination_js}
20
<script>
21
{literal}
22
function rewriteTaskTitles() {
23
24
25
26
27
    forEach(
{/literal}
        getElementsByTagAndClassName('a', 'task-title','tasktable_{$blockid}'),
{literal}
        function(element) {
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
            connect(element, 'onclick', function(e) {
                e.stop();
                var description = getFirstElementByTagAndClassName('div', 'task-desc', element.parentNode);
                toggleElementClass('hidden', description);
            });
        }
    );
}

addLoadEvent(function() {{/literal}
    {$tasks.pagination_js|safe}
    removeElementClass('plans_page_container', 'hidden');
{literal}}{/literal});

function TaskPager_{$blockid}() {literal}{
    var self = this;
    paginatorProxy.addObserver(self);
    connect(self, 'pagechanged', rewriteTaskTitles);
}
47
{/literal}
48
49
var taskPager_{$blockid} = new TaskPager_{$blockid}();
addLoadEvent(rewriteTaskTitles);
50
</script>
51
{/if} {* pagination_js *}
52
{else}
53
    <p>{str tag='notasks' section='artefact.plans'}</p>
54
{/if}
55
</div>