diff --git a/cookbook/migrations/0010_recipe_internal.py b/cookbook/migrations/0010_recipe_internal.py new file mode 100644 index 000000000..e1a1de5b8 --- /dev/null +++ b/cookbook/migrations/0010_recipe_internal.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.7 on 2019-11-15 12:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0009_auto_20191114_1800'), + ] + + operations = [ + migrations.AddField( + model_name='recipe', + name='internal', + field=models.BooleanField(default=False), + ), + ] diff --git a/cookbook/models.py b/cookbook/models.py index e6b2a8301..dc8721942 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -61,6 +61,7 @@ class Recipe(models.Model): file_path = models.CharField(max_length=512, default="") link = models.CharField(max_length=512, default="") keywords = models.ManyToManyField(Keyword, blank=True) + internal = models.BooleanField(default=False) created_by = models.ForeignKey(User, on_delete=models.PROTECT) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) diff --git a/cookbook/templates/recipe_view.html b/cookbook/templates/recipe_view.html index 20af3846d..09b7fa577 100644 --- a/cookbook/templates/recipe_view.html +++ b/cookbook/templates/recipe_view.html @@ -10,11 +10,15 @@
+ {% blocktrans %}
+ This is an external recipe, which means you can only view it by opening the link above.
+ You can convert this recipe to a fancy recipe by pressing the convert button. The original file
+ will still be accessible.
+ {% endblocktrans %}.
+
+
+ {% trans 'Convert now!' %}
+