Browse Source

html5,fix flask_maple.rbac

honmaple 8 years ago
parent
commit
573a3a1acd

+ 11 - 0
README.org

@@ -28,6 +28,17 @@
    pip install -r requirements.txt
     #+END_SRC
 
+    Beacause flask_maple.rbac isn't uploaded to pypi
+    you should 
+    #+BEGIN_SRC shell
+git clone https://github.com/honmaple/flask-maple
+cd flask-maple
+git checkout develop
+pip uninstall flask-maple
+python setup.py install
+    #+END_SRC
+    to install flask-maple
+
 *** Config
     #+BEGIN_SRC shell
     mv config.example config

+ 6 - 2
config.example/config.py

@@ -2,11 +2,11 @@
 # -*- coding=UTF-8 -*-
 # **************************************************************************
 # Copyright © 2016 jianglin
-# File Name: production.py
+# File Name: config.py
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-05-20 12:31:46 (CST)
-# Last Update:星期二 2016-7-26 18:3:24 (CST)
+# Last Update:星期五 2016-7-29 13:8:2 (CST)
 #          By: jianglin
 # Description:
 # **************************************************************************
@@ -16,6 +16,10 @@ DEBUG = True
 SECRET_KEY = 'secret key'
 SECURITY_PASSWORD_SALT = 'you will never guess'
 
+# for development use localhost:5000
+# for production use xxx.com
+SERVER_NAME = 'localhost:5000'
+
 # remember me to save cookies
 PERMANENT_SESSION_LIFETIME = timedelta(days=3)
 REMEMBER_COOKIE_DURATION = timedelta(days=3)

+ 5 - 1
config.example/production.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-05-20 12:31:46 (CST)
-# Last Update:星期二 2016-7-26 18:9:4 (CST)
+# Last Update:星期五 2016-7-29 13:7:49 (CST)
 #          By: jianglin
 # Description:
 # **************************************************************************
@@ -16,6 +16,10 @@ DEBUG = False
 SECRET_KEY = 'secret key'
 SECURITY_PASSWORD_SALT = 'you will never guess'
 
+# for development use localhost:5000
+# for production use xxx.com
+SERVER_NAME = 'localhost:5000'
+
 # remember me to save cookies
 PERMANENT_SESSION_LIFETIME = timedelta(days=3)
 REMEMBER_COOKIE_DURATION = timedelta(days=3)

+ 3 - 1
maple/__init__.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-05-20 12:35:52 (CST)
-# Last Update:星期二 2016-7-26 15:13:12 (CST)
+# Last Update:星期五 2016-7-29 12:33:47 (CST)
 #          By:jianglin
 # Description:
 # **************************************************************************
@@ -73,6 +73,8 @@ def before_request():
     g.user = current_user
     g.sort_form = SortForm()
     g.search_form = SearchForm()
+    from maple.main.records import mark_online
+    mark_online(request.remote_addr)
 
 
 @app.route('/robots.txt')

+ 1 - 1
maple/board/views.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-06-03 14:32:06 (CST)
-# Last Update:星期日 2016-7-24 15:0:46 (CST)
+# Last Update:星期五 2016-7-29 12:34:1 (CST)
 #          By:
 # Description:
 # **************************************************************************

+ 2 - 2
maple/extensions.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-05-20 13:02:50 (CST)
-# Last Update:星期二 2016-7-26 16:55:5 (CST)
+# Last Update:星期五 2016-7-29 12:31:50 (CST)
 #          By:
 # Description:
 # **************************************************************************
@@ -21,7 +21,7 @@ from flask_mail import Mail
 from flask_principal import Principal
 from flask_avatar import Avatar
 from flask_cache import Cache
-from flask_maple_rbac import Rbac
+from flask_maple.rbac import Rbac
 from redis import StrictRedis
 
 

+ 1 - 2
maple/forums/views.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-05-20 13:18:19 (CST)
-# Last Update:星期二 2016-7-26 16:50:16 (CST)
+# Last Update:星期五 2016-7-29 12:32:58 (CST)
 #          By:
 # Description:
 # **************************************************************************
@@ -60,7 +60,6 @@ def notice():
     return render_template('forums/notice.html', **data)
 
 
