Browse Source

Renamed cash module to cashonly, as it should be

master
Niklas Brachmann 9 years ago
parent
commit
8eba2ce576
  1. 1
      cash/templates/cash/index.html
  2. 0
      cashonly/__init__.py
  3. 8
      cashonly/admin.py
  4. 8
      cashonly/api.py
  5. 2
      cashonly/auth.py
  6. 0
      cashonly/formfields.py
  7. 121
      cashonly/locale/de/LC_MESSAGES/django.po
  8. 0
      cashonly/management/__init__.py
  9. 0
      cashonly/management/commands/__init__.py
  10. 6
      cashonly/management/commands/dailydigest.py
  11. 4
      cashonly/management/commands/debtreminder.py
  12. 0
      cashonly/models.py
  13. 0
      cashonly/static/images/no-image.png
  14. 0
      cashonly/static/signin.css
  15. 0
      cashonly/static/style.css
  16. 4
      cashonly/templates/cashonly/base.html
  17. 2
      cashonly/templates/cashonly/buy_confirm.html
  18. 2
      cashonly/templates/cashonly/buy_error.html
  19. 2
      cashonly/templates/cashonly/buy_thanks.html
  20. 0
      cashonly/templates/cashonly/daily_digest.txt
  21. 0
      cashonly/templates/cashonly/debt_reminder.txt
  22. 0
      cashonly/templates/cashonly/includes/product_list.html
  23. 0
      cashonly/templates/cashonly/includes/transaction_list.html
  24. 1
      cashonly/templates/cashonly/index.html
  25. 0
      cashonly/templates/cashonly/login.html
  26. 2
      cashonly/templates/cashonly/product_detail.html
  27. 4
      cashonly/templates/cashonly/product_list.html
  28. 4
      cashonly/templates/cashonly/transaction_list.html
  29. 2
      cashonly/templates/cashonly/usersettings.html
  30. 2
      cashonly/templates/cashonly/usersettings_saved.html
  31. 0
      cashonly/tests.py
  32. 16
      cashonly/urls.py
  33. 0
      cashonly/version.py
  34. 26
      cashonly/views.py
  35. 7
      lugcash2/settings.py
  36. 4
      lugcash2/urls.py

1
cash/templates/cash/index.html

@ -1 +0,0 @@
{% extends "cash/base.html" %}

0
cash/__init__.py → cashonly/__init__.py

8
cash/admin.py → cashonly/admin.py

@ -1,6 +1,6 @@
from django.contrib import admin from django.contrib import admin
from cash.models import * from cashonly.models import *
from cash.formfields import DigitField from cashonly.formfields import DigitField
from django import forms from django import forms
from django.template.defaultfilters import escape from django.template.defaultfilters import escape
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
@ -48,7 +48,7 @@ class AccountAdmin(admin.ModelAdmin):
def transaction_link(self, account): def transaction_link(self, account):
return '<a href="%s?account__id__exact=%d">%s</a>' % \ return '<a href="%s?account__id__exact=%d">%s</a>' % \
(reverse("admin:cash_transaction_changelist"), account.id, (reverse("admin:cashonly_transaction_changelist"), account.id,
_('Transactions')) _('Transactions'))
transaction_link.short_description = ugettext_lazy('Transaction link') transaction_link.short_description = ugettext_lazy('Transaction link')
@ -82,7 +82,7 @@ class AccountAdmin(admin.ModelAdmin):
'last': request.user.last_name} 'last': request.user.last_name}
if comment is not None and len(comment) > 0: if comment is not None and len(comment) > 0:
desc += ' (%s)' % (comment) desc += ' (%s)' % (comment)
obj.change_credit(amount, subject, desc) obj.change_credit(aount, subject, desc)
# Make sure the object is saved in any case # Make sure the object is saved in any case
obj.save() obj.save()

8
cash/api.py → cashonly/api.py

@ -1,4 +1,4 @@
from cash.models import * from cashonly.models import *
from django.http import HttpResponse from django.http import HttpResponse
from django.contrib.auth import authenticate from django.contrib.auth import authenticate
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
@ -178,7 +178,7 @@ def cashapi(request):
elif action == 'buy_items': elif action == 'buy_items':
s = check_session(data) s = check_session(data)
shopping_list = {} shopping_list = {}
try: try:
for item in data['items']: for item in data['items']:
@ -206,7 +206,7 @@ def cashapi(request):
treasurer = User.objects.get(pk=s['userid']) treasurer = User.objects.get(pk=s['userid'])
if not treasurer.has_perm('cash.change_account'): if not treasurer.has_perm('cashonly.change_account'):
raise ApiError(ERR_USER_NOT_AUTHORIZED) raise ApiError(ERR_USER_NOT_AUTHORIZED)
try: try:
@ -248,5 +248,5 @@ def cashapi(request):
'api_version': API_VERSION} 'api_version': API_VERSION}
print ret print ret
return HttpResponse(json.dumps(ret)) return HttpResponse(json.dumps(ret))

