-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: declare md fields for terms and serve them
- Loading branch information
Showing
9 changed files
with
194 additions
and
3 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
27 changes: 27 additions & 0 deletions
27
backend/benefit/terms/migrations/0005_add_support_for_md_terms.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,27 @@ | ||
# Generated by Django 3.2.18 on 2023-08-15 13:02 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("terms", "0004_alter_terms_terms_type"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="terms", | ||
name="terms_md_en", | ||
field=models.TextField(blank=True, verbose_name="English terms (md)"), | ||
), | ||
migrations.AddField( | ||
model_name="terms", | ||
name="terms_md_fi", | ||
field=models.TextField(blank=True, verbose_name="Finnish terms (md)"), | ||
), | ||
migrations.AddField( | ||
model_name="terms", | ||
name="terms_md_sv", | ||
field=models.TextField(blank=True, verbose_name="Swedish terms (md)"), | ||
), | ||
] |
28 changes: 28 additions & 0 deletions
28
backend/benefit/terms/migrations/0006_alter_pdf_terms_not_required.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,28 @@ | ||
# Generated by Django 3.2.18 on 2023-08-15 13:04 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('terms', '0005_add_support_for_md_terms'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='terms', | ||
name='terms_pdf_en', | ||
field=models.FileField(blank=True, upload_to='', verbose_name='english terms (pdf file)'), | ||
), | ||
migrations.AlterField( | ||
model_name='terms', | ||
name='terms_pdf_fi', | ||
field=models.FileField(blank=True, upload_to='', verbose_name='finnish terms (pdf file)'), | ||
), | ||
migrations.AlterField( | ||
model_name='terms', | ||
name='terms_pdf_sv', | ||
field=models.FileField(blank=True, upload_to='', verbose_name='swedish terms (pdf file)'), | ||
), | ||
] |
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,41 @@ | ||
.module .EasyMDEContainer h1, | ||
.module .EasyMDEContainer h2, | ||
.module .EasyMDEContainer h3, | ||
.module .EasyMDEContainer h4, | ||
.module .EasyMDEContainer h5, | ||
.module .EasyMDEContainer h6 { | ||
color: #000; | ||
background: none; | ||
margin: 0; | ||
padding: 0; | ||
margin-bottom: 1.2rem; | ||
font-weight: 400; | ||
text-transform: none; | ||
letter-spacing: 0; | ||
line-height: 1.25; | ||
} | ||
|
||
.module .EasyMDEContainer h1 { | ||
font-size: 2em; | ||
} | ||
.module .EasyMDEContainer h2 { | ||
font-size: 1.75em; | ||
} | ||
|
||
.module .EasyMDEContainer h3 { | ||
font-size: 1.5em; | ||
} | ||
|
||
.module .EasyMDEContainer h4, | ||
.module .EasyMDEContainer h5, | ||
.module .EasyMDEContainer h6 { | ||
font-size: 1.25em; | ||
} | ||
|
||
.module .EasyMDEContainer ul { | ||
margin-left: 1em; | ||
} | ||
.module .EasyMDEContainer ul li { | ||
list-style: disc; | ||
font-size: 1em; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
{% extends 'admin/base.html' %} {% block footer%} | ||
|
||
<link rel="stylesheet" href="/static/css/vendor/easymde.min.css" /> | ||
<script src="/static/js/vendor/easymde.min.js"></script> | ||
|
||
<script> | ||
document.addEventListener( | ||
"DOMContentLoaded", | ||
function () { | ||
try { | ||
["id_terms_md_fi", "id_terms_md_en", "id_terms_md_sv"].map( | ||
function (id) { | ||
const easyMDE = new EasyMDE({ | ||
spellChecker: false, | ||
toolbar: [ | ||
"heading", | ||
"bold", | ||
"italic", | ||
"link", | ||
"|", | ||
"quote", | ||
"unordered-list", | ||
"ordered-list", | ||
"|", | ||
"preview", | ||
"side-by-side", | ||
], | ||
sideBySideFullscreen: false, | ||
element: document.getElementById(id), | ||
}); | ||
} | ||
); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}, | ||
false | ||
); | ||
</script> | ||
{% endblock %} |