diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-12 06:16:13 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 06:16:13 +0000 |
| commit | 2a08506cf56418c3cc24c287c1a14cdbfcfca21d (patch) | |
| tree | 8b4913d1e501e79751de60cbd1b2fde2695c0367 | |
| parent | 4586ed6fe798079123507856d97137902622e287 (diff) | |
automatic import of python-django-tempus-dominus
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-django-tempus-dominus.spec | 484 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 486 insertions, 0 deletions
@@ -0,0 +1 @@ +/django-tempus-dominus-5.1.2.17.tar.gz diff --git a/python-django-tempus-dominus.spec b/python-django-tempus-dominus.spec new file mode 100644 index 0000000..75c62c9 --- /dev/null +++ b/python-django-tempus-dominus.spec @@ -0,0 +1,484 @@ +%global _empty_manifest_terminate_build 0 +Name: python-django-tempus-dominus +Version: 5.1.2.17 +Release: 1 +Summary: A Django widget for the Tempus Dominus Bootstrap 4 DateTime picker. +License: BSD License +URL: https://github.com/FlipperPA/django-tempus-dominus +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b7/14/48064b01708dd67358ef5b857037068d2f215d28fe42189d0ce462827271/django-tempus-dominus-5.1.2.17.tar.gz +BuildArch: noarch + +Requires: python3-django + +%description +# Django Tempus Dominus + +Django Tempus Dominus provides Django widgets for the [Tempus Dominus Bootstrap 4 DateTime](https://tempusdominus.github.io/bootstrap-4/ "Tempus Dominus") date and time picker. + +## A Note About the Future of This Package + +The parent project to this package, Tempus Dominus, is being reworked. This package will not receive any feature updates until the parent project releases version 6, which will deprecate jQuery and Bootstrap as dependencies. When that occurs, we'll update this package to support v6. + +## Installation + +* From PyPI: `pip install django-tempus-dominus` + +Then add `tempus_dominus` to `INSTALLED_APPS` in your Django settings. + +## Usage & Django Settings + +The following settings are available: + +* `TEMPUS_DOMINUS_LOCALIZE` (default: `False`): if `True`, widgets will be translated to the selected browser language and use the localized date and time formats. +* `TEMPUS_DOMINUS_INCLUDE_ASSETS` (default: `True`): if `True`, loads Tempus Dominus and `moment` JS and CSS from Cloudflare's CDN, otherwise loading the JS and CSS are up to you. +* `TEMPUS_DOMINUS_DATE_FORMAT` (default: `YYYY-MM-DD`) +* `TEMPUS_DOMINUS_DATETIME_FORMAT` (default: `YYYY-MM-DD HH:mm:ss`) +* `TEMPUS_DOMINUS_TIME_FORMAT` (default: `HH:mm:ss`) + +Three widgets are provided: + +* `DatePicker` + * Defaults to `L` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_DATE_FORMAT` +* `DateTimePicker` + * Defaults to `L LTS` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_DATETIME_FORMAT` +* `TimePicker` + * Defaults to `LTS` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_TIME_FORMAT` + +In your Django form, you can use the widgets like this: + +```python +from django import forms +from tempus_dominus.widgets import DatePicker, TimePicker, DateTimePicker + +class MyForm(forms.Form): + date_field = forms.DateField(widget=DatePicker()) + date_field_required_with_min_max_date = forms.DateField( + required=True, + widget=DatePicker( + options={ + 'minDate': '2009-01-20', + 'maxDate': '2017-01-20', + }, + ), + initial='2013-01-01', + ) + """ + In this example, the date portion of `defaultDate` is irrelevant; + only the time portion is used. The reason for this is that it has + to be passed in a valid MomentJS format. This will default the time + to be 14:56:00 (or 2:56pm). + """ + time_field = forms.TimeField( + widget=TimePicker( + options={ + 'enabledHours': [9, 10, 11, 12, 13, 14, 15, 16], + 'defaultDate': '1970-01-01T14:56:00' + }, + attrs={ + 'input_toggle': True, + 'input_group': False, + }, + ), + ) + datetime_field = forms.DateTimeField( + widget=DateTimePicker( + options={ + 'useCurrent': True, + 'collapse': False, + }, + attrs={ + 'append': 'fa fa-calendar', + 'icon_toggle': True, + } + ), + ) +``` + +Then in your template, include jQuery, `{{ form.media }}`, and render the form: + +```HTML+Django +<html> + <head> + {# Include FontAwesome; required for icon display #} + <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css"> + + {# Include Bootstrap 4 and jQuery #} + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> + <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> + + {# Django Tempus Dominus assets are included in `{{ form.media }}` #} + {{ form.media }} + </head> + + <body> + <div class="container"> + <div class="row"> + <div class="col"> + <form method="post" action="."> + {% csrf_token %} + {{ form.as_p }} + </form> + </div> + </div> + </div> + </body> +</html> +``` + +## Widget Options + +* `options` (dictionary): This dictionary will be passed to Tempus Dominus. [A full list of options is available here](https://tempusdominus.github.io/bootstrap-4/Options/). +* `input_toggle` (boolean, default `True`): Controls whether clicking on the input field toggles the datepicker popup. Typically is set to False when an icon is in use. +* `input_group` (boolean, default `True`): Whether to include a Bootstrap 4 `input-group` around the picker. +* `size` (string): Controls the size of the input group (`small` or `large`). Defaults to the default size. +* `prepend` (string): Name of a Font Awesome icon to prepend to the input field (`fa fa-calendar`). +* `append` (string): Name of a Font Awesome icon to append to the input field (`fa fa-calendar`). +* `icon_toggle` (boolean, default `True`): Controls whether clicking on the icon toggles the datepicker popup. Typically is set to False when an icon is in use. + +## Release Notes and Contributors + +* [Release notes](https://github.com/flipperpa/django-tempus-dominus/releases) +* [Our wonderful contributors](https://github.com/flipperpa/django-tempus-dominus/graphs/contributors) + +## Maintainers + +* Timothy Allen (https://github.com/FlipperPA) +* Ian Stewart (https://github.com/ianastewart) + +This package is largely maintained by the staff of [Wharton Research Data Services](https://wrds.wharton.upenn.edu/). We are thrilled that [The Wharton School](https://www.wharton.upenn.edu/) allows us a certain amount of time to contribute to open-source projects. We add features as they are necessary for our projects, and try to keep up with Issues and Pull Requests as best we can. Due to time constraints (our full time jobs!), Feature Requests without a Pull Request may not be implemented, but we are always open to new ideas and grateful for contributions and our package users. + + + + +%package -n python3-django-tempus-dominus +Summary: A Django widget for the Tempus Dominus Bootstrap 4 DateTime picker. +Provides: python-django-tempus-dominus +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-django-tempus-dominus +# Django Tempus Dominus + +Django Tempus Dominus provides Django widgets for the [Tempus Dominus Bootstrap 4 DateTime](https://tempusdominus.github.io/bootstrap-4/ "Tempus Dominus") date and time picker. + +## A Note About the Future of This Package + +The parent project to this package, Tempus Dominus, is being reworked. This package will not receive any feature updates until the parent project releases version 6, which will deprecate jQuery and Bootstrap as dependencies. When that occurs, we'll update this package to support v6. + +## Installation + +* From PyPI: `pip install django-tempus-dominus` + +Then add `tempus_dominus` to `INSTALLED_APPS` in your Django settings. + +## Usage & Django Settings + +The following settings are available: + +* `TEMPUS_DOMINUS_LOCALIZE` (default: `False`): if `True`, widgets will be translated to the selected browser language and use the localized date and time formats. +* `TEMPUS_DOMINUS_INCLUDE_ASSETS` (default: `True`): if `True`, loads Tempus Dominus and `moment` JS and CSS from Cloudflare's CDN, otherwise loading the JS and CSS are up to you. +* `TEMPUS_DOMINUS_DATE_FORMAT` (default: `YYYY-MM-DD`) +* `TEMPUS_DOMINUS_DATETIME_FORMAT` (default: `YYYY-MM-DD HH:mm:ss`) +* `TEMPUS_DOMINUS_TIME_FORMAT` (default: `HH:mm:ss`) + +Three widgets are provided: + +* `DatePicker` + * Defaults to `L` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_DATE_FORMAT` +* `DateTimePicker` + * Defaults to `L LTS` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_DATETIME_FORMAT` +* `TimePicker` + * Defaults to `LTS` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_TIME_FORMAT` + +In your Django form, you can use the widgets like this: + +```python +from django import forms +from tempus_dominus.widgets import DatePicker, TimePicker, DateTimePicker + +class MyForm(forms.Form): + date_field = forms.DateField(widget=DatePicker()) + date_field_required_with_min_max_date = forms.DateField( + required=True, + widget=DatePicker( + options={ + 'minDate': '2009-01-20', + 'maxDate': '2017-01-20', + }, + ), + initial='2013-01-01', + ) + """ + In this example, the date portion of `defaultDate` is irrelevant; + only the time portion is used. The reason for this is that it has + to be passed in a valid MomentJS format. This will default the time + to be 14:56:00 (or 2:56pm). + """ + time_field = forms.TimeField( + widget=TimePicker( + options={ + 'enabledHours': [9, 10, 11, 12, 13, 14, 15, 16], + 'defaultDate': '1970-01-01T14:56:00' + }, + attrs={ + 'input_toggle': True, + 'input_group': False, + }, + ), + ) + datetime_field = forms.DateTimeField( + widget=DateTimePicker( + options={ + 'useCurrent': True, + 'collapse': False, + }, + attrs={ + 'append': 'fa fa-calendar', + 'icon_toggle': True, + } + ), + ) +``` + +Then in your template, include jQuery, `{{ form.media }}`, and render the form: + +```HTML+Django +<html> + <head> + {# Include FontAwesome; required for icon display #} + <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css"> + + {# Include Bootstrap 4 and jQuery #} + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> + <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> + + {# Django Tempus Dominus assets are included in `{{ form.media }}` #} + {{ form.media }} + </head> + + <body> + <div class="container"> + <div class="row"> + <div class="col"> + <form method="post" action="."> + {% csrf_token %} + {{ form.as_p }} + </form> + </div> + </div> + </div> + </body> +</html> +``` + +## Widget Options + +* `options` (dictionary): This dictionary will be passed to Tempus Dominus. [A full list of options is available here](https://tempusdominus.github.io/bootstrap-4/Options/). +* `input_toggle` (boolean, default `True`): Controls whether clicking on the input field toggles the datepicker popup. Typically is set to False when an icon is in use. +* `input_group` (boolean, default `True`): Whether to include a Bootstrap 4 `input-group` around the picker. +* `size` (string): Controls the size of the input group (`small` or `large`). Defaults to the default size. +* `prepend` (string): Name of a Font Awesome icon to prepend to the input field (`fa fa-calendar`). +* `append` (string): Name of a Font Awesome icon to append to the input field (`fa fa-calendar`). +* `icon_toggle` (boolean, default `True`): Controls whether clicking on the icon toggles the datepicker popup. Typically is set to False when an icon is in use. + +## Release Notes and Contributors + +* [Release notes](https://github.com/flipperpa/django-tempus-dominus/releases) +* [Our wonderful contributors](https://github.com/flipperpa/django-tempus-dominus/graphs/contributors) + +## Maintainers + +* Timothy Allen (https://github.com/FlipperPA) +* Ian Stewart (https://github.com/ianastewart) + +This package is largely maintained by the staff of [Wharton Research Data Services](https://wrds.wharton.upenn.edu/). We are thrilled that [The Wharton School](https://www.wharton.upenn.edu/) allows us a certain amount of time to contribute to open-source projects. We add features as they are necessary for our projects, and try to keep up with Issues and Pull Requests as best we can. Due to time constraints (our full time jobs!), Feature Requests without a Pull Request may not be implemented, but we are always open to new ideas and grateful for contributions and our package users. + + + + +%package help +Summary: Development documents and examples for django-tempus-dominus +Provides: python3-django-tempus-dominus-doc +%description help +# Django Tempus Dominus + +Django Tempus Dominus provides Django widgets for the [Tempus Dominus Bootstrap 4 DateTime](https://tempusdominus.github.io/bootstrap-4/ "Tempus Dominus") date and time picker. + +## A Note About the Future of This Package + +The parent project to this package, Tempus Dominus, is being reworked. This package will not receive any feature updates until the parent project releases version 6, which will deprecate jQuery and Bootstrap as dependencies. When that occurs, we'll update this package to support v6. + +## Installation + +* From PyPI: `pip install django-tempus-dominus` + +Then add `tempus_dominus` to `INSTALLED_APPS` in your Django settings. + +## Usage & Django Settings + +The following settings are available: + +* `TEMPUS_DOMINUS_LOCALIZE` (default: `False`): if `True`, widgets will be translated to the selected browser language and use the localized date and time formats. +* `TEMPUS_DOMINUS_INCLUDE_ASSETS` (default: `True`): if `True`, loads Tempus Dominus and `moment` JS and CSS from Cloudflare's CDN, otherwise loading the JS and CSS are up to you. +* `TEMPUS_DOMINUS_DATE_FORMAT` (default: `YYYY-MM-DD`) +* `TEMPUS_DOMINUS_DATETIME_FORMAT` (default: `YYYY-MM-DD HH:mm:ss`) +* `TEMPUS_DOMINUS_TIME_FORMAT` (default: `HH:mm:ss`) + +Three widgets are provided: + +* `DatePicker` + * Defaults to `L` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_DATE_FORMAT` +* `DateTimePicker` + * Defaults to `L LTS` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_DATETIME_FORMAT` +* `TimePicker` + * Defaults to `LTS` if `TEMPUS_DOMINUS_LOCALIZE` is `True`, otherwise `TEMPUS_DOMINUS_TIME_FORMAT` + +In your Django form, you can use the widgets like this: + +```python +from django import forms +from tempus_dominus.widgets import DatePicker, TimePicker, DateTimePicker + +class MyForm(forms.Form): + date_field = forms.DateField(widget=DatePicker()) + date_field_required_with_min_max_date = forms.DateField( + required=True, + widget=DatePicker( + options={ + 'minDate': '2009-01-20', + 'maxDate': '2017-01-20', + }, + ), + initial='2013-01-01', + ) + """ + In this example, the date portion of `defaultDate` is irrelevant; + only the time portion is used. The reason for this is that it has + to be passed in a valid MomentJS format. This will default the time + to be 14:56:00 (or 2:56pm). + """ + time_field = forms.TimeField( + widget=TimePicker( + options={ + 'enabledHours': [9, 10, 11, 12, 13, 14, 15, 16], + 'defaultDate': '1970-01-01T14:56:00' + }, + attrs={ + 'input_toggle': True, + 'input_group': False, + }, + ), + ) + datetime_field = forms.DateTimeField( + widget=DateTimePicker( + options={ + 'useCurrent': True, + 'collapse': False, + }, + attrs={ + 'append': 'fa fa-calendar', + 'icon_toggle': True, + } + ), + ) +``` + +Then in your template, include jQuery, `{{ form.media }}`, and render the form: + +```HTML+Django +<html> + <head> + {# Include FontAwesome; required for icon display #} + <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css"> + + {# Include Bootstrap 4 and jQuery #} + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> + <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> + + {# Django Tempus Dominus assets are included in `{{ form.media }}` #} + {{ form.media }} + </head> + + <body> + <div class="container"> + <div class="row"> + <div class="col"> + <form method="post" action="."> + {% csrf_token %} + {{ form.as_p }} + </form> + </div> + </div> + </div> + </body> +</html> +``` + +## Widget Options + +* `options` (dictionary): This dictionary will be passed to Tempus Dominus. [A full list of options is available here](https://tempusdominus.github.io/bootstrap-4/Options/). +* `input_toggle` (boolean, default `True`): Controls whether clicking on the input field toggles the datepicker popup. Typically is set to False when an icon is in use. +* `input_group` (boolean, default `True`): Whether to include a Bootstrap 4 `input-group` around the picker. +* `size` (string): Controls the size of the input group (`small` or `large`). Defaults to the default size. +* `prepend` (string): Name of a Font Awesome icon to prepend to the input field (`fa fa-calendar`). +* `append` (string): Name of a Font Awesome icon to append to the input field (`fa fa-calendar`). +* `icon_toggle` (boolean, default `True`): Controls whether clicking on the icon toggles the datepicker popup. Typically is set to False when an icon is in use. + +## Release Notes and Contributors + +* [Release notes](https://github.com/flipperpa/django-tempus-dominus/releases) +* [Our wonderful contributors](https://github.com/flipperpa/django-tempus-dominus/graphs/contributors) + +## Maintainers + +* Timothy Allen (https://github.com/FlipperPA) +* Ian Stewart (https://github.com/ianastewart) + +This package is largely maintained by the staff of [Wharton Research Data Services](https://wrds.wharton.upenn.edu/). We are thrilled that [The Wharton School](https://www.wharton.upenn.edu/) allows us a certain amount of time to contribute to open-source projects. We add features as they are necessary for our projects, and try to keep up with Issues and Pull Requests as best we can. Due to time constraints (our full time jobs!), Feature Requests without a Pull Request may not be implemented, but we are always open to new ideas and grateful for contributions and our package users. + + + + +%prep +%autosetup -n django-tempus-dominus-5.1.2.17 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-django-tempus-dominus -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 5.1.2.17-1 +- Package Spec generated @@ -0,0 +1 @@ +c37fc476a2013f5a35d754343dbde73f django-tempus-dominus-5.1.2.17.tar.gz |
