Metadata-Version: 2.1
Name: djgentelella
Version: 0.2.10
Summary: Extra widgets for django using gentelella.
Home-page: https://solvosoft.com
Author: Luis Zarate Montero
Author-email: luis.zarate@solvosoft.com
License: GNU General Public License
Platform: OS Independent
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
License-File: LICENSE
License-File: AUTHORS

Django Gentelella widgets
############################

This app helps you to integrate Django apps with `Gentelella <https://colorlib.com/polygon/gentelella/index.html>`_ building extra widgets for forms and speciall methods to render forms in templates.

See `Documentation <https://django-gentelella-widgets.readthedocs.io/>`_

Installation
________________

Installing from repository (Updated frequently, most of great functionalities are not in pip yet ).

.. code:: bash

   pip install git+https://github.com/luisza/django-gentelella-widgets.git#egg=djgentelella

An stable version on pip, but not all available widget are in this release (new release comming soon)

.. code:: bash

   pip install djgentelella


Configure your settings

.. code:: bash

    INSTALLED_APPS = [ ..
        'djgentelella',
        'mptt',
        'rest_framework',
        'chunked_upload',
        'markitup',
    ]

    USE_L10N = False

    MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})
    MARKITUP_SET = 'markitup/sets/markdown/'
    JQUERY_URL = None

    DATE_INPUT_FORMATS=[
        '%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y'
    ]
    DATE_FORMAT= ['%d/%m/%Y',]

    DATETIME_INPUT_FORMATS = [
        '%m/%d/%Y %H:%M',
        '%d/%m/%Y %H:%M',
        '%Y-%m-%d %H:%M',
        '%d/%m/%y %H:%M'
    ]
 
.. note:: Date format on Django uses localization and depends on USE_L10N, but we can not configure yet JS date widgets to change based on Django representation so USE_L10N need to be false.

Run migrations 

.. code:: bash

    python manage.py migrate

Create statics files downloading from internet (you need to install requests for this step).

.. code:: bash

     pip install requests
     python manage.py loaddevstatic

Add djgentelella urls in your project urls.py file

.. code:: bash

    from djgentelella.urls import urlpatterns as djgentelellaurls

    urlpatterns = djgentelellaurls + [
                    ...
                  ]
     
Usage
_________


In forms 

.. code:: python

    from djgentelella.forms.forms import GTForm
    from djgentelella.widgets import core as genwidgets

    class myform(GTForm, forms.ModelForm):
        class Meta:
            model = MyObject
            fields = '__all__'
            widgets = {
                'name': genwidgets.TextInput,
                'borddate': genwidgets.DateInput,
                'email': genwidgets.EmailMaskInput
            }

In templates working with forms

.. code:: html

     {{ form.as_plain }}
     {{ form.as_inline }}
     {{ form.as_horizontal }}

In templates using base template

.. code:: html

    {% extends 'gentelella/base.html' %}
    
Take a look this file to note the template block that you can overwrite

widgets
__________

There are several widgets implemented this is a list of what you can use

- TextInput
- NumberInput
- EmailInput
- URLInput
- PasswordInput
- Textarea
- TextareaWysiwyg (not working yet)
- DateInput
- DateTimeInput
- TimeInput
- CheckboxInput
- YesNoInput
- Select  (jquery select2)
- SelectMultiple (jquery select2)
- SelectTail
- SelectMultipleTail
- RadioSelect
- NullBooleanSelect
- CheckboxSelectMultiple
- SplitDateTimeWidget (not ready)
- SplitHiddenDateTimeWidget (not ready)
- SelectDateWidget (not ready)
- PhoneNumberMaskInput
- DateMaskInput
- DateTimeMaskInput
- EmailMaskInput
- DateRangeTimeInput
- DateRangeInput
- AutocompleteSelect
- AutocompleteSelectMultiple
- Formset implementation
- Remote select2 views.

Run the demo
---------------

.. code:: bash

    cd demo
    python manage.py migrate
    python manage.py createdemo
    python manage.py demomenu
    python manage.py createsuperuser

And More see demo app.

Notes for development
____________________________

`base.js` is autogenerated so you need to call

.. code:: bash

    python manage.py createbasejs

Remember update the package version before make deploy it on server.

