base.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <html lang="zh-CN">
  2. <head>
  3. <meta charset="utf-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>{%- block title -%}{%- endblock -%}</title>
  7. {% assets "home_js" -%}
  8. <script type="text/javascript" src="{{ ASSET_URL }}"></script>
  9. {%- endassets %}
  10. {% assets "home_css" -%}
  11. <link rel="stylesheet" href="{{ ASSET_URL }}" />
  12. {%- endassets %}
  13. <script type="text/javascript" charset="utf-8">
  14. $(document).ready(function(){
  15. $("#showerror").hide();
  16. $('button#hide').click(function(){
  17. $("#showerror").hide();
  18. });
  19. var csrftoken = "{{ csrf_token() }}"
  20. $.ajaxSetup({
  21. beforeSend: function(xhr, settings) {
  22. if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
  23. xhr.setRequestHeader("X-CSRFToken", csrftoken)
  24. }
  25. }
  26. });
  27. });
  28. </script>
  29. <style type="text/css" media="all">
  30. html,body{height:100%}
  31. img {width:100%}
  32. .container {width:100%;}
  33. .footer {margin-top:-30px;height:30px;}
  34. .wrap{min-height:100%}
  35. .main{padding-bottom:30px;overflow:hidden;}
  36. li {
  37. list-style-type:none;
  38. }
  39. select {
  40. background-color: #fff;
  41. border-color: #c6c6c6;
  42. color: #141414;
  43. }
  44. .category {
  45. margin-bottom:15px;
  46. padding:15px;
  47. background:#fff;
  48. border:1px solid #ddd;
  49. box-shadow:0px 0px 1px #ddd;
  50. border-radius: 3px;
  51. }
  52. .tags {
  53. color:#999;
  54. }
  55. </style>
  56. </head>
  57. <body style="background:#f8f8f8;">
  58. <div class="wrap">
  59. <div class="main">
  60. <nav class="navbar navbar-default col-md-offset-1 col-md-10" style="background:#fff;padding:10px;margin-bottom:0;">
  61. <div class="container-fluid">
  62. <div class="navbar-header" style="margin-right:15px">
  63. <a class="navbar-brand" href="{{ url_for('forums.index') }}" style="padding:0">
  64. <img src="{{ url_for('static',filename='images/hehai.png') }}" style="height:100%;width:auto;" alt="title">
  65. </a>
  66. </div>
  67. <div class="navbar-text" style="margin:0">
  68. <h3 style="color:#EB5424;margin-top:5px;">河海大学论坛</h3>
  69. <span style="font-size:12px;color:#999;">艰苦朴素、实事求是、严格要求、勇于探索</span>
  70. </div>
  71. </div>
  72. </nav>
  73. <div class="col-md-offset-1 col-md-10" style="padding:0;">
  74. {% with messages = get_flashed_messages() %}
  75. {% if messages %}
  76. <div class="alert alert-info" style="padding:8px">
  77. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  78. <span aria-hidden="true">&times;</span>
  79. </button>
  80. <ul>
  81. {% for message in messages %}
  82. <li>{{ message }} </li>
  83. {% endfor %}
  84. </ul>
  85. </div>
  86. {% endif %}
  87. {% endwith %}
  88. {% if g.user.is_authenticated %}
  89. <div class="btn-group " style="float:right">
  90. <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  91. {{ current_user.name }} <span class="caret"></span>
  92. </button>
  93. <ul class="dropdown-menu">
  94. <li><a href="{{ url_for('user.index',user_url=current_user.name) }}">我的主页</a></li>
  95. <li><a href="{{ url_for('user.setting',user_url=current_user.name) }}">帐号设置</a></li>
  96. <li role="separator" class="divider" style="margin-bottom:0;"></li>
  97. <li><a href="{{ url_for('auth.logout') }}">退出</a></li>
  98. </ul>
  99. </div>
  100. {% else %}
  101. <a href="{{ url_for('auth.register') }}" class="btn btn-sm btn-primary" style="float:right;">注册</a>
  102. <a href="{{ url_for('auth.login') }}" class="btn btn-sm btn-primary" style="float:right">登陆</a>
  103. {% endif %}
  104. <a href="{{ url_for('group.index') }}"><span class="btn btn-sm btn-primary" style="float:right">用户组</span></a>
  105. <span class="btn btn-sm btn-primary" style="float:right">用户列表</span>
  106. <span class="btn btn-sm btn-primary" style="float:right">帮助中心</span>
  107. {% block content %}{% endblock %}
  108. </div>
  109. </div>
  110. </div>
  111. <div class="footer col-md-offset-1 col-md-10" style="padding:0">
  112. <span style="font-size:12px;color:#999;float:left">
  113. <span>当前在线用户:<strong style="color:#333;">{{ 'all_counts' | load_online_users }}</strong></span>
  114. <span style="margin-left:10px">注册用户:<strong style="color:#333;">{{ 'sign_counts' | load_online_users }}</strong></span>
  115. <span style="margin-left:10px">当前访客:<strong style="color:#333;">{{ 'counts' | load_online_users }}</strong></span>
  116. <span style="margin-left:10px">最高在线:<strong style="color:#333;">{{ 'high' | load_online_users }}</strong></span>
  117. <span style="margin-left:10px">最高在线时间:<strong style="color:#333;">{{ 'high_time' | load_online_users }}</strong></span>
  118. </span>
  119. <span style="float:right">
  120. <span style="font-size:12px;">
  121. Copyright © 2015-2016 honmaple.
  122. </span>
  123. </span>
  124. </div>
  125. </body>
  126. </html>