| | | 1 | | @model Services.TransactionUtilsServices.TransactionCommentDisplayModel |
| | | 2 | | @using Services.TransactionUtilsServices |
| | | 3 | | |
| | | 4 | | @{ |
| | 0 | 5 | | var embedded = Model.DisplayMode == TransactionCommentDisplayMode.OrderHistoryCard; |
| | 0 | 6 | | var rootClass = embedded ? "oh-tx-comment oh-tx-comment--embedded" : "oh-tx-comment"; |
| | | 7 | | } |
| | | 8 | | |
| | 0 | 9 | | @switch (Model.Kind) |
| | | 10 | | { |
| | | 11 | | case TransactionCommentDisplayKind.Empty: |
| | | 12 | | <span class="text-muted">—</span> |
| | 0 | 13 | | break; |
| | | 14 | | |
| | | 15 | | case TransactionCommentDisplayKind.Generating: |
| | | 16 | | <div class="@rootClass oh-tx-comment--generating"> |
| | | 17 | | <i class="fas fa-hourglass-half me-1" aria-hidden="true"></i> |
| | | 18 | | <span>Комментарий генерируется…</span> |
| | | 19 | | </div> |
| | 0 | 20 | | break; |
| | | 21 | | |
| | | 22 | | case TransactionCommentDisplayKind.Html: |
| | | 23 | | <div class="@rootClass oh-tx-comment--legacy@(Model.IsExpandable ? " oh-tx-comment--collapsible oh-tx-comment--c |
| | 0 | 24 | | <div class="oh-tx-comment-legacy-body">@Html.Raw(Model.Raw)</div> |
| | 0 | 25 | | @if (Model.IsExpandable) |
| | | 26 | | { |
| | | 27 | | <button type="button" class="oh-tx-comment-toggle" data-oh-tx-comment-toggle aria-expanded="false"> |
| | | 28 | | Показать полностью |
| | | 29 | | </button> |
| | | 30 | | } |
| | | 31 | | </div> |
| | 0 | 32 | | break; |
| | | 33 | | |
| | | 34 | | case TransactionCommentDisplayKind.Plain: |
| | | 35 | | <div class="@rootClass oh-tx-comment--plain@(Model.IsExpandable ? " oh-tx-comment--collapsible oh-tx-comment--co |
| | 0 | 36 | | <div class="oh-tx-comment-plain-body">@Model.Raw</div> |
| | 0 | 37 | | @if (Model.IsExpandable) |
| | | 38 | | { |
| | | 39 | | <button type="button" class="oh-tx-comment-toggle" data-oh-tx-comment-toggle aria-expanded="false"> |
| | | 40 | | Показать полностью |
| | | 41 | | </button> |
| | | 42 | | } |
| | | 43 | | </div> |
| | 0 | 44 | | break; |
| | | 45 | | |
| | | 46 | | case TransactionCommentDisplayKind.Structured: |
| | | 47 | | <div class="@rootClass oh-tx-comment--structured@(embedded ? " oh-tx-comment--embedded" : string.Empty)@(Model.I |
| | 0 | 48 | | @if (Model.Meta.Count > 0) |
| | | 49 | | { |
| | | 50 | | <dl class="oh-tx-comment-meta"> |
| | 0 | 51 | | @foreach (var item in Model.Meta) |
| | | 52 | | { |
| | | 53 | | <div class="oh-tx-comment-meta-item"> |
| | 0 | 54 | | <dt>@item.Label</dt> |
| | 0 | 55 | | <dd>@item.Value</dd> |
| | | 56 | | </div> |
| | | 57 | | } |
| | | 58 | | </dl> |
| | | 59 | | } |
| | | 60 | | |
| | 0 | 61 | | @if (Model.Sections.Count > 0) |
| | | 62 | | { |
| | | 63 | | <div class="oh-tx-comment-sections"> |
| | 0 | 64 | | @foreach (var section in Model.Sections) |
| | | 65 | | { |
| | 0 | 66 | | var paragraphs = TransactionCommentDisplayFormatter.SplitParagraphs(section.Body); |
| | | 67 | | <div class="oh-tx-comment-section@(section.IsWarning ? " oh-tx-comment-section--warning" : strin |
| | 0 | 68 | | @if (!string.IsNullOrWhiteSpace(section.Title)) |
| | | 69 | | { |
| | | 70 | | <div class="oh-tx-comment-section__title"> |
| | 0 | 71 | | @if (section.IsWarning) |
| | | 72 | | { |
| | | 73 | | <i class="fas fa-triangle-exclamation me-1" aria-hidden="true"></i> |
| | | 74 | | } |
| | 0 | 75 | | @(section.Title) |
| | | 76 | | </div> |
| | | 77 | | } |
| | 0 | 78 | | @foreach (var paragraph in paragraphs) |
| | | 79 | | { |
| | 0 | 80 | | <p class="oh-tx-comment-section__text">@paragraph</p> |
| | | 81 | | } |
| | | 82 | | </div> |
| | | 83 | | } |
| | | 84 | | </div> |
| | | 85 | | } |
| | | 86 | | |
| | 0 | 87 | | @if (Model.IsExpandable) |
| | | 88 | | { |
| | | 89 | | <button type="button" class="oh-tx-comment-toggle" data-oh-tx-comment-toggle aria-expanded="false"> |
| | | 90 | | Показать полностью |
| | | 91 | | </button> |
| | | 92 | | } |
| | | 93 | | </div> |
| | | 94 | | break; |
| | | 95 | | } |