2
cash/auth.py → cashonly/auth.py

@ -1,5 +1,5 @@
from django.contrib.auth.models import User from django.contrib.auth.models import User
from cash.models import Account from cashonly.models import Account
class CashBackend(object): class CashBackend(object):
def authenticate(self, card_number=None, pin=None): def authenticate(self, card_number=None, pin=None):

0
cash/formfields.py → cashonly/formfields.py

121
cash/locale/de/LC_MESSAGES/django.po → cashonly/locale/de/LC_MESSAGES/django.po

@ -1,7 +1,6 @@
# German language file for django cash app. # German language file for django cashonly app.
# Copyright (C) 2013 Niklas Brachmann # Copyright (C) 2013 Niklas Brachmann
# This file is distributed under the same license as the cash package. # This file is distributed under the same license as the cashonly package.
# Niklas Brachmann <mail@klonfish.de>, 2013.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@ -195,183 +194,183 @@ msgstr "Kontoauszug"
msgid "Debt Reminder" msgid "Debt Reminder"
msgstr "Schuldenerinnerung" msgstr "Schuldenerinnerung"
#: templates/cash/base.html:22 templates/cash/buy_confirm.html:17 #: templates/cashonly/base.html:22 templates/cashonly/buy_confirm.html:17
#: templates/cash/product_detail.html:11 #: templates/cashonly/product_detail.html:11
msgid "Name" msgid "Name"
msgstr "Name" msgstr "Name"
#: templates/cash/base.html:24 templates/cash/login.html:25 #: templates/cashonly/base.html:24 templates/cashonly/login.html:25
msgid "Username" msgid "Username"
msgstr "Benutzername" msgstr "Benutzername"
#: templates/cash/base.html:25 #: templates/cashonly/base.html:25
msgid "Credit" msgid "Credit"
msgstr "Guthaben" msgstr "Guthaben"
#: templates/cash/base.html:27 #: templates/cashonly/base.html:27
msgid "Warning!" msgid "Warning!"
msgstr "Achtung!" msgstr "Achtung!"
#: templates/cash/base.html:27 #: templates/cashonly/base.html:27
#, python-format #, python-format
msgid "Only %(debtlimitamount)s&nbsp;&euro; until reaching the debt limit." msgid "Only %(debtlimitamount)s&nbsp;&euro; until reaching the debt limit."
msgstr "" msgstr ""
"Nur noch %(debtlimitamount)s&nbsp;&euro; bis zum Erreichen des " "Nur noch %(debtlimitamount)s&nbsp;&euro; bis zum Erreichen des "
"Schuldenlimits." "Schuldenlimits."
#: templates/cash/base.html:63 #: templates/cashonly/base.html:63
msgid "Overview" msgid "Overview"
msgstr "Übersicht" msgstr "Übersicht"
#: templates/cash/base.html:64 templates/cash/includes/product_list.html:12 #: templates/cashonly/base.html:64 templates/cashonly/includes/product_list.html:12
msgid "Buy" msgid "Buy"
msgstr "Kaufen" msgstr "Kaufen"
#: templates/cash/base.html:65 #: templates/cashonly/base.html:65
msgctxt "monthly staement" msgctxt "monthly staement"
msgid "Transaction list" msgid "Transaction list"
msgstr "Kontoauszug" msgstr "Kontoauszug"
#: templates/cash/base.html:66 templates/cash/usersettings.html:29 #: templates/cashonly/base.html:66 templates/cashonly/usersettings.html:29
#: templates/cash/usersettings_saved.html:6 #: templates/cashonly/usersettings_saved.html:6
msgid "Preferences" msgid "Preferences"
msgstr "Einstellungen" msgstr "Einstellungen"
#: templates/cash/base.html:68 #: templates/cashonly/base.html:68
msgid "Administration" msgid "Administration"
msgstr "Administration" msgstr "Administration"
#: templates/cash/base.html:80 #: templates/cashonly/base.html:80
msgid "Logout" msgid "Logout"
msgstr "Abmelden" msgstr "Abmelden"
#: templates/cash/base.html:92 #: templates/cashonly/base.html:92
#, python-format #, python-format
msgid "Welcome, %(firstname)s!" msgid "Welcome, %(firstname)s!"
msgstr "Herzlich willkommen, %(firstname)s!" msgstr "Herzlich willkommen, %(firstname)s!"
#: templates/cash/base.html:98 #: templates/cashonly/base.html:98
msgid "Account information" msgid "Account information"
msgstr "Kontoinformationen" msgstr "Kontoinformationen"
#: templates/cash/base.html:102 #: templates/cashonly/base.html:102
msgid "Username:" msgid "Username:"
msgstr "Benutzername:" msgstr "Benutzername:"
#: templates/cash/base.html:104 #: templates/cashonly/base.html:104
msgid "Full name:" msgid "Full name:"
msgstr "Realname:" msgstr "Realname:"
#: templates/cash/base.html:106 #: templates/cashonly/base.html:106
msgid "E-Mail address:" msgid "E-Mail address:"
msgstr "E-Mail Adresse:" msgstr "E-Mail Adresse:"
#: templates/cash/base.html:108 #: templates/cashonly/base.html:108
msgid "Credit:" msgid "Credit:"
msgstr "Guthaben:" msgstr "Guthaben:"
#: templates/cash/base.html:117 #: templates/cashonly/base.html:117
msgid "Last purchased products" msgid "Last purchased products"
msgstr "Zuletzt gekaufte Produkte" msgstr "Zuletzt gekaufte Produkte"
#: templates/cash/base.html:127 #: templates/cashonly/base.html:127
msgid "Your transactions in the last 12 hours" msgid "Your transactions in the last 12 hours"
msgstr "Transaktionen in den vergangenen 12 Stunden" msgstr "Transaktionen in den vergangenen 12 Stunden"
#: templates/cash/base.html:133 #: templates/cashonly/base.html:133
msgid "There where no transactions in your account in the last 12 hours." msgid "There where no transactions in your account in the last 12 hours."
msgstr "In den vergangenen 12 Stunden wurden keine Transaktionen durchgeführt." msgstr "In den vergangenen 12 Stunden wurden keine Transaktionen durchgeführt."
#: templates/cash/buy_confirm.html:8 templates/cash/buy_error.html:8 #: templates/cashonly/buy_confirm.html:8 templates/cashonly/buy_error.html:8
#: templates/cash/buy_thanks.html:8 #: templates/cashonly/buy_thanks.html:8
msgid "Buy product" msgid "Buy product"
msgstr "Produkt kaufen" msgstr "Produkt kaufen"
#: templates/cash/buy_confirm.html:13 #: templates/cashonly/buy_confirm.html:13
msgid "Confirm purchase." msgid "Confirm purchase."
msgstr "Einkauf bestätigen." msgstr "Einkauf bestätigen."
#: templates/cash/buy_confirm.html:18 templates/cash/product_detail.html:12 #: templates/cashonly/buy_confirm.html:18 templates/cashonly/product_detail.html:12
msgid "Price" msgid "Price"
msgstr "Preis" msgstr "Preis"
#: templates/cash/buy_confirm.html:19 templates/cash/product_detail.html:13 #: templates/cashonly/buy_confirm.html:19 templates/cashonly/product_detail.html:13
msgid "Category" msgid "Category"
msgstr "Kategorie" msgstr "Kategorie"
#: templates/cash/buy_confirm.html:22 #: templates/cashonly/buy_confirm.html:22
msgid "Do you really want to buy this product?" msgid "Do you really want to buy this product?"
msgstr "Möchtest du dieses Produkt wirklich kaufen?" msgstr "Möchtest du dieses Produkt wirklich kaufen?"
#: templates/cash/buy_confirm.html:23 templates/cash/buy_confirm.html.py:24 #: templates/cashonly/buy_confirm.html:23 templates/cashonly/buy_confirm.html.py:24
msgid "Yes" msgid "Yes"
msgstr "Ja" msgstr "Ja"
#: templates/cash/buy_confirm.html:25 #: templates/cashonly/buy_confirm.html:25
msgid "No" msgid "No"
msgstr "Nein" msgstr "Nein"
#: templates/cash/buy_error.html:11 #: templates/cashonly/buy_error.html:11
msgid "You cannot buy this product, as the debt limit has been reached." msgid "You cannot buy this product, as the debt limit has been reached."
msgstr "" msgstr ""
"Du kannst dieses Produkt nicht kaufen, da das Schuldenlimit erreicht wurde." "Du kannst dieses Produkt nicht kaufen, da das Schuldenlimit erreicht wurde."
#: templates/cash/buy_error.html:14 templates/cash/buy_thanks.html:14 #: templates/cashonly/buy_error.html:14 templates/cashonly/buy_thanks.html:14
#: templates/cash/usersettings_saved.html:11 #: templates/cashonly/usersettings_saved.html:11
msgid "Back" msgid "Back"
msgstr "Zurück" msgstr "Zurück"
#: templates/cash/buy_thanks.html:11 #: templates/cashonly/buy_thanks.html:11
msgid "Thanks for your purchase!" msgid "Thanks for your purchase!"
msgstr "Danke für deinen Einkauf." msgstr "Danke für deinen Einkauf."
#: templates/cash/login.html:24 #: templates/cashonly/login.html:24
msgid "Please sign in" msgid "Please sign in"
msgstr "Bitte anmelden." msgstr "Bitte anmelden."
#: templates/cash/login.html:26 #: templates/cashonly/login.html:26
msgid "Password" msgid "Password"
msgstr "Passwort" msgstr "Passwort"
#: templates/cash/login.html:27 #: templates/cashonly/login.html:27
msgid "Sign in" msgid "Sign in"
msgstr "Anmelden" msgstr "Anmelden"
#: templates/cash/product_detail.html:8 #: templates/cashonly/product_detail.html:8
msgid "Product details" msgid "Product details"
msgstr "Produktdetails" msgstr "Produktdetails"
#: templates/cash/product_list.html:10 #: templates/cashonly/product_list.html:10
msgid "All categories" msgid "All categories"
msgstr "Alle Kategorien" msgstr "Alle Kategorien"
#: templates/cash/transaction_list.html:7 #: templates/cashonly/transaction_list.html:7
msgctxt "monthly statement" msgctxt "monthly statement"
msgid "Transaction list" msgid "Transaction list"
msgstr "Kontoauszug" msgstr "Kontoauszug"
#: templates/cash/transaction_list.html:13 #: templates/cashonly/transaction_list.html:13
msgid "less detailed" msgid "less detailed"
msgstr "weniger Details" msgstr "weniger Details"
#: templates/cash/transaction_list.html:15 #: templates/cashonly/transaction_list.html:15
msgid "more detailed" msgid "more detailed"
msgstr "mehr Details" msgstr "mehr Details"
#: templates/cash/transaction_list.html:24 #: templates/cashonly/transaction_list.html:24
#, python-format #, python-format
msgid "Page %(current)s of %(num)s" msgid "Page %(current)s of %(num)s"
msgstr "Seite %(current)s von %(num)s" msgstr "Seite %(current)s von %(num)s"
#: templates/cash/transaction_list.html:30 #: templates/cashonly/transaction_list.html:30
msgid "No transactions have been made, yet." msgid "No transactions have been made, yet."
msgstr "Es wurden noch keine Transaktionen durchgeführt." msgstr "Es wurden noch keine Transaktionen durchgeführt."
#: templates/cash/usersettings.html:34 #: templates/cashonly/usersettings.html:34
msgid "Daily digest" msgid "Daily digest"
msgstr "Tägliche Zusammenfassung" msgstr "Tägliche Zusammenfassung"
#: templates/cash/usersettings.html:36 #: templates/cashonly/usersettings.html:36
msgid "" msgid ""
"The digest will be sent nightly, as long as there were transaction made in " "The digest will be sent nightly, as long as there were transaction made in "
"the past 24 hours." "the past 24 hours."
@ -379,15 +378,15 @@ msgstr ""
"Der Kontoauszug wird nachts versandt, sofern in den vergangenen 24 Stunden " "Der Kontoauszug wird nachts versandt, sofern in den vergangenen 24 Stunden "
"Kontobewegungen stattgefunden haben." "Kontobewegungen stattgefunden haben."
#: templates/cash/usersettings.html:40 templates/cash/usersettings.html:60 #: templates/cashonly/usersettings.html:40 templates/cashonly/usersettings.html:60
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: templates/cash/usersettings.html:52 #: templates/cashonly/usersettings.html:52
msgid "Change PIN" msgid "Change PIN"
msgstr "PIN ändern" msgstr "PIN ändern"
#: templates/cash/usersettings.html:54 #: templates/cashonly/usersettings.html:54
msgid "" msgid ""
"The PIN is asked for after scanning the member's ID card. If this field is " "The PIN is asked for after scanning the member's ID card. If this field is "
"left blank, no PIN will be needed to log in." "left blank, no PIN will be needed to log in."
@ -395,39 +394,39 @@ msgstr ""
"Der PIN wird nach dem Einscannen des Mitgliederausweises abgefragt. Wenn das " "Der PIN wird nach dem Einscannen des Mitgliederausweises abgefragt. Wenn das "
"Feld leergelassen wird, wird kein PIN abgefragt." "Feld leergelassen wird, wird kein PIN abgefragt."
#: templates/cash/usersettings.html:75 templates/cash/usersettings.html:82 #: templates/cashonly/usersettings.html:75 templates/cashonly/usersettings.html:82
msgid "Clear PIN" msgid "Clear PIN"
msgstr "PIN löschen" msgstr "PIN löschen"
#: templates/cash/usersettings.html:78 #: templates/cashonly/usersettings.html:78
msgid "Do you really want to clear your PIN?" msgid "Do you really want to clear your PIN?"
msgstr "Möchtest du deinen PIN wirklich löschen?" msgstr "Möchtest du deinen PIN wirklich löschen?"
#: templates/cash/usersettings.html:81 #: templates/cashonly/usersettings.html:81
msgid "Cancel" msgid "Cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
#: templates/cash/usersettings_saved.html:9 #: templates/cashonly/usersettings_saved.html:9
msgid "The settings have been saved successfully!" msgid "The settings have been saved successfully!"
msgstr "Die Einstellungen wurden erfolgreich gespeichert." msgstr "Die Einstellungen wurden erfolgreich gespeichert."
#: templates/cash/includes/product_list.html:8 #: templates/cashonly/includes/product_list.html:8
msgid "Product image" msgid "Product image"
msgstr "Produktbild" msgstr "Produktbild"
#: templates/cash/includes/transaction_list.html:7 #: templates/cashonly/includes/transaction_list.html:7
msgid "Date" msgid "Date"
msgstr "Datum" msgstr "Datum"
#: templates/cash/includes/transaction_list.html:8 #: templates/cashonly/includes/transaction_list.html:8
msgid "Subject" msgid "Subject"
msgstr "Betreff" msgstr "Betreff"
#: templates/cash/includes/transaction_list.html:9 #: templates/cashonly/includes/transaction_list.html:9
msgid "Description" msgid "Description"
msgstr "Beschreibung" msgstr "Beschreibung"
#: templates/cash/includes/transaction_list.html:10 #: templates/cashonly/includes/transaction_list.html:10
msgctxt "money" msgctxt "money"
msgid "amount" msgid "amount"
msgstr "Betrag" msgstr "Betrag"

