|  | 
| 1 | 1 | @using DigitalLearningSolutions.Data.Models.Frameworks; | 
| 2 | 2 | @model CommentReplies; | 
| 3 | 3 | <div class="@(Model.UserIsCommenter ? "nhsuk-card comment comment-mine nhsuk-u-margin-bottom-2" : "nhsuk-card comment comment-other nhsuk-u-margin-bottom-3")"> | 
| 4 |  | -  <div class="nhsuk-card__content nhsuk-u-padding-4"> | 
| 5 |  | -    <div class="nhsuk-grid-row"> | 
| 6 |  | -      <div class="nhsuk-grid-column-full"> | 
|  | 4 | +    <div class="nhsuk-card__content nhsuk-u-padding-4"> | 
| 7 | 5 |         <div class="nhsuk-grid-row"> | 
| 8 |  | -          <div class="nhsuk-grid-column-full"> | 
| 9 |  | -            <h3 class="nhsuk-card__heading nhsuk-heading-xs heading-xxs" id="@Model.ID-header"> | 
| 10 |  | -              @Model.Commenter <span class="heading-light">@Model.AddedDate.ToString("dddd dd MMMM yyyy h:mm tt")</span> | 
| 11 |  | -            </h3> | 
| 12 |  | -            <p class="nhsuk-body-s"> | 
| 13 |  | -              @Html.Raw(Model.Comments) | 
| 14 |  | -            </p> | 
| 15 |  | -          </div> | 
| 16 |  | -        </div> | 
| 17 |  | -        <div class="grid-column-ninety"> | 
| 18 |  | -          @if (Model.Replies.Any()) | 
| 19 |  | -          { | 
| 20 |  | -            if (@ViewContext.RouteData.Values["commentId"] == null) | 
| 21 |  | -            { | 
| 22 |  | -              <details class="nhsuk-details"> | 
| 23 |  | -                <summary class="nhsuk-details__summary"> | 
| 24 |  | -                  <span class="nhsuk-details__summary-text"> | 
| 25 |  | -                    @Model.Replies.Count() @(Model.Replies.Count() > 1 ? "Replies" : "Reply") | 
| 26 |  | -                  </span> | 
| 27 |  | -                </summary> | 
| 28 |  | -                <div class="nhsuk-details__text"> | 
| 29 |  | -                  @foreach (var item in Model.Replies.Select((value, i) => new { i, value })) | 
| 30 |  | -                  { | 
| 31 |  | -                    <partial name="_ReplyCard.cshtml" model="item.value" view-data="@(new ViewDataDictionary(ViewData) { { "isLast", (item.i == Model.Replies.Count-1 ? true :false)} })" /> | 
| 32 |  | -                  } | 
|  | 6 | +            <div class="nhsuk-grid-column-full"> | 
|  | 7 | +                <div class="nhsuk-grid-row"> | 
|  | 8 | +                    <div class="nhsuk-grid-column-full"> | 
|  | 9 | +                        <h3 class="nhsuk-card__heading nhsuk-heading-xs heading-xxs" id="@Model.ID-header"> | 
|  | 10 | +                            @Model.Commenter <span class="heading-light">@Model.AddedDate.ToString("dddd dd MMMM yyyy h:mm tt")</span> | 
|  | 11 | +                        </h3> | 
|  | 12 | +                        <p class="nhsuk-body-s"> | 
|  | 13 | +                            @Html.Raw(Model.Comments) | 
|  | 14 | +                        </p> | 
|  | 15 | +                    </div> | 
| 33 | 16 |                 </div> | 
| 34 |  | -              </details> | 
| 35 |  | -            } | 
| 36 |  | -            else | 
| 37 |  | -            { | 
| 38 |  | -              @foreach (var item in Model.Replies.Select((value, i) => new { i, value })) | 
| 39 |  | -              { | 
| 40 |  | -                <partial name="_ReplyCard.cshtml" model="item.value" view-data="@(new ViewDataDictionary(ViewData) { { "isLast", (item.i == Model.Replies.Count-1 ? true :false)} })" /> | 
| 41 |  | -              } | 
| 42 |  | -            } | 
| 43 |  | -          } | 
| 44 |  | -        </div> | 
| 45 |  | -        <div class="nhsuk-grid-column-full"> | 
| 46 |  | -          @if (@ViewContext.RouteData.Values["commentId"] == null) | 
| 47 |  | -          { | 
|  | 17 | +                <div class="grid-column-ninety"> | 
|  | 18 | +                    @if (Model.Replies.Any()) | 
|  | 19 | +                    { | 
|  | 20 | +                        if (@ViewContext.RouteData.Values["commentId"] == null) | 
|  | 21 | +                        { | 
|  | 22 | +                            <details class="nhsuk-details"> | 
|  | 23 | +                                <summary class="nhsuk-details__summary"> | 
|  | 24 | +                                    <span class="nhsuk-details__summary-text"> | 
|  | 25 | +                                        @Model.Replies.Count() @(Model.Replies.Count() > 1 ? "Replies" : "Reply") | 
|  | 26 | +                                    </span> | 
|  | 27 | +                                </summary> | 
|  | 28 | +                                <div class="nhsuk-details__text"> | 
|  | 29 | +                                    @foreach (var item in Model.Replies.Select((value, i) => new { i, value })) | 
|  | 30 | +                                    { | 
|  | 31 | +                                        <partial name="_ReplyCard.cshtml" model="item.value" view-data="@(new ViewDataDictionary(ViewData) { { "isLast", (item.i == Model.Replies.Count - 1 ? true : false) } })" /> | 
|  | 32 | +                                    } | 
|  | 33 | +                                </div> | 
|  | 34 | +                            </details> | 
|  | 35 | +                        } | 
|  | 36 | +                        else | 
|  | 37 | +                        { | 
|  | 38 | +                            @foreach (var item in Model.Replies.Select((value, i) => new { i, value })) | 
|  | 39 | +                            { | 
|  | 40 | +                                <partial name="_ReplyCard.cshtml" model="item.value" view-data="@(new ViewDataDictionary(ViewData) { { "isLast", (item.i == Model.Replies.Count - 1 ? true : false) } })" /> | 
|  | 41 | +                            } | 
|  | 42 | +                        } | 
|  | 43 | +                    } | 
|  | 44 | +                </div> | 
|  | 45 | +                <div class="nhsuk-grid-column-full"> | 
|  | 46 | +                    @if (@ViewContext.RouteData.Values["commentId"] == null) | 
|  | 47 | +                    { | 
| 48 | 48 | 
 | 
| 49 |  | -            <a class="nhsuk-button button-small nhsuk-button--secondary nhsuk-u-margin-bottom-0 nhsuk-u-margin-top-0" | 
| 50 |  | -             role="button" | 
| 51 |  | -             aria-describedby="@Model.ID-header" | 
| 52 |  | -             asp-action="ViewThread" | 
| 53 |  | -             asp-controller="Frameworks" | 
| 54 |  | -             asp-route-frameworkId="@ViewContext.RouteData.Values["frameworkId"]" | 
| 55 |  | -             asp-route-commentId="@Model.ID"> | 
| 56 |  | -              Reply | 
| 57 |  | -            </a> | 
| 58 |  | -            @if (!Model.Replies.Any() && Model.UserIsCommenter) | 
| 59 |  | -            { | 
| 60 |  | -              <a class="nhsuk-button button-small delete-button nhsuk-u-margin-bottom-0 nhsuk-u-margin-top-0" | 
| 61 |  | -             role="button" | 
| 62 |  | -             aria-describedby="@Model.ID-header" | 
| 63 |  | -             asp-action="ArchiveComment" | 
| 64 |  | -             asp-controller="Frameworks" | 
| 65 |  | -             asp-route-commentId="@Model.ID" | 
| 66 |  | -             asp-route-frameworkId="@ViewContext.RouteData.Values["frameworkId"]"> | 
| 67 |  | -                Delete | 
| 68 |  | -              </a> | 
| 69 |  | -            } | 
| 70 |  | -          } | 
| 71 |  | -          else | 
| 72 |  | -          { | 
| 73 |  | -            <hr /> | 
| 74 |  | -            <form method="post"> | 
| 75 |  | -              <div class="nhsuk-form-group"> | 
| 76 |  | -                <label class="nhsuk-label" for="new-comment"> | 
| 77 |  | -                  Post a reply | 
| 78 |  | -                </label> | 
| 79 |  | -                <input type="hidden" value="@Model.Comments" name="parentComment" /> | 
| 80 |  | -                <textarea class="nhsuk-textarea" id="new-comment" name="Comment" rows="3"></textarea> | 
| 81 |  | -              </div> | 
| 82 |  | -              <button class="nhsuk-button" type="submit"> | 
| 83 |  | -                Post | 
| 84 |  | -              </button> | 
| 85 |  | -            </form> | 
| 86 |  | -          } | 
|  | 49 | +                        <a class="nhsuk-button button-small nhsuk-button--secondary nhsuk-u-margin-bottom-0 nhsuk-u-margin-top-0" | 
|  | 50 | +                           role="button" | 
|  | 51 | +                           aria-describedby="@Model.ID-header" | 
|  | 52 | +                           asp-action="ViewThread" | 
|  | 53 | +                           asp-controller="Frameworks" | 
|  | 54 | +                           asp-route-frameworkId="@ViewContext.RouteData.Values["frameworkId"]" | 
|  | 55 | +                           asp-route-commentId="@Model.ID"> | 
|  | 56 | +                            Reply | 
|  | 57 | +                        </a> | 
|  | 58 | +                        @if (!Model.Replies.Any() && Model.UserIsCommenter) | 
|  | 59 | +                        { | 
|  | 60 | +                            <a class="nhsuk-button button-small delete-button nhsuk-u-margin-bottom-0 nhsuk-u-margin-top-0" | 
|  | 61 | +                               role="button" | 
|  | 62 | +                               aria-describedby="@Model.ID-header" | 
|  | 63 | +                               asp-action="ArchiveComment" | 
|  | 64 | +                               asp-controller="Frameworks" | 
|  | 65 | +                               asp-route-commentId="@Model.ID" | 
|  | 66 | +                               asp-route-frameworkId="@ViewContext.RouteData.Values["frameworkId"]"> | 
|  | 67 | +                                Delete | 
|  | 68 | +                            </a> | 
|  | 69 | +                        } | 
|  | 70 | +                    } | 
|  | 71 | +                    else | 
|  | 72 | +                    { | 
|  | 73 | +                        <hr /> | 
|  | 74 | +                        <form method="post"> | 
|  | 75 | +                            <div class="nhsuk-form-group"> | 
|  | 76 | +                                <label class="nhsuk-label" for="new-comment"> | 
|  | 77 | +                                    Post a reply | 
|  | 78 | +                                </label> | 
|  | 79 | +                                <input type="hidden" value="@Model.Comments" name="parentComment" /> | 
|  | 80 | +                                <textarea class="nhsuk-textarea" id="new-comment" name="Comment" autocomplete="off" rows="3"></textarea> | 
|  | 81 | +                            </div> | 
|  | 82 | +                            <button class="nhsuk-button" type="submit"> | 
|  | 83 | +                                Post | 
|  | 84 | +                            </button> | 
|  | 85 | +                        </form> | 
|  | 86 | +                    } | 
| 87 | 87 | 
 | 
|  | 88 | +                </div> | 
|  | 89 | +            </div> | 
| 88 | 90 |         </div> | 
| 89 |  | -      </div> | 
| 90 | 91 |     </div> | 
| 91 |  | -  </div> | 
| 92 | 92 | </div> | 
0 commit comments