The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ViewVault.cshtml 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. @model Teknik.Areas.Vault.ViewModels.VaultViewModel
  2. @using Teknik.Areas.Vault.ViewModels
  3. @using Teknik.Utilities
  4. @using Teknik.Pygments
  5. @Styles.Render("~/Content/vault")
  6. <script type="text/javascript">
  7. var deleteVaultURL = '@Url.SubRouteUrl("v", "Vault.DeleteVault")';
  8. </script>
  9. <div class="container">
  10. <div class="row text-center">
  11. <div class="col-sm-12 text-center">
  12. <h2><b>@((string.IsNullOrEmpty(Model.Title)) ? "Untitled" : Model.Title)</b> <small>Created on <time datetime="@Model.DateCreated.ToString("s")">@Model.DateCreated.ToString("dddd, MMMM d, yyyy") at @Model.DateCreated.ToString("h:mm:ss tt")</time></small></h2>
  13. </div>
  14. </div>
  15. @if (User.Identity.IsAuthenticated && Model.User.Username == User.Identity.Name)
  16. {
  17. <div class="row">
  18. <div class="col-sm-12">
  19. <div role="group" class="btn-group pull-right">
  20. <a role="button" class="btn btn-primary edit-vault-button" href="@Url.SubRouteUrl("v", "Vault.EditVault", new { url = Model.Url })">Edit</a>
  21. <button role="button" class="btn btn-danger delete-vault-button" data-vault-url="@Model.Url">Delete</button>
  22. </div>
  23. </div>
  24. </div>
  25. }
  26. @if (!string.IsNullOrEmpty(Model.Description))
  27. {
  28. <hr />
  29. <div class="row">
  30. <div class="col-sm-10 col-sm-offset-1">
  31. <p>@Model.Description</p>
  32. </div>
  33. </div>
  34. }
  35. <br />
  36. @foreach (VaultItemViewModel item in Model.Items)
  37. {
  38. Type itemType = item.GetType();
  39. if (itemType == typeof(PasteItemViewModel))
  40. {
  41. PasteItemViewModel pasteModel = (PasteItemViewModel)item;
  42. @Html.Partial("~/Areas/Vault/Views/Vault/PasteItem.cshtml", pasteModel)
  43. }
  44. else if (itemType == typeof(UploadItemViewModel))
  45. {
  46. UploadItemViewModel uploadModel = (UploadItemViewModel)item;
  47. @Html.Partial("~/Areas/Vault/Views/Vault/UploadItem.cshtml", uploadModel)
  48. }
  49. else
  50. {
  51. // Nothing to see here folks. :)
  52. }
  53. }
  54. </div>
  55. @Scripts.Render("~/bundles/vault")