document_password.tpl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="shortcut icon" href="{{cdnimg "favicon.ico"}}">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <meta name="renderer" content="webkit" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <title>{{i18n .Lang "doc.input_pwd"}} - Powered by MinDoc</title>
  10. <script src="{{cdnjs "static/jquery/1.12.4/jquery.min.js"}}"></script>
  11. <script src="{{cdnjs "static/js/jquery.form.js"}}"></script>
  12. <style type="text/css">
  13. body{ background: #f2f2f2;}
  14. .d_button{ cursor: pointer;}
  15. @media(min-width : 450px){
  16. .auth_form{
  17. width: 400px;
  18. border: 1px solid #ccc;
  19. background-color: #fff;
  20. position: absolute;
  21. top: 20%;
  22. left: 50%;
  23. margin-left: -220px;
  24. padding: 20px;
  25. }
  26. .tit{
  27. font-size: 18px;
  28. }
  29. .inp{
  30. height: 30px;
  31. width: 387px;
  32. font-size: 14px;
  33. padding: 5px;
  34. }
  35. .btn{
  36. margin-top: 10px;
  37. float: right;
  38. }
  39. }
  40. @media(max-width : 449px){
  41. body{
  42. margin: 0 auto;
  43. }
  44. .auth_form{
  45. background-color: #fff;
  46. border-top: 1px solid #ccc;
  47. border-bottom: 1px solid #ccc;
  48. width: 100%;
  49. margin-top: 40px;
  50. }
  51. .shell{
  52. width: 90%;
  53. margin: 10px auto;
  54. }
  55. .tit{
  56. font-size: 18px;
  57. }
  58. .inp{
  59. height: 30px;
  60. width: 96.5%;
  61. font-size: 14px;
  62. padding: 5px;
  63. }
  64. .btn{
  65. margin-top: 10px;
  66. float: right;
  67. }
  68. }
  69. .clear{
  70. clear: both;
  71. }
  72. .button {
  73. color: #fff;
  74. background-color: #428bca;
  75. border-radius: 4px;
  76. display: inline-block;
  77. padding: 6px 12px;
  78. margin-bottom: 0;
  79. font-size: 14px;
  80. font-weight: 400;
  81. line-height: 1.42857143;
  82. text-align: center;
  83. white-space: nowrap;
  84. vertical-align: middle;
  85. -ms-touch-action: manipulation;
  86. touch-action: manipulation;
  87. cursor: pointer;
  88. -webkit-user-select: none;
  89. -moz-user-select: none;
  90. -ms-user-select: none;
  91. user-select: none;
  92. border: 1px solid #357ebd;
  93. }
  94. </style>
  95. <script type="text/javascript">
  96. window.IS_ENABLE_IFRAME = '{{conf "enable_iframe" }}' === 'true';
  97. window.BASE_URL = '{{urlfor "HomeController.Index" }}';
  98. </script>
  99. </head>
  100. <body>
  101. <div class="auth_form">
  102. <div class="shell">
  103. <form action="{{urlfor "DocumentController.CheckPassword" ":key" .Identify}}" method="post" id="auth_form">
  104. <div class="tit">{{i18n .Lang "doc.input_pwd"}}</div>
  105. <div style="margin-top: 10px;">
  106. <input type="password" name="bPassword" placeholder="{{i18n .Lang "doc.read_pwd"}}" class="inp"/>
  107. </div>
  108. <div class="btn">
  109. <span id="error" style="color: #919191; font-size: 13px;"></span>
  110. <input type="submit" value="{{i18n .Lang "doc.commit"}}" class="button"/>
  111. </div>
  112. <div class="clear"></div>
  113. </form>
  114. </div>
  115. </div>
  116. <script src="{{cdnjs "/static/js/custom-elements-builtin-0.6.5.min.js"}}" type="text/javascript"></script>
  117. <script src="{{cdnjs "/static/js/x-frame-bypass-1.0.2.js"}}" type="text/javascript"></script>
  118. <script type="text/javascript">
  119. $("#auth_form").ajaxForm({
  120. beforeSerialize: function () {
  121. var pwd = $("#auth_form input[name='bPassword']").val();
  122. if (pwd === "") {
  123. $("#error").html("{{i18n .Lang "doc.input_pwd"}}");
  124. return false;
  125. }
  126. },
  127. dataType: "json",
  128. success: function (res) {
  129. if (res.errcode === 0) {
  130. window.location.reload();
  131. } else {
  132. $("#auth_form input[name='password']").val("").focus();
  133. $("#error").html(res.message);
  134. }
  135. }
  136. });
  137. </script>
  138. </body>
  139. </html>