Added a button to check all the options while creating a project API token.
:thumbsup:
Relates to #4359
@lenkaseg Could you please amend your commit message to include more details? The message doesn't exactly tell us what this is for.
rebased onto e5c6d7654dca92b42633d984d4900abeda1fec5a
Alright!
pretty please pagure-ci rebuild
You should amend the commit message with a "Fixes #4359" :)
Ah, ok, I didn't get it :)
rebased onto c4184b5c5352bbbce8498bd4db2b8ae6db6f090b
I'd recommend the following changes:
diff --git a/ pagure/templates/add_token.html b/ pagure/templates/add_token.html index d523d53b..e1911c89 100644 --- a/ pagure/templates/add_token.html +++ b/ pagure/templates/add_token.html @@ -36,16 +36,14 @@ {{ render_bootstrap_field( form.description, field_description="Small description of this API token") }} <strong><label for="acls">ACLs</label></strong><br/> - <script> - function toggle(source) { + <script type="text/javascript"> + function toggle() { var checkboxes = document.querySelectorAll('input[type="checkbox"]'); for (var i = 0; i < checkboxes.length; i++) { - if (checkboxes[i] != source) - checkboxes[i].checked = source.checked; + checkboxes[i].checked = !checkboxes[i].checked; } } </script> - <input type="checkbox" onClick="toggle(this)"/> Check all?<p/> {% for acl in acls %} <div> <label class="c-input c-checkbox"> @@ -65,7 +63,7 @@ <a class="btn btn-secondary" href="{{ url_for('ui_ns.user_settings') }}#nav-api-tab">Cancel</a> {% endif %} - + <span class="btn" onclick="toggle()">Toggle all</span> {{ form.csrf_token }} </div> </form>
rebased onto e97291fc0d047a8a519bd17cee7fe1c607efbc90
Looks good to me, let's wait on jenkins and get it in :)
rebased onto 5d0a68c0f770169fee602d719dc9bcdb6af7b13c
I guess we should adjust the commit message since there is no checkbox anymore :)
True. I did in the commit message, but not here. So it is a button now?
rebased onto 22141cb17c8ae93fbb7417c87c3094a82d46a363
Pull-Request has been merged by pingou
Added a button to check all the options while creating a project API token.