0
cash/management/__init__.py → cashonly/management/__init__.py

0
cash/management/commands/__init__.py → cashonly/management/commands/__init__.py

6
cash/management/commands/dailydigest.py → cashonly/management/commands/dailydigest.py

@ -1,4 +1,4 @@
from cash.models import * from cashonly.models import *
from django.conf import settings from django.conf import settings
from django.core.mail import send_mass_mail from django.core.mail import send_mass_mail
from django.core.management.base import NoArgsCommand, CommandError from django.core.management.base import NoArgsCommand, CommandError
@ -20,7 +20,7 @@ class Command(NoArgsCommand):
def handle_noargs(self, **options): def handle_noargs(self, **options):
translation.activate('de') translation.activate('de')
tpl = get_template('cash/daily_digest.txt') tpl = get_template('cashonly/daily_digest.txt')
messages = [] messages = []
for a in Account.objects.all(): for a in Account.objects.all():
@ -29,7 +29,7 @@ class Command(NoArgsCommand):
'credit': a.credit, 'credit': a.credit,
'range': RANGE, 'range': RANGE,
'url': USERSETTINGS_URL} 'url': USERSETTINGS_URL}
transactions = Transaction.objects.filter(account = a) \ transactions = Transaction.objects.filter(account = a) \
.filter(timestamp__gte=(datetime.datetime.now() .filter(timestamp__gte=(datetime.datetime.now()
- datetime.timedelta(hours = RANGE))) - datetime.timedelta(hours = RANGE)))

