add link to help page, and question marks to fields (#1101)
This commit is contained in:
parent
7ad01f704d
commit
29337beaa3
|
@ -23,8 +23,9 @@
|
|||
<dl class="enableFormTabbing" id="search-tabs">
|
||||
<dt id="fieldsetlegend-documents">Documents parlementaires</dt>
|
||||
<dd id="fieldset-documents">
|
||||
<form method="post" action="./#resultsbox">
|
||||
<div class="newsearch"><a href="./#fieldsetlegend-documents">Nouvelle recherche</a></div>
|
||||
<div class="help-page"><a href="./aide-en-ligne">Aide en ligne</a></div>
|
||||
<form method="post" action="./#resultsbox">
|
||||
<div tal:replace="structure view/document_search_form"/>
|
||||
</form>
|
||||
|
||||
|
@ -64,8 +65,9 @@
|
|||
</dd>
|
||||
<dt id="fieldsetlegend-dossiers">Dossiers parlementaires</dt>
|
||||
<dd id="fieldset-dossiers">
|
||||
<form method="post" action="./#resultsbox">
|
||||
<div class="newsearch"><a href="./#fieldsetlegend-dossiers">Nouvelle recherche</a></div>
|
||||
<div class="help-page"><a href="./aide-en-ligne">Aide en ligne</a></div>
|
||||
<form method="post" action="./#resultsbox">
|
||||
<div tal:replace="structure view/dossier_search_form"/>
|
||||
</form>
|
||||
|
||||
|
@ -105,6 +107,7 @@
|
|||
<dt id="fieldsetlegend-questions">Questions & interpellations</dt>
|
||||
<dd id="fieldset-questions">
|
||||
<div class="newsearch"><a href="./#fieldsetlegend-questions">Nouvelle recherche</a></div>
|
||||
<div class="help-page"><a href="./aide-en-ligne">Aide en ligne</a></div>
|
||||
<form method="post" action="./#resultsbox">
|
||||
<div tal:replace="structure view/question_search_form"/>
|
||||
</form>
|
||||
|
@ -183,10 +186,37 @@
|
|||
|
||||
<div tal:replace="structure provider:plone.belowcontentbody" />
|
||||
|
||||
<ul id="help-links" style="display: none;">
|
||||
<li tal:repeat="link view/get_help_links"><a
|
||||
class="help-link"
|
||||
tal:attributes="href link/absolute_url; id link/id; title link/Description"
|
||||
tal:content="link/Title">help text</a></li>
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript" tal:content="string: var PORTAL_URL='${view/portal_url}';"></script>
|
||||
<script metal:use-macro="view/js_macros/macros/labelboxes"></script>
|
||||
<script metal:use-macro="view/js_macros/macros/sorton"></script>
|
||||
<script metal:use-macro="view/js_macros/macros/droppablecheckboxes"></script>
|
||||
<script type="text/javascript">
|
||||
function setup_help_link(index, elem)
|
||||
{
|
||||
var parts = elem.id.split('-');
|
||||
var fieldname = parts[parts.length-1];
|
||||
var help_link = $('#aide-'+fieldname).clone();
|
||||
console.log('help_link:', help_link);
|
||||
if (help_link.length > 0) {
|
||||
help_link.text('?');
|
||||
$(elem).find('label.horizontal').append(help_link);
|
||||
}
|
||||
}
|
||||
|
||||
(function($) {
|
||||
$().ready(function() {
|
||||
$('div.field').each(setup_help_link);
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
</script>
|
||||
|
||||
</tal:block>
|
||||
</tal:main-macro>
|
||||
|
|
|
@ -1014,6 +1014,13 @@ class SearchView(BrowserView):
|
|||
sort_on='dateDoc')
|
||||
return rs
|
||||
|
||||
def get_help_links(self):
|
||||
try:
|
||||
help_dir = getattr(getattr(self.context, 'aide-en-ligne'), 'aide-contextuelle')
|
||||
except AttributeError:
|
||||
return []
|
||||
return help_dir.objectValues()
|
||||
|
||||
|
||||
class Reflex(BrowserView):
|
||||
def __call__(self):
|
||||
|
@ -1035,4 +1042,3 @@ class Reflex(BrowserView):
|
|||
if not rs:
|
||||
return self.request.response.redirect('.')
|
||||
return self.request.response.redirect(rs[0].getURL())
|
||||
|
||||
|
|
Reference in New Issue