Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/djk2/django-popup-view-field

Field and widget can render bootstrap dialog window with content from django view.
https://github.com/djk2/django-popup-view-field

bootstrap3 crispy dialog django field popup

Last synced: about 1 month ago
JSON representation

Field and widget can render bootstrap dialog window with content from django view.

Awesome Lists containing this project

README

        

django-popup-view-field
------------------------

.. image:: https://badge.fury.io/py/django-popup-view-field.svg
:target: https://badge.fury.io/py/django-popup-view-field
:alt: Latest PyPI version

.. image:: https://travis-ci.org/djk2/django-popup-view-field.svg?branch=master
:target: https://travis-ci.org/djk2/django-popup-view-field
:alt: Travis CI

.. image:: https://requires.io/github/djk2/django-popup-view-field/requirements.svg?branch=master
:target: https://requires.io/github/djk2/django-popup-view-field/requirements/?branch=master
:alt: Requirements Status

Field and widget can render bootstrap dialog with content from django view.
You can create normal django View and load this view in dialog for form field.

- Support:

* Python: 2.7, 3.6
* Django: 1.9, 1.10, 1.11, 2.0, 2.1, 2.2, 3.0
* django-crispy-forms
* django-bootstrap3
* django-bootstrap4 (!Only for Django >= 2.1)

- Require:

* Django
* bootstrap3 or bootstrap4
* JQuery

- Recommended:

* django-bootstrap3 or django-bootstrap4
* django-crispy-forms

- Locale:

* EN - (english)
* PL - (polish)

- Tested on browsers:

* OK - Chromium 79.0.3945.79 - Ubuntu 18.04
* OK - Firefox 72.0.1 (64 bity) - Ubuntu 18.04
* OK - Google Chrome 70.0 - Fedora 28
* OK - Firefox 62.0.3 - Fedora 28
* OK - Firefox 50.1.0 - Ubuntu 14.04
* OK - Firefox 31.1 - CentOS 6.4
* OK - Chromium 53.0 - Ubuntu 14.04
* OK - Microsoft Edge 38 - Windows 10
* OK - Internet Explorer 11.0 - Windows 10
* OK - Internet Explorer 10.0 - Windows 7
* OK - Internet Explorer 9.0 - Windows 7
* ER - Internet Explorer <= 8 (no support "html()" for data-popup-view-value)

Screenshots
------------

- Example: Form with several popup-view-fields

.. image:: https://raw.githubusercontent.com/djk2/django-popup-view-field/master/doc/static/scr1.png
:alt: Form with django-popup-view-fields

- Example: Dialog for select sex

.. image:: https://raw.githubusercontent.com/djk2/django-popup-view-field/master/doc/static/scr2.png
:alt: Dialog for select sex

- Example: Dialog for select color

.. image:: https://raw.githubusercontent.com/djk2/django-popup-view-field/master/doc/static/scr3.png
:alt: Dialog for select color

- Example: Dialog with form

.. image:: https://raw.githubusercontent.com/djk2/django-popup-view-field/master/doc/static/scr4.png
:alt: Dialog with form

Run demo
---------
1. Clone or download repository::

git clone https://github.com/djk2/django-popup-view-field.git

2. Create virtualenv or not (red more: http://docs.python-guide.org/en/latest/dev/virtualenvs/)

3. Install requirements for demo::

cd django-popup-view-field/demo

pip install -r requirements.txt

4. Run developing web server::

python manage.py runserver

5. Run your browser and call url: 127.0.0.1:8000 ::

firefox 127.0.0.1:8000

Install
--------
Install package - There are several solutions, choose your own
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Install using pypi repository::

pip install django-popup-view-field

2. Install using pip + github repository url::

pip install git+https://github.com/djk2/django-popup-view-field.git

3. Install using pip + zip archive::

wget https://github.com/djk2/django-popup-view-field/archive/master.zip
pip install master.zip

4. Clone or download application to your django project directory::

wget https://github.com/djk2/django-popup-view-field/archive/master.zip -O /tmp/master.zip
unzip /tmp/master.zip -d /tmp/
cd my_project_dir
cp -r /tmp/django-popup-view-field-master/django_popup_view_field/ ./

Add ``django_popup_view_field`` to your INSTALLED_APPS setting
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

*settings.py* ::

INSTALLED_APPS = [
...
'bootstrap3', # If you use django-bootstrap3
'crispy_forms', # If you user django-crispy-forms

'django_popup_view_field',
...
]

# If you want use bootstrap4 then uncomment
# DJANGO_POPUP_VIEW_FIELD_TEMPLATE_PACK = 'bootstrap4'

**Warning**:
Is recommended use django-bootstrap3/django-bootstrap4 or django-crispy-forms
to render forms and fields, but this is not necessary.
You can still write django templates using pure CSS from bootstrap3/4.
More information about bootstrap forms in here: http://getbootstrap.com/css/#forms

Add the django_popup_view_field urls to your root url patterns
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*urls.py* ::

urlpatterns = [
...
url(
r'^django_popup_view_field/',
include('django_popup_view_field.urls', namespace="django_popup_view_field")
),
]

**Note**:
The URL path can be whatever you want,
but you must include 'django_popup_view_field.urls' with the 'django_popup_view_field' namespace.
You may leave out the namespace in Django >= 1.9

In your base template, add ``django_popup_view_field_javascript`` tag
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``django_popup_view_field_javascript`` template tag load all required javascripts and
template-scripts for application.
Tag should be append before body close
...
...


...
...
{% django_popup_view_field_javascript %}