Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into master_ja_update_upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
smellman committed May 24, 2013
2 parents 654712b + 6d4ed75 commit 42e871f
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 49 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ language: python
python:
- "2.7"
before_install:
- sudo apt-get update
- sudo apt-get install python-setuptools solr-jetty
- sudo apt-get install gdal-bin proj default-jre-headless
- sudo apt-get install postgresql-9.1-postgis
- pip install -r sapling/etc/install_config/travis.txt
- pip install -r sapling/etc/install_config/travis.txt --use-mirrors
- pip install coveralls --use-mirrors
install:
- python setup.py install
- install_config/setup_jetty.sh
Expand All @@ -17,4 +19,6 @@ before_script:
- echo "standard_conforming_strings=off" | sudo tee -a /etc/postgresql/9.1/main/postgresql.conf
- sudo /etc/init.d/postgresql restart
- psql localwiki -c "alter role localwiki createdb;"
script: localwiki-manage test pages maps tags versioning diff ckeditor redirects users
script: coverage run --source=sapling sapling/manage.py test pages maps tags versioning diff ckeditor redirects users
after_success:
- coveralls
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Development
===========

.. image:: https://travis-ci.org/localwiki/localwiki.png?branch=master
:target: https://travis-ci.org/localwiki/localwiki

.. image:: https://coveralls.io/repos/localwiki/localwiki/badge.png?branch=master
:target: https://coveralls.io/r/localwiki/localwiki

:Code: https://github.com/localwiki/localwiki
:Issues: https://github.com/localwiki/localwiki/issues
Expand Down
Binary file modified sapling/locale/ja/LC_MESSAGES/django.mo
Binary file not shown.
27 changes: 14 additions & 13 deletions sapling/locale/ja/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-12-11 14:27-0600\n"
"POT-Creation-Date: 2013-05-22 06:49+0900\n"
"PO-Revision-Date: 2012-06-21 22:11\n"
"Last-Translator: Anonymous User <[email protected]>\n"
"Language: pt-PT\n"
Expand Down Expand Up @@ -106,7 +106,7 @@ msgstr "成長の経時比較"
#: dashboard/templates/dashboard/index.html:55
#: dashboard/templates/dashboard/index.html:65
msgid "Generating graph..."
msgstr ""
msgstr "グラフを生成中..."

#: dashboard/templates/dashboard/index.html:43
#: dashboard/templates/dashboard/render.html:20
Expand Down Expand Up @@ -168,7 +168,9 @@ msgstr "マップ"
#: maps/templates/maps/base.html:31 maps/templates/maps/mapdata_detail.html:50
#: maps/templates/maps/mapdata_form.html:84
#: maps/templates/maps/mapdata_versions.html:22
#: pages/templates/pages/base.html:26 pages/templates/pages/page_form.html:60
#: pages/templates/pages/base.html:26
#: pages/templates/pages/page_detail.html:40
#: pages/templates/pages/page_form.html:60
#: pages/templates/pages/page_versions.html:25
msgid "Edit"
msgstr "編集"
Expand Down Expand Up @@ -342,19 +344,19 @@ msgstr "親ページがリネームされました"
msgid "file"
msgstr "ファイル"

#: pages/plugins.py:398
#: pages/plugins.py:405
msgid ""
"The embedded URL is not on the list of approved providers. Contact the site "
"administrator to add it."
msgstr ""
"埋め込みURLは承認済み提供者一覧にありません。サイト管理者にレンr買うして追加"
"してください。"

#: pages/plugins.py:402
#: pages/plugins.py:409
msgid "Invalid embed code"
msgstr "埋め込みコードが正しくありません"

#: pages/plugins.py:414 search/templates/search/search.html:13
#: pages/plugins.py:421 search/templates/search/search.html:13
#: themes/sapling/templates/site/search_form.html:5
msgid "Search or create page"
msgstr "検索するか新しいページを作成"
Expand Down Expand Up @@ -474,7 +476,7 @@ msgstr ""

#: pages/templates/pages/page_detail.html:40
#: tags/templates/tags/tagged_list_snippet.html:7
msgid "View map"
msgid "View"
msgstr "マップを閲覧"

#: pages/templates/pages/page_detail.html:57
Expand Down Expand Up @@ -825,7 +827,6 @@ msgid "Search"
msgstr "検索"

#: settings/defaults.py:37
#, fuzzy
msgid ""
"<p>Except where otherwise noted, this content is licensed under a <a rel="
"\"license\" href=\"http://creativecommons.org/licenses/by/3.0/\">Creative "
Expand Down Expand Up @@ -860,7 +861,7 @@ msgstr ""
"特段の注釈が無い限り、私は自分の投稿を <a rel=\"license\" href=\"http://"
"creativecommons.org/licenses/by/3.0/\" target=\"_blank\">Creative Commons-"
"By</a>の下にリリースすることに同意します。 <a href=\"/Copyrights\" target="
"\"_blank\">著作権</a>参照。"
"\"_blank\">著作権</a>を参照。"

#: settings/defaults.py:43
msgid ""
Expand All @@ -873,11 +874,11 @@ msgstr "英語"

#: settings/defaults.py:63
msgid "Japanese"
msgstr ""
msgstr "日本語"

#: settings/defaults.py:64
msgid "Russian"
msgstr ""
msgstr "ロシア語"

#: settings/defaults.py:65
msgid "German (Swiss)"
Expand All @@ -893,7 +894,7 @@ msgstr "デンマーク語"

#: settings/defaults.py:68
msgid "Italian"
msgstr ""
msgstr "イタリア語"

