mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
fix: using MEDIA_URL inside templates.
wip: #36, using tinyMCE (django-tinymce) to write messages in HTML. Currently, compose a new message is working pretty well. Answering or forwarding a message is still a mess...
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{% extends "common/email_listing.html" %}
|
||||
{% load i18n %}
|
||||
{% block css %}
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/quarantine.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/quarantine.css" />
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
mysubmit = function(event, name) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% load i18n %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="/static/css/calendar.css" />
|
||||
<script type="text/javascript" src="/static/js/calendar.js"></script>
|
||||
href="{{ MEDIA_URL }}css/calendar.css" />
|
||||
<script type="text/javascript" src="{{ MEDIA_URL }}js/calendar.js"></script>
|
||||
<style type="text/css">
|
||||
#id_subject {
|
||||
width: 250px;
|
||||
|
||||
@@ -109,8 +109,6 @@ class Grapher(object):
|
||||
|
||||
if not os.path.exists(path):
|
||||
print "[graph] Impossible to create %s graph" %path
|
||||
else:
|
||||
print "[graph] %s graph created" %path
|
||||
|
||||
def make_defaults(self, target, tpl=traffic_avg_template):
|
||||
end = "%d" % int(time.mktime(time.localtime()))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% load i18n %}
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/calendar.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/calendar.css" />
|
||||
<style type="text/css">
|
||||
#selectors {
|
||||
}
|
||||
@@ -76,7 +76,7 @@ window.addEvent("domready", function() {
|
||||
$("customsend").addEvent("click", get_graph);
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="/static/js/calendar.js"></script>
|
||||
<script type="text/javascript" src="{{ MEDIA_URL }}js/calendar.js"></script>
|
||||
|
||||
<div id="selectors">
|
||||
{% if admin %}
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
{% endif %}
|
||||
{% for elems in graphs %}
|
||||
<h3>{{ elems.label }}</h3>
|
||||
<p><img src="/static/stats/{{ elems.name }}_{{ domain }}_AVERAGE_{% ifequal period 'custom' %}{{ period_name }}{% else %}{{ period }}{% endifequal %}.png"
|
||||
<p><img src="{{ MEDIA_URL }}stats/{{ elems.name }}_{{ domain }}_AVERAGE_{% ifequal period 'custom' %}{{ period_name }}{% else %}{{ period }}{% endifequal %}.png"
|
||||
alt="{% trans 'No statistics available' %}" /></p>
|
||||
{% endfor %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import sys, os
|
||||
reload(sys)
|
||||
sys.setdefaultencoding("utf-8")
|
||||
|
||||
@@ -11,7 +11,9 @@ import ssl
|
||||
from datetime import datetime, timedelta
|
||||
from email.header import decode_header
|
||||
import email.utils
|
||||
import lxml
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.conf import settings
|
||||
from modoboa.lib import decode, tables, imap_utf7, Singleton
|
||||
from modoboa.lib.email_listing import MBconnector, EmailListing, Email
|
||||
from modoboa.lib import tables, imap_utf7, parameters
|
||||
@@ -458,6 +460,39 @@ class ImapEmail(Email):
|
||||
"attachments" : attachments != [] and attachments or None
|
||||
})
|
||||
|
||||
def find_images_in_body(body):
|
||||
"""Looks for images inside a HTML body
|
||||
|
||||
Before sending a message in HTML format, it is necessary to find
|
||||
all img tags contained in the body in order to rewrite them. For
|
||||
example, icons provided by tinyMCE are stored on the server
|
||||
filesystem and not accessible from the outside. We must embark
|
||||
them as parts off the MIME message if we want recipients to
|
||||
display them correctly.
|
||||
|
||||
:param body: the HTML body to parse
|
||||
"""
|
||||
from email.mime.image import MIMEImage
|
||||
html = lxml.html.fromstring(body)
|
||||
parts = []
|
||||
for tag in html.iter("img"):
|
||||
src = tag.get("src")
|
||||
fname = os.path.basename(src)
|
||||
cid = "%s@modoboa" % os.path.splitext(fname)[0]
|
||||
tag.set("src", "cid:%s" % cid)
|
||||
|
||||
path = "%s/%s" % (settings.MODOBOA_DIR, re.sub("\.\./", "", src))
|
||||
fp = open(path, "rb")
|
||||
p = MIMEImage(fp.read())
|
||||
fp.close()
|
||||
p["Content-ID"] = "<%s>" % cid
|
||||
ct = p["Content-Type"]
|
||||
p.replace_header("Content-Type", '%s; name="%s"' % (ct, fname))
|
||||
parts.append(p)
|
||||
|
||||
return lxml.html.tostring(html), parts
|
||||
|
||||
|
||||
def encrypt(clear):
|
||||
from Crypto.Cipher import AES
|
||||
import base64
|
||||
|
||||
@@ -40,6 +40,9 @@ def init():
|
||||
help=_("Folder where copies of sent messages go"))
|
||||
parameters.register_user("webmail", "SIGNATURE", type="text", default="",
|
||||
help=_("User defined email signature"))
|
||||
parameters.register_user("webmail", "EDITOR", type="list", deflt="text",
|
||||
values=[("html", "html"), ("plain", "text")],
|
||||
help=_("The default editor to use when composing a message"))
|
||||
|
||||
def destroy():
|
||||
events.unregister("UserMenuDisplay", menu)
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
{% include "common/genericform.html" %}
|
||||
</div>
|
||||
{% if body %}
|
||||
<textarea id="id_body" name="id_body">{% if bodyheader %}{{ bodyheader }}{% endif %}
|
||||
<textarea id="id_body" name="id_body" class="editor">{% if bodyheader %}{{ bodyheader }}{% endif %}
|
||||
{{ body }}
|
||||
</textarea>
|
||||
{% else %}
|
||||
<textarea id="id_body" name="id_body"></textarea>
|
||||
<textarea id="id_body" name="id_body" class="editor"></textarea>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "common/email_listing.html" %}
|
||||
{% load i18n %}
|
||||
{% block css %}
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/webmail.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/css/webmail.css" />
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
quota_pb = new ProgressBar({
|
||||
@@ -86,8 +86,14 @@
|
||||
current_anchor.update();
|
||||
}
|
||||
});
|
||||
tinyMCE.triggerSave();
|
||||
$("composemail").send();
|
||||
});
|
||||
if (resp.editor == "html") {
|
||||
new Request({url: "{% url tinymce-js 'common' %}",
|
||||
onSuccess: function(resp) { eval(resp); }
|
||||
}).get();
|
||||
}
|
||||
window.fireEvent("resize");
|
||||
}
|
||||
|
||||
|
||||
@@ -211,12 +211,14 @@ def render_compose(request, form, posturl, bodyheader=None, body=None,
|
||||
insert_signature=False):
|
||||
menu = compose_menu("", __get_current_url(request),
|
||||
request.user.get_all_permissions())
|
||||
editor = parameters.get_user(request.user, "webmail", "EDITOR")
|
||||
if insert_signature:
|
||||
if body == None:
|
||||
body = ""
|
||||
signature = parameters.get_user(request.user, "webmail", "SIGNATURE")
|
||||
if signature != "":
|
||||
body += "\n---\n%s" % signature
|
||||
body += editor == "plain" and "\n---\n%s" % signature \
|
||||
or "<br/>---<br/>%s" % re.sub("\n", "<br/>", signature)
|
||||
|
||||
content = render_to_string("webmail/compose.html", {
|
||||
"form" : form, "bodyheader" : bodyheader, "body" : body,
|
||||
@@ -225,7 +227,8 @@ def render_compose(request, form, posturl, bodyheader=None, body=None,
|
||||
mbc = IMAPconnector(user=request.user.username,
|
||||
password=request.session["password"])
|
||||
ctx = getctx("ok", level=2, menu=menu, listing=content,
|
||||
folders=__render_folders(mbc, request))
|
||||
folders=__render_folders(mbc, request),
|
||||
editor=editor)
|
||||
return HttpResponse(simplejson.dumps(ctx), mimetype="application/json")
|
||||
|
||||
def send_mail(request, withctx=False, origmsg=None, posturl=None):
|
||||
@@ -237,8 +240,19 @@ def send_mail(request, withctx=False, origmsg=None, posturl=None):
|
||||
from email.utils import make_msgid, formatdate
|
||||
import smtplib
|
||||
|
||||
msg = MIMEText(request.POST["id_body"].encode("utf-8"),
|
||||
_charset="utf-8")
|
||||
subtype = parameters.get_user(request.user, "webmail", "EDITOR")
|
||||
body = request.POST["id_body"]
|
||||
if subtype == "html":
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
msg = MIMEMultipart(_subtype="related")
|
||||
body, images = find_images_in_body(body)
|
||||
msg.attach(MIMEText(body.encode("utf-8"), _subtype=subtype,
|
||||
_charset="utf-8"))
|
||||
for img in images:
|
||||
msg.attach(img)
|
||||
else:
|
||||
msg = MIMEText(body.encode("utf-8"), _subtype=subtype)
|
||||
|
||||
msg["Subject"] = request.POST["subject"]
|
||||
msg["From"] = request.POST["from_"]
|
||||
msg["To"] = request.POST["to"]
|
||||
|
||||
+20
-7
@@ -169,10 +169,6 @@ class Email(object):
|
||||
|
||||
if part.has_key("Content-Location"):
|
||||
fname = part["Content-Location"]
|
||||
if re.match("^http:", fname):
|
||||
path = fname
|
||||
else:
|
||||
path = self.__save_image(fname, part)
|
||||
elif part.has_key("Content-Disposition"):
|
||||
if not part["Content-Disposition"].startswith("inline"):
|
||||
continue
|
||||
@@ -183,12 +179,18 @@ class Email(object):
|
||||
if len(p) and p[0] == "filename":
|
||||
fname = p[1]
|
||||
break
|
||||
path = self.__save_image(fname is None and cid or fname, part)
|
||||
if fname is None:
|
||||
fname = cid
|
||||
elif part.has_key("Content-Type"):
|
||||
m = re.match(".*name=[\"'](.+)[\"']", part["Content-Type"])
|
||||
if m is None:
|
||||
continue
|
||||
fname = m.group(1)
|
||||
else:
|
||||
continue
|
||||
|
||||
self.attached_map[cid] = path
|
||||
continue
|
||||
self.attached_map[cid] = re.match("^http:", fname) and fname \
|
||||
or self.__save_image(fname, part)
|
||||
|
||||
|
||||
if not contents.has_key(mode) or contents[mode] == "":
|
||||
@@ -201,6 +203,16 @@ class Email(object):
|
||||
getattr(self, "viewmail_%s" % mode)(contents[mode], links=links)
|
||||
|
||||
def __save_image(self, fname, part):
|
||||
"""Save an inline image on the filesystem.
|
||||
|
||||
Some HTML messages are using inline images (attached images
|
||||
with links on them inside the body). In order to display them,
|
||||
images are saved on the filesystem and links contained in the
|
||||
message are modified.
|
||||
|
||||
:param fname: the image associated filename
|
||||
:param part: the email part that contains the image payload
|
||||
"""
|
||||
from django.conf import settings
|
||||
|
||||
if re.search("\.\.", fname):
|
||||
@@ -216,6 +228,7 @@ class Email(object):
|
||||
|
||||
m = re.match(".*cid:(.+)", url)
|
||||
if m:
|
||||
print self.attached_map
|
||||
if self.attached_map.has_key(m.group(1)):
|
||||
return self.attached_map[m.group(1)]
|
||||
return url
|
||||
|
||||
@@ -21,6 +21,13 @@ events = ["CreateDomain",
|
||||
callbacks = {}
|
||||
|
||||
def register(event, callback):
|
||||
"""Register a plugin callback for a specific event
|
||||
|
||||
The event must be declared in this module.
|
||||
|
||||
:param event: the event to listen to
|
||||
:param callback: a function to execute when the event is raised
|
||||
"""
|
||||
if not event in events:
|
||||
return 0
|
||||
if not event in callbacks.keys():
|
||||
@@ -30,6 +37,11 @@ def register(event, callback):
|
||||
return 1
|
||||
|
||||
def unregister(event, callback):
|
||||
"""Unregister a callback for a specific event
|
||||
|
||||
:param event: the targeted event
|
||||
:param callback: the callback to remove
|
||||
"""
|
||||
if not event in events:
|
||||
return False
|
||||
if not callbacks.has_key(event):
|
||||
@@ -40,6 +52,13 @@ def unregister(event, callback):
|
||||
pass
|
||||
|
||||
def raiseEvent(event, **kwargs):
|
||||
"""Raise a specific event
|
||||
|
||||
Any additional keyword argument will be passed to registered
|
||||
callbacks.
|
||||
|
||||
:param event: the event to raise
|
||||
"""
|
||||
if not event in events or not event in callbacks.keys():
|
||||
return 0
|
||||
for callback in callbacks[event]:
|
||||
@@ -47,6 +66,13 @@ def raiseEvent(event, **kwargs):
|
||||
return 1
|
||||
|
||||
def raiseQueryEvent(event, **kwargs):
|
||||
"""Raise a specific event and wait for answers from callbacks
|
||||
|
||||
Any additional keyword argument will be passed to registered
|
||||
callbacks. Callback answers are returned as a list.
|
||||
|
||||
:param event: the event to raise
|
||||
"""
|
||||
result = []
|
||||
if not event in events or not event in callbacks.keys():
|
||||
return result
|
||||
|
||||
+2
-1
@@ -43,7 +43,7 @@ MEDIA_ROOT = ''
|
||||
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||
# trailing slash if there is a path component (optional in other cases).
|
||||
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
||||
MEDIA_URL = ''
|
||||
MEDIA_URL = '/static/'
|
||||
|
||||
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
||||
# trailing slash.
|
||||
@@ -89,6 +89,7 @@ INSTALLED_APPS = (
|
||||
'django.contrib.sites',
|
||||
'django.contrib.messages',
|
||||
'south',
|
||||
'tinymce',
|
||||
'modoboa',
|
||||
'modoboa.lib',
|
||||
'modoboa.admin',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% load i18n %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
window.addEvent("domready", function() {
|
||||
$("id_domain").addEvent("change", function(event) {
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
{% url admin.views.editalias domain.id alias.id as edit_url %}
|
||||
<a href="{{ edit_url }}" class="boxed"
|
||||
rel="{handler:'iframe',size:{x:300,y:250}}">
|
||||
<img src="/static/pics/edit.png" border="0" title="{% trans 'Edit alias' %}"/>
|
||||
<img src="{{ MEDIA_URL }}pics/edit.png" border="0" title="{% trans 'Edit alias' %}"/>
|
||||
</a>
|
||||
{% url admin.views.delalias domain.id alias.id as del_url %}
|
||||
<a href="{{ del_url }}" name="deleteAlias">
|
||||
<img src="/static/pics/remove.png" border="0" title="{% trans 'Delete alias' %}" />
|
||||
<img src="{{ MEDIA_URL }}pics/remove.png" border="0" title="{% trans 'Delete alias' %}" />
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ alias.full_address }}</td>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "nlayout.html" %}
|
||||
{% load i18n libextras %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/domains.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/domains.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block middletitle %}{% trans "Domain" %} {{ domain.name }}{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% load i18n %}
|
||||
{% load admin_extras %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/domains.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/domains.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
window.addEvent('domready', function() {
|
||||
{% url admin.views.domains as view_url %}
|
||||
@@ -31,11 +31,11 @@
|
||||
{% url admin.views.editdomain dom.id as edit_url %}
|
||||
<a href="{{ edit_url }}" class="boxed"
|
||||
rel="{handler:'iframe',size:{x:300,y:180}}">
|
||||
<img src="/static/pics/edit.png" border="0" title="{% trans 'Edit domain' %}"/>
|
||||
<img src="{{ MEDIA_URL }}pics/edit.png" border="0" title="{% trans 'Edit domain' %}"/>
|
||||
</a>
|
||||
{% url admin.views.deldomain dom.id as del_url %}
|
||||
<a href="{{ del_url }}" name="deleteDom">
|
||||
<img src="/static/pics/remove.png" border="0" title="{% trans 'Delete domain' %}"/>
|
||||
<img src="{{ MEDIA_URL }}pics/remove.png" border="0" title="{% trans 'Delete domain' %}"/>
|
||||
</a>
|
||||
</td>
|
||||
{% url admin.views.mailboxes dom.id as domurl %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% load i18n %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% load i18n %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% load i18n %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="title"><h1>{% trans "Mailbox" %} {{ mbox.name }}</h1></div>
|
||||
|
||||
@@ -23,21 +23,21 @@
|
||||
{% url admin.views.editmailbox domain.id mb.id as edit_url %}
|
||||
<a href="{{ edit_url }}" class="boxed"
|
||||
rel="{handler:'iframe',size:{x:300,y:280}}">
|
||||
<img src="/static/pics/edit.png" border="0" title="{% trans 'Edit mailbox' %}"/>
|
||||
<img src="{{ MEDIA_URL }}pics/edit.png" border="0" title="{% trans 'Edit mailbox' %}"/>
|
||||
</a>
|
||||
{% url admin.views.delmailbox domain.id mb.id as del_url %}
|
||||
<a href="{{ del_url }}" name="deleteMb">
|
||||
<img src="/static/pics/remove.png" border="0"
|
||||
<img src="{{ MEDIA_URL }}pics/remove.png" border="0"
|
||||
title="{% trans 'Delete mailbox' %}" />
|
||||
</a>
|
||||
{% url admin.views.newalias domain.id as alias_url %}
|
||||
<a href="{{ alias_url }}" class="boxed"
|
||||
rel="{handler:'iframe',size:{x:300,y:250}}">
|
||||
<img src="/static/pics/add.png" border="0" title="{% trans 'Add new alias' %}"/>
|
||||
<img src="{{ MEDIA_URL }}pics/add.png" border="0" title="{% trans 'Add new alias' %}"/>
|
||||
</a>
|
||||
{% url mbox-aliases domain.id mb.id as aliases_url %}
|
||||
<a href="{{ aliases_url }}">
|
||||
<img src="/static/pics/alias.png" border="0" title="{% trans 'Mailbox aliases' %}"/>
|
||||
<img src="{{ MEDIA_URL }}pics/alias.png" border="0" title="{% trans 'Mailbox aliases' %}"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ mb.name }}</td>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% load i18n %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="title"><h1>{% trans "New alias" %}</h1></div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% load i18n %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% load i18n %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="title"><h1>{% trans "New mailbox" %}</h1></div>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<td>
|
||||
{% url admin.views.deletepermission admin.id "SuperAdmins" as del_url %}
|
||||
<a href="{{ del_url }}" name="deletePerm">
|
||||
<img src="/static/pics/remove.png" border="0" title="{% trans 'Remove permission' %}" />
|
||||
<img src="{{ MEDIA_URL }}pics/remove.png" border="0" title="{% trans 'Remove permission' %}" />
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ admin.first_name }} {{ admin.last_name }}</td>
|
||||
@@ -48,7 +48,7 @@
|
||||
<td>
|
||||
{% url admin.views.deletepermission admin.id "DomainAdmins" as del_url %}
|
||||
<a href="{{ del_url }}" name="deletePerm">
|
||||
<img src="/static/pics/remove.png" border="0"
|
||||
<img src="{{ MEDIA_URL }}pics/remove.png" border="0"
|
||||
title="{% trans 'Remove permission' %}" />
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "nlayout.html" %}
|
||||
{% load i18n libextras %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/settings.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/settings.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block middletitle %}{% trans "Settings" %}{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
{% load i18n %}
|
||||
{% load libextras %}
|
||||
{% block html_head %}
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/searchbar.css" />
|
||||
<script type="text/javascript" src="/static/js/ProgressBar.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/searchbar.css" />
|
||||
<script type="text/javascript" src="{{ MEDIA_URL }}js/ProgressBar.js"></script>
|
||||
<script type="text/javascript" src="{{ MEDIA_URL }}js/tiny_mce/tiny_mce.js"></script>
|
||||
{% block css %}{% endblock %}
|
||||
<style type="text/css">
|
||||
#navbar {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% load i18n %}
|
||||
<div id="searchbox">
|
||||
<img src="/static/pics/search.png" id="searchopts" />
|
||||
<img src="{{ MEDIA_URL }}pics/search.png" id="searchopts" />
|
||||
<input type="text" name="searchfield" id="searchfield" value="{% trans "Search..." %}" />
|
||||
<div id="searchparams">
|
||||
<input type="radio" id="crit_from_addr" name="scriteria" value="from_addr" checked>{% trans "From address" %}<br/>
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
|
||||
{% if page.previous_page %}
|
||||
<a href="{{ page.baseurl }}?page=1">
|
||||
<img src="/static/pics/first.png" border="0" title="{% trans "First" %}" />
|
||||
<img src="{{ MEDIA_URL }}pics/first.png" border="0" title="{% trans "First" %}" />
|
||||
</a>
|
||||
<a href="{{ page.baseurl }}?page={{ page.previous_page }}">
|
||||
<img src="/static/pics/back.png" border="0" title="{% trans "Previous" %}" />
|
||||
<img src="{{ MEDIA_URL }}pics/back.png" border="0" title="{% trans "Previous" %}" />
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if page.next_page %}
|
||||
<a href="{{ page.baseurl }}?page={{ page.next_page }}">
|
||||
<img src="/static/pics/next.png" border="0" title="{% trans "Next" %}" />
|
||||
<img src="{{ MEDIA_URL }}pics/next.png" border="0" title="{% trans "Next" %}" />
|
||||
</a>
|
||||
<a href="{{ page.baseurl }}?page={{ page.last_page }}">
|
||||
<img src="/static/pics/last.png" border="0" title="{% trans "Last" %}" />
|
||||
<img src="{{ MEDIA_URL }}pics/last.png" border="0" title="{% trans "Last" %}" />
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
tinyMCE.init({
|
||||
mode: "specific_textareas",
|
||||
editor_selector: "editor",
|
||||
theme: "advanced",
|
||||
plugins: "spellchecker,emotions",
|
||||
language: "{{ language }}",
|
||||
spellchecker_languages: "{{ spellchecker_languages }}",
|
||||
spellchecker_rpc_url: "{{ spellchecker_rpc_url }}",
|
||||
|
||||
theme_advanced_toolbar_location: "top",
|
||||
theme_advanced_toolbar_align: "left",
|
||||
theme_advanced_buttons1: "bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,indent,outdent,separator,undo,redo,separator,link,unlink,emotions,forecolor,backcolor,code,|,fontselect,fontsizeselect,spellchecker",
|
||||
theme_advanced_buttons2: "",
|
||||
theme_advanced_buttons3: ""
|
||||
});
|
||||
@@ -4,7 +4,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head profile="http://www.w3.org/2005/10/profile">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/box.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/box.css" />
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head profile="http://www.w3.org/2005/10/profile">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="icon" type="image/png" href="/static/css/logo-icon.png" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/SqueezeBox.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/box.css" />
|
||||
<script src="/static/js/mootools.js" type="text/javascript"></script>
|
||||
<script src="/static/js/mootools-more.js" type="text/javascript"></script>
|
||||
<script src="/static/js/SqueezeBox.js" type="text/javascript"></script>
|
||||
<link rel="icon" type="image/png" href="{{ MEDIA_URL }}css/logo-icon.png" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/SqueezeBox.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/box.css" />
|
||||
<script src="{{ MEDIA_URL }}js/mootools.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/mootools-more.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/SqueezeBox.js" type="text/javascript"></script>
|
||||
{% url django.views.i18n.javascript_catalog as catalog_url %}
|
||||
<script type="text/javascript" src="{{ catalog_url }}"></script>
|
||||
{% block html_head %}{% endblock %}
|
||||
|
||||
+10
-10
@@ -9,11 +9,11 @@
|
||||
<link rel="icon" type="image/png" href="/static/css/logo-icon.png" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/default.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/SqueezeBox.css" />
|
||||
<script src="/static/js/mootools.js" type="text/javascript"></script>
|
||||
<script src="/static/js/mootools-more.js" type="text/javascript"></script>
|
||||
<script src="/static/js/SqueezeBox.js" type="text/javascript"></script>
|
||||
<script src="/static/js/infobox.js" type="text/javascript"></script>
|
||||
<script src="/static/js/common.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/mootools.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/mootools-more.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/SqueezeBox.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/infobox.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/common.js" type="text/javascript"></script>
|
||||
{% url django.views.i18n.javascript_catalog as catalog_url %}
|
||||
<script type="text/javascript" src="{{ catalog_url }}"></script>
|
||||
{%block html_head %}{% endblock %}
|
||||
@@ -29,18 +29,18 @@
|
||||
|
||||
{% if user.is_superuser or perms.admin.view_domain %}
|
||||
<li class="dropdown topdropdown">
|
||||
<img src="/static/pics/admin.png" border="0" />
|
||||
<img src="{{ MEDIA_URL }}pics/admin.png" border="0" />
|
||||
<label>{% trans "Admin" %}</label>
|
||||
<ul class="links">
|
||||
<li>
|
||||
<a href="{% url admin.views.domains %}">
|
||||
<img src="/static/pics/domains.png" />{% trans "Domains" %}
|
||||
<img src="{{ MEDIA_URL }}pics/domains.png" />{% trans "Domains" %}
|
||||
</a>
|
||||
</li>
|
||||
{% if user.is_superuser %}
|
||||
<li>
|
||||
<a href="{% url admin.views.settings %}">
|
||||
<img src="/static/pics/settings.png" border="0"/>
|
||||
<img src="{{ MEDIA_URL }}pics/settings.png" border="0"/>
|
||||
{% trans "Settings" %}
|
||||
</a>
|
||||
</li>
|
||||
@@ -64,14 +64,14 @@
|
||||
<li>
|
||||
{% url modoboa.auth.views.dologout as logout_url %}
|
||||
<a href="{{ logout_url }}">
|
||||
<img src="/static/pics/logout.png" border="0" />{% trans "Logout" %}</a>
|
||||
<img src="{{ MEDIA_URL }}pics/logout.png" border="0" />{% trans "Logout" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="page">
|
||||
<div id="header">
|
||||
<img class="logo" src="/static/css/modoboa.png" />
|
||||
<img class="logo" src="{{ MEDIA_URL }}css/modoboa.png" />
|
||||
<h1>{% block middletitle %}{% endblock %}</h1>
|
||||
<div id="menubar" class="menubar">
|
||||
{% block menu %}{% endblock %}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<head profile="http://www.w3.org/2005/10/profile">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>{% trans "Welcome to Modoboa" %}</title>
|
||||
<link rel="icon" type="image/png" href="/static/css/logo-icon.png" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/login.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/box.css" />
|
||||
<script src="/static/js/mootools.js" type="text/javascript"></script>
|
||||
<script src="/static/js/mootools-more.js" type="text/javascript"></script>
|
||||
<link rel="icon" type="image/png" href="{{ MEDIA_URL }}css/logo-icon.png" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/login.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/box.css" />
|
||||
<script src="{{ MEDIA_URL }}js/mootools.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/mootools-more.js" type="text/javascript"></script>
|
||||
{% url django.views.i18n.javascript_catalog as catalog_url %}
|
||||
<script type="text/javascript" src="{{ catalog_url }}"></script>
|
||||
</head>
|
||||
@@ -18,7 +18,7 @@
|
||||
<body>
|
||||
<div id="loginbox">
|
||||
<div id="logo">
|
||||
<img src="/static/css/modoboa.png" />
|
||||
<img src="{{ MEDIA_URL }}css/modoboa.png" />
|
||||
{% if error %}
|
||||
<div class="error"><p>{{ error }}</p></div>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "layout_simple.html" %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% load i18n %}
|
||||
|
||||
@@ -17,7 +17,7 @@ window.addEvent('domready', function(){
|
||||
{% load i18n %}
|
||||
|
||||
<div id="dlg-iconbox">
|
||||
<img src="/static/pics/dialog-warning.png" alt="Warning" />
|
||||
<img src="{{ MEDIA_URL }}pics/dialog-warning.png" alt="Warning" />
|
||||
</div>
|
||||
<div id="dlg-textbox">
|
||||
<b>{{ msg }}</b><br/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "nlayout.html" %}
|
||||
{% load i18n uprefs_extras libextras %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/preferences.js" type="text/javascript"></script>
|
||||
<script src="{{ MEDIA_URL }}js/preferences.js" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
{% block middletitle %}{% trans "Preferences" %}{% endblock %}
|
||||
{% block menu %}{% uprefs_menu user %}{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user