Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
fix remaining static links
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Bengfort committed Apr 8, 2014
1 parent fd70bc4 commit 3b921c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
11 changes: 7 additions & 4 deletions src/adhocracy/lib/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,19 @@ def add_rss(title, link):
type='application/rss+xml')


def help_link(text, page, anchor=None):
def help_url(page, anchor=None):
if adhocracy_service.instance_staticpages_api_address():
url = base_url('/static/%s.%s')
else:
url = base_url('/static/%s.%s', None)
if anchor is not None:
url += "#" + anchor
full_url = url % (page, 'html')
return (u"<a target='_new' class='staticlink_%s' href='%s' "
u">%s</a>") % (page, full_url, text)
return url % (page, 'html')


def help_link(text, page, anchor=None):
url = help_url(page, anchor=anchor)
return (u"<a class='staticlink_%s' href='%s' >%s</a>") % (page, url, text)


def get_redirect_url(target=u'login', entity=None, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion src/adhocracy/templates/error/http.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ <h2>${_("Error %s") % c.error_code}</h2>
%endif

%if not c.hide_notify:
<p>${_("If this error continues to occur, please <a class='staticlink_imprint' href='/static/imprint.html'>notify the developers</a> with a description of what you were trying to do.")|n} ${_("An automated email message describing the situation has been sent to our developers.")}</p>
<p>${_("If this error continues to occur, please %snotify the developers%s with a description of what you were trying to do.") % tuple(h.help_link('&&', 'imprint').split('&&'))|n}
${_("An automated email message describing the situation has been sent to our developers.")}</p>
%endif
</%block>
4 changes: 2 additions & 2 deletions src/adhocracy/templates/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
${h.staticpage.render_external_navigation(active) | n}
%else:

${nav_link(href=h.base_url('/static/about.html', None),
${nav_link(href=h.help_url('about'),
text=_('About'),
a_class='staticlink_about',
li_class=_class('about'),
id_="nav_about")}
<!--TODO: remove dummy link to merge in new links with diazo themeing-->
<li id="nav_dummy" style="display: none;"></li>
${nav_link(href=h.base_url('/static/help.html', None),
${nav_link(href=h.help_url('help'),
text=_("Help"),
a_class='staticlink_help',
li_class=_class('help'),
Expand Down
2 changes: 1 addition & 1 deletion src/adhocracy/templates/user/register_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<p>
%if c.agree_text is None:
${_("By registering, you agree with the %s.") % ("<a class='staticlink_terms' href='/static/terms.html'>%s</a>" % _("Terms and Conditions")) |n}
${_("By registering, you agree with the %s.") % h.help_link(_("Terms and Conditions"), 'terms') |n}
${_(u"We'll occasionally inform you about important events such as the start of a new participation process via email.")}
%else:
${c.agree_text|n}
Expand Down

0 comments on commit 3b921c9

Please sign in to comment.