# Path: traveler_pal/app/views/index.py
# def index(request):
#     """
#     渲染主页
#     """
#     if request.method == 'GET':
#         username = request.session.get('username', '')
#         content = {
#             "active": "index",
#             "username": username,
#             "recentactivity": getRecentActivities(),
#             "recentscenery": getRecentScenery(),
#             "recentstrategy": getRecentStrategy(),
#             "slider": getslider,
#         }
#         csrfContext = RequestContext(request, content)
#         return render_to_response("index.html", csrfContext)
# 
# Path: traveler_pal/app/views/user.py
# def register(request):
# def login(request):
# def logout(request):
# 
# Path: traveler_pal/app/views/u.py
# class TestUEditorForm(forms.Form):
# def getProfile(request):
# def getPerson(request):
# def getUserProfile(request, username):
# def postStrategy(request):
# def getPersonActivities(request):
# def updateProfile(request):
# def resetPassword(request):
# 
# Path: traveler_pal/app/views/root.py
# def isroot(request):
# def isget(request):
# def ispost(request):
# def getslider(request):
# def addslider(request):
# def updateslider(request):
# def deleteslider(request):
# def getactivity(request):
# def getscenery(request):
# def getstrategy(request):
# def getuser(request):
# 
# Path: traveler_pal/app/views/activity.py
# def getRecentActivities():
# def getAllActivities(request):
# def searchActivity(request):
# def getActivityInfo(request, activity_id):
# def addActivity(request):
# def joinActivity(request):
# def delActivity(request):
# 
# Path: traveler_pal/app/views/scenery.py
# def getAllScenery(request):
# def delScenery(request):
# def searchScenery(request):
# def toJSON(self):
# def getFuzzySearchScenerys(request, fuzzyQueryWord):
# def getSceneryInfo(request, scenery_id):
# def getSceneryComments(request, scenery_id):
# def getHotScenery(request):
# 
# Path: traveler_pal/app/views/strategy.py
# def getAllStrategy(request):
# def delStrategy(request):
# def getPostedStrategy(request):
# def getOneStrategy(request, strategy_id):
# 
# Path: traveler_pal/app/views/siderbar.py
# def activity(request):
# def popular_activity(request):
# def popular_scenery(request):
# def popular_strategy(request):
# 
# Path: traveler_pal/app/views/test.py
# def test(request):
#     if request.method == "GET":
#         send_mail('subject', 'message', 'ysbinang@qq.com', ['admin@rccoder.net','rccoder@foxmail.com'],fail_silently=False)
#         return render(request, 'test.html')
# 
#     else:
#         return render(request, 'test.html')


from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles import views
from django.conf import settings
from .views import index
from .views import user
from .views import u
from .views import root
from .views import activity
from .views import scenery
from .views import strategy
from .views import siderbar
from .views import test
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""


