Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: translate/pootle
...
head fork: translate/pootle
Checking mergeability… Don't worry, you can still create the pull request.
  • 13 commits
  • 24 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 21, 2012
@julen julen Added an 'apply_markup_filter' function.
This will allow to use 'textile', 'markdown', or 'restructuredtext' in
specific textareas. It'll be an optional component.

A two-tuple 'MARKUP_FILTER' setting controls the filter used. The first
argument is the filter to be used (to disable any filters, it can be
None), and the second argument is a dictionary of keyword arguments to
be passed to the markup function.

Borrowed from http://djangosnippets.org/snippets/104/
e134c41
Commits on Mar 22, 2012
@julen julen Braces in new lines for consistency. 031e2cc
@julen julen Ignore files generated by webassets. 49db323
@julen julen Return 'html_body' rather than 'fragment'. 35db3e3
@julen julen Remove conflicting selectors. 930ed10
@julen julen Add margin for h1 elements. f7fdf42
@julen julen Added comment. 50bad84
Commits on Mar 23, 2012
@julen julen Added the ability to define 'legal' pages.
These kind of pages are useful for Terms of Service, Privacy Policy,
License and similar information.

Pages can point to an external URL (privacy policy hosted in another
server) or provide own content.
Contents can be formatted according to the markup defined in the
server settings.

For now links are displayed in the footer, but selected pages will be
displayed on registration as well.

This is a first step towards fixing bug 2134.
b10927f
@julen julen Added an extra 'reg' option to the 'get_legalpages' tag.
This will retrieve the LegalPage objects that are marked to be displayed
when registering.
e7a09b7
@julen julen Enable Fancybox modal windows on a.fancybox links. a2f64b7
@julen julen Display legal links when registering. a14faf2
@julen julen Only display body when requesting page through fancyBox. bd219cc
@julen julen Merge branch 'master' of github.com:translate/pootle 794ef3c
Showing with 522 additions and 13 deletions.
  1. +5 −0 .gitignore
  2. +6 −0 html/js/common.js
  3. +38 −10 html/style.css
  4. 0  local_apps/legalpages/__init__.py
  5. +31 −0 local_apps/legalpages/forms.py
  6. +72 −0 local_apps/legalpages/models.py
  7. +18 −0 local_apps/legalpages/templates/legalpages/admin/edit.html
  8. +16 −0 local_apps/legalpages/templates/legalpages/admin/form.html
  9. +26 −0 local_apps/legalpages/templates/legalpages/admin/list.html
  10. +7 −0 local_apps/legalpages/templates/legalpages/legalpage.html
  11. +4 −0 local_apps/legalpages/templates/legalpages/legalpage_body.html
  12. 0  local_apps/legalpages/templatetags/__init__.py
  13. +78 −0 local_apps/legalpages/templatetags/legalpage_tags.py
  14. +32 −0 local_apps/legalpages/urls.py
  15. +89 −0 local_apps/legalpages/views.py
  16. +3 −1 local_apps/pootle_app/views/admin/urls.py
  17. +1 −0  local_apps/pootle_app/views/admin/util.py
  18. +59 −0 local_apps/pootle_misc/util.py
  19. +13 −0 localsettings.py
  20. +3 −0  pootle/settings.py
  21. +1 −0  pootle/urls.py
  22. +1 −0  templates/admin_profile_menu.html
  23. +5 −1 templates/base.html
  24. +14 −1 templates/registration/registration_form.html
