-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add tabbed TranslatedContent form #1427
base: develop
Are you sure you want to change the base?
Conversation
NB: I've also experimentally disabled the |
Just a quick comment on what I see directly in the video, not code-related per se:
|
I implemented the suggested style changes, and also went down deeper in the form to control the behaviour of Changing the order dynamically would be, by my estimate, easier than creating an extra tab with a selected language on the fly, which requires dealing with several forms which do not correspond to a database object. Requiring the user to save first before seeing a new |
theme_config = models.ForeignKey(ThemeConfig, on_delete=models.SET_NULL, blank=True, null=True) | ||
|
||
def __str__(self): | ||
content = self.get_fallback_content() | ||
return content.name if content and content.name else self.slug | ||
return self.slug |
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.
NB: This is now the behaviour of the Block
string representation: instead of going through parent Experiment
's translated content objects, it will just return the slug. Less fancy, but within the form, it's actually an advantage IMO if the reference to each Block
object stays stable, even if the underlying language preferences change. Outside of the admin interface, the name
property of Block
can be used.
@@ -462,10 +457,6 @@ def get_fallback_content(self) -> "BlockTranslatedContent": | |||
Returns: | |||
Fallback content | |||
""" | |||
|
|||
if not self.phase or self.phase.experiment: | |||
return self.translated_contents.first() |
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.
We don't have blocks which aren't assigned to phases, and no phases which aren't assigned to experiments anymore. If that happens, I think it's better to throw an error.
Close #1321; close #1399.
This branch adds a custom template for
TranslatedContent
models, which makes sure we can add/remove translations inline.Screen.Recording.2024-12-13.at.13.41.58.mov