mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-21 06:18:45 +02:00
Some stuff about user specific application.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
from django import forms
|
||||
from mailng.main.models import ARmessage
|
||||
|
||||
class ARmessageForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = ARmessage
|
||||
fields = ('subject', 'content', 'enabled')
|
||||
|
||||
@@ -6,3 +6,4 @@ class ARmessage(models.Model):
|
||||
last_sent = models.DateField()
|
||||
subject = models.CharField(max_length=255)
|
||||
content = models.TextField()
|
||||
enabled = models.BooleanField()
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
from django import template
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.simple_tag
|
||||
def menu(selection, perms):
|
||||
return render_to_string('main/menu.html',
|
||||
{"selection" : selection, "perms" : perms})
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
from django.conf.urls.defaults import *
|
||||
|
||||
urlpatterns = patterns('mailng.main.views',
|
||||
url(r'^$', 'index')
|
||||
url(r'^$', 'index'),
|
||||
url(r'^autoreply/$', 'autoreply')
|
||||
)
|
||||
|
||||
@@ -4,7 +4,15 @@ from django.template import RequestContext
|
||||
from django.contrib.auth.decorators \
|
||||
import login_required
|
||||
from mailng.lib import _render
|
||||
from forms import ARmessageForm
|
||||
|
||||
@login_required
|
||||
def index(request):
|
||||
return _render(request, "main/index.html", {})
|
||||
|
||||
@login_required
|
||||
def autoreply(request):
|
||||
form = ARmessageForm()
|
||||
return _render(request, "main/autoreply.html", {
|
||||
"form" : form
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user