23 lines
698 B
Python
23 lines
698 B
Python
from django.utils.translation import ugettext_lazy as _
|
|
from django.contrib.auth.forms import AuthenticationForm
|
|
from django.core.urlresolvers import reverse
|
|
|
|
from cms.plugin_base import CMSPluginBase
|
|
from cms.plugin_pool import plugin_pool
|
|
from models import LoginPlugin as LoginPluginModel
|
|
|
|
class LoginPlugin(CMSPluginBase):
|
|
model = LoginPluginModel
|
|
name = _('Login Plugin')
|
|
render_template = "login_plugin/plugin.html"
|
|
text_enabled = False
|
|
|
|
def render(self, context, instance, placeholdre):
|
|
context.update({
|
|
'form': AuthenticationForm(),
|
|
'action': reverse('login'),
|
|
})
|
|
return context
|
|
|
|
plugin_pool.register_plugin(LoginPlugin)
|