4
cash/management/commands/debtreminder.py → cashonly/management/commands/debtreminder.py

@ -1,5 +1,5 @@
from cash.models import * from cashonly.models import *
from django.conf import settings from django.conf import settings
from django.core.mail import send_mass_mail from django.core.mail import send_mass_mail
from django.core.management.base import NoArgsCommand from django.core.management.base import NoArgsCommand
@ -14,7 +14,7 @@ class Command(NoArgsCommand):
def handle_noargs(self, **options): def handle_noargs(self, **options):
translation.activate('de') translation.activate('de')
tpl = get_template('cash/debt_reminder.txt') tpl = get_template('cashonly/debt_reminder.txt')
messages = [] messages = []
for a in Account.objects.all(): for a in Account.objects.all():

0
cash/models.py → cashonly/models.py

0
cash/static/images/no-image.png → cashonly/static/images/no-image.png

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

0
cash/static/signin.css → cashonly/static/signin.css

0
cash/static/style.css → cashonly/static/style.css

4
cash/templates/cash/base.html → cashonly/templates/cashonly/base.html

@ -116,7 +116,7 @@
{% trans "Last purchased products" %} {% trans "Last purchased products" %}
</div> </div>
<div class="panel-body"> <div class="panel-body">
{% include "cash/includes/product_list.html" with products=latest_purchases class="col-xs-6 col-md-4" only %} {% include "cashonly/includes/product_list.html" with products=latest_purchases class="col-xs-6 col-md-4" only %}
</div> </div>
</div> </div>
</div> </div>
@ -126,7 +126,7 @@
{% trans "Your transactions in the last 12 hours" %} {% trans "Your transactions in the last 12 hours" %}
</div> </div>
{% if latest_transactions %} {% if latest_transactions %}
{% include "cash/includes/transaction_list.html" with transactions=latest_transactions only %} {% include "cashonly/includes/transaction_list.html" with transactions=latest_transactions only %}
{% else %} {% else %}
<div class="panel-body"> <div class="panel-body">
{% blocktrans %}There where no transactions in your account in the last 12 hours.{% endblocktrans %} {% blocktrans %}There where no transactions in your account in the last 12 hours.{% endblocktrans %}

