Skip to content

Commit

Permalink
admin parannukset
Browse files Browse the repository at this point in the history
  • Loading branch information
ArttuKuikka committed Oct 6, 2024
1 parent d3055ec commit e86ac6c
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 152 deletions.
103 changes: 64 additions & 39 deletions Views/RuokalistaAdmin/Create.cshtml
Original file line number Diff line number Diff line change
@@ -1,63 +1,88 @@
@model RuokalistaServer.Models.Ruokalista

@{
ViewData["Title"] = "Create";
ViewData["Title"] = "Luo ruokalista";
var viikko = System.Globalization.ISOWeek.GetWeekOfYear(DateTime.Now).ToString();
var vuosi = DateTime.Now.Year.ToString();
}

<h1>Create</h1>

<h4>Ruokalista</h4>
<h1>Luo ruokalista</h1>
<br />
<hr />
<div class="row">
<div class="col-md-4" style="width:60%">
<div class="col-md-4" style="width:100%">
<form asp-action="Create">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="WeekId" class="control-label"></label>
<input asp-for="WeekId" class="form-control" value="@viikko" />
<span asp-validation-for="WeekId" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Year" class="control-label"></label>
<input asp-for="Year" class="form-control" value="@vuosi" />
<span asp-validation-for="Year" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Maanantai" class="control-label"></label>
<input asp-for="Maanantai" class="form-control" />
<span asp-validation-for="Maanantai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Tiistai" class="control-label"></label>
<input asp-for="Tiistai" class="form-control" />
<span asp-validation-for="Tiistai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Keskiviikko" class="control-label"></label>
<input asp-for="Keskiviikko" class="form-control" />
<span asp-validation-for="Keskiviikko" class="text-danger"></span>
<div class="rounded-container" style="max-width: 15em;">
<div class="form-group">
<label class="control-label">Vuosi</label>
<input asp-for="Year" class="form-control" value="@vuosi" />
<span asp-validation-for="Year" class="text-danger"></span>
</div>
<div class="form-group">
<label class="control-label">Viikko</label>
<input asp-for="WeekId" class="form-control" value="@viikko" />
<span asp-validation-for="WeekId" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<label asp-for="Torstai" class="control-label"></label>
<input asp-for="Torstai" class="form-control" />
<span asp-validation-for="Torstai" class="text-danger"></span>

<br />

<div class="rounded-container" style="max-width: 50em;">
<h3>Ruokalista</h3>
<div class="form-group">
<label asp-for="Maanantai" class="control-label"></label>
<input asp-for="Maanantai" class="form-control" />
<span asp-validation-for="Maanantai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Tiistai" class="control-label"></label>
<input asp-for="Tiistai" class="form-control" />
<span asp-validation-for="Tiistai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Keskiviikko" class="control-label"></label>
<input asp-for="Keskiviikko" class="form-control" />
<span asp-validation-for="Keskiviikko" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Torstai" class="control-label"></label>
<input asp-for="Torstai" class="form-control" />
<span asp-validation-for="Torstai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Perjantai" class="control-label"></label>
<input asp-for="Perjantai" class="form-control" />
<span asp-validation-for="Perjantai" class="text-danger"></span>
</div>

</div>
<div class="form-group">
<label asp-for="Perjantai" class="control-label"></label>
<input asp-for="Perjantai" class="form-control" />
<span asp-validation-for="Perjantai" class="text-danger"></span>

<br />

<div class="rounded-container" style="max-width: 50em;">
<p>G = gluteeniton, M = maidoton, L = laktoositon <br />
Esimerkki: Uunimakkara (G,M), Muusi (L,G), Kaalisalaatti.
<br />
<br />

Merkitse vapaapäivät "(loma)" merkinnällä.<br />
Esim: Maanantai: (loma)
</p>
</div>


<br />
<div class="form-group">
<input type="submit" value="Create" class="btn btn-primary" />
<input type="submit" value="Luo ruokalista" class="btn btn-primary" />
</div>

</form>
</div>
</div>

<div>
<a asp-action="Index">Back to List</a>
<a asp-action="Index">Takaisin</a>
</div>


15 changes: 8 additions & 7 deletions Views/RuokalistaAdmin/Delete.cshtml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
@model RuokalistaServer.Models.Ruokalista

@{
ViewData["Title"] = "Delete";
ViewData["Title"] = "Poista ruokalista";
}

<h1>Delete</h1>
<h1>Poista ruokalista</h1>

<h3>Are you sure you want to delete this?</h3>
<h3>Oletko varma että haluat poistaa tämän ruokalistan</h3>
<div>
<h4>Ruokalista</h4>
<hr />
<dl class="row">
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.WeekId)
Viikko
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.WeekId)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Year)
Vuosi
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Year)
Expand Down Expand Up @@ -55,9 +55,10 @@
</dd>
</dl>

<br />
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
<input type="submit" value="Poista" class="btn btn-danger" /> |
<a asp-action="Index">Takaisin</a>
</form>
</div>
60 changes: 0 additions & 60 deletions Views/RuokalistaAdmin/Details.cshtml

This file was deleted.