urlpatterns = [
    url(r'^$', index.index, name="index"),

    url(r'^activity/$', activity.getAllActivities, name="all-activities"),
    url(r'^activity/add/$', activity.addActivity, name="addActivity"),
    url(r'^activity/(?P<activity_id>[0-9]+)/$', activity.getActivityInfo, name="activity-info"),
    url(r'^activity/join/$', activity.joinActivity, name="activity-join"),
    url(r'^activity/s/$', activity.searchActivity, name="activity-search"),

    url(r'^scenery/$', scenery.getAllScenery, name="all-scenery"),
    url(r'^scenery/(?P<scenery_id>[0-9]+)/$', scenery.getSceneryInfo, name="scenery-info"),
    url(r'^scenery/search/(?P<fuzzyQueryWord>\w+)/$', scenery.getFuzzySearchScenerys, name="getFuzzySearchScenerys"),
    url(r'^scenery/s/$', scenery.searchScenery, name="scenery-search"),


    url(r'^strategy/$', strategy.getAllStrategy, name="all-strategy"),
    url(r'^strategy/(?P<strategy_id>[0-9]+)/$', strategy.getOneStrategy, name="one-strategy"),

    url(r'^reg/$', user.register, name="register"),
    url(r'^login/$', user.login, name="login"),
    url(r'^logout/$', user.logout, name="logout"),


    url(r'^u/reset-password/$', u.resetPassword, name="reset-password"),
    url(r'^u/update/$', u.updateProfile, name="update profile"),

# Path: traveler_pal/app/views/index.py
# def index(request):
#     """
#     渲染主页
#     """
#     if request.method == 'GET':
#         username = request.session.get('username', '')
#         content = {
#             "active": "index",
#             "username": username,
#             "recentactivity": getRecentActivities(),
#             "recentscenery": getRecentScenery(),
#             "recentstrategy": getRecentStrategy(),
#             "slider": getslider,
#         }
#         csrfContext = RequestContext(request, content)
#         return render_to_response("index.html", csrfContext)
# 
# Path: traveler_pal/app/views/user.py
# def register(request):
# def login(request):
# def logout(request):
# 
# Path: traveler_pal/app/views/u.py
# class TestUEditorForm(forms.Form):
# def getProfile(request):
# def getPerson(request):
# def getUserProfile(request, username):
# def postStrategy(request):
# def getPersonActivities(request):
# def updateProfile(request):
# def resetPassword(request):
# 
# Path: traveler_pal/app/views/root.py
# def isroot(request):
# def isget(request):
# def ispost(request):
# def getslider(request):
# def addslider(request):
# def updateslider(request):
# def deleteslider(request):
# def getactivity(request):
# def getscenery(request):
# def getstrategy(request):
# def getuser(request):
# 
# Path: traveler_pal/app/views/activity.py
# def getRecentActivities():
# def getAllActivities(request):
# def searchActivity(request):
# def getActivityInfo(request, activity_id):
# def addActivity(request):
# def joinActivity(request):
# def delActivity(request):
# 
# Path: traveler_pal/app/views/scenery.py
# def getAllScenery(request):
# def delScenery(request):
# def searchScenery(request):
# def toJSON(self):
# def getFuzzySearchScenerys(request, fuzzyQueryWord):
# def getSceneryInfo(request, scenery_id):
# def getSceneryComments(request, scenery_id):
# def getHotScenery(request):
# 
# Path: traveler_pal/app/views/strategy.py
# def getAllStrategy(request):
# def delStrategy(request):
# def getPostedStrategy(request):
# def getOneStrategy(request, strategy_id):
# 
# Path: traveler_pal/app/views/siderbar.py
# def activity(request):
# def popular_activity(request):
# def popular_scenery(request):
# def popular_strategy(request):
# 
# Path: traveler_pal/app/views/test.py
# def test(request):
#     if request.method == "GET":
#         send_mail('subject', 'message', 'ysbinang@qq.com', ['admin@rccoder.net','rccoder@foxmail.com'],fail_silently=False)
#         return render(request, 'test.html')
# 
#     else:
#         return render(request, 'test.html')


# Path: traveler_pal/app/urls.py
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles import views
from django.conf import settings
from .views import index
from .views import user
from .views import u
from .views import root
from .views import activity
from .views import scenery
from .views import strategy
from .views import siderbar
from .views import test

    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""


urlpatterns = [
    url(r'^$', index.index, name="index"),

    url(r'^activity/$', activity.getAllActivities, name="all-activities"),
    url(r'^activity/add/$', activity.addActivity, name="addActivity"),
    url(r'^activity/(?P<activity_id>[0-9]+)/$', activity.getActivityInfo, name="activity-info"),
    url(r'^activity/join/$', activity.joinActivity, name="activity-join"),
    url(r'^activity/s/$', activity.searchActivity, name="activity-search"),

    url(r'^scenery/$', scenery.getAllScenery, name="all-scenery"),
    url(r'^scenery/(?P<scenery_id>[0-9]+)/$', scenery.getSceneryInfo, name="scenery-info"),
    url(r'^scenery/search/(?P<fuzzyQueryWord>\w+)/$', scenery.getFuzzySearchScenerys, name="getFuzzySearchScenerys"),
    url(r'^scenery/s/$', scenery.searchScenery, name="scenery-search"),


    url(r'^strategy/$', strategy.getAllStrategy, name="all-strategy"),
    url(r'^strategy/(?P<strategy_id>[0-9]+)/$', strategy.getOneStrategy, name="one-strategy"),

    url(r'^reg/$', user.register, name="register"),
    url(r'^login/$', user.login, name="login"),
    url(r'^logout/$', user.logout, name="logout"),


    url(r'^u/reset-password/$', u.resetPassword, name="reset-password"),
    url(r'^u/update/$', u.updateProfile, name="update profile"),

    url(r'^u/post/$', u.postStrategy, name="post journal"),