﻿@model System.Linq.IQueryable<ForumSystem.Web.ViewModels.Answers.AnswerViewModel>

@using ForumSystem.Web.ViewModels.Answers;

@foreach (var answer in Model)
{
    <div class="panel panel-success">
        <div class="panel-heading">
            <h3>
                @answer.Post.Title
            </h3>
        </div>
        <div class="panel-body">
            <div class="panel-body">
                <p>@Html.Raw(answer.Content)</p>
                @if (@answer.Author != null)
                {
                    <p>@answer.Author.Email</p>
                }
                else
                {
                    @Html.Display("Anonymous")
                }
            </div>
            <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="bottom" title="Tooltip on left">
                @Html.ActionLink("Delete", "Delete", "Answer", new { id = answer.Id }, null)
            </button>
        </div>
    </div>
}



﻿@model System.Linq.IQueryable<ForumSystem.Web.ViewModels.Answers.AnswerViewModel>

@using ForumSystem.Web.ViewModels.Answers;

<div class="panel panel-success">
    <div class="panel-heading">
        <h3>
            @Html.ActionLink(Model.FirstOrDefault().Post.Title, "Display", "Questions", new { id = Model.FirstOrDefault().PostId, url = "new" }, null)
        </h3>
    </div>
    <div class="panel-body">
            @foreach (var answer in Model)
            {
                <div class="panel-body">
                    <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                    <p>@Html.Raw(answer.Content)</p>
                    @if (@answer.Author != null)
                    {
                        <p>@answer.Author.Email</p>
                    }
                    else
                    {
                        @Html.Display("Anonymous")
                    }
                </div>
            <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="bottom" title="Tooltip on left">
                @Html.ActionLink("Delete", "Delete", "Answer", new { id = answer.Id }, null)
            </button>
            }
        </div>
    </div>
Update view of all answers
Update view of all answers
