mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-20 06:08:35 +02:00
wip: webmail big refactoring
Little issues due to the previous merge have been fixed.
This commit is contained in:
@@ -75,8 +75,6 @@ def infos():
|
||||
|
||||
@events.observe("UserMenuDisplay")
|
||||
def menu(target, user):
|
||||
import views
|
||||
|
||||
if target != "top_menu":
|
||||
return []
|
||||
if not user.has_mailbox:
|
||||
@@ -84,7 +82,7 @@ def menu(target, user):
|
||||
return [
|
||||
{"name" : "webmail",
|
||||
"label" : _("Webmail"),
|
||||
"url" : reverse(views.index),
|
||||
"url" : reverse("modoboa.extensions.webmail.views.newindex"),
|
||||
"img" : static_url("pics/webmail.png")}
|
||||
]
|
||||
|
||||
|
||||
+27
-26
@@ -5,30 +5,31 @@ from django.conf.urls.defaults import *
|
||||
# name matches one of the first entries (from "compose" to
|
||||
# "attachments"), the associated folder will not be accessible.
|
||||
#
|
||||
urlpatterns = patterns('modoboa.extensions.webmail.views',
|
||||
#(r'^$', "index"),
|
||||
(r'^$', "newindex"),
|
||||
(r'^submailboxes', "submailboxes"),
|
||||
(r'^mailcontent', "getmailcontent"),
|
||||
urlpatterns = patterns(
|
||||
'modoboa.extensions.webmail.views',
|
||||
#(r'^$', "index"),
|
||||
(r'^$', "newindex"),
|
||||
(r'^submailboxes', "submailboxes"),
|
||||
#(r'^mailcontent', "getmailcontent"),
|
||||
|
||||
|
||||
# (r'^compose/$', "compose"),
|
||||
(r'^move/$', "move"),
|
||||
(r'^mark/(?P<name>.+)/$', "mark"),
|
||||
(r'^empty/(?P<name>.+)/$', "empty"),
|
||||
(r'^compact/(?P<name>.+)/$', "compact"),
|
||||
(r'^newfolder/$', "newfolder"),
|
||||
(r'^editfolder/$', 'editfolder'),
|
||||
(r'^delfolder/$', 'delfolder'),
|
||||
|
||||
(r'^attachments/$', 'attachments'),
|
||||
(r'^delattachment/$', 'delattachment'),
|
||||
|
||||
(r'^(?P<folder>.+)/(?P<mail_id>[\w\-\+]+)/part/$', 'getattachment'),
|
||||
(r'^(?P<fdname>.+)/(?P<mail_id>[\w\-\+]+)/delete/$', 'delete'),
|
||||
#(r'^(?P<folder>.+)/(?P<mailid>[\w\-\+]+)/content/$', 'getmailcontent'),
|
||||
(r'^(?P<folder>.+)/(?P<mail_id>[\w\-\+]+)/forward/$', 'forward'),
|
||||
(r'^(?P<folder>.+)/(?P<mail_id>[\w\-\+]+)/reply/$', 'reply'),
|
||||
# (r'^(?P<folder>.+)/(?P<mail_id>[\w\-\+]+)/$', 'viewmail'),
|
||||
(r'^(?P<name>.+)/$', "folder"),
|
||||
)
|
||||
|
||||
# (r'^compose/$', "compose"),
|
||||
(r'^move/$', "move"),
|
||||
(r'^mark/(?P<name>.+)/$', "mark"),
|
||||
(r'^empty/(?P<name>.+)/$', "empty"),
|
||||
(r'^compact/(?P<name>.+)/$', "compact"),
|
||||
(r'^newfolder/$', "newfolder"),
|
||||
(r'^editfolder/$', 'editfolder'),
|
||||
(r'^delfolder/$', 'delfolder'),
|
||||
|
||||
(r'^attachments/$', 'attachments'),
|
||||
(r'^delattachment/$', 'delattachment'),
|
||||
|
||||
(r'^(?P<folder>.+)/(?P<mail_id>[\w\-\+]+)/part/$', 'getattachment'),
|
||||
(r'^(?P<fdname>.+)/(?P<mail_id>[\w\-\+]+)/delete/$', 'delete'),
|
||||
#(r'^(?P<folder>.+)/(?P<mailid>[\w\-\+]+)/content/$', 'getmailcontent'),
|
||||
(r'^(?P<folder>.+)/(?P<mail_id>[\w\-\+]+)/forward/$', 'forward'),
|
||||
(r'^(?P<folder>.+)/(?P<mail_id>[\w\-\+]+)/reply/$', 'reply'),
|
||||
# (r'^(?P<folder>.+)/(?P<mail_id>[\w\-\+]+)/$', 'viewmail'),
|
||||
(r'^(?P<name>.+)/$', "folder"),
|
||||
)
|
||||
|
||||
@@ -621,14 +621,14 @@ def viewmail(request):
|
||||
return dict(listing=content, menuargs=dict(mail_id=mailid))
|
||||
|
||||
@login_required
|
||||
@is_not_localadmin()
|
||||
@needs_mailbox()
|
||||
def submailboxes(request):
|
||||
topmailbox = request.GET.get('topmailbox', '')
|
||||
mboxes = get_imapconnector(request).getfolders(request.user, topmailbox)
|
||||
return ajax_simple_response(dict(status="ok", mboxes=mboxes))
|
||||
|
||||
@login_required
|
||||
@is_not_localadmin()
|
||||
@needs_mailbox()
|
||||
def newindex(request):
|
||||
"""Webmail actions handler
|
||||
|
||||
|
||||
Reference in New Issue
Block a user