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.

ViewServiceData.cshtml 9.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. @model Teknik.Areas.Users.ViewModels.ViewServiceDataViewModel
  2. <script>
  3. var deleteDataURL = '@Url.SubRouteUrl("account", "User.Action", new { action = "DeleteData" })';
  4. </script>
  5. <div class="container">
  6. <div class="row">
  7. <div class="col-sm-12">
  8. <ul class="nav nav-tabs" id="myTab">
  9. <li class="active"><a href="#uploads" data-toggle="tab"> Uploads </a></li>
  10. <li><a href="#pastes" data-toggle="tab"> Pastes </a></li>
  11. <li><a href="#shortenedUrls" data-toggle="tab"> Shortened Urls </a></li>
  12. <li><a href="#vaults" data-toggle="tab"> Vaults </a></li>
  13. </ul>
  14. <div class="tab-content">
  15. <div class="tab-pane active" id="uploads">
  16. @foreach (Teknik.Areas.Upload.Models.Upload upload in Model.Uploads)
  17. {
  18. <div class="panel panel-default" id="@upload.Url">
  19. <div class="panel-heading text-center">
  20. <a id="upload-url" href="@Url.SubRouteUrl("u", "Upload.Download", new { file = upload.Url })">@Url.SubRouteUrl("u", "Upload.Download", new { file = upload.Url })</a>
  21. </div>
  22. <div class="panel-body">
  23. <div class="col-sm-2 text-center">
  24. <label for="size">Size</label>
  25. <p id="size">@StringHelper.GetBytesReadable(upload.ContentLength)</p>
  26. </div>
  27. <div class="col-sm-3 text-center">
  28. <label for="type">Type</label>
  29. <p id="type">@upload.ContentType</p>
  30. </div>
  31. <div class="col-sm-4 text-center">
  32. <label for="dateUploaded">Date Uploaded</label>
  33. <p id="dateUploaded"><time datetime="@upload.DateUploaded.ToString("s")">@upload.DateUploaded.ToString("MMMM dd, yyyy")</time></p>
  34. </div>
  35. <div class="col-sm-2 text-center">
  36. <label for="downloads">Downloads</label>
  37. <p id="downloads">@upload.Downloads</p>
  38. </div>
  39. <div class="col-sm-1 text-center">
  40. <p id="delete-upload"><button role="button" class="btn btn-danger delete-upload-button" data-upload-id="@upload.Url">Delete</button></p>
  41. </div>
  42. </div>
  43. </div>
  44. }
  45. </div><!--/tab-pane-->
  46. <div class="tab-pane" id="pastes">
  47. @foreach (Teknik.Areas.Paste.Models.Paste paste in Model.Pastes)
  48. {
  49. <div class="panel panel-default" id="@paste.Url">
  50. <div class="panel-heading text-center">
  51. <a href="@Url.SubRouteUrl("paste", "Paste.View", new { url = paste.Url })">@(string.IsNullOrEmpty(paste.Title) ? "Untitled Paste" : paste.Title)</a>
  52. </div>
  53. <div class="panel-body">
  54. <div class="col-sm-1 text-center">
  55. <label for="syntax">Syntax</label>
  56. <p id="syntax">@paste.Syntax</p>
  57. </div>
  58. <div class="col-sm-3 text-center">
  59. <label for="datePosted">Date Posted</label>
  60. <p id="datePosted"><time datetime="@paste.DatePosted.ToString("s")">@paste.DatePosted.ToString("MMMM dd, yyyy")</time></p>
  61. </div>
  62. <div class="col-sm-3 text-center">
  63. <label for="expireDate">Expire Date</label>
  64. @{
  65. string expireDate = "Never";
  66. if (paste.ExpireDate != null)
  67. {
  68. expireDate = "<time datetime=\"" + paste.ExpireDate.Value.ToString("s") + "\">" + paste.ExpireDate.Value.ToString("MMMM dd, yyyy") + "</time>";
  69. }
  70. }
  71. <p id="expireDate">@Html.Raw(expireDate)</p>
  72. </div>
  73. <div class="col-sm-2 text-center">
  74. <label for="maxViews">Max Views</label>
  75. <p id="maxViews">@paste.MaxViews</p>
  76. </div>
  77. <div class="col-sm-2 text-center">
  78. <label for="views">Views</label>
  79. <p id="views">@paste.Views</p>
  80. </div>
  81. <div class="col-sm-1 text-center">
  82. <p id="delete-paste"><button role="button" class="btn btn-danger delete-paste-button" data-paste-id="@paste.Url">Delete</button></p>
  83. </div>
  84. </div>
  85. </div>
  86. }
  87. </div>
  88. <div class="tab-pane" id="shortenedUrls">
  89. @foreach (Teknik.Areas.Shortener.Models.ShortenedUrl url in Model.ShortenedUrls)
  90. {
  91. string shortUrl = string.Format("{0}://{1}/{2}", Context.Request.Scheme, Config.ShortenerConfig.ShortenerHost, url.ShortUrl);
  92. if (Config.DevEnvironment)
  93. {
  94. shortUrl = Url.SubRouteUrl("shortened", "Shortener.View", new { url = url.ShortUrl });
  95. }
  96. <div class="panel panel-default" id="@url.ShortUrl">
  97. <div class="panel-heading text-center">
  98. <a href="@url.OriginalUrl">@url.OriginalUrl</a>
  99. </div>
  100. <div class="panel-body">
  101. <div class="col-sm-5 text-center">
  102. <label for="shortUrl">Short Url</label>
  103. <p id="shortUrl"><a href="@shortUrl">@shortUrl</a></p>
  104. </div>
  105. <div class="col-sm-4 text-center">
  106. <label for="dateAdded">Date Added</label>
  107. <p id="dateAdded"><time datetime="@url.DateAdded.ToString("s")">@url.DateAdded.ToString("MMMM dd, yyyy")</time></p>
  108. </div>
  109. <div class="col-sm-2 text-center">
  110. <label for="views">Views</label>
  111. <p id="views">@url.Views</p>
  112. </div>
  113. <div class="col-sm-1 text-center">
  114. <p id="delete-shorten"><button role="button" class="btn btn-danger delete-shorten-button" data-shorten-id="@url.ShortUrl">Delete</button></p>
  115. </div>
  116. </div>
  117. </div>
  118. }
  119. </div>
  120. <div class="tab-pane" id="vaults">
  121. @foreach (Teknik.Areas.Vault.Models.Vault vault in Model.Vaults)
  122. {
  123. <div class="panel panel-default" id="@vault.Url">
  124. <div class="panel-heading text-center">
  125. <a href="@Url.SubRouteUrl("v", "Vault.ViewVault", new { id = vault.Url })">@(string.IsNullOrEmpty(vault.Title) ? "Vault" : vault.Title)</a>
  126. </div>
  127. <div class="panel-body">
  128. <div class="col-sm-5 text-center">
  129. <label for="dateAdded">Date Created</label>
  130. <p id="dateAdded"><time datetime="@vault.DateCreated.ToString("s")">@vault.DateCreated.ToString("MMMM dd, yyyy HH:mm:ss tt")</time></p>
  131. </div>
  132. <div class="col-sm-4 text-center">
  133. <label for="dateAdded">Date Edited</label>
  134. <p id="dateAdded"><time datetime="@vault.DateEdited.ToString("s")">@vault.DateEdited.ToString("MMMM dd, yyyy HH:mm:ss tt")</time></p>
  135. </div>
  136. <div class="col-sm-2 text-center">
  137. <label for="views">Views</label>
  138. <p id="views">@vault.Views</p>
  139. </div>
  140. <div class="col-sm-1 text-center">
  141. <p id="delete-vault"><button role="button" class="btn btn-danger delete-vault-button" data-vault-id="@vault.Url">Delete</button></p>
  142. </div>
  143. </div>
  144. </div>
  145. }
  146. </div>
  147. </div><!--/tab-content-->
  148. </div>
  149. </div>
  150. </div>
  151. <bundle src="js/user.serviceData.min.js" append-version="true"></bundle>