Beispiel #1
0
class SearchForm(IndicoForm):
    phrase = StringField(_('Phrase'))
    field = SelectField(_('Search in'), choices=FIELD_CHOICES, default='')
    start_date = DateField('Start Date', [Optional()],
                           parse_kwargs={'dayfirst': True})
    end_date = DateField('End Date', [Optional()],
                         parse_kwargs={'dayfirst': True})
Beispiel #2
0
class SearchForm(IndicoForm):
    phrase = StringField(_('Phrase'))
    field = SelectField(_('Search in'), choices=FIELD_CHOICES, default='')
    start_date = IndicoDateField('Start Date', [Optional()])
    end_date = IndicoDateField('End Date', [Optional()])

    def is_submitted(self):
        return 'search-phrase' in request.args
Beispiel #3
0
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from flask import request
from wtforms.ext.dateutil.fields import DateField
from wtforms.fields.core import StringField, SelectField
from wtforms.validators import Optional

from indico.web.forms.base import IndicoForm

from indico_search import _

FIELD_CHOICES = [('', _('Anywhere')), ('title', _('Title')),
                 ('abstract', _('Description/Abstract')),
                 ('author', _('Author/Speaker')),
                 ('affiliation', _('Affiliation')), ('keyword', _('Keyword'))]


class SearchForm(IndicoForm):
    phrase = StringField(_('Phrase'))
    field = SelectField(_('Search in'), choices=FIELD_CHOICES, default='')
    start_date = DateField('Start Date', [Optional()],
                           parse_kwargs={'dayfirst': True})
    end_date = DateField('End Date', [Optional()],
                         parse_kwargs={'dayfirst': True})

    def is_submitted(self):
        return 'search-phrase' in request.args
Beispiel #4
0
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.

from __future__ import unicode_literals

from wtforms.ext.dateutil.fields import DateField
from wtforms.fields.core import StringField, SelectField
from wtforms.validators import Optional

from indico.web.forms.base import IndicoForm

from indico_search import _


FIELD_CHOICES = [('', _('Anywhere')),
                 ('title', _('Title')),
                 ('abstract', _('Description/Abstract')),
                 ('author', _('Author/Speaker')),
                 ('affiliation', _('Affiliation')),
                 ('keyword', _('Keyword'))]


class SearchForm(IndicoForm):
    phrase = StringField(_('Phrase'))
    field = SelectField(_('Search in'), choices=FIELD_CHOICES, default='')
    start_date = DateField('Start Date', [Optional()], parse_kwargs={'dayfirst': True})
    end_date = DateField('End Date', [Optional()], parse_kwargs={'dayfirst': True})