only include "create doc" link if appropriate
This commit is contained in:
parent
158428aadc
commit
424b6d3004
|
@ -1,7 +1,8 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:tal="http://xml.zope.org/namespaces/tal"
|
xmlns:tal="http://xml.zope.org/namespaces/tal"
|
||||||
tal:omit-tag=""
|
tal:omit-tag=""
|
||||||
tal:define="href view/href">
|
tal:define="href view/href;
|
||||||
|
create_href view/create_href">
|
||||||
<a id="" class="" href="#" tal:condition="href"
|
<a id="" class="" href="#" tal:condition="href"
|
||||||
tal:attributes="id view/id;
|
tal:attributes="id view/id;
|
||||||
class view/klass;
|
class view/klass;
|
||||||
|
@ -20,6 +21,9 @@
|
||||||
onkeydown view/onkeydown;
|
onkeydown view/onkeydown;
|
||||||
onkeyup view/onkeyup"><tal:block
|
onkeyup view/onkeyup"><tal:block
|
||||||
condition="view/value" content="view/value"
|
condition="view/value" content="view/value"
|
||||||
/></a><span tal:condition="not: href" tal:content="view/value"></span>
|
/></a>
|
||||||
<a tal:condition="not: href" tal:attributes="href view/create_href">(créer document)</a>
|
<tal:block tal:condition="not: href">
|
||||||
|
<span tal:condition="not: href" tal:content="view/value"></span>
|
||||||
|
<a tal:condition="create_href" tal:attributes="href view/create_href">(créer document)</a>
|
||||||
|
</tal:block>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -300,6 +300,10 @@ class MailIdWidget(TextWidget):
|
||||||
|
|
||||||
def create_href(self):
|
def create_href(self):
|
||||||
form_url = self.request.getURL()
|
form_url = self.request.getURL()
|
||||||
|
from themis.config.utils import get_document_type_for_mail
|
||||||
|
document_type = get_document_type_for_mail(self.context)
|
||||||
|
if not document_type:
|
||||||
|
return None
|
||||||
return "%s/++widget++%s/@@createDoc" % (form_url, self.name)
|
return "%s/++widget++%s/@@createDoc" % (form_url, self.name)
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue