-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #963 from maykinmedia/feature/2030-fonts-override
[#2030] Add option to upload and use custom fonts
- Loading branch information
Showing
11 changed files
with
413 additions
and
17 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
69 changes: 69 additions & 0 deletions
69
src/open_inwoner/configurations/migrations/0058_customfontset.py
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,69 @@ | ||
# Generated by Django 3.2.23 on 2024-01-29 10:45 | ||
|
||
import django.core.validators | ||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
import open_inwoner.configurations.models | ||
import open_inwoner.utils.files | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("configurations", "0057_siteconfiguration_theme_stylesheet"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="CustomFontSet", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"text_body_font", | ||
open_inwoner.configurations.models.CustomFontField( | ||
blank=True, | ||
help_text="Upload text body font. TTF font types only.", | ||
null=True, | ||
storage=open_inwoner.utils.files.OverwriteStorage(), | ||
upload_to=open_inwoner.configurations.models.CustomFontSet.update_filename_body, | ||
validators=[ | ||
django.core.validators.FileExtensionValidator(["ttf"]) | ||
], | ||
verbose_name="Text body font", | ||
), | ||
), | ||
( | ||
"heading_font", | ||
open_inwoner.configurations.models.CustomFontField( | ||
blank=True, | ||
help_text="Upload heading font. TTF font types only.", | ||
null=True, | ||
storage=open_inwoner.utils.files.OverwriteStorage(), | ||
upload_to=open_inwoner.configurations.models.CustomFontSet.update_filename_heading, | ||
validators=[ | ||
django.core.validators.FileExtensionValidator(["ttf"]) | ||
], | ||
verbose_name="Heading font", | ||
), | ||
), | ||
( | ||
"site_configuration", | ||
models.OneToOneField( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="custom_fonts", | ||
to="configurations.siteconfiguration", | ||
verbose_name="Configuration", | ||
), | ||
), | ||
], | ||
), | ||
] |
13 changes: 13 additions & 0 deletions
13
src/open_inwoner/configurations/migrations/0059_merge_20240129_1645.py
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 @@ | ||
# Generated by Django 3.2.23 on 2024-01-29 15:45 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("configurations", "0058_customfontset"), | ||
("configurations", "0058_siteconfiguration_recipients_email_digest"), | ||
] | ||
|
||
operations = [] |
72 changes: 72 additions & 0 deletions
72
src/open_inwoner/configurations/migrations/0060_auto_20240208_1426.py
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,72 @@ | ||
# Generated by Django 3.2.23 on 2024-02-08 13:26 | ||
|
||
import django.core.validators | ||
from django.db import migrations | ||
import open_inwoner.configurations.models | ||
import open_inwoner.utils.files | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("configurations", "0059_merge_20240129_1645"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="customfontset", | ||
name="text_body_font", | ||
), | ||
migrations.AddField( | ||
model_name="customfontset", | ||
name="body_font_bold", | ||
field=open_inwoner.configurations.models.CustomFontField( | ||
blank=True, | ||
help_text="Upload bold text body font. TTF font types only.", | ||
null=True, | ||
storage=open_inwoner.utils.files.OverwriteStorage(), | ||
upload_to=open_inwoner.configurations.models.CustomFontSet.update_filename_body_bold, | ||
validators=[django.core.validators.FileExtensionValidator(["ttf"])], | ||
verbose_name="Body font bold", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="customfontset", | ||
name="body_font_bold_italic", | ||
field=open_inwoner.configurations.models.CustomFontField( | ||
blank=True, | ||
help_text="Upload bold italic text body font. TTF font types only.", | ||
null=True, | ||
storage=open_inwoner.utils.files.OverwriteStorage(), | ||
upload_to=open_inwoner.configurations.models.CustomFontSet.update_filename_body_bold_italic, | ||
validators=[django.core.validators.FileExtensionValidator(["ttf"])], | ||
verbose_name="Body font bold italic", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="customfontset", | ||
name="body_font_italic", | ||
field=open_inwoner.configurations.models.CustomFontField( | ||
blank=True, | ||
help_text="Upload italic text body font. TTF font types only.", | ||
null=True, | ||
storage=open_inwoner.utils.files.OverwriteStorage(), | ||
upload_to=open_inwoner.configurations.models.CustomFontSet.update_filename_body_italic, | ||
validators=[django.core.validators.FileExtensionValidator(["ttf"])], | ||
verbose_name="Body font italic", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="customfontset", | ||
name="body_font_regular", | ||
field=open_inwoner.configurations.models.CustomFontField( | ||
blank=True, | ||
help_text="Upload regular text body font. TTF font types only.", | ||
null=True, | ||
storage=open_inwoner.utils.files.OverwriteStorage(), | ||
upload_to=open_inwoner.configurations.models.CustomFontSet.update_filename_body, | ||
validators=[django.core.validators.FileExtensionValidator(["ttf"])], | ||
verbose_name="Body font regular", | ||
), | ||
), | ||
] |
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
Oops, something went wrong.