suppression de l'import depuis camembert et ajout de la recherche phonétique de nom

This commit is contained in:
Yohan Bataille 2013-06-25 16:17:05 +02:00
parent 6f3a256da4
commit 42fd23caa8
5 changed files with 18 additions and 9 deletions

View File

@ -22,8 +22,8 @@ class MembersController(AuthenticatedBaseController):
def __init__(self):
self.add = MembersAddController()
def sort_name(self, name_items):
@staticmethod
def sort_name(name_items):
return sorted(name_items, key=lambda t:t.sn.first())
@expose("brie.templates.members.index")
@ -54,7 +54,7 @@ class MembersController(AuthenticatedBaseController):
return {
"members" : members,
"residence" : residence_name,
"sort_name" : self.sort_name
"sort_name" : MembersController.sort_name
}
#end def

View File

@ -16,6 +16,7 @@ from brie.controllers.auth import AuthRestController
from brie.controllers.rooms import RoomsController
from brie.controllers.members import MembersController
from brie.controllers.show import ShowController
from brie.controllers.search import SearchController
from brie.controllers.edit import EditController
from brie.controllers.administration import AdministrationController
from brie.controllers.error import ErrorController
@ -47,6 +48,7 @@ class RootController(BaseController):
edit = EditController(show)
administration = AdministrationController()
error = ErrorController()
search = SearchController()
@expose('brie.templates.index')
def index(self):

View File

@ -36,6 +36,11 @@ class Member(object):
return user_session.ldap_bind.search(ldap_config.username_base_dn + residence_dn, "(objectClass=pacatnetMember)")
#end def
@staticmethod
def get_by_name(user_session, residence_dn, name):
return user_session.ldap_bind.search(ldap_config.username_base_dn + residence_dn, "(&(objectClass=pacatnetMember)(cn~=" + name + "))")
#end def
#end class
class Room(object):

View File

@ -113,12 +113,6 @@
</span>
</form>
</div>
<div>
<span class="item_name"></span>
<span>
<a href="/edit/import_from/${room.uid.first()}" class="button">Importer depuis Camembert</a>
</span>
</div>
</div>
</div>
</py:def>

View File

@ -31,6 +31,14 @@
</span>
</div>
</div>
<div class="section">
<span class="section_name show_section_name">Nom</span>
<form action="/search/member/" method="post" class="inline_block">
<input type="hidden" name="residence" value="${residence}"/>
<input type="text" name="name"/>
<input type="submit" value="Search" class="button"/>
</form>
</div>
</div>
</body>
</html>