chore: only inlude the id (hidden) when editing
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2020-12-27 05:30:37 +01:00
parent e8b4625165
commit 9ef5f543f7
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -1,3 +1,4 @@
@using pwt_0x01_ng.Areas.Admin.Controllers;
@model Carousel
@{
if((!String.IsNullOrEmpty(ViewBag.Action))||(!String.IsNullOrWhiteSpace(ViewBag.Action)))
@ -5,10 +6,9 @@
<div class="row">
<form asp-action="@ViewBag.Action" enctype="multipart/form-data" method="post">
<div class="form-group col-sm-4">
<div class="form-group">
<label asp-for="@Model.id"></label>
<input asp-for="@Model.id" class="form-control" id="inputCarousel" aria-describedby="carouselHelp" placeholder="id">
</div>
@{if (@ViewBag.Action == nameof(CarouselController.Edit)){
<input type="hidden" asp-for="@Model.id" class="form-control" aria-describedby="carousel id edit">
}}
<div class="form-group">
<label asp-for="@Model.DataTarget"></label>
<input asp-for="@Model.DataTarget" class="form-control" id="inputCarousel" aria-describedby="css selector id of the image" placeholder="Data Target">