Skip to content

Commit

Permalink
rename sodar-btn-submit-once
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Sep 21, 2023
1 parent 7fb6eaa commit b7ddadb
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Added

- **General**
- Release cleanup issue template (#1289)
- Use ``sodar-pr-btn-submit-once`` in object create forms (#1233)
- Use ``sodar-btn-submit-once`` in object create forms (#1233)
- **Projectroles**
- ``queryset_project_field`` override in ``APIProjectContextMixin`` (#1273)
- ``sodar-pr-btn-submit-once`` class for forms (#1233)
- ``sodar-btn-submit-once`` class for forms (#1233)

Changed
-------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/dev_resource.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ Submit Multi-Click Protection
-----------------------------

To avoid unwanted effects from a user clicking the submit button on a form
multiple times, it is recommended to use the ``sodar-pr-btn-submit-once`` class
on the submit button in your server-side form templates. Introducing this class
multiple times, it is recommended to use the ``sodar-btn-submit-once`` class on
the submit button in your server-side form templates. Introducing this class
will disable the button after the initial click while the form is submitted.
This is especially recommended for forms responsible for creating objects.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/major_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Release Highlights
==================

- Add REST API project context queryset field override
- Add sodar-pr-btn-submit-once class for forms with usage
- Add sodar-btn-submit-once class for forms with usage
- Fix project list view rendering issues with finder role
- General bug fixes and minor updates

Expand Down
2 changes: 1 addition & 1 deletion filesfolders/templates/filesfolders/file_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h3>
>
<i class="iconify" data-icon="mdi:arrow-left-circle"></i> Cancel
</a>
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
{% if object.pk %}
<i class="iconify" data-icon="mdi:lead-pencil"></i> Update
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion filesfolders/templates/filesfolders/folder_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h3>
>
<i class="iconify" data-icon="mdi:arrow-left-circle"></i> Cancel
</a>
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
<i class="iconify" data-icon="mdi:check-bold"></i>
{% if object.pk %}Update{% else %}Add{% endif %}
</button>
Expand Down
2 changes: 1 addition & 1 deletion filesfolders/templates/filesfolders/hyperlink_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h3>
>
<i class="iconify" data-icon="mdi:arrow-left-circle"></i> Cancel
</a>
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
<i class="iconify" data-icon="mdi:check-bold"></i>
{% if object.pk %}
Update
Expand Down
2 changes: 1 addition & 1 deletion projectroles/static/projectroles/js/projectroles.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ $(window).on('resize', function () {


$(document).ready(function () {
$('.sodar-pr-btn-submit-once').click(function () {
$('.sodar-btn-submit-once').click(function () {
$(this).attr('disabled', true);
$(this).find('svg').remove();
$(this).prepend('<span class="spinner-border spinner-border-sm" ' +
Expand Down
2 changes: 1 addition & 1 deletion projectroles/templates/projectroles/project_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h2 id="sodar-pr-project-form-title" data-project-type="CATEGORY">
href="{{ request.session.real_referer }}">
<i class="iconify" data-icon="mdi:arrow-left-circle"></i> Cancel
</a>
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
<i class="iconify" data-icon="mdi:check-bold"></i>
{% if object.pk %}
Update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3>Send Invite</h3>
data-toggle="modal" data-target="#sodar-modal">
<i class="iconify" data-icon="mdi:eye"></i> Preview
</a>
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
<i class="iconify" data-icon="mdi:send"></i> Send
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h4><i class="iconify" data-icon="mdi:lead-pencil"></i> Modified Access</h4>
</div>

<div class="container-fluid text-right">
<button type="submit" class="btn btn-primary">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
<i class="iconify" data-icon="mdi:check-bold"></i> Confirm
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion projectroles/templates/projectroles/remotesite_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h2>{% if object.pk %}Update{% else %}Add{% endif %} {% if site_mode == 'TARGET'
href="{{ request.session.real_referer }}">
<i class="iconify" data-icon="mdi:arrow-left-circle"></i> Cancel
</a>
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
<i class="iconify" data-icon="mdi:check-bold"></i>
{% if object.pk %}Update{% else %}Add{% endif %}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h3>Add Member</h3>
data-toggle="modal" data-target="#sodar-modal">
<i class="iconify" data-icon="mdi:eye"></i> Preview
</a>
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
{% if object.pk %}
<i class="iconify" data-icon="mdi:check-bold"></i> Update
{% elif promote_as %}
Expand Down
2 changes: 1 addition & 1 deletion projectroles/templates/projectroles/user_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2>
{{ form | crispy }}
<div class="row">
<div class="btn-group ml-auto" role="group">
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
<i class="iconify" data-icon="mdi:check-bold"></i>
{% if object %}Update{% else %}Create{% endif %}
</button>
Expand Down
2 changes: 1 addition & 1 deletion projectroles/tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@ def test_submit_button(self):
self.superuser, url, wait_elem=None, wait_loc='ID'
)
element = self.selenium.find_element(
By.CLASS_NAME, 'sodar-pr-btn-submit-once'
By.CLASS_NAME, 'sodar-btn-submit-once'
)
self.assertEqual(element.text, 'Create')
self.assertTrue(element.is_enabled())
Expand Down
2 changes: 1 addition & 1 deletion tokens/templates/tokens/token_create.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2>Create API Token</h2>
href="{% url 'tokens:list' %}">
<i class="iconify" data-icon="mdi:arrow-left-circle"></i> Cancel
</a>
<button type="submit" class="btn btn-primary sodar-pr-btn-submit-once">
<button type="submit" class="btn btn-primary sodar-btn-submit-once">
<i class="iconify" data-icon="mdi:check-bold"></i> Create
</button>
</div>
Expand Down

0 comments on commit b7ddadb

Please sign in to comment.