Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to locate asyncSettings.successMessage in the code ? #185

Open
aathlan opened this issue Sep 14, 2021 · 1 comment
Open

how to locate asyncSettings.successMessage in the code ? #185

aathlan opened this issue Sep 14, 2021 · 1 comment
Labels
enhancement New feature or request high priority

Comments

@aathlan
Copy link

aathlan commented Sep 14, 2021

I would like to locate asyncSettings.successMessage below the {% endfor %} in the modal-body div of my modal. When I click on update, I would like to display a message in the div of class "modal_success". But the asyncSettings.successMessage variable is a string variable and can be located only on the body tag of my html according to the js and not in an other tag with specific class or id.

This is my code, for example update_book.html :

<div class="modal-body">
    <div class="{% if form.non_field_errors %}invalid{% endif %} mb-2">
      {% for error in form.non_field_errors %}
      {{ error }}
      {% endfor %}
    </div>

    {% for field in form %}
    <div class="form-group">
      <label for="{{ field.id_for_label }}">{{ field.label }}</label>
      {% render_field field class="form-control" placeholder=field.label %}
      <div class="{% if field.errors %} invalid{% endif %}">
        {% for error in field.errors %}
        <p class="help-block">{{ error }}</p>
        {% endfor %}
      </div>
    </div>
    {% endfor %}
    <div id='modal_success' class= 'alert alert-success' role='alert'> </div>
  </div>


  <div class="modal-footer">
    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
    <button type="submit" class="btn btn-primary">Update</button>
  </div>

</form>

Or can I proceed to locate the asyncSettings.successMessage in the div with modal_success for class ?

Thank you.

@trco trco added the Q&A Questions and answers label Sep 14, 2021
@trco
Copy link
Owner

trco commented Sep 14, 2021

@aathlan As you already found out the message is always prepended to the body when asyncSetting is used. This is a great idea for enhancement, since it extends the options for the user. I'll tag this proposal with enhancement and high priority labels.

Of course you're invited to submit PR if you feel confident to implement this. Unfortunately I can't define my timeline, but I'll do my best to start working on this package again. Summer is almost over and autumn is definitely more appropriate time to be bound to the screen.

@trco trco added enhancement New feature or request high priority and removed Q&A Questions and answers labels Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

No branches or pull requests

2 participants