Просмотр исходного кода

change templates and static directory

honmaple 8 лет назад
Родитель
Сommit
b82e648eed
79 измененных файлов с 28 добавлено и 85 удалено
  1. 20 11
      README.org
  2. 7 2
      maple/__init__.py
  3. 1 72
      requirements.txt
  4. 0 0
      static/assets/home.css
  5. 0 0
      static/assets/home.js
  6. 0 0
      static/avatars/honmaple-14670891852944.png
  7. 0 0
      static/avatars/honmaple-14685857008552.png
  8. 0 0
      static/favicon.ico
  9. 0 0
      static/images/Moo.png
  10. 0 0
      static/images/bg1.jpg
  11. 0 0
      static/images/header.png
  12. 0 0
      static/images/snow.jpg
  13. 0 0
      static/robots.txt
  14. 0 0
      static/styles/forums.js
  15. 0 0
      static/styles/mine.css
  16. 0 0
      static/styles/mine.js
  17. 0 0
      static/styles/monokai.css
  18. 0 0
      static/styles/topic.js
  19. 0 0
      static/styles/upload.js
  20. 0 0
      static/tags/bootstrap-tokenfield.js
  21. 0 0
      static/tags/bootstrap-tokenfield.min.js
  22. 0 0
      static/tags/css/bootstrap-tokenfield.css
  23. 0 0
      static/tags/css/bootstrap-tokenfield.min.css
  24. 0 0
      static/tags/css/tokenfield-typeahead.css
  25. 0 0
      static/tags/css/tokenfield-typeahead.min.css
  26. 0 0
      templates/auth/forget.html
  27. 0 0
      templates/auth/login.html
  28. 0 0
      templates/auth/register.html
  29. 0 0
      templates/base/base.html
  30. 0 0
      templates/base/form.html
  31. 0 0
      templates/base/head.html
  32. 0 0
      templates/base/link.html
  33. 0 0
      templates/base/notice.html
  34. 0 0
      templates/base/paginate.html
  35. 0 0
      templates/base/panel.html
  36. 0 0
      templates/base/sort.html
  37. 0 0
      templates/board/board.html
  38. 0 0
      templates/board/board_base.html
  39. 0 0
      templates/board/board_list.html
  40. 0 0
      templates/follow/following_collect.html
  41. 0 0
      templates/follow/following_tag.html
  42. 0 0
      templates/follow/following_topic.html
  43. 0 0
      templates/follow/following_user.html
  44. 0 0
      templates/follow/none.html
  45. 0 0
      templates/forums/about.html
  46. 0 0
      templates/forums/contact.html
  47. 0 0
      templates/forums/forums.html
  48. 0 0
      templates/forums/help.html
  49. 0 0
      templates/forums/index.html
  50. 0 0
      templates/forums/notice.html
  51. 0 0
      templates/forums/userlist.html
  52. 0 0
      templates/maple/footer.html
  53. 0 0
      templates/mine/collect.html
  54. 0 0
      templates/mine/collect_following.html
  55. 0 0
      templates/mine/collect_list.html
  56. 0 0
      templates/mine/follow.html
  57. 0 0
      templates/setting/password.html
  58. 0 0
      templates/setting/privacy.html
  59. 0 0
      templates/setting/profile.html
  60. 0 0
      templates/setting/setting.html
  61. 0 0
      templates/tag/panel.html
  62. 0 0
      templates/tag/tag.html
  63. 0 0
      templates/tag/tag_list.html
  64. 0 0
      templates/topic/ask.html
  65. 0 0
      templates/topic/content.html
  66. 0 0
      templates/topic/edit.html
  67. 0 0
      templates/topic/panel.html
  68. 0 0
      templates/topic/replies.html
  69. 0 0
      templates/topic/topic.html
  70. 0 0
      templates/topic/topic_good.html
  71. 0 0
      templates/topic/topic_list.html
  72. 0 0
      templates/topic/topic_list_base.html
  73. 0 0
      templates/user/collect.html
  74. 0 0
      templates/user/collect_detail.html
  75. 0 0
      templates/user/follower.html
  76. 0 0
      templates/user/infor.html
  77. 0 0
      templates/user/reply.html
  78. 0 0
      templates/user/topic.html
  79. 0 0
      templates/user/user.html