-@cache.cached(timeout=60)
 def userlist():
     page = is_num(request.args.get('page'))
     users = User.query.paginate(page,

+ 1 - 1
maple/tag/models.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-07-20 17:00:08 (CST)
-# Last Update:星期三 2016-7-20 18:20:34 (CST)
+# Last Update:星期四 2016-7-28 22:30:37 (CST)
 #          By:
 # Description:
 # **************************************************************************

+ 1 - 1
maple/topic/views.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-05-20 13:47:04 (CST)
-# Last Update:星期一 2016-7-25 20:51:19 (CST)
+# Last Update:星期四 2016-7-28 21:14:7 (CST)
 #          By:
 # Description:
 # **************************************************************************

+ 1 - 1
maple/urls.py

@@ -6,7 +6,7 @@
 # Author: jianglin
 # Email: xiyang0807@gmail.com
 # Created: 2016-07-15 18:43:51 (CST)
-# Last Update:星期一 2016-7-25 16:13:50 (CST)
+# Last Update:星期三 2016-7-27 15:5:47 (CST)
 #          By:
 # Description:
 # **************************************************************************

+ 0 - 2
requirements.txt

@@ -8,8 +8,6 @@ Flask-BabelEx==0.9.3
 Flask-Cache==0.13.1
 Flask-Login==0.3.2
 Flask-Mail==0.9.1
-Flask-Maple==0.3.5
-Flask-Maple-Rbac==0.3.6
 Flask-Migrate==1.8.0
 Flask-Principal==0.4.0
 Flask-Script==2.0.5

+ 0 - 14
run.py

@@ -12,18 +12,4 @@ from werkzeug.contrib.fixers import ProxyFix
 
 app.wsgi_app = ProxyFix(app.wsgi_app)
 if __name__ == '__main__':
-    #  import logging
-    #  logFormatStr = '[%(asctime)s] p%(process)s {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s'
-    #  logging.basicConfig(format = logFormatStr, filename = "global.log", level=logging.DEBUG)
-    #  formatter = logging.Formatter(logFormatStr,'%m-%d %H:%M:%S')
-    #  fileHandler = logging.FileHandler("summary.log")
-    #  fileHandler.setLevel(logging.DEBUG)
-    #  fileHandler.setFormatter(formatter)
-    #  streamHandler = logging.StreamHandler()
-    #  streamHandler.setLevel(logging.DEBUG)
-    #  streamHandler.setFormatter(formatter)
-    #  app.logger.addHandler(fileHandler)
-    #  app.logger.addHandler(streamHandler)
-    #  app.logger.info("Logging is set up.")
     app.run()
-    print(app.url_map)

+ 2 - 2
templates/base/base.html

@@ -16,9 +16,9 @@
     <div class="container-fluid col-md-offset-1 col-md-10">
         <div class="navbar-header" style="padding-top:5px;">
             <a class="navbar-brand" href="{{ url_for('forums.index')}}" style="padding:0px">
-                <img alt="Brand" src="{{url_for('static',filename='images/header.png')}}" style="width:42px;">
+                <img alt="Honmaple" src="{{url_for('static',filename='images/header.png')}}" style="width:42px;">
             </a>
-            <div class="navbar-brand" style="padding-top:2;padding-left:16px">
+            <div class="navbar-brand" style="padding-top:2;padding-left:16px;margin-top:-12px;">
                 <span style="font-size:20px;color:#EB5424"><b class="text-capitalize">{{ Title.title}}</b></span>
                 <br/>
                 <small style="font-size:10px">{{ _(Title.description) }}</small>

+ 3 - 3
templates/maple/footer.html

@@ -3,7 +3,7 @@
      margin-top: -30px;
      height: 100px;
      background-color:#fff;
-     padding:16 0 10 10;
+     padding:16px 0 10 10;
      border:1px solid #ddd;
      border-radius:5px;
  }
@@ -18,7 +18,7 @@
  }
 </style>
 <div class="footer col-md-offset-1 col-md-10">
-    <div class="pull-right" style="margin-right:30px;">
+    <div class="pull-right" style="margin-right:30px;margin-top:10px">
         <p class="aaaa text-right">
             <a href="{{ url_for('forums.help')}}">{{ _('Help')}}</a>
             <span class="pipe"> | </span>
@@ -39,7 +39,7 @@
             <span style="margin-left:10px">{{ _('Time of highest online:')}}<strong>{{ 'high_time' | get_online_users }}</strong></span>
         </p>
     </div>
-    <blockquote style="font-size:13px;">
+    <blockquote style="font-size:13px;margin-top:10px;">
         <p style="font-size:14px;">{{ _(Title.description) }}</p>
         <footer>
             <span> Copyright © 2015-2016 honmaple.</span>