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

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

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
from cash.models import *
from cashonly.models import *
from django.http import HttpResponse
from django.contrib.auth import authenticate
from django.views.decorators.csrf import csrf_exempt
@ -178,7 +178,7 @@ def cashapi(request): @@ -178,7 +178,7 @@ def cashapi(request):
elif action == 'buy_items':
s = check_session(data)
shopping_list = {}
try:
for item in data['items']:
@ -206,7 +206,7 @@ def cashapi(request): @@ -206,7 +206,7 @@ def cashapi(request):
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)
try:
@ -248,5 +248,5 @@ def cashapi(request): @@ -248,5 +248,5 @@ def cashapi(request):
'api_version': API_VERSION}
print ret
return HttpResponse(json.dumps(ret))

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
from django.contrib.auth.models import User
from cash.models import Account
from cashonly.models import Account
class CashBackend(object):
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 @@ @@ -1,7 +1,6 @@
# German language file for django cash app.
# German language file for django cashonly app.
# Copyright (C) 2013 Niklas Brachmann
# This file is distributed under the same license as the cash package.
# Niklas Brachmann <mail@klonfish.de>, 2013.
# This file is distributed under the same license as the cashonly package.
#
#, fuzzy
msgid ""
@ -195,183 +194,183 @@ msgstr "Kontoauszug" @@ -195,183 +194,183 @@ msgstr "Kontoauszug"
msgid "Debt Reminder"
msgstr "Schuldenerinnerung"
#: templates/cash/base.html:22 templates/cash/buy_confirm.html:17
#: templates/cash/product_detail.html:11
#: templates/cashonly/base.html:22 templates/cashonly/buy_confirm.html:17
#: templates/cashonly/product_detail.html:11
msgid "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"
msgstr "Benutzername"
#: templates/cash/base.html:25
#: templates/cashonly/base.html:25
msgid "Credit"
msgstr "Guthaben"
#: templates/cash/base.html:27
#: templates/cashonly/base.html:27
msgid "Warning!"
msgstr "Achtung!"
#: templates/cash/base.html:27
#: templates/cashonly/base.html:27
#, python-format
msgid "Only %(debtlimitamount)s&nbsp;&euro; until reaching the debt limit."
msgstr ""
"Nur noch %(debtlimitamount)s&nbsp;&euro; bis zum Erreichen des "
"Schuldenlimits."
#: templates/cash/base.html:63
#: templates/cashonly/base.html:63
msgid "Overview"
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"
msgstr "Kaufen"
#: templates/cash/base.html:65
#: templates/cashonly/base.html:65
msgctxt "monthly staement"
msgid "Transaction list"
msgstr "Kontoauszug"
#: templates/cash/base.html:66 templates/cash/usersettings.html:29
#: templates/cash/usersettings_saved.html:6
#: templates/cashonly/base.html:66 templates/cashonly/usersettings.html:29
#: templates/cashonly/usersettings_saved.html:6
msgid "Preferences"
msgstr "Einstellungen"
#: templates/cash/base.html:68
#: templates/cashonly/base.html:68
msgid "Administration"
msgstr "Administration"
#: templates/cash/base.html:80
#: templates/cashonly/base.html:80
msgid "Logout"
msgstr "Abmelden"
#: templates/cash/base.html:92
#: templates/cashonly/base.html:92
#, python-format
msgid "Welcome, %(firstname)s!"
msgstr "Herzlich willkommen, %(firstname)s!"
#: templates/cash/base.html:98
#: templates/cashonly/base.html:98
msgid "Account information"
msgstr "Kontoinformationen"
#: templates/cash/base.html:102
#: templates/cashonly/base.html:102
msgid "Username:"
msgstr "Benutzername:"
#: templates/cash/base.html:104
#: templates/cashonly/base.html:104
msgid "Full name:"
msgstr "Realname:"
#: templates/cash/base.html:106
#: templates/cashonly/base.html:106
msgid "E-Mail address:"
msgstr "E-Mail Adresse:"
#: templates/cash/base.html:108
#: templates/cashonly/base.html:108
msgid "Credit:"
msgstr "Guthaben:"
#: templates/cash/base.html:117
#: templates/cashonly/base.html:117
msgid "Last purchased products"
msgstr "Zuletzt gekaufte Produkte"
#: templates/cash/base.html:127
#: templates/cashonly/base.html:127
msgid "Your transactions in the last 12 hours"
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."
msgstr "In den vergangenen 12 Stunden wurden keine Transaktionen durchgeführt."
#: templates/cash/buy_confirm.html:8 templates/cash/buy_error.html:8
#: templates/cash/buy_thanks.html:8
#: templates/cashonly/buy_confirm.html:8 templates/cashonly/buy_error.html:8
#: templates/cashonly/buy_thanks.html:8
msgid "Buy product"
msgstr "Produkt kaufen"
#: templates/cash/buy_confirm.html:13
#: templates/cashonly/buy_confirm.html:13
msgid "Confirm purchase."
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"
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"
msgstr "Kategorie"
#: templates/cash/buy_confirm.html:22
#: templates/cashonly/buy_confirm.html:22
msgid "Do you really want to buy this product?"
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"
msgstr "Ja"
#: templates/cash/buy_confirm.html:25
#: templates/cashonly/buy_confirm.html:25
msgid "No"
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."
msgstr ""
"Du kannst dieses Produkt nicht kaufen, da das Schuldenlimit erreicht wurde."
#: templates/cash/buy_error.html:14 templates/cash/buy_thanks.html:14
#: templates/cash/usersettings_saved.html:11
#: templates/cashonly/buy_error.html:14 templates/cashonly/buy_thanks.html:14
#: templates/cashonly/usersettings_saved.html:11
msgid "Back"
msgstr "Zurück"
#: templates/cash/buy_thanks.html:11
#: templates/cashonly/buy_thanks.html:11
msgid "Thanks for your purchase!"
msgstr "Danke für deinen Einkauf."
#: templates/cash/login.html:24
#: templates/cashonly/login.html:24
msgid "Please sign in"
msgstr "Bitte anmelden."
#: templates/cash/login.html:26
#: templates/cashonly/login.html:26
msgid "Password"
msgstr "Passwort"
#: templates/cash/login.html:27
#: templates/cashonly/login.html:27
msgid "Sign in"
msgstr "Anmelden"
#: templates/cash/product_detail.html:8
#: templates/cashonly/product_detail.html:8
msgid "Product details"
msgstr "Produktdetails"
#: templates/cash/product_list.html:10
#: templates/cashonly/product_list.html:10
msgid "All categories"
msgstr "Alle Kategorien"
#: templates/cash/transaction_list.html:7
#: templates/cashonly/transaction_list.html:7
msgctxt "monthly statement"
msgid "Transaction list"
msgstr "Kontoauszug"
#: templates/cash/transaction_list.html:13
#: templates/cashonly/transaction_list.html:13
msgid "less detailed"
msgstr "weniger Details"
#: templates/cash/transaction_list.html:15
#: templates/cashonly/transaction_list.html:15
msgid "more detailed"
msgstr "mehr Details"
#: templates/cash/transaction_list.html:24
#: templates/cashonly/transaction_list.html:24
#, python-format
msgid "Page %(current)s of %(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."
msgstr "Es wurden noch keine Transaktionen durchgeführt."
#: templates/cash/usersettings.html:34
#: templates/cashonly/usersettings.html:34
msgid "Daily digest"
msgstr "Tägliche Zusammenfassung"
#: templates/cash/usersettings.html:36
#: templates/cashonly/usersettings.html:36
msgid ""
"The digest will be sent nightly, as long as there were transaction made in "
"the past 24 hours."
@ -379,15 +378,15 @@ msgstr "" @@ -379,15 +378,15 @@ msgstr ""
"Der Kontoauszug wird nachts versandt, sofern in den vergangenen 24 Stunden "
"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"
msgstr ""
#: templates/cash/usersettings.html:52
#: templates/cashonly/usersettings.html:52
msgid "Change PIN"
msgstr "PIN ändern"
#: templates/cash/usersettings.html:54
#: templates/cashonly/usersettings.html:54
msgid ""
"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."
@ -395,39 +394,39 @@ msgstr "" @@ -395,39 +394,39 @@ msgstr ""
"Der PIN wird nach dem Einscannen des Mitgliederausweises abgefragt. Wenn das "
"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"
msgstr "PIN löschen"
#: templates/cash/usersettings.html:78
#: templates/cashonly/usersettings.html:78
msgid "Do you really want to clear your PIN?"
msgstr "Möchtest du deinen PIN wirklich löschen?"
#: templates/cash/usersettings.html:81
#: templates/cashonly/usersettings.html:81
msgid "Cancel"
msgstr "Abbrechen"
#: templates/cash/usersettings_saved.html:9
#: templates/cashonly/usersettings_saved.html:9
msgid "The settings have been saved successfully!"
msgstr "Die Einstellungen wurden erfolgreich gespeichert."
#: templates/cash/includes/product_list.html:8
#: templates/cashonly/includes/product_list.html:8
msgid "Product image"
msgstr "Produktbild"
#: templates/cash/includes/transaction_list.html:7
#: templates/cashonly/includes/transaction_list.html:7
msgid "Date"
msgstr "Datum"
#: templates/cash/includes/transaction_list.html:8
#: templates/cashonly/includes/transaction_list.html:8
msgid "Subject"
msgstr "Betreff"
#: templates/cash/includes/transaction_list.html:9
#: templates/cashonly/includes/transaction_list.html:9
msgid "Description"
msgstr "Beschreibung"
#: templates/cash/includes/transaction_list.html:10
#: templates/cashonly/includes/transaction_list.html:10
msgctxt "money"
msgid "amount"
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 @@ @@ -1,4 +1,4 @@
from cash.models import *
from cashonly.models import *
from django.conf import settings
from django.core.mail import send_mass_mail
from django.core.management.base import NoArgsCommand, CommandError
@ -20,7 +20,7 @@ class Command(NoArgsCommand): @@ -20,7 +20,7 @@ class Command(NoArgsCommand):
def handle_noargs(self, **options):
translation.activate('de')
tpl = get_template('cash/daily_digest.txt')
tpl = get_template('cashonly/daily_digest.txt')
messages = []
for a in Account.objects.all():
@ -29,7 +29,7 @@ class Command(NoArgsCommand): @@ -29,7 +29,7 @@ class Command(NoArgsCommand):
'credit': a.credit,
'range': RANGE,
'url': USERSETTINGS_URL}
transactions = Transaction.objects.filter(account = a) \
.filter(timestamp__gte=(datetime.datetime.now()
- datetime.timedelta(hours = RANGE)))

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
from cash.models import *
from cashonly.models import *
from django.conf import settings
from django.core.mail import send_mass_mail
from django.core.management.base import NoArgsCommand
@ -14,7 +14,7 @@ class Command(NoArgsCommand): @@ -14,7 +14,7 @@ class Command(NoArgsCommand):
def handle_noargs(self, **options):
translation.activate('de')
tpl = get_template('cash/debt_reminder.txt')
tpl = get_template('cashonly/debt_reminder.txt')
messages = []
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 @@ @@ -116,7 +116,7 @@
{% trans "Last purchased products" %}
</div>
<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>
@ -126,7 +126,7 @@ @@ -126,7 +126,7 @@
{% trans "Your transactions in the last 12 hours" %}
</div>
{% 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 %}
<div class="panel-body">
{% 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 @@ @@ -1,4 +1,4 @@
{% extends "cash/base.html" %}
{% extends "cashonly/base.html" %}
{% load i18n %}

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

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

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

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
{% extends "cash/base.html" %}
{% extends "cashonly/base.html" %}
{% 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 @@ @@ -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 @@ @@ -1,4 +1,4 @@
{% extends "cash/base.html" %}
{% extends "cashonly/base.html" %}
{% load i18n %}

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

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

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

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
{% extends "cash/base.html" %}
{% extends "cashonly/base.html" %}
{% load i18n %}
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<br/>
</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">
<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 @@ @@ -1,4 +1,4 @@
{% extends "cash/base.html" %}
{% extends "cashonly/base.html" %}
{% load i18n %}
{% load bootstrap %}
{% load staticfiles %}

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

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

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

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

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
from django.conf.urls import patterns, url
from cash import views
from cashonly import views
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'),
@ -15,19 +15,19 @@ urlpatterns = patterns('', @@ -15,19 +15,19 @@ urlpatterns = patterns('',
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'),
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'),
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 @@ -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.template import RequestContext
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_lazy
import cash.version
import cashonly.version
import datetime
def version_number_context_processor(request):
return {'version_number': cash.version.CASHONLY_VERSION}
return {'version_number': cashonly.version.CASHONLY_VERSION}
@login_required
def overview(request):
@ -34,7 +34,7 @@ def overview(request): @@ -34,7 +34,7 @@ def overview(request):
context = RequestContext(request, { 'latest_transactions': transactions,
'latest_purchases': products})
return render_to_response('cash/index.html',
return render_to_response('cashonly/index.html',
context_instance=context)
@ -59,7 +59,7 @@ def transactions(request, detailed, page): @@ -59,7 +59,7 @@ def transactions(request, detailed, page):
context = RequestContext(request, { 'transaction_list': transaction_list,
'detailed': detailed })
return render_to_response('cash/transaction_list.html',
return render_to_response('cashonly/transaction_list.html',
context_instance=context)
def products(request, category_id=None):
@ -76,7 +76,7 @@ def products(request, category_id=None): @@ -76,7 +76,7 @@ def products(request, category_id=None):
'category': category,
'categories': categories })
return render_to_response('cash/product_list.html',
return render_to_response('cashonly/product_list.html',
context_instance=context)
@login_required
@ -90,18 +90,18 @@ def buy(request, product_id, confirm=False): @@ -90,18 +90,18 @@ def buy(request, product_id, confirm=False):
return redirect('buy_error')
else:
context = RequestContext(request, {'product': product})
return render_to_response('cash/buy_confirm.html',
return render_to_response('cashonly/buy_confirm.html',
context_instance=context)
@login_required
def buy_thanks(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
def buy_error(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):
daily_digest = forms.BooleanField(required=False,
@ -140,7 +140,7 @@ def usersettings(request, submit=None): @@ -140,7 +140,7 @@ def usersettings(request, submit=None):
request.user.account.pin = pin
request.user.account.save()
context = RequestContext(request)
return render_to_response('cash/usersettings_saved.html',
return render_to_response('cashonly/usersettings_saved.html',
context_instance=context)
elif submit == 'settings':
@ -151,12 +151,12 @@ def usersettings(request, submit=None): @@ -151,12 +151,12 @@ def usersettings(request, submit=None):
request.user.account.daily_digest = daily_digest
request.user.account.save()
context = RequestContext(request)
return render_to_response('cash/usersettings_saved.html',
return render_to_response('cashonly/usersettings_saved.html',
context_instance=context)
context = RequestContext(request, { 'settings_form': settings_form,
'pin_form': pin_form})
return render_to_response('cash/usersettings.html',
return render_to_response('cashonly/usersettings.html',
context_instance=context)

7
lugcash2/settings.py

@ -128,10 +128,9 @@ INSTALLED_APPS = ( @@ -128,10 +128,9 @@ INSTALLED_APPS = (
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'django_evolution',
'bootstrapform',
'cash'
'cashonly'
)
# A sample logging configuration. The only tangible logging
@ -175,12 +174,12 @@ LOGIN_URL = '/login/' @@ -175,12 +174,12 @@ LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/'
# 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 = (
'django_auth_ldap.backend.LDAPBackend',
'django.contrib.auth.backends.ModelBackend',
'cash.auth.CashBackend',
'cashonly.auth.CashBackend',
)
AUTH_LDAP_SERVER_URI = "ldap://seraph"

4
lugcash2/urls.py

@ -16,9 +16,9 @@ urlpatterns = patterns('', @@ -16,9 +16,9 @@ urlpatterns = patterns('',
# Uncomment the next line to enable the admin:
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'),
)

Loading…
Cancel
Save