diff --git a/README.md b/README.md index 18e4e1d..28c0127 100755 --- a/README.md +++ b/README.md @@ -36,6 +36,15 @@ INSTALLED_APPS = ( Don't forget to add `DRIP_FROM_EMAIL` to settings.py, or else we will fall back to `EMAIL_HOST_USER`. +For instance, send the email from your gmail account +``` +EMAIL_USE_TLS = True +EMAIL_HOST = 'smtp.gmail.com' +EMAIL_HOST_USER = 'youremail@gmail.com' +EMAIL_HOST_PASSWORD = 'yourpassword' +EMAIL_PORT = 587 +``` + Finally, be sure to run `python manage.py syncdb` or `python manage.py migrate drip` to set up the necessary database tables. diff --git a/drip/locale/zh_CN/LC_MESSAGES/django.mo b/drip/locale/zh_CN/LC_MESSAGES/django.mo new file mode 100644 index 0000000..d3091c0 Binary files /dev/null and b/drip/locale/zh_CN/LC_MESSAGES/django.mo differ diff --git a/drip/locale/zh_CN/LC_MESSAGES/django.po b/drip/locale/zh_CN/LC_MESSAGES/django.po new file mode 100644 index 0000000..18fe09f --- /dev/null +++ b/drip/locale/zh_CN/LC_MESSAGES/django.po @@ -0,0 +1,103 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Lisheng Guan , 2012,2013. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-04 11:09+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Lisheng Guan \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0\n" + +#: models.py:21 +msgid "Drip Name" +msgstr "邮件名称" + +#: models.py:22 +msgid "A unique name for this drip." +msgstr "独一无二的名称" + +#: models.py:27 +msgid "Set a custom from email." +msgstr "设置一个电子邮箱" + +#: models.py:29 +msgid "Set a name for a custom from email." +msgstr "设置发件人姓名" + +#: models.py:32 +msgid "You will have settings and user in the context." +msgstr "可以使用设置和用户信息" + +#: models.py:72 +msgid "Filter" +msgstr "过滤" + +#: models.py:73 +msgid "Exclude" +msgstr "排除" + +#: models.py:77 +msgid "exactly" +msgstr "精准匹配" + +#: models.py:78 +msgid "exactly (case insensitive)" +msgstr "精准匹配(忽略大小写)" + +#: models.py:79 +msgid "contains" +msgstr "包含" + +#: models.py:80 models.py:82 +msgid "contains (case insensitive)" +msgstr "包含(忽略大小写)" + +#: models.py:81 +msgid "regex" +msgstr "正则匹配" + +#: models.py:83 +msgid "greater than" +msgstr "大于" + +#: models.py:84 +msgid "greater than or equal to" +msgstr "大于或等于" + +#: models.py:85 +msgid "lesser than" +msgstr "小于" + +#: models.py:86 +msgid "lesser than or equal to" +msgstr "小于或等于" + +#: models.py:87 models.py:88 +msgid "starts with" +msgstr "以,,,开始" + +#: models.py:89 models.py:90 +msgid "ends with (case insensitive)" +msgstr "以,,,结尾" + +#: templates/admin/drip/change_form.html:8 +msgid "History" +msgstr "查看历史" + +#: templates/admin/drip/change_form.html:9 +msgid "View on site" +msgstr "" + +#: templates/drip/timeline.html:17 +msgid "view email" +msgstr "查看邮件" diff --git a/drip/models.py b/drip/models.py index 8f77b81..ec812ff 100644 --- a/drip/models.py +++ b/drip/models.py @@ -3,6 +3,8 @@ from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ValidationError +from django.utils.translation import ugettext as _ + # just using this to parse, but totally insane package naming... # https://bitbucket.org/schinckel/django-timedelta-field/ @@ -16,18 +18,18 @@ class Drip(models.Model): name = models.CharField( max_length=255, unique=True, - verbose_name='Drip Name', - help_text='A unique name for this drip.') + verbose_name=_('Drip Name'), + help_text=_('A unique name for this drip.')) enabled = models.BooleanField(default=False) from_email = models.EmailField(null=True, blank=True, - help_text='Set a custom from email.') + help_text=_('Set a custom from email.')) from_email_name = models.CharField(max_length=150, null=True, blank=True, - help_text="Set a name for a custom from email.") + help_text=_("Set a name for a custom from email.")) subject_template = models.TextField(null=True, blank=True) body_html_template = models.TextField(null=True, blank=True, - help_text='You will have settings and user in the context.') + help_text=_('You will have settings and user in the context.')) message_class = models.CharField(max_length=120, blank=True, default='default') @property @@ -67,25 +69,25 @@ class SentDrip(models.Model): METHOD_TYPES = ( - ('filter', 'Filter'), - ('exclude', 'Exclude'), + ('filter', _('Filter')), + ('exclude', _('Exclude')), ) LOOKUP_TYPES = ( - ('exact', 'exactly'), - ('iexact', 'exactly (case insensitive)'), - ('contains', 'contains'), - ('icontains', 'contains (case insensitive)'), - ('regex', 'regex'), - ('iregex', 'contains (case insensitive)'), - ('gt', 'greater than'), - ('gte', 'greater than or equal to'), - ('lt', 'lesser than'), - ('lte', 'lesser than or equal to'), - ('startswith', 'starts with'), - ('endswith', 'starts with'), - ('istartswith', 'ends with (case insensitive)'), - ('iendswith', 'ends with (case insensitive)'), + ('exact', _('exactly')), + ('iexact', _('exactly (case insensitive)')), + ('contains', _('contains')), + ('icontains', _('contains (case insensitive)')), + ('regex', _('regex')), + ('iregex', _('contains (case insensitive)')), + ('gt', _('greater than')), + ('gte', _('greater than or equal to')), + ('lt', _('lesser than')), + ('lte', _('lesser than or equal to')), + ('startswith', _('starts with')), + ('endswith', _('starts with')), + ('istartswith', _('ends with (case insensitive)')), + ('iendswith', _('ends with (case insensitive)')), ) class QuerySetRule(models.Model): diff --git a/drip/templates/admin/drip/SentDrip/change_form.html b/drip/templates/admin/drip/SentDrip/change_form.html new file mode 100644 index 0000000..a57983b --- /dev/null +++ b/drip/templates/admin/drip/SentDrip/change_form.html @@ -0,0 +1,64 @@ +{% extends "admin/change_form.html" %} +{% load i18n admin_static admin_list %} +{% load url from future %} +{% load admin_urls %} + +{% block object-tools-items %} +
  • View Timeline
  • +
  • {% trans "History" %}
  • + {% if has_absolute_url %}
  • {% trans "View on site" %}
  • {% endif%} +{% endblock %} + +{% block after_related_objects %} + + + +{% endblock %} diff --git a/drip/templates/drip/timeline.html b/drip/templates/drip/timeline.html index be50bb2..a0b29a3 100644 --- a/drip/templates/drip/timeline.html +++ b/drip/templates/drip/timeline.html @@ -14,9 +14,9 @@

    {{ drip.name }} Schedule:

      {% for pack in shifted_drips %}
    • {% if pack.drip.now_shift_kwargs.days != 0 %}{{ pack.drip.now }}{% else %}today!{% endif %}{% if pack.qs %}
        {% for user in pack.qs %}{% if user.email %} -
      • {{ user.email }} - {{ user.id }} - view email
      • +
      • {{ user.email }} - {{ user.id }} - {% trans "view email"%}
      • {% endif %}{% endfor %}
      {% endif %}
    • {% endfor %}
    -{% endblock content %} \ No newline at end of file +{% endblock content %}