diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index ad823cfa..bbefb0e4 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -29,11 +29,3 @@ body: attributes: label: "Additional context" description: "Add any other context or screenshots about the feature request here." - - type: checkboxes - attributes: - label: "Contribute" - description: "Are you willing and able to help develop this feature?" - options: - - label: "Yes" - - label: "Partly" - - label: "No" diff --git a/cookbook/views/api.py b/cookbook/views/api.py index 0f256589..a5b22264 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -108,6 +108,7 @@ class ExtendedRecipeMixin(): ''' ExtendedRecipe annotates a queryset with recipe_image and recipe_count values ''' + @classmethod def annotate_recipe(self, queryset=None, request=None, serializer=None, tree=False): extended = str2bool(request.query_params.get('extended', None)) @@ -182,8 +183,8 @@ class FuzzyFilterMixin(ViewSetMixin, ExtendedRecipeMixin): class MergeMixin(ViewSetMixin): - @ decorators.action(detail=True, url_path='merge/(?P[^/.]+)', methods=['PUT'], ) - @ decorators.renderer_classes((TemplateHTMLRenderer, JSONRenderer)) + @decorators.action(detail=True, url_path='merge/(?P[^/.]+)', methods=['PUT'], ) + @decorators.renderer_classes((TemplateHTMLRenderer, JSONRenderer)) def merge(self, request, pk, target): self.description = f"Merge {self.basename} onto target {self.basename} with ID of [int]." @@ -279,8 +280,8 @@ class TreeMixin(MergeMixin, FuzzyFilterMixin, ExtendedRecipeMixin): return self.annotate_recipe(queryset=self.queryset, request=self.request, serializer=self.serializer_class, tree=True) - @ decorators.action(detail=True, url_path='move/(?P[^/.]+)', methods=['PUT'], ) - @ decorators.renderer_classes((TemplateHTMLRenderer, JSONRenderer)) + @decorators.action(detail=True, url_path='move/(?P[^/.]+)', methods=['PUT'], ) + @decorators.renderer_classes((TemplateHTMLRenderer, JSONRenderer)) def move(self, request, pk, parent): self.description = f"Move {self.basename} to be a child of {self.basename} with ID of [int]. Use ID: 0 to move {self.basename} to the root." if self.model.node_order_by: @@ -460,7 +461,7 @@ class FoodViewSet(viewsets.ModelViewSet, TreeMixin): # onhand_status = self.queryset.annotate(onhand_status=Exists(onhand_users_set__in=[shared_users])) return self.queryset.annotate(shopping_status=Exists(shopping_status)).prefetch_related('onhand_users', 'inherit_fields').select_related('recipe', 'supermarket_category') - @ decorators.action(detail=True, methods=['PUT'], serializer_class=FoodShoppingUpdateSerializer,) + @decorators.action(detail=True, methods=['PUT'], serializer_class=FoodShoppingUpdateSerializer, ) # TODO DRF only allows one action in a decorator action without overriding get_operation_id_base() this should be PUT and DELETE probably def shopping(self, request, pk): if self.request.space.demo: @@ -538,7 +539,7 @@ class MealPlanViewSet(viewsets.ModelViewSet): """ queryset = MealPlan.objects serializer_class = MealPlanSerializer - permission_classes = [CustomIsOwner] + permission_classes = [CustomIsOwner | CustomIsShared] def get_queryset(self): queryset = self.queryset.filter( diff --git a/docs/install/docker.md b/docs/install/docker.md index b8ed504e..dea392b3 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -354,7 +354,7 @@ follow these instructions: If hosting under a sub-path you might want to change the default nginx config (which gets mounted through the named volume from the application container into the nginx container) with the following config. -``` +```nginx location /my_app { # change to subfolder name include /config/nginx/proxy.conf; proxy_pass https://mywebapp.com/; # change to your host name:port @@ -371,11 +371,10 @@ location /media/ { } - location /static/ { include /config/nginx/proxy.conf; alias /staticfiles/; client_max_body_size 16M; } -``` \ No newline at end of file +``` diff --git a/nginx/conf.d/Recipes.conf b/nginx/conf.d/Recipes.conf index 71fbed51..22829720 100644 --- a/nginx/conf.d/Recipes.conf +++ b/nginx/conf.d/Recipes.conf @@ -12,5 +12,12 @@ server { location / { proxy_set_header Host $http_host; proxy_pass http://web_recipes:8080; + + error_page 502 /errors/http502.html; + } + + location /errors/ { + alias /etc/nginx/conf.d/errorpages/; + internal; } } diff --git a/nginx/conf.d/errorpages/http502.html b/nginx/conf.d/errorpages/http502.html new file mode 100644 index 00000000..e984b978 --- /dev/null +++ b/nginx/conf.d/errorpages/http502.html @@ -0,0 +1,20 @@ + + + + + + 502 - Webservice currently unavailable + + + +

Tandoor Recipes is not yet available 502

+

+ Services are still trying to start.
+ Please allow up to 3 minutes after you started the application on your server.

+ If this status persists, check the application or docker logs for further information.
+ After checking and trying everything mentioned in the docs, you can request help on the project's GitHub page. +

+
+ + + \ No newline at end of file diff --git a/vue/src/apps/RecipeEditView/RecipeEditView.vue b/vue/src/apps/RecipeEditView/RecipeEditView.vue index 14ccd0c3..215f9fb8 100644 --- a/vue/src/apps/RecipeEditView/RecipeEditView.vue +++ b/vue/src/apps/RecipeEditView/RecipeEditView.vue @@ -656,8 +656,8 @@ export default { }, warnPageLeave: function (event) { if (this.recipe_changed) { - event.returnValue = "" - return "" + event.returnValue = "this_string_cant_be_empty_because_of_firefox" + return "this_string_cant_be_empty_because_of_firefox" } }, loadRecipe: function () { @@ -672,8 +672,8 @@ export default { // set default visibility style for each component of the step this.recipe.steps.forEach((s) => { this.$set(s, "time_visible", s.time !== 0) - this.$set(s, "ingredients_visible", s.ingredients.length > 0) - this.$set(s, "instruction_visible", s.instruction !== "") + this.$set(s, "ingredients_visible", s.ingredients.length > 0 || this.recipe.steps.length === 1) + this.$set(s, "instruction_visible", s.instruction !== "" || this.recipe.steps.length === 1) this.$set(s, "step_recipe_visible", s.step_recipe !== null) this.$set(s, "file_visible", s.file !== null) }) diff --git a/vue/src/components/StepComponent.vue b/vue/src/components/StepComponent.vue index 38ccdf19..f7c2b8ba 100644 --- a/vue/src/components/StepComponent.vue +++ b/vue/src/components/StepComponent.vue @@ -32,15 +32,16 @@
-
- +
+
+ :class="{ 'col-md-8 col-12': recipe.steps.length > 1, 'col-md-12 col-12': recipe.steps.length <= 1 }">