Improve page contacblock for frio theme
This commit is contained in:
parent
8826ece55e
commit
75181322ba
4 changed files with 44 additions and 16 deletions
|
@ -441,6 +441,7 @@ function admin_page_contactblock(App $a)
|
||||||
'$baseurl' => System::baseUrl(true),
|
'$baseurl' => System::baseUrl(true),
|
||||||
|
|
||||||
'$contacts' => $contacts,
|
'$contacts' => $contacts,
|
||||||
|
'$total_contacts' => tt('%s total blocked contact', '%s total blocked contacts', $total),
|
||||||
'$paginate' => paginate($a),
|
'$paginate' => paginate($a),
|
||||||
'$contacturl' => ['contact_url', t("Profile URL"), '', t("URL of the remote contact to block.")],
|
'$contacturl' => ['contact_url', t("Profile URL"), '', t("URL of the remote contact to block.")],
|
||||||
));
|
));
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function selectall(cls) {
|
function selectall(cls) {
|
||||||
$('.' + cls).prop('checked', true);
|
$('.' + cls).prop('checked', true);
|
||||||
|
|
31
view/theme/frio/js/mod_admin.js
Normal file
31
view/theme/frio/js/mod_admin.js
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/**
|
||||||
|
* @brief Javascript for the admin module
|
||||||
|
*/
|
||||||
|
$(function() {
|
||||||
|
$('body').on('click', '.selectall', function() {
|
||||||
|
selectall($(this).data('selectAll'));
|
||||||
|
});
|
||||||
|
$('body').on('click', '.selectnone', function() {
|
||||||
|
selectnone($(this).data('selectNone'));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('change', 'input[type=checkbox].select', function() {
|
||||||
|
$this = $(this);
|
||||||
|
if ($this.prop('checked')) {
|
||||||
|
selectall($this.data('selectClass'));
|
||||||
|
$this.attr('title', $this.data('selectNone'));
|
||||||
|
} else {
|
||||||
|
selectnone($this.data('selectClass'));
|
||||||
|
$this.attr('title', $this.data('selectAll'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function selectall(cls) {
|
||||||
|
$('.' + cls).prop('checked', true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function selectnone(cls) {
|
||||||
|
$('.' + cls).prop('checked', false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
|
@ -1,14 +1,4 @@
|
||||||
|
<script type="text/javascript" src="view/theme/frio/js/mod_admin.js"></script>
|
||||||
<script>
|
|
||||||
function selectall(cls) {
|
|
||||||
$('.' + cls).prop('checked', true);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
function selectnone(cls) {
|
|
||||||
$('.' + cls).prop('checked', false);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<div id="adminpage">
|
<div id="adminpage">
|
||||||
<h1>{{$title}} - {{$page}}</h1>
|
<h1>{{$title}} - {{$page}}</h1>
|
||||||
<p>{{$description}}</p>
|
<p>{{$description}}</p>
|
||||||
|
@ -20,7 +10,7 @@
|
||||||
<table id="contactblock" class="table table-condensed table-striped">
|
<table id="contactblock" class="table table-condensed table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th><input type="checkbox" class="select contacts_ckbx" data-select-class="contacts_ckbx" data-select-all="{{$select_all}}" data-select-none="{{$select_none}}" title="{{$select_all}}"/></th>
|
||||||
{{foreach $th_contacts as $th}}
|
{{foreach $th_contacts as $th}}
|
||||||
<th>
|
<th>
|
||||||
{{$th}}
|
{{$th}}
|
||||||
|
@ -39,10 +29,17 @@
|
||||||
</tr>
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td><input type="checkbox" class="select contacts_ckbx" data-select-class="contacts_ckbx" data-select-all="{{$select_all}}" data-select-none="{{$select_none}}" title="{{$select_all}}"/></td>
|
||||||
|
<td colspan="3">
|
||||||
|
{{$total_contacts}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
<p><a href="#" onclick="return selectall('contacts_ckbx');">{{$select_all}}</a> | <a href="#" onclick="return selectnone('contacts_ckbx');">{{$select_none}}</a></p>
|
<div class="submit"><button type="submit" class="btn btn-small btn-default" name="page_contactblock_unblock" value="1">{{$unblock|escape:'html'}}</button></div>
|
||||||
{{$paginate}}
|
{{$paginate}}
|
||||||
<div class="submit"><input type="submit" name="page_contactblock_unblock" value="{{$unblock|escape:'html'}}" /></div>
|
|
||||||
{{else}}
|
{{else}}
|
||||||
<p>{{$no_data|escape:'html'}}</p>
|
<p>{{$no_data|escape:'html'}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -58,6 +55,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="submit"><input type="submit" name="page_contactblock_block" value="{{$submit|escape:'html'}}" /></div>
|
<div class="submit"><button type="submit" class="btn btn-primary" name="page_contactblock_block" value="1">{{$submit|escape:'html'}}</button></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue