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.

Full.cshtml 3.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. @model Teknik.Areas.Paste.ViewModels.PasteViewModel
  2. @using Teknik.Areas.Vault.Models
  3. @{
  4. string format = Model.Syntax;
  5. string formatName = "Text";
  6. if (!string.IsNullOrEmpty(format) && HighlightHelper.Languages.ContainsKey(format))
  7. {
  8. formatName = HighlightHelper.Languages[format];
  9. }
  10. }
  11. <bundle src="css/paste.view.min.css" append-version="true"></bundle>
  12. <script>
  13. var createVaultURL = '@Url.SubRouteUrl("vault", "Vault.NewVaultFromService", new { type = "Paste" })';
  14. var deletePasteURL = '@Url.SubRouteUrl("p", "Paste.Delete")';
  15. </script>
  16. <div class="container">
  17. <div class="row text-center">
  18. <div class="col-sm-12 text-center">
  19. <h2><b>@((string.IsNullOrEmpty(Model.Title)) ? "Untitled" : Model.Title)</b> <small>Posted on <time datetime="@Model.DatePosted.ToString("s")">@Model.DatePosted.ToString("dddd, MMMM d, yyyy") at @Model.DatePosted.ToString("h:mm:ss tt")</time> - Format: <b id="syntaxLanguage">@(formatName)</b></small></h2>
  20. </div>
  21. </div>
  22. <hr />
  23. <div class="row">
  24. <div class="col-sm-12 pull-left">
  25. <div class="btn-toolbar" role="toolbar">
  26. <div class="btn-group" role="group">
  27. <a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Simple", new { url = Model.Url })">Simple</a>
  28. <a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Raw", new { url = Model.Url })">Raw</a>
  29. <a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Download", new { url = Model.Url })">Download</a>
  30. </div>
  31. @if (User.Identity.IsAuthenticated && User.Identity.Name == Model.Username)
  32. {
  33. <div class="btn-group pull-right" role="group">
  34. <a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Edit", new { url = Model.Url })"><span class="text-primary">Edit</span></a>
  35. <button type="button" class="btn btn-default" id="delete-paste" data-paste-url="@Model.Url"><span class="text-danger">Delete</span></button>
  36. </div>
  37. }
  38. <div class="btn-group pull-right" role="group">
  39. <button type="button" class="btn btn-default" id="create-vault" data-paste-url="@Model.Url" data-paste-title="@((string.IsNullOrEmpty(Model.Title)) ? "Untitled" : Model.Title)">Create Vault</button>
  40. @if (User.Identity.IsAuthenticated)
  41. {
  42. @if (Model.Vaults != null && Model.Vaults.Any())
  43. {
  44. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Add to Vault <span class="caret"></span></button>
  45. <ul class="dropdown-menu pull-right" id="add-to-vault-menu">
  46. @foreach (Vault item in Model.Vaults)
  47. {
  48. <li><a href="#" class="add-to-vault" data-add-to-vault-url="@Url.SubRouteUrl("vault", "Vault.EditVault", new { url = item.Url, type = "Paste" })" data-paste-url="@Model.Url" data-paste-title="@((string.IsNullOrEmpty(Model.Title)) ? "Untitled" : Model.Title)">@item.Title</a></li>
  49. }
  50. </ul>
  51. }
  52. }
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <br />
  58. <div class="row">
  59. <div class="col-sm-12">
  60. <pre class="line-numbers" id="code"><code class="language-@(format)">@Model.Content</code></pre>
  61. </div>
  62. </div>
  63. </div>
  64. <bundle src="js/paste.view.min.js" append-version="true"></bundle>