2
cash/templates/cash/buy_confirm.html → cashonly/templates/cashonly/buy_confirm.html

@ -1,4 +1,4 @@
{% extends "cash/base.html" %} {% extends "cashonly/base.html" %}
{% load i18n %} {% load i18n %}

2
cash/templates/cash/buy_error.html → cashonly/templates/cashonly/buy_error.html

@ -1,4 +1,4 @@
{% extends "cash/base.html" %} {% extends "cashonly/base.html" %}
{% load i18n %} {% load i18n %}

2
cash/templates/cash/buy_thanks.html → cashonly/templates/cashonly/buy_thanks.html

@ -1,4 +1,4 @@
{% extends "cash/base.html" %} {% extends "cashonly/base.html" %}
{% load i18n %} {% load i18n %}

0
cash/templates/cash/daily_digest.txt → cashonly/templates/cashonly/daily_digest.txt

0
cash/templates/cash/debt_reminder.txt → cashonly/templates/cashonly/debt_reminder.txt

0
cash/templates/cash/includes/product_list.html → cashonly/templates/cashonly/includes/product_list.html

0
cash/templates/cash/includes/transaction_list.html → cashonly/templates/cashonly/includes/transaction_list.html

1
cashonly/templates/cashonly/index.html

@ -0,0 +1 @@
{% extends "cashonly/base.html" %}

