2012-12-14 20:53:36 +08:00
|
|
|
from django.conf.urls.defaults import *
|
|
|
|
|
|
|
|
from views import *
|
|
|
|
|
|
|
|
|
|
|
|
urlpatterns = patterns('',
|
|
|
|
url(r'^ping/$', Ping.as_view()),
|
|
|
|
url(r'^auth/ping/$', AuthPing.as_view()),
|
|
|
|
url(r'^auth-token/', ObtainAuthToken.as_view()),
|
|
|
|
|
2012-12-23 22:27:16 +08:00
|
|
|
# RESTful API
|
2013-09-07 20:59:53 +08:00
|
|
|
url(r'^accounts/$', Accounts.as_view(), name="accounts"),
|
2013-09-10 11:26:52 +08:00
|
|
|
url(r'^accounts/(?P<email>\S+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/$', Account.as_view(), name="api2-account"),
|
|
|
|
url(r'^account/info/$', AccountInfo.as_view()),
|
2014-01-17 23:27:45 +08:00
|
|
|
url(r'^regdevice/$', RegDevice.as_view(), name="regdevice"),
|
2013-12-07 17:32:26 +08:00
|
|
|
url(r'^search/$', Search.as_view(), name='api_search'),
|
2013-06-29 11:01:28 +08:00
|
|
|
url(r'^repos/$', Repos.as_view(), name="api2-repos"),
|
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/$', Repo.as_view(), name="api2-repo"),
|
2013-12-31 11:30:29 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/history/$', RepoHistory.as_view()),
|
2012-12-23 22:27:16 +08:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/download-info/$', DownloadRepo.as_view()),
|
2014-03-13 14:26:41 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/owner/$', RepoOwner.as_view()),
|
2014-04-02 12:26:09 +01:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/public/$', RepoPublic.as_view()),
|
2012-12-25 11:09:34 +08:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/upload-link/$', UploadLinkView.as_view()),
|
2013-04-02 15:09:33 +08:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/update-link/$', UpdateLinkView.as_view()),
|
2013-08-09 01:19:25 +08:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/upload-blks-link/$', UploadBlksLinkView.as_view()),
|
|
|
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/update-blks-link/$', UpdateBlksLinkView.as_view()),
|
2012-12-23 22:27:16 +08:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/file/$', FileView.as_view(), name='FileView'),
|
2014-03-03 13:12:28 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/file/detail/$', FileDetailView.as_view()),
|
2013-12-31 11:55:46 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/file/history/$', FileHistory.as_view()),
|
2013-12-31 12:07:17 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/file/revision/$', FileRevision.as_view()),
|
2013-12-31 12:46:06 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/file/revert/$', FileRevert.as_view()),
|
2012-12-23 22:27:16 +08:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/file/shared-link/$', FileSharedLinkView.as_view()),
|
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/dir/$', DirView.as_view(), name='DirView'),
|
2013-12-31 14:52:41 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/dir/sub_repo/$', DirSubRepoView.as_view()),
|
2014-01-02 10:45:50 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/dir/share/$', DirShareView.as_view()),
|
2013-12-31 12:55:15 +00:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/dir/download/$', DirDownloadView.as_view()),
|
2012-12-23 22:27:16 +08:00
|
|
|
url(r'^starredfiles/', StarredFileView.as_view(), name='starredfiles'),
|
2013-02-20 20:51:37 +08:00
|
|
|
url(r'^shared-repos/$', SharedRepos.as_view(), name='sharedrepos'),
|
|
|
|
url(r'^shared-repos/(?P<repo_id>[-0-9-a-f]{36})/$', SharedRepo.as_view(), name='sharedrepo'),
|
2013-05-18 11:01:33 +08:00
|
|
|
url(r'^beshared-repos/$', BeShared.as_view(), name='beshared'),
|
2013-12-18 13:51:43 +08:00
|
|
|
url(r'^default-repo/$', DefaultRepoView.as_view(), name='api2-defaultrepo'),
|
2013-12-31 14:34:19 +00:00
|
|
|
url(r'^shared-links/$', SharedLinksView.as_view()),
|
2013-12-31 13:10:26 +00:00
|
|
|
url(r'^shared-files/$', SharedFilesView.as_view()),
|
2013-12-31 14:46:10 +00:00
|
|
|
url(r'^virtual-repos/$', VirtualRepos.as_view()),
|
2012-12-29 10:31:23 +08:00
|
|
|
|
2014-04-03 13:56:40 +08:00
|
|
|
|
2014-04-03 11:50:29 +08:00
|
|
|
url(r'^s/f/(?P<token>[a-f0-9]{10})/$', PrivateSharedFileView.as_view()),
|
2014-03-18 09:24:43 +00:00
|
|
|
url(r'^s/f/(?P<token>[a-f0-9]{10})/detail/$', PrivateSharedFileDetailView.as_view()),
|
2014-04-03 11:50:29 +08:00
|
|
|
url(r'^f/(?P<token>[a-f0-9]{10})/$', SharedFileView.as_view()),
|
2014-03-13 14:48:11 +00:00
|
|
|
url(r'^f/(?P<token>[a-f0-9]{10})/detail/$', SharedFileDetailView.as_view()),
|
2014-02-03 14:31:06 +00:00
|
|
|
|
2014-01-18 15:51:08 +08:00
|
|
|
url(r'^groupandcontacts/$', GroupAndContacts.as_view()),
|
2013-11-27 12:48:50 +08:00
|
|
|
url(r'^events/$', EventsView.as_view()),
|
2013-12-18 13:51:43 +08:00
|
|
|
url(r'^unseen_messages/$', UnseenMessagesCountView.as_view()),
|
2014-03-03 18:34:37 +08:00
|
|
|
url(r'^group/msgs/(?P<group_id>\d+)/$', GroupMsgsView.as_view()),
|
|
|
|
url(r'^group/(?P<group_id>\d+)/msg/(?P<msg_id>\d+)/$', GroupMsgView.as_view()),
|
|
|
|
url(r'^user/msgs/(?P<id_or_email>[^/]+)/$', UserMsgsView.as_view()),
|
|
|
|
url(r'^new_replies/$', NewRepliesView.as_view()),
|
|
|
|
|
2014-04-13 01:37:04 +08:00
|
|
|
url(r'^avatars/user/(?P<user>\S+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/resized/(?P<size>[0-9]+)/$', UserAvatarView.as_view()),
|
|
|
|
url(r'^avatars/group/(?P<group_id>\d+)/resized/(?P<size>[0-9]+)/$', GroupAvatarView.as_view()),
|
2014-04-03 12:07:09 +08:00
|
|
|
|
2013-05-25 17:46:55 +08:00
|
|
|
url(r'^groups/$', Groups.as_view()),
|
2014-04-03 11:39:50 +08:00
|
|
|
url(r'^groups/(?P<group_id>\d+)/members/$', GroupMembers.as_view()),
|
|
|
|
|
2014-03-03 18:34:37 +08:00
|
|
|
url(r'^html/events/$', EventsHtml.as_view()),
|
2013-07-06 17:03:06 +08:00
|
|
|
url(r'^html/more_events/$', AjaxEvents.as_view(), name="more_events"),
|
2013-06-22 21:34:11 +08:00
|
|
|
url(r'^html/repo_history_changes/(?P<repo_id>[-0-9a-f]{36})/$', RepoHistoryChangeHtml.as_view(), name='api_repo_history_changes'),
|
2013-06-25 17:04:41 +08:00
|
|
|
url(r'^html/discussions/(?P<group_id>\d+)/$', DiscussionsHtml.as_view(), name="api_discussions"),
|
2013-06-22 21:34:11 +08:00
|
|
|
url(r'^html/discussion/(?P<msg_id>\d+)/$', DiscussionHtml.as_view(), name="api_discussion"),
|
2013-07-06 17:03:06 +08:00
|
|
|
url(r'^html/more_discussions/(?P<group_id>\d+)/$', AjaxDiscussions.as_view(), name="more_discussions"),
|
2013-07-17 00:36:37 +08:00
|
|
|
url(r'^html/newreply/$', NewReplyHtml.as_view()),
|
2014-01-17 23:27:45 +08:00
|
|
|
url(r'^html/usermsgs/(?P<id_or_email>[^/]+)/$', UserMsgsHtml.as_view()),
|
|
|
|
url(r'^html/more_usermsgs/(?P<id_or_email>[^/]+)/$', AjaxUserMsgs.as_view(), name="api_more_usermsgs"),
|
2013-06-08 14:52:45 +08:00
|
|
|
|
2013-06-10 00:25:50 +08:00
|
|
|
# Folowing is only for debug, will be removed
|
2013-08-03 15:19:23 +08:00
|
|
|
#url(r'^html/newreply2/$', api_new_replies),
|
|
|
|
#url(r'^html/events2/$', activity2),
|
2013-10-18 01:01:43 +08:00
|
|
|
#url(r'^html/more_events/$', events2, name="more_events"),
|
2013-06-22 21:34:11 +08:00
|
|
|
#url(r'^html/repo_history_changes/(?P<repo_id>[-0-9a-f]{36})/$', api_repo_history_changes, name='api_repo_history_changes'),
|
|
|
|
|
2013-08-03 15:19:23 +08:00
|
|
|
#url(r'^html/discussions2/(?P<group_id>\d+)/$', discussions2, name="api_discussions2"),
|
2013-06-25 17:04:41 +08:00
|
|
|
#url(r'^html/discussion/(?P<msg_id>\d+)/$', discussion2, name="api_discussion2"),
|
|
|
|
#url(r'^html/more_discussions/(?P<group_id>\d+)/$', more_discussions2, name="more_discussions"),
|
2014-01-17 23:27:45 +08:00
|
|
|
#url(r'^html/usermsgs2/(?P<id_or_email>[^/]+)/$', api_usermsgs),
|
|
|
|
#url(r'^html/more_usermsgs/(?P<id_or_email>[^/]+)/$', api_more_usermsgs, name="api_more_usermsgs"),
|
|
|
|
|
2013-05-25 17:46:55 +08:00
|
|
|
|
2012-12-29 10:31:23 +08:00
|
|
|
# Deprecated
|
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/fileops/delete/$', OpDeleteView.as_view()),
|
2013-12-07 10:28:36 +08:00
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/fileops/copy/$', OpCopyView.as_view()),
|
|
|
|
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/fileops/move/$', OpMoveView.as_view()),
|
2012-12-14 20:53:36 +08:00
|
|
|
)
|
2014-03-13 14:53:59 +00:00
|
|
|
|
|
|
|
# serve office converter static files
|
|
|
|
from seahub.utils import HAS_OFFICE_CONVERTER
|
|
|
|
if HAS_OFFICE_CONVERTER:
|
|
|
|
from seahub.utils import OFFICE_HTML_DIR
|
|
|
|
urlpatterns += patterns('',
|
|
|
|
url(r'^office-convert/static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': OFFICE_HTML_DIR}, name='api_office_convert_static'),
|
|
|
|
)
|
|
|
|
urlpatterns += patterns('',
|
|
|
|
url(r'^office-convert/status/$', OfficeConvertQueryStatus.as_view()),
|
|
|
|
url(r'^office-convert/page-num/$', OfficeConvertQueryPageNum.as_view()),
|
|
|
|
)
|
|
|
|
urlpatterns += patterns('',
|
|
|
|
url(r'^office-convert/generate/repos/(?P<repo_id>[-0-9-a-f]{36})/$', OfficeGenerateView.as_view()),
|
|
|
|
)
|