mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Initial commit of the new Radicale extension.
This commit is contained in:
@@ -161,6 +161,7 @@ MODOBOA_APPS = (
|
||||
'modoboa.extensions.webmail',
|
||||
'modoboa.extensions.stats',
|
||||
'modoboa.extensions.sievefilters',
|
||||
'modoboa.extensions.radicale',
|
||||
{% if not amavis_conn %}#{% endif %}'modoboa.extensions.amavis',
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
"""
|
||||
Radicale management frontend.
|
||||
|
||||
"""
|
||||
import sys
|
||||
from django.utils.translation import ugettext_lazy
|
||||
from modoboa.lib import events, parameters
|
||||
from modoboa.core.extensions import ModoExtension, exts_pool
|
||||
|
||||
|
||||
class Radicale(ModoExtension):
|
||||
"""
|
||||
"""
|
||||
name = "radicale"
|
||||
label = ugettext_lazy("Radicale management frontend")
|
||||
version = "1.0"
|
||||
description = ugettext_lazy(
|
||||
"Management frontend for Radicale, a simple calendar and contact server."
|
||||
)
|
||||
|
||||
def init(self):
|
||||
"""Plugin initialization.
|
||||
"""
|
||||
pass
|
||||
|
||||
def load(self):
|
||||
"""Plugin loading.
|
||||
"""
|
||||
from .app_settings import ParametersForm
|
||||
|
||||
parameters.register(ParametersForm, "Radicale")
|
||||
from modoboa.extensions.radicale import general_callbacks
|
||||
if 'modoboa.extensions.radicale.general_callbacks' in sys.modules:
|
||||
reload(general_callbacks)
|
||||
|
||||
def destroy(self):
|
||||
"""Plugin unloading.
|
||||
"""
|
||||
events.unregister_extension()
|
||||
parameters.unregister()
|
||||
|
||||
exts_pool.register_extension(Radicale)
|
||||
@@ -0,0 +1,8 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django import forms
|
||||
from modoboa.lib.parameters import AdminParametersForm, UserParametersForm
|
||||
from modoboa.lib.formutils import SeparatorField, YesNoField, InlineRadioSelect
|
||||
|
||||
|
||||
class ParametersForm(AdminParametersForm):
|
||||
app = "radicale"
|
||||
@@ -0,0 +1,15 @@
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.template import Template, Context
|
||||
from modoboa.lib import events, parameters
|
||||
|
||||
|
||||
@events.observe("UserMenuDisplay")
|
||||
def top_menu(target, user):
|
||||
if target == "top_menu":
|
||||
return [
|
||||
{"name": "radicale",
|
||||
"label": _("Radicale"),
|
||||
"url": reverse('modoboa.extensions.radicale.views.index')}
|
||||
]
|
||||
return []
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
This file demonstrates writing tests using the unittest module. These will pass
|
||||
when you run "manage.py test".
|
||||
|
||||
Replace this with more appropriate tests for your application.
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class SimpleTest(TestCase):
|
||||
def test_basic_addition(self):
|
||||
"""
|
||||
Tests that 1 + 1 always equals 2.
|
||||
"""
|
||||
self.assertEqual(1 + 1, 2)
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.conf.urls import patterns
|
||||
|
||||
urlpatterns = patterns(
|
||||
'modoboa.extensions.radicale.views',
|
||||
(r'^$', 'index'),
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
# Create your views here.
|
||||
|
||||
|
||||
def index(request):
|
||||
pass
|
||||
Reference in New Issue
Block a user