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 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. </script>
  15. <div class="container">
  16. <div class="row text-center">
  17. <div class="col-sm-12 text-center">
  18. <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>
  19. </div>
  20. </div>
  21. <hr />
  22. <div class="row">
  23. <div class="col-sm-12 pull-left">
  24. <div class="btn-group" role="group">
  25. <a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Simple", new { url = Model.Url })">Simple</a>
  26. <a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Raw", new { url = Model.Url })">Raw</a>
  27. <a role="button" class="btn btn-default" href="@Url.SubRouteUrl("p", "Paste.Download", new { url = Model.Url })">Download</a>
  28. <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>
  29. @if (User.Identity.IsAuthenticated && Model.Vaults != null && Model.Vaults.Any())
  30. {
  31. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Add to Vault <span class="caret"></span></button>
  32. <ul class="dropdown-menu pull-right" id="add-to-vault-menu">
  33. @foreach (Vault item in Model.Vaults)
  34. {
  35. <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>
  36. }
  37. </ul>
  38. }
  39. </div>
  40. </div>
  41. </div>
  42. <br />
  43. <div class="row">
  44. <div class="col-sm-12">
  45. <pre class="line-numbers" id="code"><code class="language-@(format)">@Model.Content</code></pre>
  46. </div>
  47. </div>
  48. </div>
  49. <bundle src="js/paste.view.min.js" append-version="true"></bundle>