create.blade.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. @extends('admin.partial.template-full')
  2. @section('section')
  3. <div class="row">
  4. <div class="col-12">
  5. <div class="d-flex justify-content-between align-items-center">
  6. <div class="title">
  7. <p class="h1 font-weight-bold">Newsroom</p>
  8. <p class="lead mb-0">Create Announcement</p>
  9. </div>
  10. <div>
  11. <a class="btn btn-outline-secondary px-2" style="font-size:13px;" href="{{route('admin.newsroom.home')}}"><i class="fas fa-chevron-left fa-sm text-lighter mr-1"></i> Back to Newsroom </a>
  12. </div>
  13. </div>
  14. <hr>
  15. </div>
  16. <div class="col-md-7 border-right">
  17. <div>
  18. <form method="post">
  19. @csrf
  20. <div class="form-group">
  21. <label for="title" class="small font-weight-bold text-muted text-uppercase">Title</label>
  22. <input type="text" class="form-control" id="title" name="title">
  23. <p class="help-text mb-0 small font-weight-bold text-lighter">We recommend titles shorter than 80 characters.</p>
  24. </div>
  25. <div class="form-group">
  26. <label for="summary" class="small font-weight-bold text-muted text-uppercase">Summary</label>
  27. <textarea class="form-control" id="summary" name="summary" rows="3"></textarea>
  28. </div>
  29. <div class="form-group">
  30. <label for="body" class="small font-weight-bold text-muted text-uppercase">Body</label>
  31. <textarea class="form-control" id="body" name="body" rows="6"></textarea>
  32. <p class="help-text mb-0 small font-weight-bold text-lighter">Click <a href="#">here</a> to enable the rich text editor.</p>
  33. </div>
  34. <div class="form-group">
  35. <label for="category" class="small font-weight-bold text-muted text-uppercase">Category</label>
  36. <input type="text" class="form-control" id="category" name="category" value="update">
  37. </div>
  38. </div>
  39. </div>
  40. <div class="col-md-5">
  41. <label class="small font-weight-bold text-muted text-uppercase">Preview</label>
  42. <div class="card border shadow-none mb-3">
  43. <div class="card-body">
  44. <div class="card-title mb-0">
  45. <span class="font-weight-bold" id="preview_title">Untitled</span>
  46. <span class="float-right cursor-pointer" title="Close"><i class="fas fa-times text-lighter"></i></span>
  47. </div>
  48. <p class="card-text">
  49. <span style="font-size:13px;" id="preview_summary">Add a summary</span>
  50. </p>
  51. <p class="d-flex align-items-center justify-content-between mb-0">
  52. <a href="#" class="small font-weight-bold mb-0">Read more</a>
  53. <span>
  54. <span class="btn btn-outline-secondary btn-sm py-0 disabled">
  55. <i class="fas fa-chevron-left fa-sm"></i>
  56. </span>
  57. <span class="btn btn-outline-success btn-sm py-0 mx-1" title="Mark as Read" data-toggle="tooltip" data-placement="bottom">
  58. <i class="fas fa-check fa-sm"></i>
  59. </span>
  60. <span class="btn btn-outline-secondary btn-sm py-0">
  61. <i class="fas fa-chevron-right fa-sm"></i>
  62. </span>
  63. </span>
  64. </p>
  65. </div>
  66. </div>
  67. <hr>
  68. <p class="mt-3">
  69. <button type="submit" class="btn btn-primary btn-block font-weight-bold py-1 px-4">Save</button>
  70. </p>
  71. <div class="form-group">
  72. <div class="custom-control custom-switch">
  73. <input type="checkbox" class="custom-control-input" id="published" name="published">
  74. <label class="custom-control-label font-weight-bold text-uppercase text-muted" for="published">Published</label>
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <div class="custom-control custom-switch">
  79. <input type="checkbox" class="custom-control-input" id="show_timeline" name="show_timeline">
  80. <label class="custom-control-label font-weight-bold text-uppercase text-muted" for="show_timeline">Show On Timelines</label>
  81. </div>
  82. </div>
  83. <div class="form-group">
  84. <div class="custom-control custom-switch">
  85. <input type="checkbox" class="custom-control-input" id="auth_only" name="auth_only">
  86. <label class="custom-control-label font-weight-bold text-uppercase text-muted" for="auth_only">Logged in users only</label>
  87. </div>
  88. </div>
  89. <div class="form-group">
  90. <div class="custom-control custom-switch">
  91. <input type="checkbox" class="custom-control-input" id="show_link" name="show_link">
  92. <label class="custom-control-label font-weight-bold text-uppercase text-muted" for="show_link">Show Read More Link</label>
  93. </div>
  94. </div>
  95. {{-- <div class="form-group">
  96. <div class="custom-control custom-switch">
  97. <input type="checkbox" class="custom-control-input" id="force_modal" name="force_modal">
  98. <label class="custom-control-label font-weight-bold text-uppercase text-muted" for="force_modal">Show Modal on timelines</label>
  99. </div>
  100. </div> --}}
  101. </form>
  102. </div>
  103. </div>
  104. <form id="delete-form" method="post">
  105. @method('delete')
  106. @csrf
  107. </form>
  108. @endsection
  109. @push('scripts')
  110. <script type="text/javascript">
  111. $('#title').on('change keyup paste',function(e) {
  112. let el = $(this);
  113. let title = el.val()
  114. $('#preview_title').text(title);
  115. });
  116. $('#summary').on('change keyup paste',function(e) {
  117. let el = $(this);
  118. let title = el.val()
  119. $('#preview_summary').text(title);
  120. });
  121. $('#btn-delete').on('click', function(e) {
  122. e.preventDefault();
  123. if(window.confirm('Are you sure you want to delete this post?') == true) {
  124. document.getElementById('delete-form').submit();
  125. }
  126. })
  127. </script>
  128. @endpush