Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (1.11 KB)

1
# -*- coding: utf-8 -*-
2
# vim:set expandtab tabstop=4 shiftwidth=4:
3
# Copyright (C) 2007-2020 CS GROUP - France
4
# License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html>
5

    
6
"""Le formulaire de recherche/filtrage."""
7

    
8
from tg.i18n import lazy_ugettext as l_
9
import tw.forms as twf
10
import tg
11

    
12
__all__ = (
13
    'SearchForm',
14
    'create_search_form',
15
)
16

    
17
class SearchForm(twf.TableForm):
18
    """
19
    Formulaire de recherche dans les événements
20

21
    Affiche un champ texte pour l'hôte, le service, la sortie,
22
    le ticket d'incidence, et la date.
23

24
    Ce widget permet de répondre aux exigences suivantes :
25
        - VIGILO_EXIG_VIGILO_BAC_0070
26
        - VIGILO_EXIG_VIGILO_BAC_0100
27
    """
28

    
29
    method = 'GET'
30
    style = 'display: none'
31

    
32
    # Paramètres liés à la pagination et au tri.
33
    fields = [
34
        twf.HiddenField('page'),
35
        twf.HiddenField('sort'),
36
        twf.HiddenField('order')
37
    ]
38
    for plugin, instance in tg.config.get('columns_plugins', []):
39
        fields.extend(instance.get_search_fields())
40

    
41
create_search_form = SearchForm("search_form",
42
    submit_text=l_('Search'), action=tg.url('/'),
43
)