Bug 29999: (follow-up) Show the remote image tab if selected

This follow-up corrects the markup so that if a value is entered in the
"Remote image" field, the correct tab will be selected upon page load.

The patch also corrrects the input name on the "No image" field so that
the option works correctly.

To test, apply the patch and edit an authorized value.

- Select an icon from an icon set. Save, and then re-edit.
  - The correct icon set tab should be activated.
- Select "No image," save, and re-edit.
  - The "No image" tab should be selected.
- On the "Remote image" tab, enter a remote image url, e.g.
  https://via.placeholder.com/50/FF0000/FFFFFF.png. Save and re-edit.
- The "Remote image" should be selected.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Owen Leonard 2022-03-17 18:17:44 +00:00 committed by Fridolin Somers
parent 2fc5c28fec
commit 7d1e2bb45c

View file

@ -189,7 +189,7 @@
<div id="none" role="tabpanel" class="tab-pane">
<div class="authval-icons">
<label for="noimage">No image:
<input type="radio" name="imageurl" id="noimage" value="removeImage" />
<input type="radio" name="image" id="noimage" value="removeImage" />
</label>
</div>
</div> <!-- /.tab-pane -->
@ -221,7 +221,11 @@
</div> <!-- /.tab-pane -->
[% END # /FOREACH imageset %]
<div id="remote" role="tabpanel" class="tab-pane">
[% IF av.imageurl.match('^http') %]
<div id="remote" role="tabpanel" class="tab-pane active">
[% ELSE %]
<div id="remote" role="tabpanel" class="tab-pane">
[% END %]
<label for="remote_image_check"> Remote image:</label>
[% IF av.imageurl.match('^http') %]
<input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />