commit 6e24ef90557b6b5f2aed40177480f4387d8f9ea7 Author: Serghei MIHAI Date: Tue Mar 25 11:54:53 2014 +0100 initial version diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cms_plugins.py b/cms_plugins.py new file mode 100644 index 0000000..c9377dc --- /dev/null +++ b/cms_plugins.py @@ -0,0 +1,16 @@ +from django.utils.translation import ugettext as _ +from cms.plugin_base import CMSPluginBase +from cms.plugin_pool import plugin_pool + +from .models import TipiPluginModel + +class TipiPlugin(CMSPluginBase): + model = TipiPluginModel + name = _(u'Formulaire de paiement TIPI') + render_template = 'tipi.html' + + def render(self, context, instance, placeholder): + context.update({'instance': instance}) + return context + +plugin_pool.register_plugin(TipiPlugin) diff --git a/models.py b/models.py new file mode 100644 index 0000000..f891d48 --- /dev/null +++ b/models.py @@ -0,0 +1,18 @@ +#-*- coding: utf-8 -*- + +from django.db import models +from django.utils.translation import ugettext as _ + +from cms.models import CMSPlugin + +SAISIES = ( + ('T', 'T'), + ('M', 'M'), + ('X', 'X'), + ) + +class TipiPluginModel(CMSPlugin): + url = models.URLField(help_text=_(u'addresse de paiement sur le site de la DGFiP')) + numero_client = models.CharField(max_length=64, help_text=_(u'le numéro de régie attribué par la DGFiP')) + saisie = models.CharField(max_length=1, choices=SAISIES) + diff --git a/templates/tipi.html b/templates/tipi.html new file mode 100644 index 0000000..4801606 --- /dev/null +++ b/templates/tipi.html @@ -0,0 +1,122 @@ +{% load sekizai_tags %} +{% load i18n %} + +{% addtoblock "js" %} + +{% endaddtoblock %} +{% addtoblock "css" %} + +{% endaddtoblock %} +
+
+

{% trans "Paiement en cours..." %}

+
+
+
    +
  • + + + {% trans "numéro invalide" %} +
  • +
  • + + € + {% trans "montant invalide" %} +
  • +
  • + + + {% trans "courriel invalide" %}
  • +
  • + +
  • +
+
+