diff --git a/api/api/dashboard.py b/api/api/dashboard.py new file mode 100644 index 0000000..9c5d4c7 --- /dev/null +++ b/api/api/dashboard.py @@ -0,0 +1,32 @@ +from django.utils.translation import ugettext_lazy as _ +from jet.dashboard import modules +from jet.dashboard.dashboard import Dashboard, AppIndexDashboard + + +class CustomIndexDashboard(Dashboard): + columns = 3 + + def init_with_context(self, context): + self.available_children.append(modules.LinkList) + self.children.append(modules.LinkList( + _('Support'), + children=[ + { + 'title': _('Django documentation'), + 'url': 'http://docs.djangoproject.com/', + 'external': True, + }, + { + 'title': _('Django "django-users" mailing list'), + 'url': 'http://groups.google.com/group/django-users', + 'external': True, + }, + { + 'title': _('Django irc channel'), + 'url': 'irc://irc.freenode.net/django', + 'external': True, + }, + ], + column=0, + order=0 + )) \ No newline at end of file diff --git a/api/api/settings.py b/api/api/settings.py index a3b7f99..eda5890 100644 --- a/api/api/settings.py +++ b/api/api/settings.py @@ -37,6 +37,7 @@ ALLOWED_HOSTS = ["127.0.0.1", "192.168.1.187", "192.168.1.23"] INSTALLED_APPS = [ 'jet.dashboard', 'jet', + 'bills.apps.BillsConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -46,7 +47,6 @@ INSTALLED_APPS = [ 'rest_framework', 'rest_framework.authtoken', 'django_filters', - 'bills.apps.BillsConfig', ] MIDDLEWARE = [ @@ -137,3 +137,40 @@ STATIC_URL = '/static/' # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +JET_THEMES = [ + { + 'theme': 'default', # theme folder name + 'color': '#47bac1', # color of the theme's button in user menu + 'title': 'Default' # theme title + }, + { + 'theme': 'green', + 'color': '#44b78b', + 'title': 'Green' + }, + { + 'theme': 'light-green', + 'color': '#2faa60', + 'title': 'Light Green' + }, + { + 'theme': 'light-violet', + 'color': '#a464c4', + 'title': 'Light Violet' + }, + { + 'theme': 'light-blue', + 'color': '#5EADDE', + 'title': 'Light Blue' + }, + { + 'theme': 'light-gray', + 'color': '#222', + 'title': 'Light Gray' + } +] + +# JET_INDEX_DASHBOARD = 'jet.dashboard.dashboard.DefaultIndexDashboard' +JET_APP_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard' +# JET_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard' \ No newline at end of file diff --git a/api/api/urls.py b/api/api/urls.py index 1b2bdb3..fea5601 100644 --- a/api/api/urls.py +++ b/api/api/urls.py @@ -24,6 +24,8 @@ urlpatterns = [ # url(r'^$', view=TemplateView.as_view(template_name='bills/home.html')), # url(r'^$', view=TemplateView.as_view(template_name='main_api/home.html')), path('', views.index, name='index'), + # url(r'^jet/', include('jet.urls', 'jet')), # Django JET URLS + # url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')), path('jet/', include('jet.urls', 'jet')), path('jet/dashboard', include('jet.dashboard.urls', 'jet-dashboard')), path('bills/', include('bills.urls')), diff --git a/api/bills/migrations/0004_auto_20211203_1549.py b/api/bills/migrations/0004_auto_20211203_1549.py new file mode 100644 index 0000000..79fe779 --- /dev/null +++ b/api/bills/migrations/0004_auto_20211203_1549.py @@ -0,0 +1,48 @@ +# Generated by Django 3.2.9 on 2021-12-03 20:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bills', '0003_alter_bill_paid_date'), + ] + + operations = [ + migrations.AlterField( + model_name='bill', + name='due', + field=models.DateField(verbose_name='Due Date'), + ), + migrations.AlterField( + model_name='bill', + name='is_missed', + field=models.BooleanField(default=False, verbose_name='Missed Payment'), + ), + migrations.AlterField( + model_name='bill', + name='is_overdue', + field=models.BooleanField(default=False, verbose_name='Overdue'), + ), + migrations.AlterField( + model_name='bill', + name='is_paid', + field=models.BooleanField(default=False, verbose_name='Paid'), + ), + migrations.AlterField( + model_name='bill', + name='name', + field=models.CharField(max_length=64, verbose_name='Name'), + ), + migrations.AlterField( + model_name='bill', + name='paid_date', + field=models.DateField(blank=True, null=True, verbose_name='Paid Date'), + ), + migrations.AlterField( + model_name='bill', + name='type', + field=models.CharField(max_length=64, verbose_name='Type'), + ), + ] diff --git a/api/bills/models.py b/api/bills/models.py index 9df1d33..9414e8a 100644 --- a/api/bills/models.py +++ b/api/bills/models.py @@ -7,7 +7,7 @@ class Bill(models.Model): due = models.DateField(verbose_name="Due Date") amount = models.FloatField(default='00.00') is_paid = models.BooleanField(default=False, verbose_name="Paid") - paid_date = models.DateField('paid_date',null=True, blank=True) + paid_date = models.DateField('Paid Date',null=True, blank=True) is_overdue = models.BooleanField(default=False, verbose_name="Overdue") is_missed = models.BooleanField(default=False, verbose_name='Missed Payment')