0
cash/templates/cash/login.html → cashonly/templates/cashonly/login.html

2
cash/templates/cash/product_detail.html → cashonly/templates/cashonly/product_detail.html

@ -1,4 +1,4 @@
{% extends "cash/base.html" %} {% extends "cashonly/base.html" %}
{% load i18n %} {% load i18n %}

4
cash/templates/cash/product_list.html → cashonly/templates/cashonly/product_list.html

@ -1,4 +1,4 @@
{% extends "cash/base.html" %} {% extends "cashonly/base.html" %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
@ -15,6 +15,6 @@
<!-- Ugly workaround --> <!-- Ugly workaround -->
<br/> <br/>
{% include "cash/includes/product_list.html" with products=product_list only %} {% include "cashonly/includes/product_list.html" with products=product_list only %}
{% endblock %} {% endblock %}

4
cash/templates/cash/transaction_list.html → cashonly/templates/cashonly/transaction_list.html

@ -1,4 +1,4 @@
{% extends "cash/base.html" %} {% extends "cashonly/base.html" %}
{% load i18n %} {% load i18n %}
@ -16,7 +16,7 @@
<br/> <br/>
</div> </div>
{% include "cash/includes/transaction_list.html" with transactions=transaction_list only %} {% include "cashonly/includes/transaction_list.html" with transactions=transaction_list only %}
<ul class="pagination"> <ul class="pagination">
<li {% if not transaction_list.has_previous %}class="disabled"{% endif %}><a href="{% if transaction_list.has_previous %}{% if detailed %}{% url 'transactions_detailed' page=transaction_list.previous_page_number %}{% else %}{% url 'transactions' page=transaction_list.previous_page_number %}{% endif %}{% endif %}">&laquo;</a></li> <li {% if not transaction_list.has_previous %}class="disabled"{% endif %}><a href="{% if transaction_list.has_previous %}{% if detailed %}{% url 'transactions_detailed' page=transaction_list.previous_page_number %}{% else %}{% url 'transactions' page=transaction_list.previous_page_number %}{% endif %}{% endif %}">&laquo;</a></li>

2
cash/templates/cash/usersettings.html → cashonly/templates/cashonly/usersettings.html

@ -1,4 +1,4 @@
{% extends "cash/base.html" %} {% extends "cashonly/base.html" %}
{% load i18n %} {% load i18n %}
{% load bootstrap %} {% load bootstrap %}
{% load staticfiles %} {% load staticfiles %}

2
cash/templates/cash/usersettings_saved.html → cashonly/templates/cashonly/usersettings_saved.html

@ -1,4 +1,4 @@
{% extends "cash/base.html" %} {% extends "cashonly/base.html" %}
{% load url from future %} {% load url from future %}
{% load i18n %} {% load i18n %}

0
cash/tests.py → cashonly/tests.py

16
cash/urls.py → cashonly/urls.py

@ -1,8 +1,8 @@
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from cash import views from cashonly import views
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^/?$', 'cash.views.overview', name='overview'), url(r'^/?$', 'cashonly.views.overview', name='overview'),
url(r'^product/(?P<pk>\d+)/$', views.ProductView.as_view(), name='product'), url(r'^product/(?P<pk>\d+)/$', views.ProductView.as_view(), name='product'),
@ -15,19 +15,19 @@ urlpatterns = patterns('',
url(r'products/((?P<category_id>\d+)/)?$', views.products, name='products'), url(r'products/((?P<category_id>\d+)/)?$', views.products, name='products'),
url(r'buy/(?P<product_id>\d+)/$', 'cash.views.buy', name='buy'), url(r'buy/(?P<product_id>\d+)/$', 'cashonly.views.buy', name='buy'),
url(r'buy/(?P<product_id>\d+)/really/$', 'cash.views.buy', url(r'buy/(?P<product_id>\d+)/really/$', 'cashonly.views.buy',
{'confirm': True}, name='buy_really'), {'confirm': True}, name='buy_really'),
url(r'buy/thanks/$', 'cash.views.buy_thanks', name='buy_thanks'), url(r'buy/thanks/$', 'cashonly.views.buy_thanks', name='buy_thanks'),
url(r'buy/error/$', 'cash.views.buy_error', name='buy_error'), url(r'buy/error/$', 'cashonly.views.buy_error', name='buy_error'),
url(r'usersettings(/(?P<submit>\w+))?/$', 'cash.views.usersettings', url(r'usersettings(/(?P<submit>\w+))?/$', 'cashonly.views.usersettings',
name='usersettings'), name='usersettings'),
url(r'api/?$', 'cash.api.cashapi'), url(r'api/?$', 'cashonly.api.cashapi'),
) )

