Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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
  • 19 commits
  • 17 files changed
  • 0 commit comments
  • 1 contributor
View
3  .gitignore
@@ -9,6 +9,9 @@
/html/*.min.css
/html/js/*.min.js
+# /mo/
+/mo/*
+
# General
*.pyc
*.prefs
View
23 README.rst
@@ -2,14 +2,10 @@
Pootle: a web translation and translation management engine
===========================================================
-* How it works
-* Running
-* Manual preparation
-* Notes
-* Assignments
-* Common problems
-* Bug reporting/Feature requests
-* References
+* Web: <http://translate.sourceforge.net/wiki/pootle/index>
+* Bugzilla: <http://bugs.locamotion.org/>
+* Mailing List: <https://lists.sourceforge.net/lists/listinfo/translate-pootle>
+* IRC: #pootle on irc.freenode.org
How it works
@@ -41,7 +37,7 @@ Use ``--help`` to see the other options. The defaults will generally work.
Now visit http://localhost:8000/ to try out Pootle.
-To stop the server, press Ctrl-C.
+To stop the server, press ``Ctrl-C``.
It is not recommended to run Pootle as the root user. For any non-trivial
installation of Pootle, ensure that you use a database server (not SQLite) and
@@ -119,12 +115,3 @@ specific about how the bug occurred and what you expected to happen.
If this is a feature request then try to be specific about how you think this
feature should work.
-
-
-References
-----------
-
-* Web: <http://translate.sourceforge.net/wiki/pootle/index>
-* Bugzilla: <http://bugs.locamotion.org/>
-* Mailing List: <https://lists.sourceforge.net/lists/listinfo/translate-pootle>
-* IRC: #pootle on irc.freenode.org
View
26 html/admin.css
@@ -61,11 +61,32 @@ html[dir="rtl"] div#depchecks ul li.error
/* ADMIN GENERAL SETTINGS */
-textarea#id_DESCRIPTION
+textarea#id_DESCRIPTION,
+.legalpages-form textarea
{
width: 100%;
}
+/* LEGAL PAGES */
+
+.legalpages-list li
+{
+ margin: 0 1em;
+ list-style-type: square;
+}
+
+.legalpages-form input[type="checkbox"]
+{
+ display: inline;
+ float: left;
+ margin: 0 .25em;
+}
+
+html[dir="rtl"] .legalpages-form input[type="checkbox"]
+{
+ float: right;
+}
+
/* ADMIN LANGUAGES, FILES */
td.code input
@@ -115,5 +136,8 @@ html[dir="rtl"] td.pootle_path
.admin-buttons-block input
{
+ display: inline;
margin-bottom: 1em;
+ margin-left: .25em;
+ margin-right: .25em;
}
View
7 html/style.css
@@ -845,6 +845,13 @@ input[type="submit"]
color: #000;
}
+input.delete[type="submit"]
+{
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeeee', endColorstr='#ffcccc');
+ background: -webkit-gradient(linear, left top, left bottom, from(#fee), to(#fcc));
+ background: -moz-linear-gradient(top, #fee, #fcc);
+}
+
body.zoom-out-1 input[type="submit"]
{
min-width: 100px;
View
17 local_apps/legalpages/forms.py
@@ -19,7 +19,8 @@
# 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 django.forms import ModelForm, ValidationError
+from django.utils.translation import ugettext_lazy as _
from legalpages.models import LegalPage
@@ -29,3 +30,17 @@ class LegalPageForm(ModelForm):
class Meta:
model = LegalPage
+
+ def clean(self):
+
+ cleaned_data = super(LegalPageForm, self).clean()
+
+ url = cleaned_data.get('url')
+ body = cleaned_data.get('body')
+
+ if url == '' and body == '':
+ #L10n: 'URL' and 'content' refer to form fields.
+ msg = _('URL or content must be provided.')
+ raise ValidationError(msg)
+
+ return cleaned_data
View
10 local_apps/legalpages/models.py
@@ -37,11 +37,11 @@ class LegalPage(models.Model):
# 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.'))
+ help_text=_('If set, any references to this legal page will redirect ' \
+ 'to this URL'))
slug = models.SlugField(_("slug"),
help_text=_('The page will be independently available in ' \
- '/about/<slug>/.'))
+ '/about/<slug>/'))
try:
markup_filter = settings.MARKUP_FILTER[0]
@@ -57,6 +57,10 @@ def __unicode__(self):
return self.slug
+ def localized_title(self):
+ return _(self.title)
+
+
def get_absolute_url(self):
if self.url:
View
11 local_apps/legalpages/templates/legalpages/admin/edit.html
@@ -12,7 +12,14 @@
{% endblock %}
{% block section_body %}
-<div id="settings">
-{% include "legalpages/admin/form.html" %}
+<div class="legalpages settings-container centered">
+ <div class="legalpages-edit">
+ <div class="hd">
+ <h2>{% trans "Edit Legal Page" %}</h2>
+ </div>
+ <div class="bd">
+ {% include "legalpages/admin/form.html" %}
+ </div>
+ </div>
</div>
{% endblock %}
View
7 local_apps/legalpages/templates/legalpages/admin/form.html
@@ -1,5 +1,5 @@
{% load i18n %}
-<form action="" method="post">
+<form action="" method="post" class="legalpages-form">
{{ form.non_field_errors }}
{% for field in form %}
<p> {{ field.errors }}
@@ -11,6 +11,9 @@
</p>
{% endfor %}
<p class="admin-buttons-block">
- <input type="submit" class="save" value='{% trans "Save" %}' />
+ <input type="submit" class="save" name="_save" value="{% trans 'Save' %}" />
+ {% if show_delete %}
+ <input type="submit" class="delete" name="_delete" value="{% trans 'Delete' %}" />
+ {% endif %}
</p>
</form>
View
33 local_apps/legalpages/templates/legalpages/admin/list.html
@@ -12,15 +12,28 @@
{% 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 class="legalpages settings-container centered">
+ <div class="legalpages-list module first">
+ <div class="hd">
+ <h2>{% trans "Existing Legal Pages" %}</h2>
+ </div>
+ <div class="bd">
+ <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>
+ </div>
+ <div class="legalpages-edit module">
+ <div class="hd">
+ <h2>{% trans "Add a new Legal Page" %}</h2>
+ </div>
+ <div class="bd">
+ {% include "legalpages/admin/form.html" %}
+ </div>
+ </div>
</div>
-<h2>{% trans "Add a new Legal Page" %}</h2>
-{% include "legalpages/admin/form.html" %}
{% endblock %}
View
11 local_apps/legalpages/views.py
@@ -37,6 +37,11 @@ def admin_page(request, page_id):
lp = get_object_or_404(LegalPage, id=page_id)
if request.method == 'POST':
+
+ if '_delete' in request.POST:
+ lp.delete()
+ return redirect('legalpages.views.admin')
+
form = LegalPageForm(request.POST, instance=lp)
if form.is_valid():
@@ -46,7 +51,8 @@ def admin_page(request, page_id):
else:
form = LegalPageForm(instance=lp)
- return render_to_response('legalpages/admin/edit.html', {'form': form},
+ return render_to_response('legalpages/admin/edit.html',
+ {'form': form, 'show_delete': True},
RequestContext(request))
@@ -69,7 +75,8 @@ def admin(request):
lps = LegalPage.objects.all()
return render_to_response('legalpages/admin/list.html',
- {'legalpages': lps, 'form': form, 'message': msg},
+ {'legalpages': lps, 'form': form, 'message': msg,
+ 'show_delete': False},
RequestContext(request))
View
2  local_apps/pootle_app/assets.py
@@ -43,7 +43,7 @@
register('js_editor', js_editor)
css_common = Bundle(
- 'style.css', 'fancybox.css', 'tipsy.css', 'local/custom.css',
+ 'style.css', 'fancybox.css', 'tipsy.css', 'custom/custom.css',
filters='cssmin', output='common.min.css')
register('css_common', css_common)
View
3  local_apps/pootle_misc/dbupdate.py
@@ -344,6 +344,9 @@ def staggered_update(db_buildversion, tt_buildversion):
if db_buildversion < 21060:
yield update_stats_21060()
+ if db_buildversion < 22000:
+ update_tables_22000()
+
if tt_buildversion < 12008:
yield update_ts_tt_12008()
View
2  pootle/__version__.py
@@ -20,6 +20,6 @@
"""This file contains the version of Pootle."""
-build = 21060
+build = 22000
sver = "2.2.0-alpha1a"
ver = (2, 2, 0)
View
1  setup.py
@@ -190,7 +190,6 @@ def build_mo(self):
gettext.c2py(store.getheaderplural()[1])
except Exception, e:
print "skipping %s, probably invalid header: %s" % (lang, e)
- return
try:
if not path.exists(lang_dir):
View
7 strings.py
@@ -37,3 +37,10 @@
_("Source Language")
_("Android strings")
+
+
+# Commonly used terms to refer to Terms of Services, Privacy Policies...
+
+_("Privacy Policy")
+_("Legal")
+_("License")
View
34 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 legalpage_tags %}
+{% load i18n assets baseurl cache legalpage_tags %}
{% get_current_language as LANGUAGE_CODE %}
{% get_current_language_bidi as LANGUAGE_BIDI %}
@@ -129,6 +129,20 @@
{% block innernav %}{% endblock %}
</div><!-- precontent -->
+ {% if message or error_message or messages %}
+ <div class="form message{% if error_message %} error{% endif %}" lang="{{ LANGUAGE_CODE }}">
+ {% block message %}
+ <div class="info">{{ message }}</div>
+ <div class="error">{{ error_message }}</div>
+ {% for msg in messages %}
+ <p class="info">
+ {{ msg }}
+ </p>
+ {% endfor %}
+ {% endblock message %}
+ </div>
+ {% endif %}
+
<div id="content">
{% block content %}{% endblock %}
</div><!-- content -->
@@ -139,20 +153,6 @@
{% block extra_content %}{% endblock %}
</div> <!--body-->
- {% if message or error_message or messages %}
- <div class="form message{% if error_message %} error{% endif %}" lang="{{ LANGUAGE_CODE }}">
- {% block message %}
- <div class="info">{{ message }}</div>
- <div class="error">{{ error_message }}</div>
- {% for msg in messages %}
- <p class="info">
- {{ msg }}
- </p>
- {% endfor %}
- {% endblock message %}
- </div>
- {% endif %}
-
{% block footer %}
<div id="footer" lang="{{ LANGUAGE_CODE }}">
<ul class="nav">
@@ -161,10 +161,12 @@
<li><a href='{{ "/contact/"|l }}'>{% trans "Contact Us" %}</a></li>
{% endif %}
<li><a href='{{ "/about.html"|l }}'>{% trans "About this Pootle Server" %}</a></li>
+ {% cache settings.CACHE_TIMEOUT legalpages LANGUAGE_CODE %}
{% get_legalpages as legalpages %}
{% for lp in legalpages %}
- <li><a href="{{ lp.get_absolute_url }}">{{ lp.title }}</a></li>
+ <li><a href="{{ lp.get_absolute_url }}">{{ lp.localized_title }}</a></li>
{% endfor %}
+ {% endcache %}
</ul>
</div><!--footer-->
{% endblock footer %}
View
6 templates/registration/registration_form.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% load i18n baseurl legalpage_tags %}
+{% load i18n baseurl cache legalpage_tags %}
{% block title %}
{{ block.super }} » {% trans "Register" %}
@@ -10,6 +10,7 @@
{% endblock %}
{% block content %}
+{% cache settings.CACHE_TIMEOUT legalpages_reg LANGUAGE_CODE %}
{% get_legalpages as legalpages reg %}
{% if legalpages %}
<div class="legal">
@@ -17,12 +18,13 @@
<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>
+ <li><a href="{{ lp.get_absolute_url }}" class="fancybox{% if lp.url %} external{% endif %}">{{ lp.localized_title }}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
+{% endcache %}
<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.