Code Monkey home page Code Monkey logo

django-crispy-formset-modal's People

Contributors

blasferna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ademkocamaz

django-crispy-formset-modal's Issues

Add a setting in settings.py to define a custom edit icon

Currently, the icon for the edit function is hard-coded. This limits the ability for users to personalize their interface based on their specific needs.

Add a new setting in settings.py, say CRIPSY_FORMSET_MODAL. This will enable users to define specific parameters of the package via a dictionary configuration.

Example

# In settings.py
CRISPY_FORMSET_MODAL = {
    "edit_icon": {
        'bootstrap4': "...",
        'tailwind': "...",
        'bulma': "...",
        'bootstrap5': "..."
    }
}

TemplateDoesNotExist at /degree_list/ home/degree_form.html i got this error how can i solve

TemplateDoesNotExist at /degree_list/ home/degree_form.html i got this error how can i solve

### 1. > if you provide more details about templates it will be useful

my project director structure is

SMS/
โ”œโ”€โ”€ apps/
โ”‚ โ”œโ”€โ”€ templates/
โ”‚ โ”‚ โ”œโ”€โ”€ crispy_formset_modal/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ bootstrap5/
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ form.html
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ modal.html
โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ table.html
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ...
โ””โ”€โ”€ core

class UpdateDegreeView(UpdateWithInlinesView):
model = degree
success_url = reverse_lazy('degreesub_list')
#template_name = 'crispy_formset_modal/bootstrap5/form.html'
inlines = [DegreeSubjectsInline, ]
form_class = DegreeFormNew

Screenshot from 2023-09-05 18-02-15

Add Keyboard Shortcut Instructions in Modal

Display Keyboard Shortcuts in Modal for Enhanced User Awareness

The modal already supports the use of keyboard combinations for navigating between records. For instance, users can utilize:

ctrl+down
ctrl+up

However, we currently lack a mechanism to notify users about this available functionality. We should include instructions or hints within the modal to inform users about these keyboard shortcuts, thereby enhancing the overall user experience.

Reference:

imagen

Add to template packages:

  • Bootstrap4
  • Bootstrap5
  • Bulma
  • Tailwind

Missing Assets for Widgets Used in Formsets

There's an issue with the package where the necessary CSS and JavaScript dependencies for widgets are not loaded when these widgets are placed in a formset within a form. Please note that this issue does not occur when the same widget is added directly to the main form.

imagen

Steps to Reproduce:

The issue is reproducible using the django-bootstrap-datepicker-plus package with the following steps:

  1. Install the package: pip install django-bootstrap-datepicker-plus

  2. Add it to INSTALLED_APPS:

    INSTALLED_APPS = [
        "bootstrap_datepicker_plus",
    ]
  3. Create a custom widget without redefining the CSS and JavaScript:

    from bootstrap_datepicker_plus.widgets import (
        DatePickerInput,
        TimePickerInput
    )
    
    class DatePickerWidget(DatePickerInput):
        def __init__(self, attrs=None, format=None):
            attrs = attrs or {}
            attrs.update({'class': 'datepicker'})
            super(DatePickerWidget, self).__init__(attrs, format)
  4. Assign the custom widget to a formset example (in this case, PaymentTermForm):

    from demo.widgets import DatePickerWidget
    
    class PaymentTermForm(forms.ModelForm):
        def __init__(self, *args, **kwargs):
            ...
        class Meta:
            model = PaymentTerm
            fields = "__all__"
            widgets = {"due_date": DatePickerWidget}

Uncaught TypeError: e is null when using django-bootstrap-datepicker-plus

The error occurs when the modal form is closed to update the table.

Uncaught TypeError: e is null
    hasFieldError modal-form.js:48
    _refresh formset-modal.js:370
    _refresh formset-modal.js:368
    _refresh formset-modal.js:335
    _onModalFormClose formset-modal.js:197
    onClose formset-modal.js:132
    _onModalClose modal-form.js:95
    onHide modal-form.js:72
    hide modal.js:185
    close modal-form.js:114
    _addEvents modal-form.js:40
    _addEvents modal-form.js:39
    _addEvents modal-form.js:38
    _ modal-form.js:26
    _newModalForm formset-modal.js:135
    _onFormsetAdded formset-modal.js:146
    _addEvents formset-modal.js:94
    jQuery 7
    bindForm formset.js:135
    jQuery 7
    bindForm formset.js:137
    addForm formset.js:97
    jQuery 10
    u formset.js:51
    getOrCreate formset.js:75
    t.fn[h]/< index.js:72
    jQuery 2
    h index.js:71
    _init formset-modal.js:48
    x formset-modal.js:38
    C index.js:16
    C index.js:15
    EventListener.handleEvent* utils.js:155
    <anonymous> utils.js:155

Issue with boolean fields

Hi, I really appreciate your work.

Using boolean fields with class="form-switch" and role="switch" defined in a modal form, I've got this nasty error:
Uncaught ReferenceError: assignment to undeclared variable checked.

How is possible to fix that?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.