-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow content edit and translation #162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #162 +/- ##
==========================================
+ Coverage 85.64% 86.46% +0.82%
==========================================
Files 31 34 +3
Lines 1219 1271 +52
==========================================
+ Hits 1044 1099 +55
+ Misses 175 172 -3
|
16f75cf
to
1b497f6
Compare
|
||
class StaticContent(models.Model): | ||
key = models.CharField(max_length=50, primary_key=True) | ||
content = models.TextField(_("content"), blank=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jraddaoui , wouldn't be a good idea to have the model mapped out after the concept of a "Page"? E.g. a model where you can also fit the title of the page or in the future things like its permalink? Or you're thinking on something more generic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1b497f6
to
eed005c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @jraddaoui! Some comments inline, but this code looks good generally.
3d64f0a
to
4de6423
Compare
Thank you very much @cole! Back to you ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- Create Content model with key and content fields. - Use `django-modeltranslation` to allow content field translation. - Add initial content for "home", "login" and "faq" pages. - Use numbered keys to order them and add labels for display. - Add content page to manage them in a formset. - Render content, allowing Markdown syntax.
4de6423
to
2d1cbc3
Compare
django-modeltranslation
to allow content field translation.Refs #96, #105.