+ 20 - 11
README.org

@@ -21,30 +21,39 @@
    + Topic vote
      
 ** Installation
-   Some package is not neccessary
-   #+BEGIN_SRC python
+
+*** Install necessary package
+    Some package is not neccessary
+    #+BEGIN_SRC python
    pip install -r requirements.txt
-   #+END_SRC
+    #+END_SRC
+
+*** Comment before init db
 
-   Then,you should comment *maple/topic/forms.py*
-   #+BEGIN_SRC python
+    place of file: *maple/topic/forms.py*
+    #+BEGIN_SRC python
     category = SelectField(
         _('Category:'),
         choices=[(b.id, b.board + '   --' + b.parent_board)
                  for b in Board.query.all()],
         coerce=int)
-   #+END_SRC
+    #+END_SRC
 
-   Now,please init db use 
-   #+BEGIN_SRC python
+*** Init sql
+    #+BEGIN_SRC python
     python manage.py db init 
     python manage.py db migrate -m "first migrate"
     python manage.py db upgrade
-   #+END_SRC
+    #+END_SRC
+    *Ok*,please recovery *maple/topic/forms.py*
 
-   Finally,you can register a account,and `update users set is_superuser = true`
+*** Create admin account
+    #+BEGIN_SRC shell
+python manager.py create_user
+    #+END_SRC
 
