mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Remove details from compact disc offsets.
This commit is contained in:
@@ -20,24 +20,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
View(await _context.CdOffsets.OrderBy(o => o.Manufacturer).ThenBy(o => o.Model).ThenBy(o => o.Offset).
|
||||
ToListAsync());
|
||||
|
||||
// GET: Admin/CompactDiscOffsets/Details/5
|
||||
public async Task<IActionResult> Details(int? id)
|
||||
{
|
||||
if(id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
CompactDiscOffset compactDiscOffset = await _context.CdOffsets.FirstOrDefaultAsync(m => m.Id == id);
|
||||
|
||||
if(compactDiscOffset == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return View(compactDiscOffset);
|
||||
}
|
||||
|
||||
// GET: Admin/CompactDiscOffsets/Edit/5
|
||||
public async Task<IActionResult> Edit(int? id)
|
||||
{
|
||||
@@ -69,27 +51,26 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
if(ModelState.IsValid)
|
||||
if(!ModelState.IsValid)
|
||||
return View(compactDiscOffset);
|
||||
|
||||
try
|
||||
{
|
||||
try
|
||||
_context.Update(compactDiscOffset);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch(DbUpdateConcurrencyException)
|
||||
{
|
||||
if(!CompactDiscOffsetExists(compactDiscOffset.Id))
|
||||
{
|
||||
_context.Update(compactDiscOffset);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch(DbUpdateConcurrencyException)
|
||||
{
|
||||
if(!CompactDiscOffsetExists(compactDiscOffset.Id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
throw;
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return RedirectToAction(nameof(Index));
|
||||
throw;
|
||||
}
|
||||
|
||||
return View(compactDiscOffset);
|
||||
return RedirectToAction(nameof(Index));
|
||||
|
||||
}
|
||||
|
||||
// GET: Admin/CompactDiscOffsets/Delete/5
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
@model CompactDiscOffset
|
||||
|
||||
@{
|
||||
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
|
||||
ViewBag.Title = "DiscImageChef";
|
||||
}
|
||||
@{
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Details.cshtml
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
}
|
||||
<div>
|
||||
<h4>CompactDiscOffset</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.AddedWhen)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.AddedWhen)
|
||||
</dd>
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.ModifiedWhen)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.ModifiedWhen)
|
||||
</dd>
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Manufacturer)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.Manufacturer)
|
||||
</dd>
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Model)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.Model)
|
||||
</dd>
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Offset)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.Offset)
|
||||
</dd>
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Submissions)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.Submissions)
|
||||
</dd>
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Agreement)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.Agreement)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary">Edit</a>
|
||||
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
|
||||
</div>
|
||||
@@ -87,7 +87,6 @@
|
||||
@Html.DisplayFor(modelItem => item.Agreement)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-primary">Details</a>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-secondary">Edit</a>
|
||||
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Delete</a>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user