Skip to content

Commit 798f9c4

Browse files
committed
Formatting and cleanup
1 parent 91400a3 commit 798f9c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+844
-1654
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
relative_files = True

.coveralls.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[*]
2+
charset = utf-8
3+
indent_style = space
4+
indent_size = 2
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
8+
[*.py]
9+
indent_style = space
10+
indent_size = 4
11+
12+
[Makefile]
13+
indent_style = tab
14+
15+
[*.{md,rst}]
16+
indent_style = space
17+
indent_size = 4

.github/CONTRIBUTING.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,22 @@ Follow the following steps to get started contributing to this project.
1616
git checkout -b name-of-your-bugfix-or-feature
1717

1818
3. Create a virtual environment of your choice and activate it.
19-
4. Install the dependencies via pip and run the migrations for demo_project.
19+
4. Install the dependencies via pip and run the migrations for django application.
2020

21-
npm run pip-install
22-
npm run migrate
21+
make
2322

24-
5. Now you can run the demo_project on localhost:8000 to see the changes you make in action real-time.
23+
5. Now you can run the django application on localhost:8000 to see the changes you make in action real-time.
2524

26-
npm run demo
25+
make dev
2726

2827

2928
## Testing
3029

3130
1. Run the tests by the following command.
3231

33-
npm run test
32+
make test
3433

3534
2. See the coverage report by the following command.
3635

37-
npm run coverage
36+
make coverage
3837

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.venv
1+
/venv*
22
.vscode
33
node_modules
44
db.sqlite3

.pylintrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[MASTER]
2+
init-hook='import os, sys; sys.path.append(os.path.abspath("."))'
3+
disable=
4+
R,
5+
C,
6+
missing-docstring,
7+
W0143, # comparison-with-callable
8+
W0613, # unused-argument
9+
10+
[FORMAT]
11+
max-line-length=88 # black

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.PHONY: dev docs build
2+
3+
install:
4+
python -m pip install --upgrade pip
5+
python -m pip install -r requirements/dev.txt
6+
python dev/manage.py migrate
7+
8+
dev:
9+
python dev/manage.py runserver
10+
11+
docs:
12+
make -C docs html
13+
14+
lint:
15+
python -m pylint bootstrap_datepicker_plus tests dev
16+
python -m black --exclude /migrations/* --check bootstrap_datepicker_plus tests dev
17+
rstcheck --report warning *.rst docs/*.rst
18+
19+
test:
20+
python dev/manage.py test tests/ --keepdb
21+
22+
coverage:
23+
coverage run --source=bootstrap_datepicker_plus dev/manage.py test tests/ --keepdb
24+
coverage report
25+
26+
build:
27+
python setup.py sdist bdist_wheel
28+
29+
deploy:
30+
twine upload --repository testpypi dist/*
31+
32+
deploy-prod:
33+
twine upload dist/*

README.rst

Lines changed: 63 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,49 @@
1+
########################################
12
django-bootstrap-datepicker-plus
2-
================================
3+
########################################
34

45
This django widget contains Bootstrap 3 and Bootstrap 4
56
Date-Picker, Time-Picker, DateTime-Picker, Month-Picker and Year-Picker input
67
with date-range-picker functionality for django version 2.1, 2.0, 1.11, 1.10 and 1.8.
7-
The widget implements `bootstrap-datetimepicker v4 <http://eonasdan.github.io/bootstrap-datetimepicker/>`__
8+
The widget implements `bootstrap-datetimepicker v4 <http://eonasdan.github.io/bootstrap-datetimepicker/>`_
89
to show bootstrap-datepicker in django model forms and custom forms
910
which can be configured easily for date-range selection.
1011

1112

12-
| |ci-status| |docs-status| |coverage.io| |maintainability| |test-coverage|
13-
| |pyversions| |djversions| |pypi-version|
14-
| |format| |status| |license|
15-
16-
| |date-picker-image| |datetime-picker-image| |time-picker-image|
13+
| |build-status| |docs-status| |coverage|
14+
| |pyversions| |pypi-version| |license|
1715
16+
| |date-picker-image| |datetime-picker-image| |time-picker-image|
1817
1918

2019

20+
********************
2121
Demo
22-
----
23-
- `With Bootstrap 3 <https://monim67.github.io/django-bootstrap-datepicker-plus/>`__.
24-
- `With Bootstrap 4 <https://monim67.github.io/django-bootstrap-datepicker-plus/Bootstrap4.html>`__.
22+
********************
2523

24+
- `With Bootstrap 3 <https://monim67.github.io/django-bootstrap-datepicker-plus/>`_.
25+
- `With Bootstrap 4 <https://monim67.github.io/django-bootstrap-datepicker-plus/Bootstrap4.html>`_.
2626

2727

28-
Getting Started
29-
---------------
3028

29+
********************
30+
Getting Started
31+
********************
3132

33+
++++++++++++++++++++
3234
Prerequisites
33-
^^^^^^^^^^^^^
34-
- Python >= 3.3
35-
- Django >= 1.8
36-
- Bootstrap >= 3
37-
- jquery >= 1.7.1
35+
++++++++++++++++++++
3836

37+
- Python >= 3.6
38+
- Django >= 1.8
39+
- Bootstrap >= 3
40+
- jquery >= 1.7.1
3941

42+
43+
++++++++++++++++++++
4044
Installing
41-
^^^^^^^^^^
45+
++++++++++++++++++++
46+
4247
Install the PyPI package via pip
4348

4449
::
@@ -58,21 +63,25 @@ This installation instruction assumes you have ``jQuery`` and Bootstrap JS/CSS f
5863
and you are using ``form.media`` in your django template. If not you have to configure your template.
5964

6065

61-
Next
62-
^^^^^^^^^^
63-
- `Template configuration <https://monim67.github.io/django-bootstrap-datepicker-plus/configure/>`__
64-
- `Documentation on ReadTheDocs <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/>`__
65-
- `Quick Walkthrough Tutorial <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Walkthrough.html>`__
66-
- `I am having errors <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Troubleshooting.html>`__
66+
++++++++++++++++++++
67+
Next Steps
68+
++++++++++++++++++++
6769

70+
- `Template configuration <https://monim67.github.io/django-bootstrap-datepicker-plus/configure/>`_
71+
- `Documentation on ReadTheDocs <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/>`_
72+
- `Quick Walkthrough Tutorial <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Walkthrough.html>`_
73+
- `I am having errors <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Troubleshooting.html>`_
6874

6975

76+
77+
********************
7078
Usage
71-
-----
79+
********************
7280

7381

82+
++++++++++++++++++++++++++++++
7483
Usage in Generic View
75-
^^^^^^^^^^^^^^^^^^^^^^
84+
++++++++++++++++++++++++++++++
7685

7786
.. code:: python
7887
@@ -90,15 +99,17 @@ Usage in Generic View
9099
return form
91100
92101
102+
++++++++++++++++++++++++++++++
93103
Advanced Usage
94-
^^^^^^^^^^^^^^^^^
104+
++++++++++++++++++++++++++++++
95105

96-
- `Usage in Custom Form <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Usage.html#custom-form-usage>`__
97-
- `Usage in Model Form <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Usage.html#model-form-usage>`__
106+
- `Usage in Custom Form <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Usage.html#custom-form-usage>`_
107+
- `Usage in Model Form <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Usage.html#model-form-usage>`_
98108

99109

110+
++++++++++++++++++++++++++++++
100111
Types of DatePickers
101-
^^^^^^^^^^^^^^^^^^^^
112+
++++++++++++++++++++++++++++++
102113

103114
The widget contains all types of date-picker you may ever need.
104115

@@ -121,8 +132,9 @@ The widget contains all types of date-picker you may ever need.
121132
}
122133
123134
135+
++++++++++++++++++++++++++++++
124136
Implement date-range-picker
125-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
137+
++++++++++++++++++++++++++++++
126138

127139
DatePickers can be linked to select a date-range or time-range.
128140

@@ -144,29 +156,34 @@ DatePickers can be linked to select a date-range or time-range.
144156
}
145157
146158
159+
++++++++++++++++++++++++++++++
147160
Customization
148-
^^^^^^^^^^^^^^
149-
- `Datepicker Options <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Usage.html#customize-datepicker-options>`__
150-
- `Input field HTML template <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Template_Customizing.html>`__
151-
- `Language <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Usage.html#customize-the-language>`__
161+
++++++++++++++++++++++++++++++
162+
163+
- `Datepicker Options <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Usage.html#customize-datepicker-options>`_
164+
- `Input field HTML template <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Template_Customizing.html>`_
165+
- `Language <https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/Usage.html#customize-the-language>`_
152166

153167

168+
********************
154169
Contributing
155-
------------
170+
********************
156171

157-
- `CONTRIBUTING.md <https://github.com/monim67/django-bootstrap-datepicker-plus/blob/master/.github/CONTRIBUTING.md>`__.
158-
- `CODE_OF_CONDUCT.md <https://github.com/monim67/django-bootstrap-datepicker-plus/blob/master/.github/CODE_OF_CONDUCT.md>`__.
172+
- `CONTRIBUTING.md <https://github.com/monim67/django-bootstrap-datepicker-plus/blob/master/.github/CONTRIBUTING.md>`_.
173+
- `CODE_OF_CONDUCT.md <https://github.com/monim67/django-bootstrap-datepicker-plus/blob/master/.github/CODE_OF_CONDUCT.md>`_.
159174

175+
********************
160176
License
161-
-------
177+
********************
162178

163-
This project is licensed under Apache License 2.0 - see the `LICENSE <https://github.com/monim67/django-bootstrap-datepicker-plus/blob/master/LICENSE>`__ file for details.
179+
This project is licensed under Apache License 2.0 - see the `LICENSE <https://github.com/monim67/django-bootstrap-datepicker-plus/blob/master/LICENSE>`_ file for details.
164180

181+
********************
165182
Acknowledgments
166-
---------------
183+
********************
167184

168-
This project implements `Eonasdan/bootstrap-datetimepicker <https://github.com/Eonasdan/bootstrap-datetimepicker>`__ to display date-pickers.
169-
The project was initially forked from `pbucher/django-bootstrap-datepicker <https://github.com/pbucher/django-bootstrap-datepicker>`__.
185+
This project implements `Eonasdan/bootstrap-datetimepicker <https://github.com/Eonasdan/bootstrap-datetimepicker>`_ to display date-pickers.
186+
The project was initially forked from `pbucher/django-bootstrap-datepicker <https://github.com/pbucher/django-bootstrap-datepicker>`_.
170187

171188

172189
.. |date-picker-image| image:: https://raw.githubusercontent.com/monim67/django-bootstrap-datepicker-plus/26d89a744d403a895422313a48c02885c4718251/images/date-picker.png
@@ -184,8 +201,8 @@ The project was initially forked from `pbucher/django-bootstrap-datepicker <http
184201
:width: 218px
185202
:height: 280px
186203

187-
.. |ci-status| image:: https://travis-ci.org/monim67/django-bootstrap-datepicker-plus.svg?branch=master
188-
:target: https://travis-ci.org/monim67/django-bootstrap-datepicker-plus
204+
.. |build-status| image:: https://github.com/monim67/django-bootstrap-datepicker-plus/workflows/build/badge.svg?event=push
205+
:target: https://github.com/monim67/django-bootstrap-datepicker-plus/actions?query=build
189206
:alt: Build Status
190207
:height: 20px
191208

@@ -194,46 +211,21 @@ The project was initially forked from `pbucher/django-bootstrap-datepicker <http
194211
:alt: Documentation Status
195212
:height: 20px
196213

197-
.. |coverage.io| image:: https://coveralls.io/repos/github/monim67/django-bootstrap-datepicker-plus/badge.svg?branch=master
214+
.. |coverage| image:: https://coveralls.io/repos/github/monim67/django-bootstrap-datepicker-plus/badge.svg?branch=master
198215
:target: https://coveralls.io/github/monim67/django-bootstrap-datepicker-plus?branch=master
199216
:alt: Coverage Status
200217
:height: 20px
201218

202-
.. |maintainability| image:: https://api.codeclimate.com/v1/badges/d89033abcc5c8220f4cb/maintainability
203-
:target: https://codeclimate.com/github/monim67/django-bootstrap-datepicker-plus/maintainability
204-
:alt: Maintainability
205-
:height: 20px
206-
207-
.. |test-coverage| image:: https://api.codeclimate.com/v1/badges/d89033abcc5c8220f4cb/test_coverage
208-
:target: https://codeclimate.com/github/monim67/django-bootstrap-datepicker-plus/test_coverage
209-
:alt: Test Coverage
210-
:height: 20px
211-
212219
.. |pyversions| image:: https://img.shields.io/pypi/pyversions/django-bootstrap-datepicker-plus.svg
213220
:target: https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
214221
:alt: Python Versions
215222
:height: 20px
216223

217-
.. |djversions| image:: https://img.shields.io/pypi/djversions/django-bootstrap-datepicker-plus.svg
218-
:target: https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
219-
:alt: DJango Versions
220-
:height: 20px
221-
222224
.. |pypi-version| image:: https://badge.fury.io/py/django-bootstrap-datepicker-plus.svg
223225
:target: https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
224226
:alt: PyPI version
225227
:height: 20px
226228

227-
.. |format| image:: https://img.shields.io/pypi/format/django-bootstrap-datepicker-plus.svg
228-
:target: https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
229-
:alt: Format
230-
:height: 20px
231-
232-
.. |status| image:: https://img.shields.io/pypi/status/django-bootstrap-datepicker-plus.svg
233-
:target: https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
234-
:alt: Status
235-
:height: 20px
236-
237229
.. |license| image:: https://img.shields.io/pypi/l/django-bootstrap-datepicker-plus.svg
238230
:target: https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
239231
:alt: Licence

0 commit comments

Comments
 (0)