97 changes: 58 additions & 39 deletions Views/RuokalistaAdmin/Edit.cshtml
Original file line number Diff line number Diff line change
@@ -1,62 +1,81 @@
@model RuokalistaServer.Models.Ruokalista

@{
ViewData["Title"] = "Edit";
ViewData["Title"] = "Muokkaa ruokalistaa";
}

<h1>Edit</h1>
<h1>Muokkaa ruokalistaa</h1>

<h4>Ruokalista</h4>
<hr />
<div class="row">
<div class="col-md-4" style="width:60%">
<div class="col-md-4" style="width:100%">
<form asp-action="Edit">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Id" />
<div class="form-group">
<label asp-for="WeekId" class="control-label"></label>
<input asp-for="WeekId" class="form-control" readonly="readonly" />
<span asp-validation-for="WeekId" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Year" class="control-label"></label>
<input asp-for="Year" class="form-control" readonly="readonly" />
<span asp-validation-for="Year" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Maanantai" class="control-label"></label>
<input asp-for="Maanantai" class="form-control" />
<span asp-validation-for="Maanantai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Tiistai" class="control-label"></label>
<input asp-for="Tiistai" class="form-control" />
<span asp-validation-for="Tiistai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Keskiviikko" class="control-label"></label>
<input asp-for="Keskiviikko" class="form-control" />
<span asp-validation-for="Keskiviikko" class="text-danger"></span>
<div class="rounded-container" style="max-width: 15em;">
<div class="form-group">
<label class="control-label">Vuosi</label>
<input readonly disabled asp-for="Year" class="form-control" value="@Model.Year" />
<span asp-validation-for="Year" class="text-danger"></span>
</div>
<div class="form-group">
<label class="control-label">Viikko</label>
<input readonly disabled asp-for="WeekId" class="form-control" value="@Model.WeekId" />
<span asp-validation-for="WeekId" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<label asp-for="Torstai" class="control-label"></label>
<input asp-for="Torstai" class="form-control" />
<span asp-validation-for="Torstai" class="text-danger"></span>

<br />

<div class="rounded-container" style="max-width: 50em;">
<h3>Ruokalista</h3>
<div class="form-group">
<label asp-for="Maanantai" class="control-label"></label>
<input asp-for="Maanantai" class="form-control" />
<span asp-validation-for="Maanantai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Tiistai" class="control-label"></label>
<input asp-for="Tiistai" class="form-control" />
<span asp-validation-for="Tiistai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Keskiviikko" class="control-label"></label>
<input asp-for="Keskiviikko" class="form-control" />
<span asp-validation-for="Keskiviikko" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Torstai" class="control-label"></label>
<input asp-for="Torstai" class="form-control" />
<span asp-validation-for="Torstai" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Perjantai" class="control-label"></label>
<input asp-for="Perjantai" class="form-control" />
<span asp-validation-for="Perjantai" class="text-danger"></span>
</div>

</div>
<div class="form-group">
<label asp-for="Perjantai" class="control-label"></label>
<input asp-for="Perjantai" class="form-control" />
<span asp-validation-for="Perjantai" class="text-danger"></span>

<br />

<div class="rounded-container" style="max-width: 50em;">
<p>
G = gluteeniton, M = maidoton, L = laktoositon <br />
Esimerkki: Uunimakkara (G,M), Muusi (L,G), Kaalisalaatti.
</p>
</div>


<br />
<div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" />
<input type="submit" value="Luo ruokalista" class="btn btn-primary" />
</div>
</form>
</div>
</div>

<div>
<a asp-action="Index">Back to List</a>
<a asp-action="Index">Takaisin</a>
</div>

@section Scripts {
Expand Down
17 changes: 10 additions & 7 deletions Views/RuokalistaAdmin/SetBG.cshtml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
@model RuokalistaServer.Models.BackgroundForWeek

@{
ViewData["Title"] = "Edit";
ViewData["Title"] = "Vaihda taustakuva";
}

<h1>Edit</h1>
<h1>Vaihda taustakuva</h1>

<h4>Viikko @Model.WeekId/@Model.Year</h4>

<h4>Taustakuva</h4>
<hr />
<div class="row">
<div class="col-md-4" style="width:60%">
Expand All @@ -15,20 +16,22 @@
<input type="hidden" asp-for="Id" />
<input type="hidden" asp-for="WeekId" />
<div class="form-group">
<label asp-for="FileName" class="control-label"></label>
<label class="control-label">Tiedostonimi</label>
<input asp-for="FileName" class="form-control" />
<span asp-validation-for="FileName" class="text-danger"></span>
</div>

<br />
<a class="btn btn-primary" asp-action="NewRandomBG" asp-route-id="@Model.Id">Arvo uusi taustakuva</a>

<div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" />
<input type="submit" value="Tallenna" class="btn btn-primary" />
</div>
</form>
</div>
</div>

<div>
<a asp-action="Index">Back to List</a>
<a asp-action="Index">Takaisin</a>
</div>

@section Scripts {
Expand Down
Loading

0 comments on commit e86ac6c

Please sign in to comment.