from django.conf.urls import patterns,url
from django.http import HttpResponse
from views import StaticViewSitemap, CuisinesSitemap, DishesSitemap, PicturesSitemap, MembersSitemap, ListSitemap, authorized_digital_sellers_view
from django.contrib.sitemaps.views import sitemap

sitemaps = {
	'static': StaticViewSitemap,
	'cuisines': CuisinesSitemap,
	'dishes': DishesSitemap,
	'pictures': PicturesSitemap,
	'lists': ListSitemap,
	'members': MembersSitemap,
}

urlpatterns = patterns('dish.files.views',
	url(r'^$','index_view',name='view_main'),
	url(r'^sitemap\.xml$', sitemap,{'sitemaps':sitemaps}),
	url(r'^ads\.txt$', authorized_digital_sellers_view, name='authorized_digital_sellers'),
	url(r'^cuisine/(?P<id>\d+)/$','cuisine_redirect_view',name='view_cuisine'),
	url(r'^cuisine/(?P<urlname>.*)/$','cuisine_view',name='view_cuisine'),
	url(r'^cuisinenew/$','cuisinenew_view',name='view_cuisinenew'),
	url(r'^cuisineedit/(?P<id>\d+)/$','cuisineedit_view',name='view_cuisineedit'),
	url(r'^cuisinedelete/(?P<urlname>.*)/$','cuisinedelete_view',name='view_cuisinedelete'),
	url(r'^cuisines/(?P<page>.*)/$','cuisines_view',name='view_cuisines'),
	url(r'^cuisines/$','cuisines_view',name='view_cuisines'),
	url(r'^cuisines_result/(?P<search>.*)/(?P<page>.*)/$','cuisines_result_view',name='view_cuisines_result'),
	url(r'^cuisinedishes/(?P<id_cuis>\d+)/(?P<page>.*)/$','cuisinedishes_redirect_view',name='view_cuisinedishes_redirect'),
	url(r'^cuisinedishes/(?P<urlname>.*)/(?P<page>.*)/$','cuisinedishes_view',name='view_cuisinedishes'),
	url(r'^cuisinedishes/(?P<urlname>.*)/$','cuisinedishes_view',name='view_cuisinedishes'),

	url(r'^dish/(?P<id>\d+)/$','dishredirect_view',name='view_dishredirect'),
	url(r'^dish/(?P<urlname>.*)/$','dish_view',name='view_dish'),
	url(r'^dish_addto_list/(?P<dish_id>.*)/(?P<list_id>.*)/(?P<url_return>.*)/$','dish_addto_list_view',name='view_dish_addto_list'),
	url(r'^dish_addto_similar/(?P<dish_id>.*)/(?P<similar_id>.*)/$','dish_addto_simimar_view',name='view_dish_addto_similar'),
	#url(r'^dishunlike/$','dishunlike_view'),
	#url(r'^dishlike/$','dishlike_view'),
	url(r'^dishlikeaction/$','dishlikeaction_view'),
	url(r'^disheslatest/(?P<page>.*)/$','disheslatest_view',name='view_disheslatest'),
	url(r'^disheslatest/$','disheslatest_view',name='view_disheslatest'),
	url(r'^dishes/(?P<page>.*)/$','dishes_view',name='view_dishes'),
	url(r'^dishes/$','dishes_view',name='view_dishes'),
	url(r'^dishes_result/(?P<search>.*)/(?P<page>.*)/$','dishes_result_view',name='view_dishes_result'),
	#dishnew replaced by dishphotonew
	url(r'^dishnew/(?P<id_cui>.*)/(?P<name>.*)/$','dishphotonew_view',name='view_dishphotonew'),
	url(r'^dishnew/(?P<id_cui>.*)/$','dishphotonew_view',name='view_dishphotonew'),
	url(r'^dishnew/$','dishphotonew_view',name='view_dishphotonew'),
	url(r'^dishphotonew/(?P<id_cui>.*)/(?P<name>.*)/$','dishphotonew_view',name='view_dishphotonew'),
	url(r'^dishphotonew/(?P<id_cui>.*)/$','dishphotonew_view',name='view_dishphotonew'),
	url(r'^dishphotonew/$','dishphotonew_view',name='view_dishphotonew'),
	url(r'^dishedit/(?P<id>.*)/$','dishedit_view',name='view_dishedit'),
	url(r'^dishdelete/(?P<id>.*)/$','dishdelete_view',name='view_dishdelete'),
	url(r'^dishsimilar/(?P<urlname>.*)/$','dishsimilar_view',name='view_dishsimilar'),
	#url(r'^dishsimilar_delete/$','dishsimilar_delete_view',name='view_dishsimilar_delete'),	
	url(r'^dishsimilar_delete/(?P<dish1_id>\d+)/(?P<dish2_id>.*)/$','dishsimilar_delete_view',name='view_dishsimilar_delete'),
	#url(r'^profile_photo_upload/(?P<user_id>\d+)/(?P<url>.*)/$','profile_photo_upload_view',name='view_profile_photo_upload'),
	#url(r'^profile_photo_upload/(?P<fb_id>.*)/$','profile_photo_upload_view',name='view_profile_photo_upload'),
	url(r'^profile_photo_upload/$','profile_photo_upload_view',name='view_profile_photo_upload'),
	url(r'^profile_photo_delete/$','profile_photo_delete_view',name='view_profile_photo_delete'),
	#ajax to get dish used in: 1)dishphotonew:
	url(r'^ajax_getdish/$','ajax_getdish_view'),
	#ajax to get list used in: 1)dish:
	url(r'^ajax_getlist/$','ajax_getlist_view'),
	#for autocmpleate ajax in dishphotonew:
	url(r'^ajax_autocom_dishes1/$','ajax_autocom_dishes1_view'),
	#for ajax in photonewnodish, dish_similar:
	url(r'^dish_list/$','dishlist_view'),
	url(r'^dish_list/(?P<id_dish>.*)/$','dishlist_view'),
	#for ajax in dish to add to list in modal autocmpleate:
	url(r'^lists_autocomplete/$','lists_autocomplete_view'),
	#url(r'^lookup_cuisine/$','lookup_cuisine_view'),
	#for ajax in dish new
	url(r'^lookup_dish/$','lookup_dish_view'),
	#for ajax in dishnew $ dishedit to return dishes based in othernames input
	url(r'^lookup_othernames/$','lookup_othernames_view'),
	#for ajax in cuisine new
	url(r'^lookup_cui/$','lookup_cui_view'),
	#for ajax in cuisine edit
	#url(r'^lookup_cui_pk/$','lookup_cui_pk_view'),
	
	#url(r'^runit/$','runit_view',name='view_runit'),
	url(r'^listnew/$','listnew_view',name='view_listnew'),
	url(r'^listedit/(?P<urlname>.*)/$','listedit_view',name='view_listedit'),
	url(r'^listeditowner/(?P<urlname>.*)/$','listedit_owner_view',name='view_listedit_owner'),
	url(r'^listeditpublic/(?P<urlname>.*)/$','listedit_public_view',name='view_listedit_public'),
	url(r'^list_add_dish/(?P<list_id>.*)/(?P<dish_id>.*)/(?P<url_return>.*)/$','list_add_dish_view',name='view_list_add_dish'),
	#url(r'^list_add_dish2/(?P<list_id>.*)/(?P<dish_id>.*)/$','list_add_dish2_view',name='view_list_add_dish2'),
	url(r'^list_delete_dish/(?P<list_id>.*)/(?P<dish_id>.*)/$','list_delete_dish_view',name='view_list_delete_dish'),
	#url(r'^listdishedit/(?P<urlname>.*)/$','listdishedit_view',name='view_listdishedit'),
	url(r'^listindexedit/(?P<urlname>.*)/$','listindexedit_view',name='view_listindexedit'),
	url(r'^list/(?P<urlname>.*)/$','list_view',name='view_list'),
	url(r'^lists/(?P<page>.*)/(?P<alert>.*)/$','lists_view',name='view_lists'),
	url(r'^lists/(?P<page>.*)/$','lists_view',name='view_lists'),
	url(r'^lists/$','lists_view',name='view_lists'),
	url(r'^list_dish_comment_update/$','list_dish_comment_update_view',name='view_list_dish_comment_update'),
	url(r'^lists_mine/(?P<page>.*)/$','lists_mine_view',name='view_lists_mine'),
	url(r'^lists_mine/$','lists_mine_view',name='view_lists_mine'),
	url(r'^lists_foodie/(?P<username>.*)/(?P<page>.*)/$','listsfoodie_view',name='view_listsfoodie'),
	url(r'^lists_foodie/(?P<username>.*)/$','listsfoodie_view',name='view_listsfoodie'),
	url(r'^listlikeaction/$','listlikeaction_view'),
	url(r'^quick_search_list/$','quick_search_list_view',name='view_quick_search_list'),#From list results
	url(r'^list_search/$','list_search_view',name='view_list_search'),
	url(r'^list_search/(?P<search>.*)/(?P<alert>.*)/$','list_search_view',name='view_list_search'),
	url(r'^list_search_results/$','list_search_results_view',name='view_list_search_results'),
	url(r'^list_search_results/(?P<search>.*)/(?P<page>.*)/$','list_search_results_view',name='view_list_search_results'),
	url(r'^list_delete/(?P<id>.*)/$','list_delete_view',name='view_list_delete'),

	url(r'^photo/(?P<id>\d+)/$','photo_redirect_view',name='view_photo'),
	#url(r'^photo/(?P<urlname>.*)/(?P<reload>.*)/$','photourl_afterrotate_view',name='view_photourl_afterrotate'),
	url(r'^photo/(?P<urlname>.*)/(?P<reload>.*)/$','photourl_view',name='view_photourl'),
	url(r'^photo/(?P<urlname>.*)/$','photourl_view',name='view_photourl'),
	url(r'^photounlike/$','photounlike_view'),
	url(r'^photolike/$','photolike_view'),
	url(r'^photolikeaction/$','photolikeaction_view'),
	url(r'^photos/$','photos_view',name='view_photos'),
	url(r'^photos_mine/(?P<page>.*)/$','photos_mine_view',name='view_photos_mine'),
	url(r'^photos_mine/$','photos_mine_view',name='view_photos_mine'),
	url(r'^photonew/(?P<id>\d+)/$','photonew_view',name='view_photonew'),
	url(r'^photoedit/(?P<id>\d+)/$','photoedit_view',name='view_photoedit'),
	url(r'^photorotate/(?P<id>\d+)/$','photorotate_view',name='view_photorotate'),
	url(r'^photocrop/(?P<id>\d+)/$','photocrop_view',name='view_photocrop'),
	url(r'^photodelete/(?P<id>\d+)/$','photodelete_view',name='view_photodelete'),
	url(r'^photofullscreen/(?P<pic_id>\d+)/$','photofullscreen_view',name='view_photofullscreen'),
	url(r'^photosfull/$','photosfull_view',name='view_photosfull'),
	url(r'^photouploadmain/$','photouploadmain_view',name='view_photouploadmain'),

	url(r'^latestphotos/$','latestphotos_view',name='view_latestphotos'),
	url(r'^latestphotos/(?P<page>.*)/$','latestphotos_view',name='view_latestphotos'),

	url(r'^searchadvance/$','searchadvance_view',name='view_searchadvance'),
	url(r'^searchadvance/(?P<alert>.*)/(?P<names>.*)/(?P<ingredients>.*)/(?P<cuisines>.*)/(?P<page>.*)/$','searchadvance_view',name='view_searchadvance'),
	url(r'^searchresultadv/(?P<names>.*)/(?P<ingredients>.*)/(?P<cuisines>.*)/(?P<page>.*)/$','searchresultadv_view',name='view_searchresultadv'),
	url(r'^searchquick/$','searchquick_view',name='view_searchquick'),
	url(r'^searchquickres/$','searchquickres_view',name='view_searchquickres'),
	url(r'^searchquickres/(?P<alert>.*)/(?P<search>.*)/(?P<page>.*)/$','searchquickres_view',name='view_searchquickres'),
	#####delete later######
	#url(r'^searchdish/$','searchdish_view',name='view_searchdish'),
	#url(r'^searchdish/(?P<names>.*)/(?P<ingredients>.*)/(?P<cuisines>.*)/(?P<page>.*)/$','searchdish_view',name='view_searchdish'),
	
#	url(r'^next/(?P<where>\d+)/(?P<id_dish>.*)/$','next_view',name='view_next'),

	url(r'^siteindex/$','siteindex_view',name='view_siteindex'),
	url(r'^login/$','login_view',name='view_login'),
	url(r'^login/(?P<mensa>.*)/$','login_view',name='view_login'),
	#url(r'^login/(?P<username>.*)/$','login_view',name='view_login'),
	url(r'^signin/$','signin_view',name='view_signin'),
	url(r'^signin/(?P<mensa>.*)/$','signin_view',name='view_signin'),
	url(r'^signup/$','signup_view',name='view_signup'),
	url(r'^create_pass/$','create_pass_view',name='view_create_pass'),
	url(r'^unlink_account/$','unlink_account_view',name='view_unlink_account'),
	url(r'^about/$','about_view',name='view_about'),
	url(r'^contact/$','contact_view',name='view_contact'),
	url(r'^help/$','help_view',name='view_help'),
	url(r'^guidelines/$','guidelines_view',name='view_guidelines'),
	url(r'^terms/$','terms_view',name='view_terms'),
	url(r'^passrecovery/$','passrecovery_view',name='view_passrecovery'),
	url(r'^myprofile/$','myprofile_view',name='view_myprofile'),
	#url(r'^myprofile/(?P<mensa>.*)/$','myprofile_view',name='view_myprofile'),
	url(r'^privacy/$','privacy_view',name='view_privacy'),
	#url(r'^update_email/$','updateEmail_view',name='view_updateEmail'),
	url(r'^update_password/$','updatePassword_view',name='view_updatePassword'),
	url(r'^update_profile/$','updateProfile_view',name='view_updateProfile'),
	url(r'^update_picture/$','updatePicture_view',name='view_updatePicture'),
	url(r'^update_aboutme/$','updateAboutme_view',name='view_updateAboutme'),
	url(r'^logout/$','logout_view',name='view_logout'),
	url(r'^profile/(?P<id>\d+)/$','profile_redirect_view',name='view_profile_redirect'),
	url(r'^profile/(?P<username>.*)/$','profile_view',name='view_profile'),
	url(r'^foodie/(?P<username>.*)/$','profile_view',name='view_profile'),
	#url(r'^users/(?P<page>.*)/$','foodies_view',name='view_foodies'),
	url(r'^foodies/(?P<page>.*)/$','foodies_view',name='view_foodies'),
	url(r'^foodies/$','foodies_view',name='view_foodies'),

	#url(r'^userPictures/(?P<id>\d+)/(?P<page>.*)/$','userPictures_redirect_view',name='view_userPictures_redirect'),
	#url(r'^userPictures/(?P<username>.*)/(?P<page>.*)/$','userPictures_view',name='view_userPictures'),
	url(r'^userphotos/(?P<username>.*)/(?P<page>.*)/$','userphotos_view',name='view_userphotos'),
	url(r'^userphotos/(?P<username>.*)/$','userphotos_view',name='view_userphotos'),
	url(r'^google6e29e8258e0b7265\.html$', lambda r: HttpResponse("google-site-verification: google6e29e8258e0b7265.html", content_type="text/plain")),
	)