Add controls to cancel / confirm search selection

This refs 32826
This commit is contained in:
Laurent Lasudry 2019-10-25 13:13:52 +02:00
parent ba1d9cd185
commit 463d140eb0
6 changed files with 49 additions and 1 deletions

View File

@ -22,6 +22,14 @@ msgstr "Ajouter"
msgid "Add Collection Portlet"
msgstr "Ajouter un portlet de collection"
#: ../templates/view_form.pt:23
msgid "Cancel"
msgstr "Annuler"
#: ../templates/view_form.pt:26
msgid "Confirm"
msgstr "Confirmer"
#: ../searchview.py:372
msgid "Creation Date"
msgstr "Date de création"

View File

@ -25,6 +25,14 @@ msgstr ""
msgid "Add Collection Portlet"
msgstr ""
#: ../templates/view_form.pt:23
msgid "Cancel"
msgstr ""
#: ../templates/view_form.pt:26
msgid "Confirm"
msgstr ""
#: ../searchview.py:372
msgid "Creation Date"
msgstr ""

View File

@ -128,3 +128,15 @@ a.batch-link.current {
#form-widgets-sort_reversed-0 {
display: none;
}
#iframe-controls {
text-align: center;
}
#iframe-controls input[type=submit] {
height: 2em;
font-size: 1.2em;
padding-left: 0.5em;
padding-right: 0.5em;
margin: 1em 0.5em 0em 0.5em;
}

View File

@ -521,4 +521,13 @@ function select_metatype(elem)
$(this).find('select:disabled').enable();
});
$('#confirm-overlay').click(function() {
$('div.close', window.parent.document).click();
});
$('#cancel-overlay').click(function() {
$('#searchresults input:checkbox').removeAttr('checked');
$('#searchresults tr').removeClass('selected');
$('div.close', window.parent.document).click();
});
}(jQuery));

View File

@ -17,5 +17,16 @@
<div id="searchresults"/>
<div id="iframe-controls"
tal:condition="request/iframe | nothing"
i18n:domain="pfwbged.collection">
<input id="cancel-overlay" class="allowMultiSubmit" type="submit"
value="Cancel"
i18n:attributes="value" />
<input id="confirm-overlay" class="allowMultiSubmit" type="submit"
value="Confirm"
i18n:attributes="value" />
</div>
</body>
</html>

View File

@ -50,6 +50,6 @@ class PFWBRelatedDocsWidget(RelatedDocsWidget):
$(this).after(" ");
});
""" % dict(search_url=api.portal.get().absolute_url() + '/pfwbsearch?iframe',
""" % dict(search_url=api.portal.get().absolute_url() + '/pfwbsearch?iframe=1',
id=self.name.replace('.', '-'),
anchor_text=translate(_(u'Add'), context=self.request))