diff --git a/charter_members/admin.py b/charter_members/admin.py index d89f125..55300b0 100644 --- a/charter_members/admin.py +++ b/charter_members/admin.py @@ -12,5 +12,5 @@ class MemberAdmin(admin.ModelAdmin): list_display = ['name', 'position', 'chapter', 'phone_formatted', 'email', 'front_page', 'joined', 'thumbnail'] list_filter = ['chapter', 'position', 'front_page', 'joined'] search_fields = ['email', 'joined', 'name', 'chapter', 'position', 'website', 'phone', 'phone_formatted'] - fields = ['image_preview', 'image', 'name', 'position', 'chapter', 'biography', 'phone', 'email', 'website', 'front_page', 'joined'] + fields = ['image_preview', 'image', 'name', 'position', 'chapter', 'biography', 'phone', 'email', 'website', 'front_page', 'order', 'joined'] readonly_fields = ['image_preview'] diff --git a/charter_members/migrations/0004_attorney_order.py b/charter_members/migrations/0004_attorney_order.py new file mode 100644 index 0000000..613c78e --- /dev/null +++ b/charter_members/migrations/0004_attorney_order.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2018-01-15 02:08 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('charter_members', '0003_auto_20180114_1722'), + ] + + operations = [ + migrations.AddField( + model_name='attorney', + name='order', + field=models.IntegerField(blank=True, null=True, verbose_name='Order On Front Page'), + ), + ] diff --git a/charter_members/models.py b/charter_members/models.py index a599d33..b8a898b 100644 --- a/charter_members/models.py +++ b/charter_members/models.py @@ -26,6 +26,7 @@ class Attorney(models.Model): image = models.ImageField(upload_to='portraits', default='portraits/silhouette.png') joined = models.DateField(blank=True, null=True) name = models.CharField(max_length=100) + order = models.IntegerField(blank=True, null=True, verbose_name='Order On Front Page') phone = models.CharField(max_length=10, blank=True, null=True) position = models.ForeignKey(Position) website = models.CharField(max_length=255, blank=True, null=True) diff --git a/main/views.py b/main/views.py index 2245def..88def91 100644 --- a/main/views.py +++ b/main/views.py @@ -13,7 +13,7 @@ from OACPL import settings def index(request): - attorneys = Attorney.objects.filter(front_page=True) + attorneys = Attorney.objects.filter(front_page=True).order_by('order') return render(request, 'index.html', {'attorneys': attorneys, 'contact': settings.EMAIL_CONTACT}) diff --git a/media/portraits/download.jpg b/media/portraits/download.jpg new file mode 100644 index 0000000..e69358d Binary files /dev/null and b/media/portraits/download.jpg differ diff --git a/newsletters/migrations/0004_auto_20180114_2108.py b/newsletters/migrations/0004_auto_20180114_2108.py new file mode 100644 index 0000000..cb7d632 --- /dev/null +++ b/newsletters/migrations/0004_auto_20180114_2108.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2018-01-15 02:08 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('newsletters', '0003_subscriber_date'), + ] + + operations = [ + migrations.AlterField( + model_name='subscriber', + name='date', + field=models.DateField(auto_now_add=True), + ), + ]