Coder Social home page Coder Social logo

prestui's Introduction

PrestUI: UI library for PrestaShop modules

PrestUI is an UI library to help you develop interfaces for your PrestaShop modules. It allows you to write one concise html, compatible with all recent versions of PrestaShop (1.5, 1.6 and 1.7). PrestUI will automatically adapt depending on which PrestaShop version the module is used on.

Eg, you can write:

<ps-switch name="switch" label="Switch" yes="Yes" no="No" active="true"></ps-switch>

And you will automatically get something like this, a valid HTML for PrestaShop (1.6+ here):

<div class="form-group">
    <label class="control-label col-lg-3 "><span>Switch</span></label>
    <div class="col-lg-9">
        <span class="switch prestashop-switch fixed-width-lg">
            <input type="radio" value="1" name="switch" id="switch_on" checked="checked">
            <label for="switch_on">Yes</label>
            <input type="radio" value="0" name="switch" id="switch_off">
            <label for="switch_off">No</label>
            <a class="slide-button btn"></a>
        </span>
    </div>
</div>

PrestUI is based on RiotJS 3, a really light React-like user interface library. You can find more information about RiotJS on GitHub and a full documentation on the official website.

Installation / Usage

To use PrestUI, you need to include the files into your module. Download PrestUI and move the folder in /views/templates/admin/

You also need to include RiotJS+compiler since all the components are based on it. You can download a copy and include it into the module, or you can use a CDN.

You can now include PrestUI and RiotJS like this:

$this->context->controller->addJS('path/to/riot+compiler.js')

$html = $this->display(__FILE__, 'path/to/your/file.tpl')

return $html.$this->display(__FILE__, 'views/templates/admin/prestui/ps-tags.tpl');

If you only need a few tags, you can assign a variable with only the groups you need, before rendering ps-tags:

$this->smarty->assign('tags', array('tabs', 'panel'));

Available tags

All available tags and their attributes are listed on the wiki

Contribution

Found a bug or have an idea? Use GitHub's tickets system. If you want to help and add a feature or fix a bug, you need to make a pull request:

  • Create a fork of this repo
  • Create a new branch like "feature-xxxxxx"
  • Commit your changes on the dev branch
  • Create your pull request on GitHub

License

PrestUI is licensed under the MIT licence

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.