@page "/admin/recipes/edit" @model Recipes.EditModel @using DataServer.Data.Entities @{ ViewData["Title"] = Model.IsNew ? "Create Recipe" : $"Edit: {Model.Recipe.Name}"; }

@(Model.IsNew ? "Create Recipe" : "Edit Recipe")

@(Model.IsNew ? "Add a new crafting recipe" : $"ID: {Model.Recipe.Id}")

@if (!string.IsNullOrEmpty(Model.Message)) {
@Model.Message
}
@Html.AntiForgeryToken()

Basic Information

Output

Cancel
@if (!Model.IsNew) {

Ingredients (@Model.Ingredients.Count)

@for (int i = 0; i < 16; i++) { var ingredient = Model.Ingredients.FirstOrDefault(ing => ing.SlotOrder == i);
@if (ingredient != null) { @if (ingredient.ItemDefinition != null && !string.IsNullOrEmpty(ingredient.ItemDefinition.SpritePath)) { } else { @ingredient.ItemDefinition?.Name?.Substring(0, Math.Min(3, ingredient.ItemDefinition?.Name?.Length ?? 0)) } @if (ingredient.Quantity > 1) { @ingredient.Quantity } } else { @i }
}
→
@if (Model.Recipe.OutputItem != null && !string.IsNullOrEmpty(Model.Recipe.OutputItem.SpritePath)) { } else { @Model.Recipe.OutputItem?.Name } @if (Model.Recipe.OutputQuantity > 1) { @Model.Recipe.OutputQuantity }
@foreach (var ing in Model.Ingredients.OrderBy(i => i.SlotOrder)) { } @if (!Model.Ingredients.Any()) { }
Slot Icon Item Quantity Actions
@ing.SlotOrder @if (ing.ItemDefinition != null && !string.IsNullOrEmpty(ing.ItemDefinition.SpritePath)) { } @ing.ItemDefinition?.Name (ID: @ing.ItemDefinitionId) @ing.Quantity
@Html.AntiForgeryToken()
No ingredients yet. Add items to create the recipe.
}
@section Scripts { }