Date/Time popup widget on bots select screens

18 views
Skip to first unread message

BikeMike

unread,
Jan 20, 2012, 12:19:29 AM1/20/12
to Bots Open Source EDI Translator
Hi all,
I have wanted this feature for a long time, so I decided to get stuck in
and add it myself. There are quite a few ways you could do this... I
searched google and read quite a few pages. I decided against using the
Django admin widgets, general consensus seems to be that it's an ugly
hack to get them working in custom forms, relying on undocumented
features. So with a bit of trial and error I think I have this working
quite well, using jQuery UI and a date & time add-on I found. I'm using
the "smoothness" theme, this seems a good match to the look of bots pages.

Features:
* Widget pops up when a date selection field gets focus.
* Available date range is shaded, and you can't select dates outside of
available history range. (screenshot attached shows 14 days, based on
maxdays in bots.ini)
* Sliders for hours & minutes
* Selection field updated dynamically as you make changes

Only 2 bots core files are modified (templates/bots/selectform.html and
templatetags/botsfilters.py) and a new directory is created for the rest
(media/jquery-ui).

I have created 2 plugins. Both are for bots 2.1.0 but should work fine
with bots 2.0.*. There is one for Django 1.1 and one for Django 1.2+.
The only difference is the csrf token in html template.

Hope you like it :-)

--
Kind Regards,
Mike

datetimeselect.png
updatebots-datetimepicker-django1.2+.zip
updatebots-datetimepicker-django1.1.zip
Message has been deleted

BikeMike

unread,
Jan 20, 2012, 12:44:00 AM1/20/12
to bots...@googlegroups.com
oops... plugins on the previous post don't have the jquery-ui images.
Also note, you need to restart bots-webserver after loading the plugin!


Kind Regards,
Mike

updatebots-datetimepicker-django1.1.zip
updatebots-datetimepicker-django1.2+.zip
Reply all
Reply to author
Forward
0 new messages