0
cash/version.py → cashonly/version.py

26
cash/views.py → cashonly/views.py

@ -4,14 +4,14 @@ from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.template import RequestContext from django.template import RequestContext
from django.core import paginator from django.core import paginator
from cash.models import * from cashonly.models import *
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy
import cash.version import cashonly.version
import datetime import datetime
def version_number_context_processor(request): def version_number_context_processor(request):
return {'version_number': cash.version.CASHONLY_VERSION} return {'version_number': cashonly.version.CASHONLY_VERSION}
@login_required @login_required
def overview(request): def overview(request):
@ -34,7 +34,7 @@ def overview(request):
context = RequestContext(request, { 'latest_transactions': transactions, context = RequestContext(request, { 'latest_transactions': transactions,
'latest_purchases': products}) 'latest_purchases': products})
return render_to_response('cash/index.html', return render_to_response('cashonly/index.html',
context_instance=context) context_instance=context)
@ -59,7 +59,7 @@ def transactions(request, detailed, page):
context = RequestContext(request, { 'transaction_list': transaction_list, context = RequestContext(request, { 'transaction_list': transaction_list,
'detailed': detailed }) 'detailed': detailed })
return render_to_response('cash/transaction_list.html', return render_to_response('cashonly/transaction_list.html',
context_instance=context) context_instance=context)
def products(request, category_id=None): def products(request, category_id=None):
@ -76,7 +76,7 @@ def products(request, category_id=None):
'category': category, 'category': category,
'categories': categories }) 'categories': categories })
return render_to_response('cash/product_list.html', return render_to_response('cashonly/product_list.html',
context_instance=context) context_instance=context)
@login_required @login_required
@ -90,18 +90,18 @@ def buy(request, product_id, confirm=False):
return redirect('buy_error') return redirect('buy_error')
else: else:
context = RequestContext(request, {'product': product}) context = RequestContext(request, {'product': product})
return render_to_response('cash/buy_confirm.html', return render_to_response('cashonly/buy_confirm.html',
context_instance=context) context_instance=context)
@login_required @login_required
def buy_thanks(request): def buy_thanks(request):
context = RequestContext(request) context = RequestContext(request)
return render_to_response('cash/buy_thanks.html', context_instance=context) return render_to_response('cashonly/buy_thanks.html', context_instance=context)
@login_required @login_required
def buy_error(request): def buy_error(request):
context = RequestContext(request) context = RequestContext(request)
return render_to_response('cash/buy_error.html', context_instance=context) return render_to_response('cashonly/buy_error.html', context_instance=context)
class UserSettingsForm(forms.Form): class UserSettingsForm(forms.Form):
daily_digest = forms.BooleanField(required=False, daily_digest = forms.BooleanField(required=False,
@ -140,7 +140,7 @@ def usersettings(request, submit=None):
request.user.account.pin = pin request.user.account.pin = pin
request.user.account.save() request.user.account.save()
context = RequestContext(request) context = RequestContext(request)
return render_to_response('cash/usersettings_saved.html', return render_to_response('cashonly/usersettings_saved.html',
context_instance=context) context_instance=context)
elif submit == 'settings': elif submit == 'settings':
@ -151,12 +151,12 @@ def usersettings(request, submit=None):
request.user.account.daily_digest = daily_digest request.user.account.daily_digest = daily_digest
request.user.account.save() request.user.account.save()
context = RequestContext(request) context = RequestContext(request)
return render_to_response('cash/usersettings_saved.html', return render_to_response('cashonly/usersettings_saved.html',
context_instance=context) context_instance=context)
context = RequestContext(request, { 'settings_form': settings_form, context = RequestContext(request, { 'settings_form': settings_form,
'pin_form': pin_form}) 'pin_form': pin_form})
return render_to_response('cash/usersettings.html', return render_to_response('cashonly/usersettings.html',
context_instance=context) context_instance=context)

7
lugcash2/settings.py

@ -128,10 +128,9 @@ INSTALLED_APPS = (
'django.contrib.admin', 'django.contrib.admin',
# Uncomment the next line to enable admin documentation: # Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs', # 'django.contrib.admindocs',
'django_evolution',
'bootstrapform', 'bootstrapform',
'cash' 'cashonly'
) )
# A sample logging configuration. The only tangible logging # A sample logging configuration. The only tangible logging
@ -175,12 +174,12 @@ LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/' LOGIN_REDIRECT_URL = '/'
# Add custom context processors # Add custom context processors
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ('cash.views.version_number_context_processor',) TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ('cashonly.views.version_number_context_processor',)
AUTHENTICATION_BACKENDS = ( AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend', 'django_auth_ldap.backend.LDAPBackend',
'django.contrib.auth.backends.ModelBackend', 'django.contrib.auth.backends.ModelBackend',
'cash.auth.CashBackend', 'cashonly.auth.CashBackend',
) )
AUTH_LDAP_SERVER_URI = "ldap://seraph" AUTH_LDAP_SERVER_URI = "ldap://seraph"

4
lugcash2/urls.py

@ -16,9 +16,9 @@ urlpatterns = patterns('',
# Uncomment the next line to enable the admin: # Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'', include('cash.urls')), url(r'', include('cashonly.urls')),
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'cash/login.html'}), url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'cashonly/login.html'}),
url(r'^logout/$', 'django.contrib.auth.views.logout_then_login'), url(r'^logout/$', 'django.contrib.auth.views.logout_then_login'),
) )

Loading…
Cancel
Save