oscarmlage / django-cruds-adminlte

django-cruds is simple drop-in django app that creates CRUD for faster prototyping
BSD 3-Clause "New" or "Revised" License
424 stars 83 forks source link

Support overriding blocks in CRUD views #77

Closed mbourqui closed 6 years ago

mbourqui commented 6 years ago

Hi,

This PR allows users to quickly change any block in a template without having to overwrite the whole template. For example, if you'd like to change the page title, name and description, you just need to set:

from cruds_adminlte.crud import CRUDView
from django.utils.translation import ugettext_lazy as _

class MyView(CRUDView):
    from .models import MyModel
    model = MyModel
    template_blocks = {'title': _('My fancy page title'),
                       'page_name': _('Some results'),
                       'page_description': _('Details')}
oscarmlage commented 6 years ago

Merged! Thanks @mbourqui for the work.