Skip to content

Commit

Permalink
Edit button for the owner on the Show page #46
Browse files Browse the repository at this point in the history
Show info to the user that benchmark will be posted as guest and unable to edit #45
  • Loading branch information
thecoderok committed Sep 6, 2016
1 parent 59bff42 commit 9eb02df
Show file tree
Hide file tree
Showing 2 changed files with 330 additions and 299 deletions.
15 changes: 15 additions & 0 deletions src/BenchmarkLab/Views/Benchmarks/Add.cshtml
Expand Up @@ -2,7 +2,9 @@
@using System.Threading.Tasks
@using MeasureThat.Net.Logic.Web
@using MeasureThat.Net.Models
@using Microsoft.AspNetCore.Identity
@model MeasureThat.Net.Models.NewBenchmarkModel
@inject SignInManager<ApplicationUser> SignInManager

@{
string action = Model.Id == 0 ? "Add new" : "Edit";
Expand All @@ -11,11 +13,24 @@

@{
ViewData["Title"] = verb + " benchmark";
ViewData["ReturnUrl"] = Url.Action("Add");
}

<div class="page-header">
<h1>@verb benchmark</h1>
</div>

@if (!SignInManager.IsSignedIn(User))
{
<div class="alert alert-warning" role="alert">
<b>Consider signing in before you create benchmark.</b> Then you will be able to edit it later.
Benchmarks created by guest users <b>can't be edited</b>, only forked.
<br><br>
<button class="btn btn-primary" data-toggle="modal" data-target="#authenticateModal">Log in</button>
</div>
<hr/>
}

@using (Html.BeginForm(action, "Benchmarks", null, FormMethod.Post, true, new { id = "new-benchmark-form" }))
{
@Html.ValidationSummary()
Expand Down

0 comments on commit 9eb02df

Please sign in to comment.