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.

Index.cshtml 4.4KB

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