View
5 .gitignore
@@ -4,6 +4,11 @@
# /dbs/
/dbs/*.db
+# /html/
+/html/.webassets-cache/
+/html/*.min.css
+/html/js/*.min.js
+
# General
*.pyc
*.prefs
View
6 html/js/common.js
@@ -131,4 +131,10 @@ $(document).ready(function ($) {
}
});
+ /* Fancybox on links */
+ $(document).on("click", "a.fancybox", function (e) {
+ e.preventDefault();
+ $.fancybox({'href': $(e.target).attr('href'), 'type': 'ajax'});
+ });
+
});
View
48 html/style.css
@@ -157,7 +157,6 @@ img
}
address, caption, cite, code, dfn,
-em, strong,
th, var
{
font-style: normal;
@@ -944,7 +943,7 @@ html[dir="rtl"] a.external {
}
/*
- * DOCUMENTATION
+ * DOCUMENTATION, LEGAL
*/
.documentation
@@ -952,27 +951,46 @@ html[dir="rtl"] a.external {
margin: 2em;
}
+.legal
+{
+ float: right;
+ margin-right: 3em;
+ position: relative;
+}
+
+.documentation .document h1
+{
+ margin-top: .5em;
+ margin-bottom: .25em;
+}
+
.documentation h2,
-.documentation h3 {
+.documentation h3
+{
color: #999;
border-bottom: 1px solid #eee;
}
-.documentation h3 {
+.documentation h3
+{
margin-top: 1.5em;
}
-.documentation p
+.documentation p,
+.legal p
{
margin: 1em 0;
}
.documentation ol,
-.documentation ul {
+.documentation ul,
+.legal ul
+{
margin: 1em 1.5em;
}
-.documentation ul li
+.documentation ul li,
+.legal ul li
{
list-style-type: square;
}
@@ -987,7 +1005,8 @@ html[dir="rtl"] a.external {
border-bottom: 1px dotted black;
}
-.documentation .sidenote
+.documentation .sidenote,
+.legal .sidenote
{
width: 10em;
font-size: 95%;
@@ -998,12 +1017,20 @@ html[dir="rtl"] a.external {
color: #777;
}
-.documentation .sidenote p
+.legal .sidenote
+{
+ width: 12em;
+}
+
+.documentation .sidenote p,
+.legal .sidenote p
{
line-height: 130%;
}
-.documentation .sidenote li {
+.documentation .sidenote li,
+.legal .sidenote li
+{
margin: 0.2em 0;
}
@@ -1086,6 +1113,7 @@ body.adminusers div#submenu-tabs a.adminusers,
body.adminlanguages div#submenu-tabs a.adminlanguages,
body.adminprojects div#submenu-tabs a.adminprojects,
body.adminpermissions div#submenu-tabs a.adminpermissions,
+body.adminlegalpages div#submenu-tabs a.adminlegalpages,
body.projectoverview div#submenu-tabs a.projectoverview,
body.projectadmin div#submenu-tabs a.projectadmin,
body.projectperm div#submenu-tabs a.projectperm,
View
0  local_apps/legalpages/__init__.py
No changes.
View
31 local_apps/legalpages/forms.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright 2012 Zuza Software Foundation
+#
+# This file is part of Pootle.
+#
+# translate is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# translate is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with translate; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from django.forms import ModelForm
+
+from legalpages.models import LegalPage
+
+
+class LegalPageForm(ModelForm):
+
+ class Meta:
+ model = LegalPage
+
View
72 local_apps/legalpages/models.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright 2012 Zuza Software Foundation
+#
+# This file is part of Pootle.
+#
+# translate is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# translate is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with translate; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from django.db import models
+from django.conf import settings
+from django.core.urlresolvers import reverse
+from django.utils.translation import ugettext_lazy as _
+
+from pootle_misc.util import apply_markup_filter
+
+class LegalPage(models.Model):
+
+ active = models.BooleanField(_('Active'),
+ _('Whether this page is active or not.'))
+
+ display_on_register = models.BooleanField(_('Display on registration'),
+ _('Whether this page should be displayed on registration.'))
+
+ # TODO: make title and body localizable fields
+ title = models.CharField(_("Title"), max_length=100)
+ url = models.URLField(_("URL"), blank=True,
+ help_text=_('If set, any references to this legal page will point ' \
+ 'to this URL rather than to the slug.'))
+ slug = models.SlugField(_("slug"),
+ help_text=_('The page will be independently available in ' \
+ '/about/<slug>/.'))
+
+ try:
+ markup_filter = settings.MARKUP_FILTER[0]
+ except AttributeError, IndexError:
+ markup_filter = u'HTML'
+ body = models.TextField(_("Content"), blank=True,
+ help_text=_('Allowed markup: %s' % markup_filter))
+
+ body_html = models.TextField(editable=False, blank=True)
+
+
+ def __unicode__(self):
+ return self.slug
+
+
+ def get_absolute_url(self):
+
+ if self.url:
+ return self.url
+
+ return reverse('legalpages.views.legalpage', args=[self.slug])
+
+
+ def save(self, *args, **kwargs):
+ """Applies a markup filter to populate `body_html` upon saving."""
+
+ self.body_html = apply_markup_filter(self.body)
+ super(LegalPage, self).save(*args, **kwargs)
View
18 local_apps/legalpages/templates/legalpages/admin/edit.html
@@ -0,0 +1,18 @@
+{% extends "admin_profile_base.html" %}
+{% load i18n %}
+
+{% block title %}
+{{ block.super }} » {% trans "Edit Legal Page" %}
+{% endblock %}
+
+{% block bodyclass %}adminlegalpages{% endblock %}
+
+{% block breadcrumb_content %}
+{{ block.super }} » <span>{% trans "Edit Legal Page" %}</span>
+{% endblock %}
+
+{% block section_body %}
+<div id="settings">
+{% include "legalpages/admin/form.html" %}
+</div>
+{% endblock %}
View
16 local_apps/legalpages/templates/legalpages/admin/form.html
@@ -0,0 +1,16 @@
+{% load i18n %}
+<form action="" method="post">
+ {{ form.non_field_errors }}
+ {% for field in form %}
+ <p> {{ field.errors }}
+ {{ field.label_tag }}
+ {{ field }}
+ {% if field.help_text %}
+ <span class="help_text">{{ field.help_text }}</span>
+ {% endif %}
+ </p>
+ {% endfor %}
+ <p class="admin-buttons-block">
+ <input type="submit" class="save" value='{% trans "Save" %}' />
+ </p>
+</form>
View
26 local_apps/legalpages/templates/legalpages/admin/list.html
@@ -0,0 +1,26 @@
+{% extends "admin_profile_base.html" %}
+{% load i18n %}
+
+{% block title %}
+{{ block.super }} » {% trans "Legal Pages" %}
+{% endblock %}
+
+{% block bodyclass %}adminlegalpages{% endblock %}
+
+{% block breadcrumb_content %}
+{{ block.super }} » <span>{% trans "Legal Pages" %}</span>
+{% endblock %}
+
+{% block section_body %}
+<div id="settings">
+ <ul>
+{% for lp in legalpages %}
+ <li>{{ lp.title }} ({% if lp.active %}{% trans "Active" %}{% else %}{% trans "Inactive" %}{% endif %}) — <a href="{% url legalpages.views.admin_page lp.id %}">{% trans "Edit" %}</a></li>
+{% empty %}
+ <li>{% trans "No pages yet." %}</li>
+{% endfor %}
+ </ul>
+</div>
+<h2>{% trans "Add a new Legal Page" %}</h2>
+{% include "legalpages/admin/form.html" %}
+{% endblock %}
View
7 local_apps/legalpages/templates/legalpages/legalpage.html
@@ -0,0 +1,7 @@
+{% extends "base.html" %}
+
+{% block title %}{{ block.super }} » {{ lp.title }}{% endblock title %}
+
+{% block content %}
+{% include "legalpages/legalpage_body.html" %}
+{% endblock content %}
View
4 local_apps/legalpages/templates/legalpages/legalpage_body.html
@@ -0,0 +1,4 @@
+<div class="documentation">
+ <h2>{{ lp.title }}</h2>
+ {{ lp.body_html|safe }}
+</div>
View
0  local_apps/legalpages/templatetags/__init__.py
No changes.
View
78 local_apps/legalpages/templatetags/legalpage_tags.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright 2012 Zuza Software Foundation
+#
+# This file is part of Pootle.
+#
+# translate is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# translate is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with translate; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from django import template
+
+from legalpages.models import LegalPage
+
+
+register = template.Library()
+
+
+class LegalPageNode(template.Node):
+
+ def __init__(self, context_name, on_register=False):
+ self.context_name = context_name
+ self.on_register = on_register
+
+ def render(self, context):
+ lps = LegalPage.objects.filter(active=True)
+
+ if self.on_register:
+ lps = lps.filter(display_on_register=True)
+
+ context[self.context_name] = lps
+ return ''
+
+
+@register.tag
+def get_legalpages(parser, token):
+ """
+ Retrieves all active LegalPage objects.
+ Populates the template context with them in a variable
+ whose name is defined by the ``as`` clause.
+
+ An optional ``reg`` clause can be added at the end to retrieve
+ only the objects that have the ``display_on_register`` bit set.
+
+ Syntax::
+
+ {% get_legalpages as context_name [reg]%}
+ """
+
+ bits = token.split_contents()
+ syntax_message = ("%(tag_name)s expects a syntax of %(tag_name)s "
+ "as context_name" %
+ dict(tag_name=bits[0]))
+
+ if len(bits) >= 3 and len(bits) <= 4:
+
+ if bits[1] != 'as':
+ raise template.TemplateSyntaxError(syntax_message)
+ context_name = bits[2]
+
+ on_register = False
+ if len(bits) == 4:
+ on_register = True
+
+ return LegalPageNode(context_name, on_register)
+ else:
+ raise template.TemplateSyntaxError(syntax_message)
View
32 local_apps/legalpages/urls.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright 2012 Zuza Software Foundation
+#
+# This file is part of Pootle.
+#
+# translate is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# translate is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with translate; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+ (r'^(?P<slug>[^/]+)/$', 'legalpages.views.legalpage'),
+)
+
+admin_patterns = patterns('',
+ (r'^$', 'legalpages.views.admin'),
+ (r'^(?P<page_id>\d+)/?$', 'legalpages.views.admin_page'),
+)
+
View
89 local_apps/legalpages/views.py
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright 2012 Zuza Software Foundation
+#
+# This file is part of Pootle.
+#
+# translate is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# translate is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with translate; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from django.core.urlresolvers import reverse
+from django.shortcuts import get_object_or_404, redirect, render_to_response
+from django.template import RequestContext
+from django.utils.translation import ugettext as _
+
+from legalpages.forms import LegalPageForm
+from legalpages.models import LegalPage
+
+from pootle_app.views.admin.util import user_is_admin
+
+
+@user_is_admin
+def admin_page(request, page_id):
+ """Administration view."""
+
+ lp = get_object_or_404(LegalPage, id=page_id)
+
+ if request.method == 'POST':
+ form = LegalPageForm(request.POST, instance=lp)
+
+ if form.is_valid():
+ form.save()
+ return redirect('legalpages.views.admin')
+
+ else:
+ form = LegalPageForm(instance=lp)
+
+ return render_to_response('legalpages/admin/edit.html', {'form': form},
+ RequestContext(request))
+
+
+@user_is_admin
+def admin(request):
+ """Lists available pages in the administration."""
+
+ msg = ''
+
+ if request.method == 'POST':
+ form = LegalPageForm(request.POST)
+
+ if form.is_valid():
+ form.save()
+ form = LegalPageForm()
+ msg = _("Legal Page created.")
+ else:
+ form = LegalPageForm()
+
+ lps = LegalPage.objects.all()
+
+ return render_to_response('legalpages/admin/list.html',
+ {'legalpages': lps, 'form': form, 'message': msg},
+ RequestContext(request))
+
+
+def legalpage(request, slug):
+ """The actual Legal Page."""
+
+ lp = get_object_or_404(LegalPage, active=True, slug=slug)
+
+ if lp.url:
+ return redirect(lp.url)
+
+ template_name = 'legalpages/legalpage.html'
+ if 'HTTP_X_FANCYBOX' in request.META:
+ template_name = 'legalpages/legalpage_body.html'
+
+ return render_to_response(template_name, {'lp': lp},
+ RequestContext(request))
View
4 local_apps/pootle_app/views/admin/urls.py
@@ -21,7 +21,10 @@
from django.conf.urls.defaults import *
+import legalpages.urls
+
urlpatterns = patterns('pootle_app.views.admin',
+ (r'^/legalpages/', include(legalpages.urls.admin_patterns)),
(r'^/users.html$', 'adminusers.view'),
(r'^/languages.html$', 'adminlanguages.view'),
(r'^/projects.html$', 'adminprojects.view'),
@@ -29,5 +32,4 @@
(r'^/general.html$', 'adminpages.view'),
(r'^/stats/more/?$', 'dashboard.server_stats_more'),
(r'^/?|/index.html$', 'dashboard.view'),
-
)
View
1  local_apps/pootle_app/views/admin/util.py
@@ -32,6 +32,7 @@
from pootle_profile.models import get_profile
+# XXX: Move to pootle_misc?
def user_is_admin(f):
def decorated_f(request, *args, **kwargs):
if not request.user.is_superuser:
View
59 local_apps/pootle_misc/util.py
@@ -130,3 +130,62 @@ def _closure(self):
return value
return property(_closure)
+
+
+def apply_markup_filter(text):
+ """
+ Applies a text-to-HTML conversion function to a piece of text and
+ returns the generated HTML.
+
+ The function to use is derived from the value of the setting
+ ``MARKUP_FILTER``, which should be a 2-tuple:
+
+ * The first element should be the name of a markup filter --
+ e.g.,"markdown" -- to apply. If no markup filter is desired,
+ set this to None.
+
+ * The second element should be a dictionary of keyword
+ arguments which will be passed to the markup function. If no
+ extra arguments are desired, set this to an empty
+ dictionary; some arguments may still be inferred as needed,
+ however.
+
+ So, for example, to use Markdown with safe mode turned on (safe
+ mode removes raw HTML), put this in your settings file::
+
+ MARKUP_FILTER = ('markdown', { 'safe_mode': True })
+
+ Currently supports Textile, Markdown and reStructuredText, using
+ names identical to the template filters found in
+ ``django.contrib.markup``.
+
+ Borrowed from http://djangosnippets.org/snippets/104/
+ """
+ markup_func_name, markup_kwargs = settings.MARKUP_FILTER
+
+ if markup_func_name is None: # No processing is needed.
+ return text
+
+ if markup_func_name not in ('textile', 'markdown', 'restructuredtext'):
+ raise ValueError("'%s' is not a valid value for the first element of MARKUP_FILTER; acceptable values are 'textile', 'markdown', 'restructuredtext' and None" % markup_func_name)
+
+ if markup_func_name == 'textile':
+ import textile
+ if 'encoding' not in markup_kwargs:
+ markup_kwargs.update(encoding=settings.DEFAULT_CHARSET)
+ if 'output' not in markup_kwargs:
+ markup_kwargs.update(output=settings.DEFAULT_CHARSET)
+ return textile.textile(text, **markup_kwargs)
+
+ elif markup_func_name == 'markdown':
+ import markdown
+ return markdown.markdown(text, **markup_kwargs)
+
+ elif markup_func_name == 'restructuredtext':
+ from docutils import core
+ if 'settings_overrides' not in markup_kwargs:
+ markup_kwargs.update(settings_overrides=getattr(settings, "RESTRUCTUREDTEXT_FILTER_SETTINGS", {}))
+ if 'writer_name' not in markup_kwargs:
+ markup_kwargs.update(writer_name='html4css1')
+ parts = core.publish_parts(source=text, **markup_kwargs)
+ return parts['html_body']
View
13 localsettings.py
@@ -104,6 +104,19 @@
ASSETS_DEBUG = DEBUG
+# Two-tuple defining the markup filter to apply in certain textareas.
+# - Accepted values for the first element are 'textile', 'markdown',
+# 'restructuredtext' and None
+# - The second element should be a dictionary of keyword arguments that
+# will be passed to the markup function
+#
+# Examples:
+# MARKUP_FILTER = (None, {})
+# MARKUP_FILTER = ('markdown', {'safe_mode': True})
+# MARKUP_FILTER = ('restructuredtext', {})
+MARKUP_FILTER = (None, {})
+
+
# Use the commented definition to authenticate first with an LDAP system and
# then to fall back to Django's authentication system.
#AUTHENTICATION_BACKENDS = ('pootle.auth.ldap_backend.LdapBackend', 'django.contrib.auth.backends.ModelBackend',)
View
3  pootle/settings.py
@@ -132,6 +132,7 @@
'django.contrib.contenttypes',
'django.contrib.sites',
'django.contrib.admin',
+ # Pootle-specific
'pootle_app',
'pootle_misc',
'pootle_store',
@@ -143,6 +144,8 @@
'pootle_notifications',
'pootle_autonotices',
'pootle_terminology',
+ 'legalpages',
+ # External apps
'registration',
'profiles',
'djblets.siteconfig',
View
1  pootle/urls.py
@@ -50,6 +50,7 @@
(r'^contact/', include('contact_form_i18n.urls')),
(r'^accounts/', include('pootle_profile.urls')),
# Pootle urls
+ (r'^about/', include('legalpages.urls')),
(r'^projects/', include('pootle_project.urls')),
(r'', include('pootle_notifications.urls')),
(r'', include('pootle_terminology.urls')),
View
1  templates/admin_profile_menu.html
@@ -8,5 +8,6 @@
<a href='{{ "/admin/languages.html"|l }}' class="adminlanguages" title="{% trans 'Manage the languages' %}">{% trans "Languages" %}</a>
<a href='{{ "/admin/projects.html"|l }}' class="adminprojects" title="{% trans 'Manage the projects' %}">{% trans "Projects" %}</a>
<a href='{{ "/admin/permissions.html"|l }}' class="adminpermissions" title="{% trans 'Manage the default permissions' %}">{% trans "Permissions" %}</a>
+ <a href='{{ "/admin/legalpages/"|l }}' class="adminlegalpages" title="{% trans 'Manage Legal Pages' %}">{% trans "Legal Pages" %}</a>
</div>
</div>
View
6 templates/base.html
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-{% load i18n assets baseurl %}
+{% load i18n assets baseurl legalpage_tags %}
{% get_current_language as LANGUAGE_CODE %}
{% get_current_language_bidi as LANGUAGE_BIDI %}
@@ -161,6 +161,10 @@
<li><a href='{{ "/contact/"|l }}'>{% trans "Contact Us" %}</a></li>
{% endif %}
<li><a href='{{ "/about.html"|l }}'>{% trans "About this Pootle Server" %}</a></li>
+ {% get_legalpages as legalpages %}
+ {% for lp in legalpages %}
+ <li><a href="{{ lp.get_absolute_url }}">{{ lp.title }}</a></li>
+ {% endfor %}
</ul>
</div><!--footer-->
{% endblock footer %}
View
15 templates/registration/registration_form.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% load i18n baseurl %}
+{% load i18n baseurl legalpage_tags %}
{% block title %}
{{ block.super }} » {% trans "Register" %}
@@ -10,6 +10,19 @@
{% endblock %}
{% block content %}
+{% get_legalpages as legalpages reg %}
+{% if legalpages %}
+<div class="legal">
+ <div class="sidenote">
+ <p>{% trans "Make sure to read the following:" %}</p>
+ <ul>
+{% for lp in legalpages %}
+ <li><a href="{{ lp.get_absolute_url }}" class="fancybox{% if lp.url %} external{% endif %}">{{ lp.title }}</a></li>
+{% endfor %}
+ </ul>
+ </div>
+</div>
+{% endif %}
<div id="register" class="form" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}">
<h2>{% trans "Register a New Pootle Account" %}</h2>
<p>{% trans "Fill in the following form to get started translating." %}</p>

No commit comments for this range

Something went wrong with that request. Please try again.