-   *Ok* ,visit forums.localhost:5000/admin to add something
+*** Login and visit admin 
+    *Ok* ,visit forums.localhost:5000/admin to add something
    
 ** Demo
    Please visit [[https://forums.honmaple.org][forums.honmaple.org]] 

+ 7 - 2
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-23 20:48:57 (CST)
+# Last Update:星期一 2016-7-25 11:11:52 (CST)
 #          By:jianglin
 # Description:
 # **************************************************************************
@@ -19,11 +19,16 @@ from maple.extensions import (register_form, register_babel,
 from maple.extensions import register_rbac
 from flask_login import current_user
 from flask_sqlalchemy import SQLAlchemy
+import os
 
 
 def create_app():
+    templates = os.path.abspath(os.path.join(
+        os.path.dirname(__file__), os.pardir, 'templates'))
+    static = os.path.abspath(os.path.join(
+        os.path.dirname(__file__), os.pardir, 'static'))
 
-    app = Flask(__name__)
+    app = Flask(__name__, template_folder=templates, static_folder=static)
     app.config.from_object('config.config')
     app.url_map._rules.clear()
     app.url_map._rules_by_endpoint.clear()

+ 1 - 72
requirements.txt

@@ -1,98 +1,27 @@
-17MonIP==0.2.7
-alembic==0.8.6
-amqp==1.4.9
-aniso8601==1.1.0
-anyjson==0.3.3
-Babel==2.3.4
-billiard==3.3.0.23
-bleach==1.4.2
-blinker==1.3
-celery==3.1.23
-cffi==1.5.2
-click==6.6
-cov-core==1.15.0
-coverage==4.0.3
+bleach==1.4.3
 cssmin==0.2.0
-cycler==0.10.0
-decorator==4.0.9
-dominate==2.2.0
-elasticsearch==2.3.0
-eventlet==0.19.0
 Flask==0.11.1
 Flask-Admin==1.4.2
-flask-allows==0.1.0
 Flask-Assets==0.11
 Flask-Avatar==0.1.0
-Flask-Babel==0.11.1
 Flask-BabelEx==0.9.3
-Flask-BabelPlus==1.0.1
-Flask-Bootstrap==3.3.5.7
 Flask-Cache==0.13.1
-Flask-DebugToolbar==0.10.0
-Flask-HTTPAuth==3.1.2
 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-OAuthlib==0.9.3
-Flask-Plugins==1.6.1
 Flask-Principal==0.4.0
-flask-profiler==1.0.1
-Flask-RBAC==0.2.1
-Flask-Redis==0.1.0
-Flask-RESTful==0.3.5
 Flask-Script==2.0.5
-Flask-SocketIO==2.2
 Flask-SQLAlchemy==2.1
-Flask-Themes2==0.1.4
-flask-util-js==0.2.25
-Flask-WhooshAlchemy==0.56
 Flask-WTF==0.12
 gevent==1.1.1
-greenlet==0.4.9
 gunicorn==19.4.5
 hiredis==0.2.0
-html5lib==0.9999999
-itsdangerous==0.24
 Jinja2==2.8
 jsmin==2.2.0
-kombu==3.0.35
-Mako==1.0.4
-MarkupSafe==0.23
-matplotlib==1.5.1
 misaka==2.0.0
-mistune==0.7.1
-numpy==1.11.1
-oauthlib==1.1.2
 Pillow==3.2.0
 psycopg2==2.6.1
-pycparser==2.14
 Pygments==2.1
-pyparsing==2.1.1
-python-dateutil==2.5.3
-python-editor==1.0
-python-engineio==0.9.0
-python-socketio==1.2
-pytz==2016.4
 redis==2.10.5
-requests==2.9.1
-requests-oauthlib==0.6.1
-simple-rbac==0.1.1
-simplejson==3.8.1
-six==1.10.0
-speaklater==1.3
-SQLAlchemy==1.0.13
-sqlalchemy-elasticquery==0.0.3
-SQLAlchemy-Searchable==0.10.1
-SQLAlchemy-Utils==0.31.6
-Unidecode==0.4.19
-urllib3==1.15.1
-uuid==1.30
-validators==0.10
-visitor==0.1.2
-webassets==0.11.1
-Werkzeug==0.11.10
-Whoosh==2.7.0
-WTForms==2.1
-yapf==0.7.0

+ 0 - 0
maple/static/assets/home.css → static/assets/home.css


+ 0 - 0
maple/static/assets/home.js → static/assets/home.js


+ 0 - 0
maple/static/avatars/honmaple-14670891852944.png → static/avatars/honmaple-14670891852944.png


+ 0 - 0
maple/static/avatars/honmaple-14685857008552.png → static/avatars/honmaple-14685857008552.png


+ 0 - 0
maple/static/favicon.ico → static/favicon.ico


+ 0 - 0
maple/static/images/Moo.png → static/images/Moo.png


+ 0 - 0
maple/static/images/bg1.jpg → static/images/bg1.jpg


+ 0 - 0
maple/static/images/header.png → static/images/header.png


+ 0 - 0
maple/static/images/snow.jpg → static/images/snow.jpg


+ 0 - 0
maple/static/robots.txt → static/robots.txt


+ 0 - 0
maple/static/styles/forums.js → static/styles/forums.js


+ 0 - 0
maple/static/styles/mine.css → static/styles/mine.css


+ 0 - 0
maple/static/styles/mine.js → static/styles/mine.js


+ 0 - 0
maple/static/styles/monokai.css → static/styles/monokai.css


+ 0 - 0
maple/static/styles/topic.js → static/styles/topic.js


+ 0 - 0
maple/static/styles/upload.js → static/styles/upload.js


+ 0 - 0
maple/static/tags/bootstrap-tokenfield.js → static/tags/bootstrap-tokenfield.js


+ 0 - 0
maple/static/tags/bootstrap-tokenfield.min.js → static/tags/bootstrap-tokenfield.min.js


+ 0 - 0
maple/static/tags/css/bootstrap-tokenfield.css → static/tags/css/bootstrap-tokenfield.css


+ 0 - 0
maple/static/tags/css/bootstrap-tokenfield.min.css → static/tags/css/bootstrap-tokenfield.min.css


+ 0 - 0
maple/static/tags/css/tokenfield-typeahead.css → static/tags/css/tokenfield-typeahead.css


+ 0 - 0
maple/static/tags/css/tokenfield-typeahead.min.css → static/tags/css/tokenfield-typeahead.min.css


+ 0 - 0
maple/templates/auth/forget.html → templates/auth/forget.html


+ 0 - 0
maple/templates/auth/login.html → templates/auth/login.html


+ 0 - 0
maple/templates/auth/register.html → templates/auth/register.html


+ 0 - 0
maple/templates/base/base.html → templates/base/base.html


+ 0 - 0
maple/templates/base/form.html → templates/base/form.html


+ 0 - 0
maple/templates/base/head.html → templates/base/head.html


+ 0 - 0
maple/templates/base/link.html → templates/base/link.html


+ 0 - 0
maple/templates/base/notice.html → templates/base/notice.html


+ 0 - 0
maple/templates/base/paginate.html → templates/base/paginate.html


+ 0 - 0
maple/templates/base/panel.html → templates/base/panel.html


+ 0 - 0
maple/templates/base/sort.html → templates/base/sort.html


+ 0 - 0
maple/templates/board/board.html → templates/board/board.html


+ 0 - 0
maple/templates/board/board_base.html → templates/board/board_base.html


+ 0 - 0
maple/templates/board/board_list.html → templates/board/board_list.html


+ 0 - 0
maple/templates/follow/following_collect.html → templates/follow/following_collect.html


+ 0 - 0
maple/templates/follow/following_tag.html → templates/follow/following_tag.html


+ 0 - 0
maple/templates/follow/following_topic.html → templates/follow/following_topic.html


+ 0 - 0
maple/templates/follow/following_user.html → templates/follow/following_user.html


+ 0 - 0
maple/templates/follow/none.html → templates/follow/none.html


+ 0 - 0
maple/templates/forums/about.html → templates/forums/about.html


+ 0 - 0
maple/templates/forums/contact.html → templates/forums/contact.html


+ 0 - 0
maple/templates/forums/forums.html → templates/forums/forums.html


+ 0 - 0
maple/templates/forums/help.html → templates/forums/help.html


+ 0 - 0
maple/templates/forums/index.html → templates/forums/index.html


+ 0 - 0
maple/templates/forums/notice.html → templates/forums/notice.html


+ 0 - 0
maple/templates/forums/userlist.html → templates/forums/userlist.html


+ 0 - 0
maple/templates/maple/footer.html → templates/maple/footer.html


+ 0 - 0
maple/templates/mine/collect.html → templates/mine/collect.html


+ 0 - 0
maple/templates/mine/collect_following.html → templates/mine/collect_following.html


+ 0 - 0
maple/templates/mine/collect_list.html → templates/mine/collect_list.html


+ 0 - 0
maple/templates/mine/follow.html → templates/mine/follow.html


+ 0 - 0
maple/templates/setting/password.html → templates/setting/password.html


+ 0 - 0
maple/templates/setting/privacy.html → templates/setting/privacy.html


+ 0 - 0
maple/templates/setting/profile.html → templates/setting/profile.html


+ 0 - 0
maple/templates/setting/setting.html → templates/setting/setting.html


+ 0 - 0
maple/templates/tag/panel.html → templates/tag/panel.html


+ 0 - 0
maple/templates/tag/tag.html → templates/tag/tag.html


+ 0 - 0
maple/templates/tag/tag_list.html → templates/tag/tag_list.html


+ 0 - 0
maple/templates/topic/ask.html → templates/topic/ask.html


+ 0 - 0
maple/templates/topic/content.html → templates/topic/content.html


+ 0 - 0
maple/templates/topic/edit.html → templates/topic/edit.html


+ 0 - 0
maple/templates/topic/panel.html → templates/topic/panel.html


+ 0 - 0
maple/templates/topic/replies.html → templates/topic/replies.html


+ 0 - 0
maple/templates/topic/topic.html → templates/topic/topic.html


+ 0 - 0
maple/templates/topic/topic_good.html → templates/topic/topic_good.html


+ 0 - 0
maple/templates/topic/topic_list.html → templates/topic/topic_list.html


+ 0 - 0
maple/templates/topic/topic_list_base.html → templates/topic/topic_list_base.html


+ 0 - 0
maple/templates/user/collect.html → templates/user/collect.html


+ 0 - 0
maple/templates/user/collect_detail.html → templates/user/collect_detail.html


+ 0 - 0
maple/templates/user/follower.html → templates/user/follower.html


+ 0 - 0
maple/templates/user/infor.html → templates/user/infor.html


+ 0 - 0
maple/templates/user/reply.html → templates/user/reply.html


+ 0 - 0
maple/templates/user/topic.html → templates/user/topic.html


+ 0 - 0
maple/templates/user/user.html → templates/user/user.html