idlesign / django-sitegate

Reusable application for Django to ease sign up & sign in processes
https://github.com/idlesign/django-sitegate
BSD 3-Clause "New" or "Revised" License
34 stars 4 forks source link

crispy forms support #10

Open imposeren opened 10 years ago

imposeren commented 10 years ago

Maybe app should use https://pypi.python.org/pypi/django-crispy-forms/1.4.0 ?

idlesign commented 10 years ago

There are no fancy forms in sitegate, why do you think it'd be useful?

imposeren commented 10 years ago

builtin support for several css frameworks. And I think that with crispy forms you can use one template for both signin and signup form. self.helper.layout may be useful for defining forms for different flows. Better support for help-text. Easy integration with django-parsley. Easy way to enable "appended" helptexts for "inline" helps:

override bootstrap3/layout/help_text.html

{% load crispy_forms_field %}
{% if field.help_text %}
    {% if help_text_inline %}
      {% if not field|is_checkbox %}<span class="input-group-addon">{% endif %}
      <a href="#" data-toggle="tooltip" data-placement="left" data-title="{{ field.help_text }}" data-original-title="" title=""><span class="glyphicon glyphicon-info-sign"></span></a>
      {% if not field|is_checkbox %}</span>{% endif %}
    {% else %}
        <p id="hint_{{ field.auto_id }}" class="help-block">{{ field.help_text|safe }}</p>
    {% endif %}
{% endif %}

But that's just my personal preferance as I used you app with crispy forms. It required more manipulations to project than I thought it may need to use crispy together with your app: so maybe something may be improved in your app (or in crispy forms?) to make this integration easier.

idlesign commented 10 years ago

That's a dependency that should be thoroughly thought out. If a compatibility layer might be done in a backward-compatible manner, with respect for those who do not want to deal with crispy, and simultaneously keeping all things simple it's probably worth trying. Yet I myself hardly have time for the task.