/
showall.bootstrap3.tpl
132 lines (126 loc) · 5.79 KB
/
showall.bootstrap3.tpl
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
{*
* Copyright (c) 2004-2014 OIC Group, Inc.
*
* This file is part of Exponent
*
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* GPL: http://www.gnu.org/licenses/gpl.txt
*
*}
{if !$error}
{*{css unique="data-view" corecss="button"}*}
{*{/css}*}
{css unique="manage-groups" corecss="datatables-tools"}
{/css}
<div class="module forms showall">
<{$config.item_level|default:'h2'}>{$title}</{$config.item_level|default:'h2'}>
{if $description != ""}
{$description}
{/if}
{permissions}
<div class="module-actions">
{if $permissions.create}
{icon class=add action=enterdata forms_id=$f->id text='Add record'|gettext}
  |  
{/if}
{icon class="downloadfile" action=export_csv id=$f->id text="Export as CSV"|gettext}
{export_pdf_link landscapepdf=1 limit=999 prepend='  |  '}
{if $permissions.manage}
  |  
{icon class=configure action=design_form id=$f->id text="Design Form"|gettext}
  |  
{icon action=manage text="Manage Forms"|gettext}
{if !empty($filtered)}
  |  <span style="background-color: yellow; font-weight: bold;margin-bottom: 5px">{'Records Filtered'|gettext}: '{$filtered}'</span>
{/if}
{/if}
</div>
{br}
{/permissions}
{*{$page->links}*}
<div>
<table id="forms-showall" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
{*{$page->header_columns}*}
{foreach from=$page->columns item=column key=name name=column}
<th{if $column@first} data-class="expand"{elseif $column@iteration < 4} data-hide="phone"{elseif $column@iteration > 7} data-hide="always"{else} data-hide="phone,tablet"{/if}>{$name}</th>
{/foreach}
<div class="item-actions">
<th>{'Actions'|gettext}</th>
</div>
</tr>
</thead>
<tbody>
{foreach from=$page->records item=fields key=ukey name=fields}
<tr>
{foreach from=$page->columns item=column key=field name=column}
<td>
{if $smarty.foreach.column.iteration == 1}
<a href={link action=show forms_id=$f->id id=$fields.id}>{$fields.$column}</a>
{elseif $column == 'email'}
<a href="mailto:{$fields.$column}">{$fields.$column}</a>
{else}
{$fields.$column}
{/if}
</td>
{/foreach}
<div class="item-actions">
<td>
{icon img="view.png" action=show forms_id=$f->id id=$fields.id title='View all data fields for this record'|gettext}
{if $permissions.edit}
{icon img="edit.png" action=enterdata forms_id=$f->id id=$fields.id title='Edit this record'|gettext}
{/if}
{if $permissions.delete}
{icon img="delete.png" action=delete forms_id=$f->id id=$fields.id title='Delete this record'|gettext}
{/if}
</td>
</div>
</tr>
{/foreach}
</tbody>
</table>
</div>
{*{$page->links}*}
{*<a class="{button_style}" href="{$backlink}">{'Back'|gettext}</a>*}
</div>
{/if}
{script unique="form-showall" jquery='jquery.dataTables,dataTables.tableTools,dataTables.bootstrap3,datatables.responsive'}
{literal}
$(document).ready(function() {
var responsiveHelper;
var breakpointDefinition = {
tablet: 1024,
phone : 480
};
var tableContainer = $('#forms-showall');
var table = tableContainer.dataTable({
// sDom: 'T<"row-fluid"<"span6"l><"span6"f>r>t<"row-fluid"<"span6"i><"span6"p>>',
aoColumnDefs: [
{ bSearchable: false, "aTargets": [ -1 ] },
{ bSortable: false, "aTargets": [ -1 ] },
],
autoWidth: false,
preDrawCallback: function () {
// Initialize the responsive datatables helper once.
if (!responsiveHelper) {
responsiveHelper = new ResponsiveDatatablesHelper(tableContainer, breakpointDefinition);
}
},
rowCallback: function (nRow) {
responsiveHelper.createExpandIcon(nRow);
},
drawCallback: function (oSettings) {
responsiveHelper.respond();
}
});
var tt = new $.fn.dataTable.TableTools( table, { sSwfPath: EXPONENT.JQUERY_RELATIVE+"addons/swf/copy_csv_xls_pdf.swf" } );
$( tt.fnContainer() ).insertBefore('div.dataTables_wrapper');
} );
{/literal}
{/script}