Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / widgets / search_form.py @ 011743be

History | View | Annotate | Download (1.11 KB)

1 08d86103 Francois POIROTTE
# -*- coding: utf-8 -*-
2
# vim:set expandtab tabstop=4 shiftwidth=4:
3 011743be Francois POIROTTE
# Copyright (C) 2007-2020 CS GROUP - France
4 9b8d9497 Francois POIROTTE
# License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html>
5 a77de887 Francois POIROTTE
6 08d86103 Francois POIROTTE
"""Le formulaire de recherche/filtrage."""
7
8 02c4a1e7 Francois POIROTTE
from tg.i18n import lazy_ugettext as l_
9 2dbc5942 Francois POIROTTE
import tw.forms as twf
10
import tg
11
12 daa19d09 Francois POIROTTE
__all__ = (
13
    'SearchForm',
14 2dbc5942 Francois POIROTTE
    'create_search_form',
15 daa19d09 Francois POIROTTE
)
16 08d86103 Francois POIROTTE
17 2dbc5942 Francois POIROTTE
class SearchForm(twf.TableForm):
18 08d86103 Francois POIROTTE
    """
19
    Formulaire de recherche dans les événements
20

21 840079e0 Vincent QUEMENER
    Affiche un champ texte pour l'hôte, le service, la sortie,
22
    le ticket d'incidence, et la date.
23 e48c54c4 Francois POIROTTE

24
    Ce widget permet de répondre aux exigences suivantes :
25 daa19d09 Francois POIROTTE
        - VIGILO_EXIG_VIGILO_BAC_0070
26
        - VIGILO_EXIG_VIGILO_BAC_0100
27 08d86103 Francois POIROTTE
    """
28 d6572890 Aurelien BOMPARD
29 08d86103 Francois POIROTTE
    method = 'GET'
30
    style = 'display: none'
31 840079e0 Vincent QUEMENER
32 ecf084d9 Francois POIROTTE
    # Paramètres liés à la pagination et au tri.
33 27140946 Francois POIROTTE
    fields = [
34 5a845c93 Vincent QUEMENER
        twf.HiddenField('page'),
35
        twf.HiddenField('sort'),
36
        twf.HiddenField('order')
37 27140946 Francois POIROTTE
    ]
38
    for plugin, instance in tg.config.get('columns_plugins', []):
39
        fields.extend(instance.get_search_fields())
40 2dbc5942 Francois POIROTTE
41
create_search_form = SearchForm("search_form",
42 3f4ed8a6 Francois POIROTTE
    submit_text=l_('Search'), action=tg.url('/'),
43 2dbc5942 Francois POIROTTE
)