post.view.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {% extends "base-with-sidebar.html" %}
  2. {% load staticres %}
  3. {% block title %}
  4. {{title}} - 丘丘塔台
  5. {% endblock %}
  6. {% block sidebar %}
  7. {% if adminmode %}
  8. {% include "home/sysconf.sidebar.html" %}
  9. {% else %}
  10. {% include "home/front.sidebar.html" %}
  11. {% endif %}
  12. {% endblock %}
  13. {% block content %}
  14. <div class="btn-toolbar">
  15. <div class="btn-group">
  16. <a class="btn btn-primary" href="javascript:history.go(-2);">
  17. <span class="glyphicon glyphicon-chevron-left"></span>
  18. 后退
  19. </a>
  20. </div>
  21. <div class="btn-group">
  22. <a class="btn btn-info" href="#context">
  23. 正文
  24. </a>
  25. <a class="btn btn-info" href="#commentBox">
  26. 评论
  27. </a>
  28. <a class="btn btn-info" href="#commentAdd">
  29. 发表评论
  30. </a>
  31. </div>
  32. </div>
  33. <br />
  34. <div class="panel panel-info">
  35. <div class="panel-heading"><h4 class="panel-title">
  36. {{title}}
  37. {% if bkmode %}
  38. (-*-预览-*-)
  39. {% endif %}
  40. </h4></div>
  41. <div id="context" class="panel-body">
  42. {{content|safe}}
  43. </div>
  44. </div>
  45. <div class="panel panel-info">
  46. <div class="panel-heading"><h4 class="panel-title">评论</h4></div>
  47. <div id="commentBox" class="panel-body">
  48. 载入中...
  49. </div>
  50. </div>
  51. <div class="panel panel-info">
  52. <div class="panel-heading">
  53. <h4 class="panel-title">发表评论</h4>
  54. </div>
  55. <div id="commentAdd" class="panel-body">
  56. <div class="container main-container-with-sidebar">
  57. <form class="form-horizontal" role="form" action="" method="POST" >
  58. {% csrf_token %}
  59. {% if not request.auth.islogin %}
  60. <div class="form-group">
  61. <label for="anonymousMail">电子邮箱</label>
  62. <input type="email" name="mail" class="form-control" id="anonymousMail" placeholder="电子邮箱(不会公开,仅管理员和本小说作者可见)">
  63. </div>
  64. <div class="form-group">
  65. <label for="anonymousSite">个人主页</label>
  66. <input type="text" name="website" class="form-control" id="anonymousSite" placeholder="个人主页">
  67. </div>
  68. <div class="form-group">
  69. <label for="anonymousNick">昵称</label>
  70. <input type="text" name="nick" class="form-control" id="anonymousNick" placeholder="昵称">
  71. </div>
  72. {% endif %}
  73. <div class="form-group">
  74. <label for="CmtCnt">内容</label>
  75. <textarea name="content" id="CmtCnt" class="form-control" rows="3" placeholder="评论内容"></textarea>
  76. </div>
  77. {% if not request.auth.islogin %}
  78. <div class="form-group">
  79. <label for="CmtCnt">验证码</label>
  80. <input type="text" name="captcha" id="CaptInput" class="form-control" placeholder="验证码">
  81. </div>
  82. <div><img id="captcha_box" src="" alt="" class="img-thumbnail"></div>
  83. <div class="alert alert-info" role="alert"><strong>友情提示:</strong>注册后发表评论无需再输入验证码~</div>
  84. {% endif %}
  85. <br />
  86. <div class="form-group">
  87. <button type="submit" class="btn btn-primary">发表评论</button>
  88. {% if not request.auth.islogin %}
  89. <button type="button" class="btn btn-info" onclick="newCaptcha();">
  90. <span class="glyphicon glyphicon-refresh"></span>
  91. 刷新验证码
  92. </button>
  93. {% endif %}
  94. </div>
  95. </form>
  96. </div>
  97. </div>
  98. </div>
  99. <script type="text/javascript">
  100. function LoadComment(page){
  101. $("#commentBox").html("载入中...");
  102. //$("#commentBox").load("?page="+page);
  103. }
  104. function pageturn_cmt(page){
  105. LoadComment(page);
  106. }
  107. function newCaptcha(){
  108. var uuid = uuidGenerate();
  109. var urlsource = "{{OutsiteCaptchaURL}}";
  110. var url = urlsource + uuid + ".png";
  111. $("#captcha_box").attr("src",url);
  112. }
  113. LoadComment(1);
  114. newCaptcha();
  115. </script>
  116. {% endblock %}