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.8KB

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