Commit e155569e authored by Michal Čihař's avatar Michal Čihař

Do not hardcode urls

parent 95db47f4
......@@ -37,20 +37,20 @@
</head>
<body>
<h1 class="ui-state-default"><a href="/">{% include "title.html" %}</a></h1>
<h1 class="ui-state-default"><a href="{% url 'home' %}">{% include "title.html" %}</a></h1>
<ul class="menu">
{% if user.is_authenticated %}
<li><a href="/accounts/profile/">{% blocktrans with user.get_full_name as name %}Logged in as {{ name }}{% endblocktrans %}</a></li>
<li><a href="/accounts/logout/">{% trans "Logout" %}</a></li>
<li><a href="{% url 'profile' %}">{% blocktrans with user.get_full_name as name %}Logged in as {{ name }}{% endblocktrans %}</a></li>
<li><a href="{% url 'auth_logout' %}">{% trans "Logout" %}</a></li>
{% else %}
<li><a href="/accounts/register/">{% trans "Register" %}</a></li>
<li><a href="/accounts/login/?next={{ current_url }}">{% trans "Login" %}</a></li>
<li><a href="{% url 'weblate_register' %}">{% trans "Register" %}</a></li>
<li><a href="{% url 'auth_login' %}?next={{ current_url }}">{% trans "Login" %}</a></li>
{% endif %}
</ul>
<ul class="breadcrumbs">
<li><a href="/">{% trans "Home" %}</a></li>
<li><a href="{% url 'home' %}">{% trans "Home" %}</a></li>
{% block breadcrumbs %}
{% endblock %}
</ul>
......@@ -76,9 +76,9 @@
{% if not request.is_ajax %}
</div>
<ul class="footer">
<li>{% blocktrans %}Powered by <a href="http://weblate.org">Weblate {{ version }}</a>{% endblocktrans %}</li>
<li><a href="{% url 'weblate.trans.views.about' %}">{% blocktrans %}About Weblate{% endblocktrans %}</a></li>
<li><a href="{% url 'weblate.accounts.views.contact' %}">{% trans "Contact us" %}</a></li>
<li>{% blocktrans %}Powered by <a href="http://weblate.org/">Weblate {{ version }}</a>{% endblocktrans %}</li>
<li><a href="{% url 'about' %}">{% blocktrans %}About Weblate{% endblocktrans %}</a></li>
<li><a href="{% url 'contact' %}">{% trans "Contact us" %}</a></li>
<li><a href="http://weblate.readthedocs.org/en/weblate-{{ version }}/usage.html">{% trans "Documentation" %}</a></li>
</ul>
</body>
......
......@@ -37,7 +37,7 @@
<h1>{% blocktrans with object.name as project %}Get involved in {{ project }}!{% endblocktrans %}</h1>
<p>
{% blocktrans with object.name as name %}Hi, and thank you for your interest!{% endblocktrans %}
{% blocktrans %}Hi, and thank you for your interest!{% endblocktrans %}
</p>
<p>
{% blocktrans with object.name as name %}{{ name }} is being translated using <a href="http://weblate.org/">Weblate</a>, a web tool designed to ease translating for both developers and translators.{% endblocktrans %}
......@@ -46,10 +46,11 @@
{% blocktrans with object.name as name and object.get_total as total and object.get_language_count as languages and object.get_absolute_url as url and object.get_translated_percent as percent%}Translation project for {{ name }} currently contains {{ total }} strings for translation and is <a href="{{ url }}">being translated into {{ languages }} languages</a>. Overall, these translations are {{ percent }}% complete.{% endblocktrans %}
</p>
<p>
{% blocktrans with object.name as name and object.get_total as total and object.get_absolute_url as url %}If you would like to contribute to translation of {{ name }}, you need to <a href="/accounts/register/">register on this server</a>.{% endblocktrans %}
{% url 'weblate_register' as reg_url %}
{% blocktrans with object.name as name %}If you would like to contribute to translation of {{ name }}, you need to <a href="{{ reg_url }}">register on this server</a>.{% endblocktrans %}
</p>
<p>
{% blocktrans with object.name as name and object.get_total as total and object.get_absolute_url as url %}Once you have activated your account just proceed to the <a href="{{ url }}">translation section</a>.{% endblocktrans %}
{% blocktrans with object.get_absolute_url as url %}Once you have activated your account just proceed to the <a href="{{ url }}">translation section</a>.{% endblocktrans %}
</p>
</div>
......
......@@ -18,8 +18,8 @@
<li><a href="#your">{% trans "Your translations" %}</a></li>
{% endif %}
<li><a href="#projects">{% trans "Projects" %}</a></li>
<li><a href="/languages/">{% trans "Languages" %}</a></li>
<li><a href="/checks/">{% trans "Checks" %}</a></li>
<li><a href="{% url 'languages' %}">{% trans "Languages" %}</a></li>
<li><a href="{% url 'checks' %}">{% trans "Checks" %}</a></li>
</ul>
{% if usertranslations %}
......@@ -105,8 +105,8 @@
<div id="others">
<ul>
<li><a href="{% url 'weblate.trans.views.show_languages' %}">{% trans "Languages summary" %}</a></li>
<li><a href="{% url 'weblate.trans.views.show_checks' %}">{% trans "Checks overview" %}</a></li>
<li><a href="{% url 'languages' %}">{% trans "Languages summary" %}</a></li>
<li><a href="{% url 'checks' %}">{% trans "Checks overview" %}</a></li>
</ul>
</div>
......
......@@ -7,8 +7,9 @@
<h2>{% trans "Your account could not be activated" %}</h2>
<p>
{% blocktrans count expiration_days as days %}This may be because it is already active or because you waited over {{ days }} day to activate it.{% plural %}This may be because it is already active or because you waited over {{ days }} days to activate it.{% endblocktrans %}
{% url 'registration.views.register' as reg_url %}
{% blocktrans %}If this is not the case, please <a href="/contact/">contact</a> the website administrator. Otherwise, you may <a href="{{ reg_url }}">register again</a>.{% endblocktrans %}
{% url 'weblate_register' as reg_url %}
{% url 'contact' as contact_url %}
{% blocktrans %}If this is not the case, please <a href="{{ contact_url }}">contact</a> the website administrator. Otherwise, you may <a href="{{ reg_url }}">register again</a>.{% endblocktrans %}
</p>
{% endblock %}
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block content %}
<p>{% blocktrans %}Sorry, but registrations on this site are disabled. You can <a href="/contact/">contact us</a> for more details.{% endblocktrans %}</p>
<p>
{% url 'contact' as contact_url %}
{% blocktrans %}Sorry, but registrations on this site are disabled. You can <a href="{{ contact_url }}">contact us</a> for more details.{% endblocktrans %}
</p>
{% endblock %}
......@@ -7,6 +7,9 @@
<p>{% blocktrans %}Thank you for registering. You will very soon receive an email with
a confirmation link. Please follow this link in order to complete your registration.{% endblocktrans %}</p>
<p>{% blocktrans %}If you don't receive it shortly, please check your spam folder. If it's not there, please <a href="/contact/?subject=Lost activation code">contact us</a>.{% endblocktrans %}</p>
<p>
{% url 'contact' as contact_url %}
{% blocktrans %}If you don't receive it shortly, please check your spam folder. If it's not there, please <a href="{{ contact_url }}?subject=Lost activation code">contact us</a>.{% endblocktrans %}
</p>
{% endblock %}
......@@ -155,9 +155,9 @@
<div class="translate-tabs">
<ul>
<li><a href="#tab-nearby" title="{% trans "Messages placed around this one" %}">{% trans "Nearby messages" %}</a></li>
<li><a href="/js/similar/{{ unit.id }}/" title="{% trans "Similar messages" %}">{% trans "Similar messages" %}</a></li>
<li><a href="/js/other/{{ unit.id }}/?type={{ type }}&amp;pos={{ unit.position }}{{ search_url }}" title="{% trans "Same message used in different subprojects" %}">{% trans "All locations" %}</a></li>
<li><a href="/js/dictionary/{{ unit.id }}/" title="{% trans "Words extracted from dictionary" %}">{% trans "Words in dictionary" %}</a></li>
<li><a href="{% url 'js-similar' unit_id=unit.id %}" title="{% trans "Similar messages" %}">{% trans "Similar messages" %}</a></li>
<li><a href="{% url 'js-other' unit_id=unit.id %}?type={{ type }}&amp;pos={{ unit.position }}{{ search_url }}" title="{% trans "Same message used in different subprojects" %}">{% trans "All locations" %}</a></li>
<li><a href="{% url 'js-dictionary' unit_id=unit.id %}" title="{% trans "Words extracted from dictionary" %}">{% trans "Words in dictionary" %}</a></li>
<li><a href="#tab-changes" title="{% trans "List of recent changes done in Weblate" %}">{% trans "Recent edits" %}</a></li>
<li><a href="#tab-project" title="{% trans "Information about project" %}">{% trans "Project" %}</a></li>
</ul>
......
......@@ -41,7 +41,7 @@ js_info_dict = {
admin.site.index_template = 'admin/custom-index.html'
urlpatterns = patterns('',
url(r'^$', 'weblate.trans.views.home'),
url(r'^$', 'weblate.trans.views.home', name = 'home'),
url(r'^projects/$', RedirectView.as_view(url = '/')),
url(r'^projects/(?P<project>[^/]*)/$', 'weblate.trans.views.show_project'),
url(r'^engage/(?P<project>[^/]*)/$', 'weblate.trans.views.show_engage'),
......@@ -82,10 +82,10 @@ urlpatterns = patterns('',
url(r'^lock/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/$', 'weblate.trans.views.lock_translation'),
url(r'^unlock/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/$', 'weblate.trans.views.unlock_translation'),
url(r'^languages/$', 'weblate.trans.views.show_languages'),
url(r'^languages/$', 'weblate.trans.views.show_languages', name='languages'),
url(r'^languages/(?P<lang>[^/]*)/$', 'weblate.trans.views.show_language'),
url(r'^checks/$', 'weblate.trans.views.show_checks'),
url(r'^checks/$', 'weblate.trans.views.show_checks', name='checks'),
url(r'^checks/(?P<name>[^/]*)/$', 'weblate.trans.views.show_check'),
url(r'^checks/(?P<name>[^/]*)/(?P<project>[^/]*)/$', 'weblate.trans.views.show_check_project'),
url(r'^checks/(?P<name>[^/]*)/(?P<project>[^/]*)/(?P<subproject>[^/]*)/$', 'weblate.trans.views.show_check_subproject'),
......@@ -103,10 +103,10 @@ urlpatterns = patterns('',
url(r'^js/get/(?P<checksum>[^/]*)/$', 'weblate.trans.views.get_string'),
url(r'^js/ignore-check/(?P<check_id>[0-9]*)/$', 'weblate.trans.views.ignore_check'),
url(r'^js/i18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
url(r'^js/config/$', 'weblate.trans.views.js_config'),
url(r'^js/similar/(?P<unit_id>[0-9]*)/$', 'weblate.trans.views.get_similar'),
url(r'^js/other/(?P<unit_id>[0-9]*)/$', 'weblate.trans.views.get_other'),
url(r'^js/dictionary/(?P<unit_id>[0-9]*)/$', 'weblate.trans.views.get_dictionary'),
url(r'^js/config/$', 'weblate.trans.views.js_config', name = 'js-config'),
url(r'^js/similar/(?P<unit_id>[0-9]*)/$', 'weblate.trans.views.get_similar', name = 'js-similar'),
url(r'^js/other/(?P<unit_id>[0-9]*)/$', 'weblate.trans.views.get_other', name = 'js-other'),
url(r'^js/dictionary/(?P<unit_id>[0-9]*)/$', 'weblate.trans.views.get_dictionary', name = 'js-dictionary'),
url(r'^js/git/(?P<project>[^/]*)/$', 'weblate.trans.views.git_status_project'),
url(r'^js/git/(?P<project>[^/]*)/(?P<subproject>[^/]*)/$', 'weblate.trans.views.git_status_subproject'),
url(r'^js/git/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/$', 'weblate.trans.views.git_status_translation'),
......@@ -192,10 +192,10 @@ urlpatterns = patterns('',
auth_views.password_reset_done,
{'extra_context': {'title': _('Password reset')}},
name='auth_password_reset_done'),
url(r'^accounts/profile/', 'weblate.accounts.views.profile'),
url(r'^accounts/profile/', 'weblate.accounts.views.profile', name = 'profile'),
url(r'^contact/', 'weblate.accounts.views.contact'),
url(r'^about/$', 'weblate.trans.views.about'),
url(r'^contact/', 'weblate.accounts.views.contact', name = 'contact'),
url(r'^about/$', 'weblate.trans.views.about', name = 'about'),
# Media files
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment