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.

Blog.cshtml 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. @model Teknik.Areas.Blog.ViewModels.BlogViewModel
  2. @Scripts.Render("~/bundles/blog")
  3. <div class="container">
  4. <?php
  5. if ($blog_id >= 0)
  6. {
  7. ?>
  8. <div class="row">
  9. <div class="col-sm-12 blog-heading">
  10. <h1 class="blog-title text-center"><?php echo $blog_title; ?></h1>
  11. <p class="lead blog-description text-center text-muted"><?php echo $blog_desc; ?></p>
  12. </div>
  13. </div>
  14. <div class="row">
  15. <div class="col-sm-12 text-center">
  16. <p>
  17. <a href="<?php echo get_page_url('rss', $CONF).'/blog/'.$blog_author; ?>"><i class="fa fa-rss fa-2x fa-border"></i></a>
  18. </p>
  19. </div>
  20. </div>
  21. <?php
  22. }
  23. if ($own_blog)
  24. {
  25. ?>
  26. <div class="row">
  27. <div class="col-sm-12 text-center">
  28. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newPost">Create Post</button>
  29. </div>
  30. </div>
  31. <div class="modal fade" id="newPost" tabindex="-1" role="dialog" aria-labelledby="newPostLabel" aria-hidden="true">
  32. <div class="modal-dialog">
  33. <div class="modal-content">
  34. <form class="form" action="##" method="post" id="publishPost">
  35. <div class="modal-header">
  36. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  37. <h4 class="modal-title" id="newPostLabel">Create a New Post</h4>
  38. </div>
  39. <div class="modal-body">
  40. <input name="blog_userid" id="blog_userid" type="hidden" value="<?php echo $blog_id; ?>" />
  41. <div class="row">
  42. <div class="form-group col-sm-12">
  43. <label for="blog_title"><h4>Title</h4></label>
  44. <input class="form-control" name="blog_title" id="blog_title" placeholder="generic click bait" title="enter a title for your post." type="text" />
  45. </div>
  46. </div>
  47. <div class="row">
  48. <div class="form-group col-sm-12">
  49. <label for="blog_post"><h4>Article</h4></label>
  50. <textarea class="form-control wmd-input" name="blog_post" id="blog_post" placeholder="I ate a burger today." title="enter any information you want to share with the world." data-provide="markdown" rows="10"></textarea>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="modal-footer">
  55. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  56. <button type="button" class="btn btn-primary" id="blog_submit">Create</button>
  57. </div>
  58. </form>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="modal fade" id="editPost" tabindex="-1" role="dialog" aria-labelledby="editPostLabel" aria-hidden="true">
  63. <div class="modal-dialog">
  64. <div class="modal-content">
  65. <form class="form" action="##" method="post" id="editPostForm">
  66. <div class="modal-header">
  67. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  68. <h4 class="modal-title" id="editPostLabel">Edit Your Post</h4>
  69. </div>
  70. <div class="modal-body">
  71. <input name="edit_blog_userid" id="edit_blog_userid" type="hidden" value="<?php echo $blog_id; ?>" />
  72. <input name="edit_blog_postid" id="edit_blog_postid" type="hidden" />
  73. <div class="row">
  74. <div class="form-group col-sm-12">
  75. <label for="edit_blog_title"><h4>Title</h4></label>
  76. <input class="form-control" name="edit_blog_title" id="edit_blog_title" placeholder="generic click bait" title="enter a title for your post." type="text" />
  77. </div>
  78. </div>
  79. <div class="row">
  80. <div class="form-group col-sm-12">
  81. <label for="edit_blog_post"><h4>Article</h4></label>
  82. <textarea class="form-control" name="edit_blog_post" id="edit_blog_post" placeholder="I ate a burger today." title="enter any information you want to share with the world." data-provide="markdown" rows="10"></textarea>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="modal-footer">
  87. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  88. <button type="button" class="btn btn-primary" id="edit_submit">Save</button>
  89. </div>
  90. </form>
  91. </div>
  92. </div>
  93. </div>
  94. <?php
  95. }
  96. if (empty($error))
  97. {
  98. ?>
  99. <div class="blog-main" id="<?php echo $blog_id; ?>"></div>
  100. <script>
  101. var posts = <?php echo $posts_per_load; ?>;
  102. var start_post = 0;
  103. loadMorePosts(start_post, posts);
  104. start_post = start_post + posts;
  105. </script>
  106. <?php
  107. }
  108. else
  109. {
  110. ?>
  111. <div class="row">
  112. <div class="col-sm-12 text-center">
  113. <h2><?php echo $error; ?></h2>
  114. </div>
  115. </div>
  116. <?php
  117. }
  118. ?>
  119. </div>