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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. @model Teknik.Areas.Paste.ViewModels.PasteCreateViewModel
  2. @using Teknik.Helpers
  3. @using FearTheCowboy.Pygments
  4. @Styles.Render("~/Content/paste")
  5. @Scripts.Render("~/bundles/paste")
  6. <div class="container">
  7. <div class="row">
  8. <div class="col-sm-10 col-sm-offset-1 text-center">
  9. <b>@Html.ValidationSummary(true, "The input is not valid")</b>
  10. </div>
  11. </div>
  12. <div class="row">
  13. <div class="col-sm-12">
  14. <form class="form-horizontal" name="editor" method="post" action="@Url.SubRouteUrl("paste", "Paste.Action", new { action = "Paste" })">
  15. <div class="form-group">
  16. <div class="col-sm-10 col-sm-offset-1">
  17. <textarea class="form-control" name="Content" id="content" rows="20"></textarea>
  18. </div>
  19. </div>
  20. <div class="form-group">
  21. <label for="title" class="col-sm-2 col-sm-offset-1 control-label">Title</label>
  22. <div class="col-sm-4">
  23. <input type="text" class="form-control" name="Title" id="title" placeholder="My Awesome Paste">
  24. </div>
  25. <div class="col-sm-1 col-sm-offset-2">
  26. <button type="submit" class="btn btn-primary" id="pasteSubmit">Submit Paste</button>
  27. </div>
  28. </div>
  29. <div class="form-group">
  30. <label for="syntax" class="col-sm-2 col-sm-offset-1 control-label">Syntax</label>
  31. <div class="col-sm-4">
  32. <select class="form-control" name="Syntax" id="syntax">
  33. <option value="Text only">Text only</option>
  34. @{
  35. foreach (Highlighter.Lexer format in Highlighter.Lexers.OrderBy(l => l.Name))
  36. {
  37. <option value="@format.Name">@format.Name</option>
  38. }
  39. }
  40. </select>
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label for="syntax" class="col-sm-2 col-sm-offset-1 control-label">Expires</label>
  45. <div class="col-sm-2 hidden" id="length-div">
  46. <input type="number" min="1" step="1" class="form-control" name="ExpireLength" id="expirelength" value="1">
  47. </div>
  48. <div class="col-sm-4" id="unit-div">
  49. <select class="form-control" name="ExpireUnit" id="expireunit">
  50. <option value="never">Never</option>
  51. <option value="view">Views</option>
  52. <option value="minute">Minutes</option>
  53. <option value="hour">Hours</option>
  54. <option value="day">Days</option>
  55. <option value="month">Months</option>
  56. <option value="year">Years</option>
  57. </select>
  58. </div>
  59. </div>
  60. <div class="form-group">
  61. <label for="password" class="col-sm-2 col-sm-offset-1 control-label">Password</label>
  62. <div class="col-sm-4">
  63. <input type="password" class="form-control" name="Password" id="password" placeholder="Secret">
  64. </div>
  65. </div>
  66. <div class="form-group">
  67. <div class="col-sm-offset-3 col-sm-6">
  68. <div class="checkbox">
  69. <label>
  70. <input type="checkbox" name="Hide" id="hide" value="true"> Hide from Public List
  71. </label>
  72. </div>
  73. </div>
  74. </div>
  75. </form>
  76. </div>
  77. </div>
  78. <div class="text-center">
  79. Useful Tools: <a href="@Url.SubRouteUrl("help", "Help.Tools")">Paste Scripts and Utilities</a>
  80. </div>
  81. </div>
  82. <script>
  83. $("select[name='ExpireUnit']").change(function () {
  84. if ($(this).val() == "never") {
  85. $('#length-div').addClass("hidden");
  86. $('#unit-div').removeClass("col-sm-2");
  87. $('#unit-div').addClass("col-sm-4");
  88. }
  89. else {
  90. $('#length-div').removeClass("hidden");
  91. $('#unit-div').removeClass("col-sm-4");
  92. $('#unit-div').addClass("col-sm-2");
  93. }
  94. });
  95. </script>