diff --git a/mhackspace/base/migrations/0005_auto_20170228_2210.py b/mhackspace/base/migrations/0005_auto_20170228_2210.py new file mode 100644 index 0000000..0e923a9 --- /dev/null +++ b/mhackspace/base/migrations/0005_auto_20170228_2210.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-02-28 22:10 +from __future__ import unicode_literals + +from django.db import migrations +import stdimage.models +import stdimage.utils +import stdimage.validators + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0004_merge_20170226_0844'), + ] + + operations = [ + migrations.RemoveField( + model_name='bannerimage', + name='original_image', + ), + migrations.RemoveField( + model_name='bannerimage', + name='scaled_image', + ), + migrations.AddField( + model_name='bannerimage', + name='image', + field=stdimage.models.StdImageField(default='', upload_to=stdimage.utils.UploadToAutoSlugClassNameDir('title'), validators=[stdimage.validators.MinSizeValidator(1200, 300)]), + preserve_default=False, + ), + ] diff --git a/mhackspace/base/models.py b/mhackspace/base/models.py index 8550807..4002ced 100644 --- a/mhackspace/base/models.py +++ b/mhackspace/base/models.py @@ -12,22 +12,35 @@ class BannerImage(models.Model): url = models.URLField() title = models.CharField(max_length=255) displayed = models.BooleanField(default=True) - original_image = models.URLField(max_length=255, blank=True, null=True) - scaled_image = StdImageField( + image = StdImageField( upload_to=UploadToAutoSlugClassNameDir(populate_from='title'), - blank=True, - null=True, variations={ 'small': { - "width": 600, + "width": 400, "height": 300, "crop": True}, - 'large': { - "width": 1024, + 'small2x': { + "width": 800, + "height": 600, + "crop": True}, + 'medium': { + "width": 800, "height": 300, + "crop": True}, + 'medium2x': { + "width": 1600, + "height": 600, + "crop": True}, + 'large': { + "width": 1200, + "height": 300, + "crop": True}, + 'large2x': { + "width": 2400, + "height": 600, "crop": True}}, validators=[ - MinSizeValidator(1200, 300)]) + MinSizeValidator(2400, 600)]) caption = models.TextField() date = models.DateTimeField(default=timezone.now) diff --git a/mhackspace/base/templatetags/banner_images.py b/mhackspace/base/templatetags/banner_images.py index a478169..44b22a5 100644 --- a/mhackspace/base/templatetags/banner_images.py +++ b/mhackspace/base/templatetags/banner_images.py @@ -6,5 +6,5 @@ register = template.Library() @register.inclusion_tag('partials/banner_list.html') def show_banner_images(): - return {'bannerlist': BannerImage.objects.all(), 'test': 'abc'} + return {'bannerlist': BannerImage.objects.all()} diff --git a/mhackspace/blog/migrations/0004_auto_20170228_2210.py b/mhackspace/blog/migrations/0004_auto_20170228_2210.py new file mode 100644 index 0000000..7d7c464 --- /dev/null +++ b/mhackspace/blog/migrations/0004_auto_20170228_2210.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-02-28 22:10 +from __future__ import unicode_literals + +from django.db import migrations +import draceditor.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('blog', '0003_auto_20170215_2348'), + ] + + operations = [ + migrations.AlterField( + model_name='post', + name='description', + field=draceditor.models.DraceditorField(), + ), + ] diff --git a/mhackspace/static/sass/pages/_home.scss b/mhackspace/static/sass/components/_feeds.scss similarity index 87% rename from mhackspace/static/sass/pages/_home.scss rename to mhackspace/static/sass/components/_feeds.scss index d193ec7..13d9443 100644 --- a/mhackspace/static/sass/pages/_home.scss +++ b/mhackspace/static/sass/components/_feeds.scss @@ -14,10 +14,14 @@ } } +.card-deck { + margin-bottom: 30px; +} + .card-title { color: $body-color; } #feeds img { width: 100%; -} +} \ No newline at end of file diff --git a/mhackspace/static/sass/project.scss b/mhackspace/static/sass/project.scss index dc86b25..6b9b3ab 100644 --- a/mhackspace/static/sass/project.scss +++ b/mhackspace/static/sass/project.scss @@ -6,8 +6,7 @@ @import "components/header"; @import "components/membership"; @import "components/footer"; - -@import "pages/home"; +@import "components/feeds"; //////////////////////////////// //Django Toolbar// diff --git a/mhackspace/templates/feeds/list.html b/mhackspace/templates/feeds/list.html index f03ba85..9cb5c1e 100644 --- a/mhackspace/templates/feeds/list.html +++ b/mhackspace/templates/feeds/list.html @@ -2,8 +2,7 @@ {% get_static_prefix as STATIC_PREFIX %}