-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static Alias Placeholder functionality (django CMS Static Placeholder…
… replacement) (#59) * Add a new identifier field * Created a tag and a start to a suite of tests for the feature * Updated the implementation to create a default category and create an alias if one doesn't yet exist for the static code * Added versioning integration with a default user * Added a template and versioning tests, highlights some weaknesses in the previous configuration * Added the latest version of the model migration
- Loading branch information
Showing
14 changed files
with
492 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Generated by Django 2.2.13 on 2020-07-23 14:24 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import parler.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sites', '0002_alter_domain_unique'), | ||
('djangocms_alias', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='alias', | ||
name='creation_method', | ||
field=models.CharField(blank=True, choices=[('template', 'by template'), ('code', 'by code')], default='code', max_length=20, verbose_name='creation_method'), | ||
), | ||
migrations.AddField( | ||
model_name='alias', | ||
name='site', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'), | ||
), | ||
migrations.AddField( | ||
model_name='alias', | ||
name='static_code', | ||
field=models.CharField(blank=True, help_text='To render the alias in templates.', max_length=255, null=True, verbose_name='static code'), | ||
), | ||
migrations.AlterField( | ||
model_name='categorytranslation', | ||
name='master', | ||
field=parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='djangocms_alias.Category'), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='alias', | ||
unique_together={('static_code', 'site')}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% extends "base.html" %} | ||
{% load cms_tags djangocms_alias_tags %} | ||
|
||
{% block title %}{% page_attribute 'title' %}{% endblock title %} | ||
|
||
{% block content %} | ||
<h2>Static Alias tags</h2> | ||
|
||
|
||
{% static_alias "template_example_global_alias_code" %} | ||
{% endblock content %} | ||
|
||
|
Oops, something went wrong.