Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2aa5a01

Browse files
committed
Merge pull request alphagov#213 from Davidslv/only-show-more-information-link-when-link-is-provided
Only show "more information" link when one is provided
2 parents 73da8d7 + a1886b3 commit 2aa5a01

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

campaigns.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@ def template(app):
3939
<div class="campaign-inner">
4040
<h1>{{ heading|e }}</h1>
4141
<p>{{ extra_info|e }}</p>
42-
<a href="{{ more_info_url|e }}">More information</a>
42+
43+
{% if more_info_url %}
44+
<a href="{{ more_info_url|e }}">More information</a>
45+
{% endif %}
4346
</div>
4447
</div>""")
4548
elif app == 'static':
4649
template = Template("""<p>{{ heading|e }}<br />
4750
{{ extra_info|e }}</p>
48-
<a href="{{ more_info_url|e }}" class="right">More information</a>""")
51+
{% if more_info_url %}
52+
<a href="{{ more_info_url|e }}" class="right">More information</a>
53+
{% endif %}""")
4954

5055
env['template_contents'] = template.render(env.context)
5156

0 commit comments

Comments
 (0)