Skip to content

Commit

Permalink
add action image and link
Browse files Browse the repository at this point in the history
  • Loading branch information
yomguy committed Aug 25, 2023
1 parent 9924e24 commit 78cfc0e
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 2 deletions.
2 changes: 1 addition & 1 deletion organization/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ class Meta:
abstract = True


class Action(Named):
class Action(Image, Link):
"""
Abstract model that provides an Action object.
"""
Expand Down
106 changes: 106 additions & 0 deletions organization/pages/migrations/0060_auto_20230825_1039.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Generated by Django 3.2.19 on 2023-08-25 08:39

from django.db import migrations, models
import django.db.models.deletion
import mezzanine.core.fields


class Migration(migrations.Migration):

dependencies = [
('organization_core', '0014_metacategory_icon_id'),
('organization_pages', '0059_pageaction_action'),
]

operations = [
migrations.AlterModelOptions(
name='pageaction',
options={'ordering': ('_order',), 'verbose_name': 'action', 'verbose_name_plural': 'action'},
),
migrations.AddField(
model_name='pageaction',
name='_order',
field=mezzanine.core.fields.OrderField(null=True, verbose_name='Order'),
),
migrations.AddField(
model_name='pageaction',
name='action_en',
field=models.CharField(blank=True, max_length=1024, null=True, verbose_name='action'),
),
migrations.AddField(
model_name='pageaction',
name='action_fr',
field=models.CharField(blank=True, max_length=1024, null=True, verbose_name='action'),
),
migrations.AddField(
model_name='pageaction',
name='credits',
field=models.CharField(blank=True, max_length=256, null=True, verbose_name='credits'),
),
migrations.AddField(
model_name='pageaction',
name='credits_en',
field=models.CharField(blank=True, max_length=256, null=True, verbose_name='credits'),
),
migrations.AddField(
model_name='pageaction',
name='credits_fr',
field=models.CharField(blank=True, max_length=256, null=True, verbose_name='credits'),
),
migrations.AddField(
model_name='pageaction',
name='crop_data',
field=models.CharField(blank=True, default='', max_length=1024, null=True),
),
migrations.AddField(
model_name='pageaction',
name='file',
field=mezzanine.core.fields.FileField(blank=True, max_length=1024, null=True, verbose_name='Image'),
),
migrations.AddField(
model_name='pageaction',
name='link_type',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization_core.linktype', verbose_name='link type'),
),
migrations.AddField(
model_name='pageaction',
name='title',
field=models.CharField(blank=True, max_length=1024, null=True, verbose_name='title'),
),
migrations.AddField(
model_name='pageaction',
name='title_en',
field=models.CharField(blank=True, max_length=1024, null=True, verbose_name='title'),
),
migrations.AddField(
model_name='pageaction',
name='title_fr',
field=models.CharField(blank=True, max_length=1024, null=True, verbose_name='title'),
),
migrations.AddField(
model_name='pageaction',
name='type',
field=models.CharField(blank=True, choices=[('logo', 'logo'), ('logo_white', 'logo white'), ('logo_black', 'logo black'), ('logo_header', 'logo header'), ('logo_back', 'logo back'), ('logo_footer', 'logo footer'), ('slider', 'slider'), ('card', 'card'), ('page_slider', 'page - slider'), ('page_featured', 'page - featured'), ('hero', 'hero'), ('banner', 'banner')], max_length=64, null=True, verbose_name='type'),
),
migrations.AddField(
model_name='pageaction',
name='url',
field=models.URLField(blank=True, max_length=512, verbose_name='URL'),
),
migrations.AlterOrderWithRespectTo(
name='pageaction',
order_with_respect_to=None,
),
migrations.RemoveField(
model_name='pageaction',
name='name',
),
migrations.RemoveField(
model_name='pageaction',
name='name_en',
),
migrations.RemoveField(
model_name='pageaction',
name='name_fr',
),
]
2 changes: 1 addition & 1 deletion organization/pages/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class PageRelatedTitleTranslationOptions(TranslationOptions):
@register(PageAction)
class PageActionTranslationOptions(TranslationOptions):

fields = ('name', 'description')
fields = ('title', 'description', 'action')


@register(HomeImage)
Expand Down

0 comments on commit 78cfc0e

Please sign in to comment.