Contents
Integration of django-inplaceedit with bootstrap 3
It is distributed under the terms of the GNU Lesser General Public License.
This egg would not have been possible without the help of Tyrdall
- django-inplaceedit (== 1.4.1)
- Bootstrap (== 3.3.5)
- django-inplace-edit-extra-fields (== 0.6.1, optional but recommended)
- django-bootstrap3-datetimepicker (== 2.2.3, optional but recommended)
Video Demo, of django-inplaceedit, django-inplaceedit-extra-fields and django-inlinetrans (Set full screen mode to view it correctly)
Attention: This demo is not a demo of this package, in this video there are not any inegration with bootstrap. Please to see a demo use the testing django project.
After installing django-inplaceedit egg (1.4.1)
After installing django-inplaceedit-extra-fields egg (0.6.1, this is optional but recommended)
And after installing django-bootstrap3-datetimepicker egg (2.2.3, this is optional but recommended)
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', #.....................# 'inplaceeditform_bootstrap', # it is very important that this app is before that inplaceeditform and inplaceeditform_extra_fields 'inplaceeditform', 'inplaceeditform_extra_fields', # this is optional but recommended 'bootstrap3_datetime', # this is optional but recommended ) ... # Optional, but recommended ADAPTOR_INPLACEEDIT = {} if 'inplaceeditform_extra_fields' in INSTALLED_APPS: ADAPTOR_INPLACEEDIT['tiny'] = 'inplaceeditform_extra_fields.fields.AdaptorTinyMCEField' # You can add the other adaptors of inplaceeditform_extra_fields # https://pypi.python.org/pypi/django-inplaceedit-extra-fields#installation if 'bootstrap3_datetime' in INSTALLED_APPS: ADAPTOR_INPLACEEDIT['date'] = 'inplaceeditform_bootstrap.fields.AdaptorDateBootStrapField' ADAPTOR_INPLACEEDIT['datetime'] = 'inplaceeditform_bootstrap.fields.AdaptorDateTimeBootStrapField' INPLACEEDIT_EDIT_TOOLTIP_TEXT = 'Please doubleclick to edit'
If you want, you can register these fields in your settings with different keys:
... if 'bootstrap3_datetime' in INSTALLED_APPS: ADAPTOR_INPLACEEDIT['date_bootstrap'] = 'inplaceeditform_bootstrap.fields.AdaptorDateBootStrapField' ADAPTOR_INPLACEEDIT['datetime_bootstrap'] = 'inplaceeditform_bootstrap.fields.AdaptorDateTimeBootStrapField'
And after that, to want use a specific adaptor you can pass it to the templatetag, e.g.:
{% inplace_edit "content.field_name" adaptor="date_bootstrap" %} {% inplace_edit "content.field_name" adaptor="datetime_bootstrap" %}
- This code depends on the bootstrap
- This is a specific solution
Exists a testing django project. This project can use as demo project.
This project overwrites the default options of django-inplaceedit and a default option of django-inplaceedit-bootstrap
INPLACEEDIT_AUTO_SAVE = True INPLACEEDIT_EVENT = 'click' INPLACEEDIT_EDIT_TOOLTIP_TEXT = 'Click to edit' # This option is of django-inplaceedit-bootstrap
You can get the bleeding edge version of django-inplaceedit-bootstrap by doing a clone of its git repository:
git clone [email protected]:django-inplaceedit/django-inplaceedit-bootstrap.git