{% macro create_star(page, form, active_persona, controlled_personas) %}

<!-- TODO: empty listelement if element not to be displayed
-->

<form method="POST" action="{{url_for('create_star')}}" enctype="multipart/form-data">
    <!-- Main text field -->
    <section class="textarea card {{ page.create_star_form[0].css_class }}">
        <div class="card-handle">
            <i class="fa fa-asterisk"></i>
        </div>

        <div class="sidenav">
            {% if form.text.errors %}
                {% for error in form.text.errors %}<small>{{ error }}</small>{% endfor %}
            {% endif %}
        </div>

        <div class="fullsize-input">
        {{ form.text(placeholder="Enter your message") }}
        </div>
        {{ form.csrf_token }}
        {{ form.group_id }}
    </section>

    <!-- Link attachment field -->
    <section class="card {{ page.create_star_form[1].css_class }}">
        <div class="card-handle">
            <i class="fa fa-link"></i>
        </div>

        <div class="sidenav">
            {% if form.link.errors %}
                {% for error in form.link.errors %}<small>{{ error }}</small>{% endfor %}
            {% endif %}
        </div>

        <div class="fullsize-input">
            {{ form.link(default='Enter a URL', disabled='disabled') }}
        </div>
    </section>

    <!-- File attachment field -->
    <section class="card {{ page.create_star_form[2].css_class }}">
        <div class="card-handle">
            <i class="fa fa-file"></i>
        </div>
        <div class="fileupload fileupload-new" data-provides="fileupload">
            <div class="sidenav">
                <div class="btn btn-file btn-small">
                    <span class="fileupload-new">Select image</span>
                    <span class="fileupload-exists">Change</span>
                    {{ form.picture() }}
                </div>
                <a href="#" class="btn  btn-small fileupload-exists" data-dismiss="fileupload">Remove</a>
            </div>
          <div class="fileupload-preview thumbnail"></div>
        </div>
    </section>


    <!-- Add Attachments -->
    <section class="{{ page.create_star_form[3].css_class }}">
        <div class="card-handle">
            <i class="fa fa-plus"></i>
        </div>
        <div class="btn-group well well-small">
            <a class="btn" href="#"><i class="fa fa-font"></i></a>
            <a class="btn" href="#"><i class="fa fa-link"></i></a>
        </div>
    </section>

    <!-- Controls -->
    <section class="{{ page.create_star_form[4].css_class }}">
        <span class="pull-right">
            <button type="submit" class="btn" disabled="disabled"><i
                    class="fa fa-save"></i> Save Draft</button>
            <div class="btn-group">
                <button type="submit" class="btn btn-default">
                    <i class="fa fa-star"></i>
                    Publish
                </button>

                <button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
                     as {{active_persona.username}} <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    {% for p in controlled_personas %}
                    <li><a href="#"><i class="fa fa-user"></i> {{p.username}} [{{p.id[:6]}}]</a></li>
                    {% endfor %}
                </ul>

                <!-- <span class="privacy-selector">
                    <ul>
                        <li>Only important</li>
                        <li>All contacts</li>
                        <li>public</li>
                    </ul>
                </span> -->
            </div>
            </div>
        </span>

    </section>

    <section class="col0 row0 w0 h0" style="display:none">
        {{ form.author() }}
        {% if form.author.errors %}
            <ul class="errors">{% for error in form.author.errors %}<li>{{ error }}</li>{% endfor %}</ul>
        {% endif %}

        {{ form.context }}
    </section>
</form>

{% endmacro%}
