Giter VIP home page Giter VIP logo

flask-fomanticui's Introduction

Flask-FomanticUI

Build status codecov docstr-cov PyPI PyPI - Downloads Documentation Status Forks star issues GitHub contributors black

Flask-FomanticUI is a collection of Jinja macros for Fomantic UI and Flask for the global style. Very similar to Bootstrap-Flask.

Features

  • Table generation: Render data objects (dict or class objects) to Fomantic UI Table.
  • Paginate generation: Render Flask-SQLAlchemy Pagination object to Fomantic UI Pagination.
  • Form generation: Render Flask-WTF/WTForms form object to Fomantic UI Form, etc.

Requirements

Python 3.8+

Dependecies for this project.

intallation

You can install via pip:

    $> pip install Flask-FomanticUI

Example

Register the extension:

from flask import Flask
# To follow the naming rule of Flask extension, although
# this project's name is Flask-FomanticUI, the actual package
# installed is named `flask_fomanticui`.
from flask_fomanticui import FomanticUI

app = Flask(__name__)
fomantic = FomanticUI(app)

Assuming you have a Flask-WTF form like this:

class LoginForm(FlaskForm):
    username = StringField('Username', validators=[DataRequired(), Length(1, 20)])
    password = PasswordField('Password', validators=[DataRequired(), Length(8, 150)])
    submit = SubmitField()
    remember = BooleanField('Remember me')

Now with the render_ui_form macro:

{% from 'fomanticui/form_ui.html' import render_ui_form %}
<html>
<head>
<!-- Fomantic UI - CSS -->
</head>
<body>

<h2>Login</h2>
{{ render_ui_form(form) }}

<!-- Fomantic UI - JS -->
</body>
</html>

You will get a form like this with only one line code (i.e. {{ render_ui_form(form) }}):

form rendering

When the validation fails, the error messages will be rendered with proper style:

error form rendering

Read the Basic Usage docs for more details.

Links

Authors

  • Ferreira, Juan David

Please submit bug reports, suggestions for improvements and patches via the (E-mail: [email protected]).

Contributors

Credits goes to these peoples:

Official repository and Issues

License

Flask-FomanticUI is free software you can redistribute it and/or modify it under the terms of the MIT License. For more information, you can see the LICENSE file for details.

flask-fomanticui's People

Contributors

juniors90 avatar azmeuk avatar

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.