Skip to content

Commit

Permalink
added translations
Browse files Browse the repository at this point in the history
removed send view
  • Loading branch information
ojii committed Mar 10, 2010
1 parent 7dfea9c commit 38000fa
Show file tree
Hide file tree
Showing 11 changed files with 216 additions and 41 deletions.
3 changes: 2 additions & 1 deletion MANIFEST.in
@@ -1,3 +1,4 @@
include README
include LICENSE
recursive-include mailchimp/templates *
recursive-include mailchimp/templates *
recursive-include mailchimp/locale *
2 changes: 1 addition & 1 deletion mailchimp/__init__.py
Expand Up @@ -4,4 +4,4 @@
All versions with an uneven minor version number are unstable! Versions with
even minor version numbers are considered stable.
"""
__version__ = '0.1.4.1'
__version__ = '0.1.5'
101 changes: 101 additions & 0 deletions mailchimp/locale/de/LC_MESSAGES/django.po
@@ -0,0 +1,101 @@
# SOME DESCRIPTIVE TITLE.
# 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: 2010-03-10 17:42+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: models.py:171
msgid "Mailchimp Log"
msgstr ""

#: models.py:172
msgid "Mailchimp Logs"
msgstr ""

#: templates/mailchimp/campaign_information.html:8
#: templates/mailchimp/overview.html:8
msgid "Home"
msgstr ""

#: templates/mailchimp/campaign_information.html:9
#: templates/mailchimp/overview.html:9
msgid "mailchimp overview"
msgstr ""

#: templates/mailchimp/campaign_information.html:28
msgid "Campaign Subject"
msgstr ""

#: templates/mailchimp/campaign_information.html:31
#: templates/mailchimp/overview.html:25
msgid "Sent Date"
msgstr ""

#: templates/mailchimp/campaign_information.html:35
msgid "Recipients"
msgstr ""

#: templates/mailchimp/campaign_information.html:40
msgid "Object"
msgstr ""

#: templates/mailchimp/overview.html:19
msgid "Log"
msgstr ""

#: templates/mailchimp/overview.html:24 templates/mailchimp/overview.html:60
msgid "Subject"
msgstr ""

#: templates/mailchimp/overview.html:40
msgid "First"
msgstr ""

#: templates/mailchimp/overview.html:50
msgid "Last"
msgstr ""

#: templates/mailchimp/overview.html:55
msgid "Queue"
msgstr ""

#: templates/mailchimp/overview.html:61
msgid "Actions"
msgstr ""

#: templates/mailchimp/overview.html:68
msgid "Send Now!"
msgstr ""

#: templates/mailchimp/overview.html:68
msgid "Cancel!"
msgstr ""

#: templates/mailchimp/overview.html:71
msgid "No Campaigns in the Queue"
msgstr ""

#: templates/mailchimp/send_button.html:23
#: templates/mailchimp/send_button.html:25
msgid "Sent via mailchimp:"
msgstr ""

#: templates/mailchimp/send_button.html:28
msgid "scheduled for sending via mailchimp"
msgstr ""

#: templates/mailchimp/send_button.html:31
msgid "Send via Mailchimp"
msgstr ""
101 changes: 101 additions & 0 deletions mailchimp/locale/en/LC_MESSAGES/django.po
@@ -0,0 +1,101 @@
# SOME DESCRIPTIVE TITLE.
# 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: 2010-03-10 17:41+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: models.py:171
msgid "Mailchimp Log"
msgstr ""

#: models.py:172
msgid "Mailchimp Logs"
msgstr ""

#: templates/mailchimp/campaign_information.html:8
#: templates/mailchimp/overview.html:8
msgid "Home"
msgstr ""

#: templates/mailchimp/campaign_information.html:9
#: templates/mailchimp/overview.html:9
msgid "mailchimp overview"
msgstr ""

#: templates/mailchimp/campaign_information.html:28
msgid "Campaign Subject"
msgstr ""

#: templates/mailchimp/campaign_information.html:31
#: templates/mailchimp/overview.html:25
msgid "Sent Date"
msgstr ""

#: templates/mailchimp/campaign_information.html:35
msgid "Recipients"
msgstr ""

#: templates/mailchimp/campaign_information.html:40
msgid "Object"
msgstr ""

#: templates/mailchimp/overview.html:19
msgid "Log"
msgstr ""

#: templates/mailchimp/overview.html:24 templates/mailchimp/overview.html:60
msgid "Subject"
msgstr ""

#: templates/mailchimp/overview.html:40
msgid "First"
msgstr ""

#: templates/mailchimp/overview.html:50
msgid "Last"
msgstr ""

#: templates/mailchimp/overview.html:55
msgid "Queue"
msgstr ""

#: templates/mailchimp/overview.html:61
msgid "Actions"
msgstr ""

#: templates/mailchimp/overview.html:68
msgid "Send Now!"
msgstr ""

#: templates/mailchimp/overview.html:68
msgid "Cancel!"
msgstr ""

#: templates/mailchimp/overview.html:71
msgid "No Campaigns in the Queue"
msgstr ""

#: templates/mailchimp/send_button.html:23
#: templates/mailchimp/send_button.html:25
msgid "Sent via mailchimp:"
msgstr ""

#: templates/mailchimp/send_button.html:28
msgid "scheduled for sending via mailchimp"
msgstr ""

#: templates/mailchimp/send_button.html:31
msgid "Send via Mailchimp"
msgstr ""
1 change: 0 additions & 1 deletion mailchimp/settings.py
Expand Up @@ -20,6 +20,5 @@
WEBHOOK_KEY += random.choice(alphanum)

VIEWS_OVERVIEW = getattr(settings, 'MAILCHIMP_VIEWS_OVERVIEW', 'mailchimp.views.overview')
VIEWS_SEND = getattr(settings, 'MAILCHIMP_VIEWS_SEND', 'mailchimp.views.send_campaign')
VIEWS_INFO = getattr(settings, 'MAILCHIMP_VIEWS_INFO', 'mailchimp.views.campaign_information')
VIEWS_SCHEDULE_OBJECT = getattr(settings, 'MAILCHIMP_VIEWS_SEND_OBJECT', 'mailchimp.views.schedule_campaign_for_object')
8 changes: 4 additions & 4 deletions mailchimp/templates/mailchimp/campaign_information.html
Expand Up @@ -25,19 +25,19 @@
}
</style>
<div class="module aligned campaininfo">
<h2>Campaign Information: {{ campaign.mc.subject }}</h2>
<h2>{% trans "Campaign Subject" %} {{ campaign.mc.subject }}</h2>
<table>
<tr>
<td class="title"><p><strong>Sent Date</strong></p></td>
<td class="title"><p><strong>{% trans "Sent Date" %}</strong></p></td>
<td><p>{{ campaign.sent_date }}</p></td>
</tr>
<tr>
<td class="title"><p><strong>Recipients</strong></p></td>
<td class="title"><p><strong>{% trans "Recipients" %}</strong></p></td>
<td><p>{{ campaign.recievers.all.count }}</p></td>
</tr>
{% if campaign.object %}
<tr>
<td class="title"><p><strong>object</strong></p></td>
<td class="title"><p><strong>{% trans "Object" %}</strong></p></td>
<td><p><a href="{{ campaign.get_object_admin_url }}">{{ campaign.object }}</a></p></td>
</tr>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions mailchimp/templates/mailchimp/overview.html
Expand Up @@ -16,7 +16,7 @@
<div id="content-main">
{% block object-tools %}
{% endblock %}
<h2>Log</h2>
<h2>{% trans "Log" %}</h2>
<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
<table cellspacing="0">
<thead>
Expand Down Expand Up @@ -52,7 +52,7 @@ <h2>Log</h2>
</p>
{% endif %}
</div>
<h2>Queue</h2>
<h2>{% trans "Queue" %}</h2>
<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
<table cellspacing="0">
<thead>
Expand Down
Empty file.
1 change: 0 additions & 1 deletion mailchimp/urls.py
Expand Up @@ -5,7 +5,6 @@
urlpatterns = patterns('',
url(r'^$', VIEWS_OVERVIEW, name='mailchimp_overview', kwargs={'page':'1'}),
url(r'^(?P<page>\d+)/$', VIEWS_OVERVIEW, name='mailchimp_overview'),
url(r'^send/$', VIEWS_SEND, name='mailchimp_send_campaign'),
url(r'^send/(?P<content_type>\d+)/(?P<pk>\d+)/$', VIEWS_SCHEDULE_OBJECT, name='mailchimp_schedule_for_object'),
url(r'^info/(?P<campaign_id>\w+)/$', VIEWS_INFO, name='mailchimp_campaign_info'),
url(r'^dequeue/(?P<id>\d+)/', dequeue, name='mailchimp_dequeue'),
Expand Down
32 changes: 1 addition & 31 deletions mailchimp/views.py
Expand Up @@ -23,42 +23,13 @@ def get_page_link(self, page):
return self.reverse('mailchimp_overview', page=page)


class SendCampaign(MailchimpView):

class ScheduleCampaignForObject(MailchimpView):
def auth_check(self):
basic = super(SendCampaign, self).auth_check()
if not basic:
return basic
return self.request.user.has_perm('mailchimp.can_send')

def get_form(self):
return

def handle_get(self):
# display a form?
self.data['form'] = self.get_form()

def handle_post(self):
form = self.get_form(self.POST)
if form.is_valid():
if self.handle_campaign(form):
self.message_success("The Campaign has been scheduled for sending.")
return self.redirect('mailchimp_overview')
else:
self.message_error("An error has occured while trying to send, please try again later.")
self.data['form'] = form

def handle_campaign(self, data):
return self.send(self.create(**data))

def create(self, **kwargs):
return self.connection.create_campaign(**kwargs)

def send(self, camp):
return camp.schedule(datetime.datetime.now())


class ScheduleCampaignForObject(SendCampaign):
def handle_post(self):
return self.not_allowed()

Expand Down Expand Up @@ -145,6 +116,5 @@ def handle_get(self):
dequeue = Dequeue()
cancel = Cancel()
campaign_information = CampaignInformation()
send_campaign = SendCampaign()
overview = Overview()
schedule_campaign_for_object = ScheduleCampaignForObject()
4 changes: 4 additions & 0 deletions setup.py
Expand Up @@ -13,6 +13,10 @@
package_data={
'mailchimp': [
'templates/mailchimp/*.html',
'locale/en/LC_MESSAGES/django.po',
'locale/en/LC_MESSAGES/django.mo',
'locale/de/LC_MESSAGES/django.po',
'locale/de/LC_MESSAGES/django.mo',
],
},
)

0 comments on commit 38000fa

Please sign in to comment.