user contacts: fix #797 , add searching in url and nickname, add batch actions

This commit is contained in:
Fabrixxm 2013-12-17 05:19:06 -05:00
commit 9febcedf93
10 changed files with 206 additions and 56 deletions

View file

@ -1,8 +1,3 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}" >
<div class="contact-entry-photo-wrapper" >
@ -12,15 +7,16 @@
<a href="{{$contact.url}}" title="{{$contact.img_hover}}" /><img src="{{$contact.thumb}}" {{$contact.sparkle}} alt="{{$contact.name}}" /></a>
<input type="checkbox" class="contact-select" name="contact_batch[]" value="{{$contact.id}}">
{{if $contact.photo_menu}}
<span onclick="openClose('contact-photo-menu-{{$contact.id}}');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-{{$contact.id}}">menu</span>
<div class="contact-photo-menu" id="contact-photo-menu-{{$contact.id}}">
<ul>
{{foreach $contact.photo_menu as $c}}
{{foreach $contact.photo_menu as $k=>$c}}
{{if $c.2}}
<li><a target="redir" href="{{$c.1}}">{{$c.0}}</a></li>
<li><a class="{{$k}}" target="redir" href="{{$c.1}}">{{$c.0}}</a></li>
{{else}}
<li><a href="{{$c.1}}">{{$c.0}}</a></li>
<li><a class="{{$k}}" href="{{$c.1}}">{{$c.0}}</a></li>
{{/if}}
{{/foreach}}
</ul>

View file

@ -1,8 +1,4 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<h1>{{$header}}{{if $total}} ({{$total}}){{/if}}</h1>
{{if $finding}}<h4>{{$finding}}</h4>{{/if}}
@ -18,11 +14,44 @@
{{$tabs}}
<form action="{{$baseurl}}/contacts/batch/" method="POST">
{{foreach $contacts as $contact}}
{{include file="contact_template.tpl"}}
{{/foreach}}
<div id="contact-edit-end"></div>
<div class="submit">
{{foreach $batch_actions as $n=>$l}}
<input class="batch-action" name="{{$n}}" value="{{$l}}" type="submit">
{{/foreach}}
</div>
</form>
<script>
$(document).ready(function() {
// javascript dialog to batch actions
$(".batch-action").click(function(e){
if (confirm($(this).attr('value')+" ?")) {
return true;
} else {
e.preventDefault();
return false;
}
});
// add javascript confirm dialog to "drop" links. Plain html url have "?confirm=1" to show confirmation form, we need to remove it
$(".drop").each(function() {
$(this).attr('href', $(this).attr('href').replace("confirm=1","") );
$(this).click(function(e){
if (confirm("{{$contact_drop_confirm}}")) {
return true;
} else {
e.preventDefault();
return false;
}
});
});
});
</script>
{{$paginate}}