Guest User

Untitled

a guest
Jan 16th, 2017
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 53.49 KB | None | 0 0
  1. @{
  2.     ViewData["Title"] = "Confirm Email";
  3. }
  4.  
  5. <h2>@ViewData["Title"].</h2>
  6. <div>
  7.     <p>
  8.         Thank you for confirming your email. Please <a asp-controller="Account" asp-action="Login">Click here to Log in</a>.
  9.     </p>
  10. </div>
  11.  
  12.  
  13.  
  14. @model Beerhall.Models.ViewModels.AccountViewModels.ExternalLoginConfirmationViewModel
  15. @{
  16.     ViewData["Title"] = "Register";
  17. }
  18.  
  19. <h2>@ViewData["Title"].</h2>
  20. <h3>Associate your @ViewData["LoginProvider"] account.</h3>
  21.  
  22. <form asp-controller="Account" asp-action="ExternalLoginConfirmation" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
  23.     <h4>Association Form</h4>
  24.     <hr />
  25.     <div asp-validation-summary="All" class="text-danger"></div>
  26.  
  27.     <p class="text-info">
  28.         You've successfully authenticated with <strong>@ViewData["LoginProvider"]</strong>.
  29.        Please enter an email address for this site below and click the Register button to finish
  30.        logging in.
  31.    </p>
  32.    <div class="form-group">
  33.        <label asp-for="Email" class="col-md-2 control-label"></label>
  34.        <div class="col-md-10">
  35.            <input asp-for="Email" class="form-control" />
  36.            <span asp-validation-for="Email" class="text-danger"></span>
  37.        </div>
  38.    </div>
  39.    <div class="form-group">
  40.        <div class="col-md-offset-2 col-md-10">
  41.            <button type="submit" class="btn btn-default">Register</button>
  42.        </div>
  43.    </div>
  44. </form>
  45.  
  46. @section Scripts {
  47.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  48. }
  49.  
  50.  
  51.  
  52. @{
  53.    ViewData["Title"] = "Login Failure";
  54. }
  55.  
  56. <header>
  57.    <h2>@ViewData["Title"].</h2>
  58.    <p class="text-danger">Unsuccessful login with service.</p>
  59. </header>
  60.  
  61.  
  62.  
  63. @model Beerhall.Models.ViewModels.AccountViewModels.ForgotPasswordViewModel
  64. @{
  65.    ViewData["Title"] = "Forgot your password?";
  66. }
  67.  
  68. <h2>@ViewData["Title"]</h2>
  69. <p>
  70.    For more information on how to enable reset password please see this <a href="http://go.microsoft.com/fwlink/?LinkID=532713">article</a>.
  71. </p>
  72.  
  73. @*<form asp-controller="Account" asp-action="ForgotPassword" method="post" class="form-horizontal">
  74.    <h4>Enter your email.</h4>
  75.    <hr />
  76.    <div asp-validation-summary="All" class="text-danger"></div>
  77.    <div class="form-group">
  78.        <label asp-for="Email" class="col-md-2 control-label"></label>
  79.        <div class="col-md-10">
  80.            <input asp-for="Email" class="form-control" />
  81.            <span asp-validation-for="Email" class="text-danger"></span>
  82.        </div>
  83.    </div>
  84.    <div class="form-group">
  85.        <div class="col-md-offset-2 col-md-10">
  86.            <button type="submit" class="btn btn-default">Submit</button>
  87.        </div>
  88.    </div>
  89. </form>*@
  90.  
  91. @section Scripts {
  92.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  93. }
  94.  
  95.  
  96.  
  97. @{
  98.    ViewData["Title"] = "Forgot Password Confirmation";
  99. }
  100.  
  101. <h2>@ViewData["Title"].</h2>
  102. <p>
  103.    Please check your email to reset your password.
  104. </p>
  105.  
  106.  
  107.  
  108. @{
  109.    ViewData["Title"] = "Locked out";
  110. }
  111.  
  112. <header>
  113.    <h1 class="text-danger">Locked out.</h1>
  114.    <p class="text-danger">This account has been locked out, please try again later.</p>
  115. </header>
  116.  
  117.  
  118.  
  119. @using System.Threading.Tasks
  120. @using Beerhall.Models.Domain
  121. @model Beerhall.Models.ViewModels.AccountViewModels.LoginViewModel
  122. @inject SignInManager<ApplicationUser> SignInManager
  123.  
  124. @{
  125.    ViewData["Title"] = "Log in";
  126. }
  127.  
  128. <h2>@ViewData["Title"].</h2>
  129. <div class="row">
  130.    <div class="col-md-8">
  131.        <section>
  132.            <form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
  133.                <h4>Use a local account to log in.</h4>
  134.                <hr />
  135.                <div asp-validation-summary="All" class="text-danger"></div>
  136.                <div class="form-group">
  137.                    <label asp-for="Email" class="col-md-2 control-label"></label>
  138.                    <div class="col-md-10">
  139.                        <input asp-for="Email" class="form-control" />
  140.                        <span asp-validation-for="Email" class="text-danger"></span>
  141.                    </div>
  142.                </div>
  143.                <div class="form-group">
  144.                    <label asp-for="Password" class="col-md-2 control-label"></label>
  145.                    <div class="col-md-10">
  146.                        <input asp-for="Password" class="form-control" />
  147.                        <span asp-validation-for="Password" class="text-danger"></span>
  148.                    </div>
  149.                </div>
  150.                <div class="form-group">
  151.                    <div class="col-md-offset-2 col-md-10">
  152.                        <div class="checkbox">
  153.                            <label asp-for="RememberMe">
  154.                                <input asp-for="RememberMe" />
  155.                                @Html.DisplayNameFor(m => m.RememberMe)
  156.                            </label>
  157.                        </div>
  158.                    </div>
  159.                </div>
  160.                <div class="form-group">
  161.                    <div class="col-md-offset-2 col-md-10">
  162.                        <button type="submit" class="btn btn-default">Log in</button>
  163.                    </div>
  164.                </div>
  165.                <p>
  166.                    <a asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]">Register as a new user?</a>
  167.                </p>
  168.                <p>
  169.                    <a asp-action="ForgotPassword">Forgot your password?</a>
  170.                </p>
  171.            </form>
  172.        </section>
  173.    </div>
  174.    <div class="col-md-4">
  175.        <section>
  176.            <h4>Use another service to log in.</h4>
  177.            <hr />
  178.            @{
  179.                var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList();
  180.                if (loginProviders.Count == 0)
  181.                {
  182.                    <div>
  183.                        <p>
  184.                            There are no external authentication services configured. See <a href="http://go.microsoft.com/fwlink/?LinkID=532715">this article</a>
  185.                            for details on setting up this ASP.NET application to support logging in via external services.
  186.                        </p>
  187.                    </div>
  188.                }
  189.                else
  190.                {
  191.                    <form asp-controller="Account" asp-action="ExternalLogin" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
  192.                        <div>
  193.                            <p>
  194.                                @foreach (var provider in loginProviders)
  195.                                {
  196.                                    <button type="submit" class="btn btn-default" name="provider" value="@provider.AuthenticationScheme" title="Log in using your @provider.DisplayName account">@provider.AuthenticationScheme</button>
  197.                                }
  198.                            </p>
  199.                        </div>
  200.                    </form>
  201.                }
  202.            }
  203.        </section>
  204.    </div>
  205. </div>
  206.  
  207. @section Scripts {
  208.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  209. }
  210.  
  211.  
  212.  
  213. @model Beerhall.Models.ViewModels.AccountViewModels.RegisterViewModel
  214. @{
  215.    ViewData["Title"] = "Register";
  216. }
  217.  
  218. <h2>@ViewData["Title"].</h2>
  219.  
  220. <form asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
  221.    <h4>Create a new account.</h4>
  222.    <hr />
  223.    <div asp-validation-summary="ModelOnly" class="text-danger"></div>
  224.    <div class="form-group">
  225.        <label asp-for="Email" class="col-md-2 control-label"></label>
  226.        <div class="col-md-10">
  227.            <input asp-for="Email" class="form-control" />
  228.            <span asp-validation-for="Email" class="text-danger"></span>
  229.        </div>
  230.    </div>
  231.    <div class="form-group">
  232.        <label asp-for="Name" class="col-md-2 control-label"></label>
  233.        <div class="col-md-10">
  234.            <input asp-for="Name" class="form-control" />
  235.            <span asp-validation-for="Name" class="text-danger"></span>
  236.        </div>
  237.    </div>
  238.    <div class="form-group">
  239.        <label asp-for="FirstName" class="col-md-2 control-label"></label>
  240.        <div class="col-md-10">
  241.            <input asp-for="FirstName" class="form-control" />
  242.            <span asp-validation-for="FirstName" class="text-danger"></span>
  243.        </div>
  244.    </div>
  245.    <div class="form-group">
  246.        <label asp-for="Street" class="col-md-2 control-label"></label>
  247.        <div class="col-md-10">
  248.            <input asp-for="Street" class="form-control" />
  249.            <span asp-validation-for="Street" class="text-danger"></span>
  250.        </div>
  251.    </div>
  252.    <div class="form-group">
  253.        <label asp-for="PostalCode" class="col-md-2 control-label"></label>
  254.        <div class="col-md-10">
  255.            <select asp-for="PostalCode" asp-items="@(ViewData["Locations"] as SelectList)" class="form-control">
  256.                <option value="">-- select location --</option>
  257.            </select>
  258.            <span asp-validation-for="PostalCode" class="text-danger"></span>
  259.        </div>
  260.    </div>
  261.    <div class="form-group">
  262.        <label asp-for="Password" class="col-md-2 control-label"></label>
  263.        <div class="col-md-10">
  264.            <input asp-for="Password" class="form-control" />
  265.            <span asp-validation-for="Password" class="text-danger"></span>
  266.        </div>
  267.    </div>
  268.    <div class="form-group">
  269.        <label asp-for="ConfirmPassword" class="col-md-2 control-label"></label>
  270.        <div class="col-md-10">
  271.            <input asp-for="ConfirmPassword" class="form-control" />
  272.            <span asp-validation-for="ConfirmPassword" class="text-danger"></span>
  273.        </div>
  274.    </div>
  275.    <div class="form-group">
  276.        <div class="col-md-offset-2 col-md-10">
  277.            <button type="submit" class="btn btn-default">Register</button>
  278.        </div>
  279.    </div>
  280. </form>
  281.  
  282. @section Scripts {
  283.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  284. }
  285.  
  286.  
  287.  
  288. @model Beerhall.Models.ViewModels.AccountViewModels.ResetPasswordViewModel
  289. @{
  290.    ViewData["Title"] = "Reset password";
  291. }
  292.  
  293. <h2>@ViewData["Title"].</h2>
  294.  
  295. <form asp-controller="Account" asp-action="ResetPassword" method="post" class="form-horizontal">
  296.    <h4>Reset your password.</h4>
  297.    <hr />
  298.    <div asp-validation-summary="All" class="text-danger"></div>
  299.    <input asp-for="Code" type="hidden" />
  300.    <div class="form-group">
  301.        <label asp-for="Email" class="col-md-2 control-label"></label>
  302.        <div class="col-md-10">
  303.            <input asp-for="Email" class="form-control" />
  304.            <span asp-validation-for="Email" class="text-danger"></span>
  305.        </div>
  306.    </div>
  307.    <div class="form-group">
  308.        <label asp-for="Password" class="col-md-2 control-label"></label>
  309.        <div class="col-md-10">
  310.            <input asp-for="Password" class="form-control" />
  311.            <span asp-validation-for="Password" class="text-danger"></span>
  312.        </div>
  313.    </div>
  314.    <div class="form-group">
  315.        <label asp-for="ConfirmPassword" class="col-md-2 control-label"></label>
  316.        <div class="col-md-10">
  317.            <input asp-for="ConfirmPassword" class="form-control" />
  318.            <span asp-validation-for="ConfirmPassword" class="text-danger"></span>
  319.        </div>
  320.    </div>
  321.    <div class="form-group">
  322.        <div class="col-md-offset-2 col-md-10">
  323.            <button type="submit" class="btn btn-default">Reset</button>
  324.        </div>
  325.    </div>
  326. </form>
  327.  
  328. @section Scripts {
  329.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  330. }
  331.  
  332.  
  333.  
  334. @{
  335.    ViewData["Title"] = "Reset password confirmation";
  336. }
  337.  
  338. <h1>@ViewData["Title"].</h1>
  339. <p>
  340.    Your password has been reset. Please <a asp-controller="Account" asp-action="Login">Click here to log in</a>.
  341. </p>
  342.  
  343.  
  344.  
  345. @model Beerhall.Models.ViewModels.AccountViewModels.SendCodeViewModel
  346. @{
  347.    ViewData["Title"] = "Send Verification Code";
  348. }
  349.  
  350. <h2>@ViewData["Title"].</h2>
  351.  
  352. <form asp-controller="Account" asp-action="SendCode" asp-route-returnurl="@Model.ReturnUrl" method="post" class="form-horizontal">
  353.    <input asp-for="RememberMe" type="hidden" />
  354.    <div class="row">
  355.        <div class="col-md-8">
  356.            Select Two-Factor Authentication Provider:
  357.            <select asp-for="SelectedProvider" asp-items="Model.Providers"></select>
  358.            <button type="submit" class="btn btn-default">Submit</button>
  359.        </div>
  360.    </div>
  361. </form>
  362.  
  363. @section Scripts {
  364.    @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  365. }
  366.  
  367.  
  368.  
  369. @model Beerhall.Models.ViewModels.AccountViewModels.VerifyCodeViewModel
  370. @{
  371.    ViewData["Title"] = "Verify";
  372. }
  373.  
  374. <h2>@ViewData["Title"].</h2>
  375.  
  376. <form asp-controller="Account" asp-action="VerifyCode" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
  377.    <div asp-validation-summary="All" class="text-danger"></div>
  378.    <input asp-for="Provider" type="hidden" />
  379.    <input asp-for="RememberMe" type="hidden" />
  380.    <h4>@ViewData["Status"]</h4>
  381.    <hr />
  382.    <div class="form-group">
  383.        <label asp-for="Code" class="col-md-2 control-label"></label>
  384.        <div class="col-md-10">
  385.            <input asp-for="Code" class="form-control" />
  386.            <span asp-validation-for="Code" class="text-danger"></span>
  387.        </div>
  388.    </div>
  389.    <div class="form-group">
  390.        <div class="col-md-offset-2 col-md-10">
  391.            <div class="checkbox">
  392.                <input asp-for="RememberBrowser" />
  393.                <label asp-for="RememberBrowser"></label>
  394.            </div>
  395.        </div>
  396.    </div>
  397.    <div class="form-group">
  398.        <div class="col-md-offset-2 col-md-10">
  399.            <button type="submit" class="btn btn-default">Submit</button>
  400.        </div>
  401.    </div>
  402. </form>
  403.  
  404. @section Scripts {
  405.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  406. }
  407.  
  408.  
  409.  
  410. @{
  411.    ViewData["Title"] = "Brewers";
  412. }
  413.  
  414. <h2>@ViewData["Title"]</h2>
  415.  
  416. <h4>
  417.    Please confirm you want to delete brewer @ViewData["Name"]...
  418. </h4>
  419. <form asp-action="Delete" method="post">
  420.    <div>
  421.        <button class="btn btn-primary" type="submit">Delete</button>
  422.        <a asp-action="Index" class="btn btn-default">Cancel</a>
  423.    </div>
  424. </form>
  425.  
  426.  
  427. @model EditViewModel
  428.  
  429. @{
  430.    ViewData["Title"] = Model.BrewerId == 0 ? "Create brewer" : "Edit brewer";
  431.    var action = Model.BrewerId == 0 ? "Create" : "Edit";
  432. }
  433.  
  434. <h2>@ViewData["Title"]</h2>
  435.  
  436. <form asp-action="@action" method="post">
  437.    <div asp-validation-summary="ModelOnly"></div>
  438.    <input asp-for="BrewerId" />
  439.    <div class="form-group">
  440.        <label asp-for="Name"></label>
  441.        <input asp-for="Name" class="form-control" />
  442.        <span asp-validation-for="Name" class="text-danger"></span>
  443.    </div>
  444.    <div class="form-group">
  445.        <label asp-for="Street"></label>
  446.        <input asp-for="Street" class="form-control" />
  447.        <span asp-validation-for="Street" class="text-danger"></span>
  448.    </div>
  449.    <div class="form-group">
  450.        <label asp-for="PostalCode"></label>
  451.        <select asp-for="PostalCode" asp-items="@(ViewData["Locations"] as SelectList)" class="form-control">
  452.            <option value="">-- select location --</option>
  453.        </select>
  454.        <span asp-validation-for="PostalCode" class="text-danger"></span>
  455.    </div>
  456.    <div class="form-group">
  457.        <label asp-for="ContactEmail"></label>
  458.        <input asp-for="ContactEmail" class="form-control" />
  459.        <span asp-validation-for="ContactEmail" class="text-danger"></span>
  460.    </div>
  461.    <div class="form-group">
  462.        <label asp-for="Description"></label>
  463.        <textarea asp-for="Description" class="form-control"></textarea>
  464.        <span asp-validation-for="Description" class="text-danger"></span>
  465.    </div>
  466.    <div class="form-group">
  467.        <label asp-for="DateEstablished"></label>
  468.        <input asp-for="DateEstablished" class="form-control" />
  469.        <span asp-validation-for="DateEstablished" class="text-danger"></span>
  470.    </div>
  471.    <div class="form-group">
  472.        <label asp-for="Turnover"></label>
  473.        <input asp-for="Turnover" class="form-control" />
  474.        <span asp-validation-for="Turnover" class="text-danger"></span>
  475.    </div>
  476.    <div>
  477.        <button class="btn btn-primary" type="submit">Save</button>
  478.        <a asp-action="Index" class="btn btn-default">Cancel</a>
  479.    </div>
  480. </form>
  481.  
  482. @section Scripts {
  483.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  484. }
  485.  
  486.  
  487.  
  488. @model IEnumerable<Beerhall.Models.Domain.Brewer>
  489.  
  490. @{
  491.    ViewData["Title"] = "Brewers";
  492. }
  493.  
  494. <h2>@ViewData["Title"]</h2>
  495.  
  496. <p>
  497.    <a asp-controller="Brewer" asp-action="Create">Add a brewer</a>
  498. </p>
  499.  
  500. <table class="table table-striped table-condensed table-bordered">
  501.    <tr>
  502.        <th>Name</th>
  503.        <th>Street</th>
  504.        <th>Location</th>
  505.        <th class="text-right">Turnover</th>
  506.        <th class="text-right">Date established</th>
  507.        <th></th>
  508.    </tr>
  509.  
  510.    @foreach (var item in Model) {
  511.        <tr>
  512.            <td>
  513.                @item.Name
  514.            </td>
  515.            <td>
  516.                @item.Street
  517.            </td>
  518.            <td>
  519.                @item.Location?.PostalCode @item.Location?.Name
  520.            </td>
  521.            <td class="text-right">
  522.                @(item.Turnover?.ToString("c") ?? "-")
  523.            </td>
  524.            <td class="text-right">
  525.                @(item.DateEstablished?.Date.ToString("d") ?? "-")
  526.            </td>
  527.            <td>
  528.                <a asp-controller="Brewer" asp-action="Detail" asp-route-id="@item.BrewerId">Detail</a> |
  529.                <a asp-controller="Brewer" asp-action="Edit" asp-route-id="@item.BrewerId">Edit</a> |
  530.                <a asp-controller="Brewer" asp-action="Delete" asp-route-id="@item.BrewerId">Delete</a>
  531.            </td>
  532.        </tr>
  533.    }
  534. </table>
  535. <p>Total turnover: @($"{(int)ViewData["TotalTurnover"]:N0} €") </p>
  536.  
  537.  
  538. @model Beerhall.Models.ViewModels.CartViewModels.CheckOutViewModel
  539.  
  540. @{
  541.    ViewData["Title"] = "Checkout";
  542. }
  543.  
  544. <h2>Checkout</h2>
  545.  
  546. <form asp-action="Checkout">
  547.    <div class="form-horizontal">
  548.        <h4>Delivery address</h4>
  549.        <hr />
  550.        <div asp-validation-summary="ModelOnly" class="text-danger"></div>
  551.        <div class="form-group">
  552.            <label asp-for="@Model.ShippingViewModel.Street" class="col-md-2 control-label"></label>
  553.            <div class="col-md-10">
  554.                <input asp-for="@Model.ShippingViewModel.Street" class="form-control" />
  555.                <span asp-validation-for="@Model.ShippingViewModel.Street" class="text-danger"></span>
  556.            </div>
  557.        </div>
  558.        <div class="form-group">
  559.            <label asp-for="@Model.ShippingViewModel.PostalCode" class="col-md-2 control-label"></label>
  560.            <div class="col-md-10">
  561.                <select asp-for="@Model.ShippingViewModel.PostalCode" asp-items="@Model.Locations" class="form-control">
  562.                    <option value="">-- select location --</option>
  563.                </select>
  564.                <span asp-validation-for="@Model.ShippingViewModel.PostalCode" class="text-danger"></span>
  565.            </div>
  566.        </div>
  567.  
  568.        <h4>Options</h4>
  569.        <hr />
  570.        <div class="form-group">
  571.            <label asp-for="@Model.ShippingViewModel.DeliveryDate" class="col-md-2 control-label"></label>
  572.            <div class="col-md-10">
  573.                <input asp-for="@Model.ShippingViewModel.DeliveryDate" class="form-control" />
  574.                <span asp-validation-for="@Model.ShippingViewModel.DeliveryDate" class="text-danger"></span>
  575.            </div>
  576.        </div>
  577.        <div class="form-group">
  578.            <label asp-for="@Model.ShippingViewModel.Giftwrapping" class="col-md-2 control-label"></label>
  579.            <div class="checkbox col-md-10">
  580.                <input asp-for="@Model.ShippingViewModel.Giftwrapping" />
  581.            </div>
  582.        </div>
  583.        <div class="form-group">
  584.            <div class="col-md-offset-2 col-md-10">
  585.                <input type="submit" value="Order" class="btn btn-primary" />
  586.                <a asp-action="Index" class="btn btn-default">Cancel</a>
  587.            </div>
  588.        </div>
  589.    </div>
  590. </form>
  591.  
  592. @section Scripts {
  593.    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
  594. }
  595.  
  596.  
  597.  
  598. @model IEnumerable<Beerhall.Models.ViewModels.CartViewModels.IndexViewModel>
  599.  
  600. @{
  601.    ViewData["Title"] = "Cart";
  602. }
  603.  
  604. <h2>Your shopping cart</h2>
  605.  
  606. @if (Model.Count() != 0) {
  607.    <table class="table">
  608.        <thead>
  609.            <tr>
  610.                <th></th>
  611.                <th>Product</th>
  612.                <th class="text-right">Unit price</th>
  613.                <th class="text-right">Subtotal</th>
  614.                <th></th>
  615.            </tr>
  616.        </thead>
  617.        <tbody>
  618.            @foreach (var line in Model) {
  619.                <tr>
  620.                    <td class="text-right">@($"{line.Quantity} x")</td>
  621.                    <td>@line.Beer</td>
  622.                    <td class="text-right">@($"{line.Price:N2} €")</td>
  623.                    <td class="text-right">@($"{line.SubTotal:N2} €")</td>
  624.                    <td>
  625.                        <form method="post" asp-action="Remove" asp-route-id="@line.BeerId">
  626.                            <button type="submit" class="btn btn-xs"><span class="glyphicon-remove glyphicon"></span> Remove</button>
  627.                        </form>
  628.                    </td>
  629.                </tr>
  630.            }
  631.        </tbody>
  632.        <tfoot>
  633.            <tr>
  634.                <td colspan="4" class="text-right">@($"Total: {ViewData["Total"]:N2} €")</td>
  635.                <td></td>
  636.            </tr>
  637.        </tfoot>
  638.    </table>
  639.    <div align="center" class="actionButtons">
  640.        <a asp-action="Index" asp-controller="Store" class="btn btn-default">Continue shopping</a>
  641.        <a asp-action="CheckOut" asp-controller="Cart" class="btn btn-default">Check out</a>
  642.    </div>
  643. }
  644. else {
  645.    <h4>
  646.        You don't have any products in your shopping cart,
  647.         <a asp-controller="Store" asp-action="Index">start shopping here...</a>
  648.     </h4>
  649. }
  650.  
  651.  
  652. @{
  653.     ViewData["Title"] = "About";
  654. }
  655. <h2>@ViewData["Title"].</h2>
  656. <h3>@ViewData["Message"]</h3>
  657.  
  658. <p>Use this area to provide additional information.</p>
  659.  
  660.  
  661.  
  662. @{
  663.     ViewData["Title"] = "Contact";
  664. }
  665. <h2>@ViewData["Title"].</h2>
  666. <h3>@ViewData["Message"]</h3>
  667.  
  668. <address>
  669.     One Microsoft Way<br />
  670.     Redmond, WA 98052-6399<br />
  671.     <abbr title="Phone">P:</abbr>
  672.     425.555.0100
  673. </address>
  674.  
  675. <address>
  676.     <strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
  677.     <strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
  678. </address>
  679.  
  680.  
  681.  
  682. @{
  683.     ViewData["Title"] = "Home Page";
  684. }
  685.  
  686. <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
  687.     <ol class="carousel-indicators">
  688.         <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
  689.         <li data-target="#myCarousel" data-slide-to="1"></li>
  690.         <li data-target="#myCarousel" data-slide-to="2"></li>
  691.         <li data-target="#myCarousel" data-slide-to="3"></li>
  692.     </ol>
  693.     <div class="carousel-inner" role="listbox">
  694.         <div class="item active">
  695.             <img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" />
  696.             <div class="carousel-caption" role="option">
  697.                 <p>
  698.                     Learn how to build ASP.NET apps that can run anywhere.
  699.                     <a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409">
  700.                         Learn More
  701.                     </a>
  702.                 </p>
  703.             </div>
  704.         </div>
  705.         <div class="item">
  706.             <img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" />
  707.             <div class="carousel-caption" role="option">
  708.                 <p>
  709.                     There are powerful new features in Visual Studio for building modern web apps.
  710.                     <a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409">
  711.                         Learn More
  712.                     </a>
  713.                 </p>
  714.             </div>
  715.         </div>
  716.         <div class="item">
  717.             <img src="~/images/banner3.svg" alt="Package Management" class="img-responsive" />
  718.             <div class="carousel-caption" role="option">
  719.                 <p>
  720.                     Bring in libraries from NuGet, Bower, and npm, and automate tasks using Grunt or Gulp.
  721.                     <a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409">
  722.                         Learn More
  723.                     </a>
  724.                 </p>
  725.             </div>
  726.         </div>
  727.         <div class="item">
  728.             <img src="~/images/banner4.svg" alt="Microsoft Azure" class="img-responsive" />
  729.             <div class="carousel-caption" role="option">
  730.                 <p>
  731.                     Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
  732.                    <a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409">
  733.                        Learn More
  734.                    </a>
  735.                </p>
  736.            </div>
  737.        </div>
  738.    </div>
  739.    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
  740.        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
  741.        <span class="sr-only">Previous</span>
  742.    </a>
  743.    <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
  744.        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  745.        <span class="sr-only">Next</span>
  746.    </a>
  747. </div>
  748.  
  749. <div class="row">
  750.    <div class="col-md-3">
  751.        <h2>Application uses</h2>
  752.        <ul>
  753.            <li>Sample pages using ASP.NET Core MVC</li>
  754.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li>
  755.            <li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
  756.        </ul>
  757.    </div>
  758.    <div class="col-md-3">
  759.        <h2>How to</h2>
  760.        <ul>
  761.            <li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li>
  762.            <li><a href="http://go.microsoft.com/fwlink/?LinkID=699562">Add an appsetting in config and access it in app.</a></li>
  763.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
  764.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
  765.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
  766.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li>
  767.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
  768.        </ul>
  769.    </div>
  770.    <div class="col-md-3">
  771.        <h2>Overview</h2>
  772.        <ul>
  773.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li>
  774.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
  775.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
  776.            <li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
  777.            <li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
  778.            <li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
  779.            <li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
  780.        </ul>
  781.    </div>
  782.    <div class="col-md-3">
  783.        <h2>Run & Deploy</h2>
  784.        <ul>
  785.            <li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
  786.            <li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li>
  787.            <li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li>
  788.        </ul>
  789.    </div>
  790. </div>
  791.  
  792.  
  793.  
  794. @model Beerhall.Models.ViewModels.ManageViewModels.AddPhoneNumberViewModel
  795. @{
  796.    ViewData["Title"] = "Add Phone Number";
  797. }
  798.  
  799. <h2>@ViewData["Title"].</h2>
  800. <form asp-controller="Manage" asp-action="AddPhoneNumber" method="post" class="form-horizontal">
  801.    <h4>Add a phone number.</h4>
  802.    <hr />
  803.    <div asp-validation-summary="All" class="text-danger"></div>
  804.    <div class="form-group">
  805.        <label asp-for="PhoneNumber" class="col-md-2 control-label"></label>
  806.        <div class="col-md-10">
  807.            <input asp-for="PhoneNumber" class="form-control" />
  808.            <span asp-validation-for="PhoneNumber" class="text-danger"></span>
  809.        </div>
  810.    </div>
  811.    <div class="form-group">
  812.        <div class="col-md-offset-2 col-md-10">
  813.            <button type="submit" class="btn btn-default">Send verification code</button>
  814.        </div>
  815.    </div>
  816. </form>
  817.  
  818. @section Scripts {
  819.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  820. }
  821.  
  822.  
  823.  
  824. @model Beerhall.Models.ViewModels.ManageViewModels.ChangePasswordViewModel
  825. @{
  826.    ViewData["Title"] = "Change Password";
  827. }
  828.  
  829. <h2>@ViewData["Title"].</h2>
  830.  
  831. <form asp-controller="Manage" asp-action="ChangePassword" method="post" class="form-horizontal">
  832.    <h4>Change Password Form</h4>
  833.    <hr />
  834.    <div asp-validation-summary="All" class="text-danger"></div>
  835.    <div class="form-group">
  836.        <label asp-for="OldPassword" class="col-md-2 control-label"></label>
  837.        <div class="col-md-10">
  838.            <input asp-for="OldPassword" class="form-control" />
  839.            <span asp-validation-for="OldPassword" class="text-danger"></span>
  840.        </div>
  841.    </div>
  842.    <div class="form-group">
  843.        <label asp-for="NewPassword" class="col-md-2 control-label"></label>
  844.        <div class="col-md-10">
  845.            <input asp-for="NewPassword" class="form-control" />
  846.            <span asp-validation-for="NewPassword" class="text-danger"></span>
  847.        </div>
  848.    </div>
  849.    <div class="form-group">
  850.        <label asp-for="ConfirmPassword" class="col-md-2 control-label"></label>
  851.        <div class="col-md-10">
  852.            <input asp-for="ConfirmPassword" class="form-control" />
  853.            <span asp-validation-for="ConfirmPassword" class="text-danger"></span>
  854.        </div>
  855.    </div>
  856.    <div class="form-group">
  857.        <div class="col-md-offset-2 col-md-10">
  858.            <button type="submit" class="btn btn-default">Change password</button>
  859.        </div>
  860.    </div>
  861. </form>
  862.  
  863. @section Scripts {
  864.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  865. }
  866.  
  867.  
  868.  
  869. @model Beerhall.Models.ViewModels.ManageViewModels.IndexViewModel
  870. @{
  871.    ViewData["Title"] = "Manage your account";
  872. }
  873.  
  874. <h2>@ViewData["Title"].</h2>
  875. <p class="text-success">@ViewData["StatusMessage"]</p>
  876.  
  877. <div>
  878.    <h4>Change your account settings</h4>
  879.    <hr />
  880.    <dl class="dl-horizontal">
  881.        <dt>Password:</dt>
  882.        <dd>
  883.            @if (Model.HasPassword)
  884.            {
  885.                <a asp-controller="Manage" asp-action="ChangePassword" class="btn-bracketed">Change</a>
  886.            }
  887.            else
  888.            {
  889.                <a asp-controller="Manage" asp-action="SetPassword" class="btn-bracketed">Create</a>
  890.            }
  891.        </dd>
  892.        <dt>External Logins:</dt>
  893.        <dd>
  894.  
  895.            @Model.Logins.Count <a asp-controller="Manage" asp-action="ManageLogins" class="btn-bracketed">Manage</a>
  896.        </dd>
  897.        <dt>Phone Number:</dt>
  898.        <dd>
  899.            <p>
  900.                Phone Numbers can used as a second factor of verification in two-factor authentication.
  901.                See <a href="http://go.microsoft.com/fwlink/?LinkID=532713">this article</a>
  902.                for details on setting up this ASP.NET application to support two-factor authentication using SMS.
  903.            </p>
  904.            @*@(Model.PhoneNumber ?? "None")
  905.                @if (Model.PhoneNumber != null)
  906.                {
  907.                    <br />
  908.                    <a asp-controller="Manage" asp-action="AddPhoneNumber" class="btn-bracketed">Change</a>
  909.                    <form asp-controller="Manage" asp-action="RemovePhoneNumber" method="post">
  910.                        [<button type="submit" class="btn-link">Remove</button>]
  911.                    </form>
  912.                }
  913.                else
  914.                {
  915.                    <a asp-controller="Manage" asp-action="AddPhoneNumber" class="btn-bracketed">Add</a>
  916.                }*@
  917.        </dd>
  918.  
  919.        <dt>Two-Factor Authentication:</dt>
  920.        <dd>
  921.            <p>
  922.                There are no two-factor authentication providers configured. See <a href="http://go.microsoft.com/fwlink/?LinkID=532713">this article</a>
  923.                for setting up this application to support two-factor authentication.
  924.            </p>
  925.            @*@if (Model.TwoFactor)
  926.                {
  927.                    <form asp-controller="Manage" asp-action="DisableTwoFactorAuthentication" method="post" class="form-horizontal">
  928.                        Enabled <button type="submit" class="btn-link btn-bracketed">Disable</button>
  929.                    </form>
  930.                }
  931.                else
  932.                {
  933.                    <form asp-controller="Manage" asp-action="EnableTwoFactorAuthentication" method="post" class="form-horizontal">
  934.                        <button type="submit" class="btn-link btn-bracketed">Enable</button> Disabled
  935.                    </form>
  936.                }*@
  937.        </dd>
  938.    </dl>
  939. </div>
  940.  
  941.  
  942.  
  943. @model Beerhall.Models.ViewModels.ManageViewModels.ManageLoginsViewModel
  944. @{
  945.    ViewData["Title"] = "Manage your external logins";
  946. }
  947.  
  948. <h2>@ViewData["Title"].</h2>
  949.  
  950. <p class="text-success">@ViewData["StatusMessage"]</p>
  951. @if (Model.CurrentLogins.Count > 0)
  952. {
  953.    <h4>Registered Logins</h4>
  954.    <table class="table">
  955.        <tbody>
  956.            @for (var index = 0; index < Model.CurrentLogins.Count; index++)
  957.            {
  958.                <tr>
  959.                    <td>@Model.CurrentLogins[index].LoginProvider</td>
  960.                    <td>
  961.                        @if ((bool)ViewData["ShowRemoveButton"])
  962.                        {
  963.                            <form asp-controller="Manage" asp-action="RemoveLogin" method="post" class="form-horizontal">
  964.                                <div>
  965.                                    <input asp-for="@Model.CurrentLogins[index].LoginProvider" name="LoginProvider" type="hidden" />
  966.                                    <input asp-for="@Model.CurrentLogins[index].ProviderKey" name="ProviderKey" type="hidden" />
  967.                                    <input type="submit" class="btn btn-default" value="Remove" title="Remove this @Model.CurrentLogins[index].LoginProvider login from your account" />
  968.                                </div>
  969.                            </form>
  970.                        }
  971.                        else
  972.                        {
  973.                            @: &nbsp;
  974.                        }
  975.                    </td>
  976.                </tr>
  977.            }
  978.        </tbody>
  979.    </table>
  980. }
  981. @if (Model.OtherLogins.Count > 0)
  982. {
  983.    <h4>Add another service to log in.</h4>
  984.    <hr />
  985.    <form asp-controller="Manage" asp-action="LinkLogin" method="post" class="form-horizontal">
  986.        <div id="socialLoginList">
  987.            <p>
  988.                @foreach (var provider in Model.OtherLogins)
  989.                {
  990.                    <button type="submit" class="btn btn-default" name="provider" value="@provider.AuthenticationScheme" title="Log in using your @provider.DisplayName account">@provider.AuthenticationScheme</button>
  991.                }
  992.            </p>
  993.        </div>
  994.    </form>
  995. }
  996.  
  997.  
  998.  
  999. @model Beerhall.Models.ViewModels.ManageViewModels.SetPasswordViewModel
  1000. @{
  1001.    ViewData["Title"] = "Set Password";
  1002. }
  1003.  
  1004. <p class="text-info">
  1005.    You do not have a local username/password for this site. Add a local
  1006.    account so you can log in without an external login.
  1007. </p>
  1008.  
  1009. <form asp-controller="Manage" asp-action="SetPassword" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
  1010.    <h4>Set your password</h4>
  1011.    <hr />
  1012.    <div asp-validation-summary="All" class="text-danger"></div>
  1013.    <div class="form-group">
  1014.        <label asp-for="NewPassword" class="col-md-2 control-label"></label>
  1015.        <div class="col-md-10">
  1016.            <input asp-for="NewPassword" class="form-control" />
  1017.            <span asp-validation-for="NewPassword" class="text-danger"></span>
  1018.        </div>
  1019.    </div>
  1020.    <div class="form-group">
  1021.        <label asp-for="ConfirmPassword" class="col-md-2 control-label"></label>
  1022.        <div class="col-md-10">
  1023.            <input asp-for="ConfirmPassword" class="form-control" />
  1024.            <span asp-validation-for="ConfirmPassword" class="text-danger"></span>
  1025.        </div>
  1026.    </div>
  1027.    <div class="form-group">
  1028.        <div class="col-md-offset-2 col-md-10">
  1029.            <button type="submit" class="btn btn-default">Set password</button>
  1030.        </div>
  1031.    </div>
  1032. </form>
  1033.  
  1034. @section Scripts {
  1035.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  1036. }
  1037.  
  1038.  
  1039.  
  1040. @model Beerhall.Models.ViewModels.ManageViewModels.VerifyPhoneNumberViewModel
  1041. @{
  1042.    ViewData["Title"] = "Verify Phone Number";
  1043. }
  1044.  
  1045. <h2>@ViewData["Title"].</h2>
  1046.  
  1047. <form asp-controller="Manage" asp-action="VerifyPhoneNumber" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
  1048.    <input asp-for="PhoneNumber" type="hidden" />
  1049.    <h4>Add a phone number.</h4>
  1050.    <h5>@ViewData["Status"]</h5>
  1051.    <hr />
  1052.    <div asp-validation-summary="All" class="text-danger"></div>
  1053.    <div class="form-group">
  1054.        <label asp-for="Code" class="col-md-2 control-label"></label>
  1055.        <div class="col-md-10">
  1056.            <input asp-for="Code" class="form-control" />
  1057.            <span asp-validation-for="Code" class="text-danger"></span>
  1058.        </div>
  1059.    </div>
  1060.    <div class="form-group">
  1061.        <div class="col-md-offset-2 col-md-10">
  1062.            <button type="submit" class="btn btn-default">Submit</button>
  1063.        </div>
  1064.    </div>
  1065. </form>
  1066.  
  1067. @section Scripts {
  1068.    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
  1069. }
  1070.  
  1071.  
  1072.  
  1073. <!DOCTYPE html>
  1074. <html>
  1075. <head>
  1076.    <meta charset="utf-8" />
  1077.    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  1078.    <title>@ViewData["Title"]</title>
  1079.  
  1080.    <environment names="Development">
  1081.        <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
  1082.        <link rel="stylesheet" href="~/css/site.css" />
  1083.    </environment>
  1084.    <environment names="Staging,Production">
  1085.        <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.min.css"
  1086.              asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
  1087.              asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
  1088.        <link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
  1089.    </environment>
  1090. </head>
  1091. <body>
  1092.    <div class="navbar navbar-inverse navbar-fixed-top">
  1093.        <div class="container">
  1094.            <div class="navbar-header">
  1095.                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  1096.                    <span class="sr-only">Toggle navigation</span>
  1097.                    <span class="icon-bar"></span>
  1098.                    <span class="icon-bar"></span>
  1099.                    <span class="icon-bar"></span>
  1100.                </button>
  1101.                <a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">Beerhall</a>
  1102.            </div>
  1103.            <div class="navbar-collapse collapse">
  1104.                <ul class="nav navbar-nav">
  1105.                    <li><a asp-area="" asp-controller="Brewer" asp-action="Index">Brewers</a></li>
  1106.                    <li><a asp-area="" asp-controller="Store" asp-action="Index">Store</a></li>
  1107.                    <li><a asp-area="" asp-controller="Cart" asp-action="Index">Cart</a></li>
  1108.                    <li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
  1109.                    <li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li>
  1110.                </ul>
  1111.                @await Html.PartialAsync("_LoginPartial")
  1112.            </div>
  1113.        </div>
  1114.    </div>
  1115.    <div class="container body-content">
  1116.        @if (TempData["message"] != null) {
  1117.            <div class="alert alert-success">@TempData["message"]</div>
  1118.        }
  1119.        @if (TempData["error"] != null) {
  1120.            <div class="alert alert-warning">@TempData["error"]</div>
  1121.        }
  1122.        @RenderBody()
  1123.        <hr />
  1124.        <footer>
  1125.            <p>&copy; 2016 - Beerhall</p>
  1126.        </footer>
  1127.    </div>
  1128.  
  1129.    <environment names="Development">
  1130.        <script src="~/lib/jquery/dist/jquery.js"></script>
  1131.        <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
  1132.        <script src="~/js/site.js" asp-append-version="true"></script>
  1133.    </environment>
  1134.    <environment names="Staging,Production">
  1135.        <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js"
  1136.                asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
  1137.                asp-fallback-test="window.jQuery">
  1138.        </script>
  1139.        <script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/bootstrap.min.js"
  1140.                asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
  1141.                asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
  1142.        </script>
  1143.        <script src="~/js/site.min.js" asp-append-version="true"></script>
  1144.    </environment>
  1145.  
  1146.    @RenderSection("scripts", required: false)
  1147. </body>
  1148. </html>
  1149.  
  1150.  
  1151.  
  1152. @using Beerhall.Models.Domain
  1153.  
  1154. @inject SignInManager<ApplicationUser> SignInManager
  1155. @inject UserManager<ApplicationUser> UserManager
  1156.  
  1157. @if (SignInManager.IsSignedIn(User))
  1158. {
  1159.    <form asp-area="" asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="navbar-right">
  1160.        <ul class="nav navbar-nav navbar-right">
  1161.            <li>
  1162.                <a asp-area="" asp-controller="Manage" asp-action="Index" title="Manage">Hello @UserManager.GetUserName(User)!</a>
  1163.            </li>
  1164.            <li>
  1165.                <button type="submit" class="btn btn-link navbar-btn navbar-link">Log off</button>
  1166.            </li>
  1167.        </ul>
  1168.    </form>
  1169. }
  1170. else
  1171. {
  1172.    <ul class="nav navbar-nav navbar-right">
  1173.        <li><a asp-area="" asp-controller="Account" asp-action="Register">Register</a></li>
  1174.        <li><a asp-area="" asp-controller="Account" asp-action="Login">Log in</a></li>
  1175.    </ul>
  1176. }
  1177.  
  1178.  
  1179.  
  1180. <environment names="Development">
  1181.    <script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
  1182.    <script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
  1183. </environment>
  1184. <environment names="Staging,Production">
  1185.    <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"
  1186.            asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
  1187.            asp-fallback-test="window.jQuery && window.jQuery.validator">
  1188.    </script>
  1189.    <script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js"
  1190.            asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
  1191.            asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive">
  1192.    </script>
  1193. </environment>
  1194.  
  1195.  
  1196.  
  1197. @{
  1198.    ViewData["Title"] = "Error";
  1199. }
  1200.  
  1201. <h1 class="text-danger">Error.</h1>
  1202. <h2 class="text-danger">An error occurred while processing your request.</h2>
  1203.  
  1204. <h3>Development Mode</h3>
  1205. <p>
  1206.    Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
  1207. </p>
  1208. <p>
  1209.    <strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application.
  1210. </p>
  1211.  
  1212.  
  1213.  
  1214. @using Beerhall
  1215. @using Beerhall.Models
  1216. @using Beerhall.Models.ViewModels.BrewerViewModels
  1217. @using Microsoft.AspNetCore.Identity
  1218. @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
  1219.  
  1220.  
  1221.  
  1222. @model IEnumerable<Beerhall.Models.Domain.Beer>
  1223.  
  1224. @{
  1225.    ViewData["Title"] = "The Beer Store";
  1226. }
  1227.  
  1228. <h2>@ViewData["Title"]</h2>
  1229. @foreach (var beer in Model) {
  1230.    <div class="col-md-6 col-xs-12">
  1231.        <img src="~/images/beers/placeholder.gif" alt="@beer.Name" class="pull-left" />
  1232.        <h3>
  1233.            @beer.Name
  1234.            <span class="pull-right">@($"{beer.Price:N2} €")</span>
  1235.        </h3>
  1236.        <form asp-controller="Cart" asp-action="Add" asp-route-id="@beer.BeerId">
  1237.            <div class="form-group pull-right">
  1238.                <label class="sr-only" for="quantity">Quantity</label>
  1239.                <input type="number" name="quantity" value="1" min="1" style="width:5em" />
  1240.                <button type="submit" class="btn btn-default">
  1241.                    <span class="glyphicon glyphicon-shopping-cart"></span> Add to cart
  1242.                </button>
  1243.            </div>
  1244.        </form>
  1245.    </div>
  1246. }
  1247. <div class="clearfix"></div>
  1248.  
  1249.  
  1250. using System.IO;
  1251. using Microsoft.AspNetCore.Hosting;
  1252.  
  1253. namespace Beerhall
  1254. {
  1255.    public class Program
  1256.    {
  1257.        public static void Main(string[] args)
  1258.        {
  1259.            var host = new WebHostBuilder()
  1260.                .UseKestrel()
  1261.                .UseContentRoot(Directory.GetCurrentDirectory())
  1262.                .UseIISIntegration()
  1263.                .UseStartup<Startup>()
  1264.                .Build();
  1265.  
  1266.            host.Run();
  1267.        }
  1268.    }
  1269. }
  1270.  
  1271.  
  1272.  
  1273. using System.Security.Claims;
  1274. using Microsoft.AspNetCore.Builder;
  1275. using Microsoft.AspNetCore.Hosting;
  1276. using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
  1277. using Microsoft.EntityFrameworkCore;
  1278. using Microsoft.Extensions.Configuration;
  1279. using Microsoft.Extensions.DependencyInjection;
  1280. using Microsoft.Extensions.Logging;
  1281. using Beerhall.Data;
  1282. using Beerhall.Data.Repositories;
  1283. using Beerhall.Filters;
  1284. using Beerhall.Services;
  1285. using Beerhall.Models.Domain;
  1286. using Microsoft.AspNetCore.Http;
  1287.  
  1288. namespace Beerhall
  1289. {
  1290.    public class Startup
  1291.    {
  1292.        public Startup(IHostingEnvironment env)
  1293.        {
  1294.            var builder = new ConfigurationBuilder()
  1295.                .SetBasePath(env.ContentRootPath)
  1296.                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
  1297.                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
  1298.  
  1299.            if (env.IsDevelopment())
  1300.            {
  1301.                // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
  1302.                builder.AddUserSecrets();
  1303.            }
  1304.  
  1305.            builder.AddEnvironmentVariables();
  1306.            Configuration = builder.Build();
  1307.        }
  1308.  
  1309.        public IConfigurationRoot Configuration { get; }
  1310.  
  1311.        // This method gets called by the runtime. Use this method to add services to the container.
  1312.        public void ConfigureServices(IServiceCollection services)
  1313.        {
  1314.            // Add framework services.
  1315.            services.AddDbContext<ApplicationDbContext>(options =>
  1316.                options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
  1317.  
  1318.            services.AddIdentity<ApplicationUser, IdentityRole>(options => {
  1319.                options.Cookies.ApplicationCookie.AccessDeniedPath = new PathString("/Brewer/Index");
  1320.            })
  1321.                .AddEntityFrameworkStores<ApplicationDbContext>()
  1322.                .AddDefaultTokenProviders();
  1323.  
  1324.            services.AddAuthorization(options => {
  1325.                options.AddPolicy("AdminOnly", policy => policy.RequireClaim(ClaimTypes.Role, "admin"));
  1326.                options.AddPolicy("Customer", policy => policy.RequireClaim(ClaimTypes.Role, "customer"));
  1327.            });
  1328.  
  1329.            services.AddSession();
  1330.  
  1331.            services.AddMvc();
  1332.  
  1333.            // Add application services.
  1334.            services.AddTransient<IEmailSender, AuthMessageSender>();
  1335.            services.AddTransient<ISmsSender, AuthMessageSender>();
  1336.            services.AddScoped<IBrewerRepository, BrewerRepository>();
  1337.            services.AddScoped<ILocationRepository, LocationRepository>();
  1338.            services.AddScoped<IBeerRepository, BeerRepository>();
  1339.            services.AddScoped<ICustomerRepository, CustomerRepository>();
  1340.            services.AddScoped<CartSessionFilter>();
  1341.            services.AddScoped<CustomerFilter>();
  1342.            services.AddScoped<BeerhallDataInitializer>();
  1343.  
  1344.        }
  1345.  
  1346.        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
  1347.        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, BeerhallDataInitializer beerhallDataInitializer)
  1348.        {
  1349.            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
  1350.            loggerFactory.AddDebug();
  1351.  
  1352.            if (env.IsDevelopment())
  1353.            {
  1354.                app.UseDeveloperExceptionPage();
  1355.                app.UseDatabaseErrorPage();
  1356.                app.UseBrowserLink();
  1357.            }
  1358.            else
  1359.            {
  1360.                app.UseExceptionHandler("/Home/Error");
  1361.            }
  1362.  
  1363.            app.UseStaticFiles();
  1364.            app.UseStatusCodePages();
  1365.            app.UseSession();
  1366.            app.UseIdentity();
  1367.  
  1368.            // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715
  1369.  
  1370.            app.UseMvc(routes =>
  1371.            {
  1372.                routes.MapRoute(
  1373.                    name: "default",
  1374.                    template: "{controller=Brewer}/{action=Index}/{id?}");
  1375.            });
  1376.  
  1377.            beerhallDataInitializer.InitializeData().Wait();
  1378.        }
  1379.    }
  1380. }
  1381.  
  1382.  
  1383.  
  1384. {
  1385.  "userSecretsId": "aspnet-Beerhall-5560a25f-a16f-40ef-bad4-59749740753c",
  1386.  
  1387.  "dependencies": {
  1388.    "Microsoft.NETCore.App": {
  1389.      "version": "1.0.1",
  1390.      "type": "platform"
  1391.    },
  1392.    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
  1393.    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
  1394.    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
  1395.    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
  1396.    "Microsoft.AspNetCore.Mvc": "1.0.1",
  1397.    "Microsoft.AspNetCore.Razor.Tools": {
  1398.      "version": "1.0.0-preview2-final",
  1399.      "type": "build"
  1400.    },
  1401.    "Microsoft.AspNetCore.Routing": "1.0.1",
  1402.    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
  1403.    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
  1404.    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
  1405.    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
  1406.    "Microsoft.EntityFrameworkCore.SqlServer.Design": {
  1407.      "version": "1.0.1",
  1408.      "type": "build"
  1409.    },
  1410.    "Microsoft.EntityFrameworkCore.Tools": {
  1411.      "version": "1.0.0-preview2-final",
  1412.      "type": "build"
  1413.    },
  1414.    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
  1415.    "Microsoft.Extensions.Configuration.Json": "1.0.0",
  1416.    "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
  1417.    "Microsoft.Extensions.Logging": "1.0.0",
  1418.    "Microsoft.Extensions.Logging.Console": "1.0.0",
  1419.    "Microsoft.Extensions.Logging.Debug": "1.0.0",
  1420.    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
  1421.    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
  1422.    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
  1423.      "version": "1.0.0-preview2-final",
  1424.      "type": "build"
  1425.    },
  1426.    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
  1427.      "version": "1.0.0-preview2-final",
  1428.      "type": "build"
  1429.    },
  1430.    "Microsoft.AspNetCore.Session": "1.0.0"
  1431.  },
  1432.  
  1433.  "tools": {
  1434.    "BundlerMinifier.Core": "2.0.238",
  1435.    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
  1436.    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
  1437.    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
  1438.    "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
  1439.    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
  1440.      "version": "1.0.0-preview2-final",
  1441.      "imports": [
  1442.        "portable-net45+win8"
  1443.      ]
  1444.    }
  1445.  },
  1446.  
  1447.  "frameworks": {
  1448.    "netcoreapp1.0": {
  1449.      "imports": [
  1450.        "dotnet5.6",
  1451.        "portable-net45+win8"
  1452.      ]
  1453.    }
  1454.  },
  1455.  
  1456.  "buildOptions": {
  1457.    "emitEntryPoint": true,
  1458.    "preserveCompilationContext": true
  1459.  },
  1460.  
  1461.  "runtimeOptions": {
  1462.    "configProperties": {
  1463.      "System.GC.Server": true
  1464.    }
  1465.  },
  1466.  
  1467.  "publishOptions": {
  1468.    "include": [
  1469.      "wwwroot",
  1470.      "**/*.cshtml",
  1471.      "appsettings.json",
  1472.      "web.config"
  1473.    ]
  1474.  },
  1475.  
  1476.  "scripts": {
  1477.    "prepublish": [ "bower install", "dotnet bundle" ],
  1478.    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  1479.  }
  1480. }
Add Comment
Please, Sign In to add comment