#: settings/defaults.py:69
msgid "Portuguese"
Expand Down
2 changes: 1 addition & 1 deletion sapling/pages/templates/pages/page_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{% if map %}
<div id="map">
{{ map }}
<div class="info"><a class="view tiny button" href="{% url maps:show slug=page.pretty_slug %}">{% trans "View" %}</a><a class="edit tiny button" href="{% url maps:edit slug=page.pretty_slug %}">Edit</a></div>
<div class="info"><a class="view tiny button" href="{% url maps:show slug=page.pretty_slug %}">{% trans "View" %}</a><a class="edit tiny button" href="{% url maps:edit slug=page.pretty_slug %}">{% trans "Edit" %}</a></div>
</div>
{% endif %}

Expand Down
3 changes: 2 additions & 1 deletion sapling/templates/tos/license_in_edit.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load i18n %}
{% if not request.user.is_authenticated %}
{{ EDIT_LICENSE_NOTE|safe }}
{% trans EDIT_LICENSE_NOTE|safe %}
{% endif %}
3 changes: 2 additions & 1 deletion sapling/themes/sapling/templates/site/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load static from staticfiles %}
{% load i18n %}
<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -107,7 +108,7 @@ <h1 id="object_title">{% block header_title %}{% endblock %}</h1>

<div id="attributions">
{% block attributions %}
{{ GLOBAL_LICENSE_NOTE|safe }}
{% trans GLOBAL_LICENSE_NOTE|safe %}
{% endblock %}
</div>

Expand Down
3 changes: 2 additions & 1 deletion sapling/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from django.contrib.auth.models import User
from django.utils.encoding import smart_str
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.conf import settings
from django.contrib.sites.models import Site
Expand Down Expand Up @@ -52,7 +53,7 @@ def get_absolute_url(self):
class UserProfile(models.Model):
# this field is required
user = models.OneToOneField(User)
subscribed = models.BooleanField(verbose_name=settings.SUBSCRIBE_MESSAGE)
subscribed = models.BooleanField(verbose_name=_(settings.SUBSCRIBE_MESSAGE))


# For registration calls
Expand Down
2 changes: 1 addition & 1 deletion sapling/users/registration_backend/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RegistrationForm(forms.Form):
name = forms.CharField(required=False, label=_("Your name"))

tos = forms.BooleanField(widget=forms.CheckboxInput(attrs=attrs_dict),
label=mark_safe(settings.SIGNUP_TOS),
label=mark_safe(_(settings.SIGNUP_TOS)),
error_messages={'required':
_("You must agree to the terms to register")})

Expand Down
61 changes: 32 additions & 29 deletions sapling/versionutils/versioning/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,35 @@ def connect(self, m, manager_name=None):

do_versioning = getattr(
settings, 'VERSIONUTILS_VERSIONING_ENABLED', True)
if not do_versioning:
# We still create the historical models but don't set any
# signals for saving/deleting.
return

setattr(m, '_track_changes', True)

# Over-ride the save, delete methods to allow arguments to be passed in
# such as comment="Made a small change."
setattr(m, 'save', save_func(m.save))
setattr(m, 'delete', delete_func(m.delete))

# We also attach signal handlers to the save, delete methods. It's
# easier to have two things going on (signal, and an overridden method)
# because the signal handlers tell us if the object is new or not.
# (Just checking object.pk is None is not enough!)
# Signal handlers are called when a bulk QuerySet.delete()
# is issued -- custom delete() and save() methods aren't called
# in that case.

_post_save = partial(self.post_save, m)
_pre_delete = partial(self.pre_delete, m)
_post_delete = partial(self.post_delete, m)
# The ChangesTracker object will be discarded, so the signal handlers
# can't use weak references.
models.signals.post_save.connect(_post_save, weak=False)
models.signals.pre_delete.connect(_pre_delete, weak=False)
models.signals.post_delete.connect(_post_delete, weak=False)

self.wrap_model_fields(m)
# Even if versioning is disabled, we still create the historical models
# but don't set any signals for saving/deleting.
if do_versioning:
setattr(m, '_track_changes', True)

# Over-ride the save, delete methods to allow arguments to be passed in
# such as comment="Made a small change."
setattr(m, 'save', save_func(m.save))
setattr(m, 'delete', delete_func(m.delete))

# We also attach signal handlers to the save, delete methods. It's
# easier to have two things going on (signal, and an overridden method)
# because the signal handlers tell us if the object is new or not.
# (Just checking object.pk is None is not enough!)
# Signal handlers are called when a bulk QuerySet.delete()
# is issued -- custom delete() and save() methods aren't called
# in that case.

_post_save = partial(self.post_save, m)
_pre_delete = partial(self.pre_delete, m)
_post_delete = partial(self.post_delete, m)
# The ChangesTracker object will be discarded, so the signal handlers
# can't use weak references.
models.signals.post_save.connect(_post_save, weak=False)
models.signals.pre_delete.connect(_pre_delete, weak=False)
models.signals.post_delete.connect(_post_delete, weak=False)

self.wrap_model_fields(m)

descriptor = manager.HistoryDescriptor(history_model)
setattr(m, self.manager_name, descriptor)
Expand Down Expand Up @@ -510,6 +509,10 @@ def m2m_changed(self, attname, sender, instance, action, reverse,
Args:
attname: Attribute name of the m2m field on the base model.
"""
if not hasattr(instance, '_track_changes'):
# Skip this signal when we have version tracking disabled.
return

if pk_set:
changed_ms = [model.objects.get(pk=pk) for pk in pk_set]
hist_changed_ms = []
Expand Down

0 comments on commit 42e871f

Please sign in to comment.