Code Monkey home page Code Monkey logo

django-foundation-formtags's Introduction

Django Foundation Formtags

https://travis-ci.org/chrisdev/django-foundation-formtags.svg?branch=master Updates

Django template tags to work with Zurb Foundation forms

Getting Started

Create a virtualenv:

$ virtualenv my-env

At the command line:

$ pip install django-foundation-formtags

Usage

To start use django-foundation-forms in a project you must include in your settings:

INSTALLED_APPS = (
    'foundation_formtags',
)

In the template load foundation tags by:

{% load foundation_formtags %}

To use the django-form-foundation filter:

<form class="form" action="{{ url }}" method="POST">
    {% csrf_token %}
    {{ form|as_foundation }}
</form>

To use the django-form-foundation field tags:

<form class="form" action="{{ url }}" method="POST">
    {% csrf_token %}
    {% render_field form.name %}

    {% render_field form.subject %}

    {% render_field form.message %}
</form>

Required versus optional fields

The normal behaviour is to mark required fields with *. If you want to mark only optional fields, you can add the following setting to your project settings file.

FOUNDATION_FORMTAGS_USE_OPTIONAL = True

To learn more about optional fields read this blog.

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

django-foundation-formtags's People

Contributors

andrlik avatar chrisdev avatar lendlsmith avatar parbhat avatar pyup-bot avatar tehaef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-foundation-formtags's Issues

Tests failing with Django 1.10

Must be a problem with the test harness?
"No DjangoTemplates backend is configured.") ImproperlyConfigured: No DjangoTemplates backend is configured.

Release on PYPI

  • Docs including README.rst
  • Integrate with read the docs
  • Version number
  • Contributors
  • Promote

Make the new "(optional)" text optional

Hi there! Thanks Chris for the work on the app ;)

I updated the app from 0.0.7 to 0.0.9 and suddenly all kinds of (optional) words started appearing in my website's forms. Is there any possibility to make those optional? I'm going to downgrade the app to 0.0.7 again for now, but in the future would prefer not to show that text to my users.

Thanks!

{% if not field.field.required %}
<span class="optional">(optional)</span>
{% endif %}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.