@model ResoursesManager.Models.Resource

@{
    ViewBag.Title = "Leírás";
}

<h2>Erőforrás</h2>

<div>
    <h4>Erőforrás részletei</h4>
    <hr />

    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.ImagePath)
        </dt>
        <dd>
            <img src="@Url.Action("GetImage", "Resources", new { path = Model.ImagePath } )" class="img-responsive" />
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Name)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Name)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.AssetTag)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.AssetTag)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.TimeLimit)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.TimeLimit)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Description)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Description)
        </dd>

        <dt>

            @Html.DisplayNameFor(model => model.Users)
        </dt>
        <dd>
            <ul>
                @foreach (var item in Model.Users)
                {
                    <li>
                        @Html.DisplayFor(m => item.UserName)
                    </li>
                }
            </ul>
        </dd>

    </dl>
</div>

<p>
    <a href="javascript:void(0);" onclick="history.go(-1);" class="btn btn-default">Vissza</a>
    @if (User.Identity.IsAuthenticated)
    {
        if (User.IsInRole("Admin"))
        {
            @Html.ActionLink("Módosítás", "Edit", new { id = Model.Id }, new { @class = "btn btn-warning" })

        }
    }

    @Html.ActionLink("Foglalás", "Create", "Reservations", new { ResourceId = Model.Id }, new { @class = "btn btn-primary" })
</p>

@Html.Partial("ReservationsPartial", Model.Reservation)


