stevotvr/phpbb-groupsub

View on GitHub
adm/style/packages.html

Summary

Maintainability
Test Coverage
{% include 'overall_header.html' %}

<a id="maincontent"></a>

{% if S_ADD_PKG or S_EDIT_PKG %}

    {% INCLUDEJS '@stevotvr_groupsub/edit_package.js' %}

<a href="{{ U_BACK }}" style="float: {{ S_CONTENT_FLOW_END }};">&laquo; {{ lang('BACK') }}</a>

    {% if ERROR_MESSAGE %}
<div class="errorbox">
    <h3>{{ lang('WARNING') }}</h3>
    <p>{{ ERROR_MESSAGE }}</p>
</div>
    {% endif %}

    {% if S_ADD_PKG %}
<h1>{{ lang('ACP_GROUPSUB_PKG_ADD') }}</h1>
    {% else %}
<h1>{{ lang('ACP_GROUPSUB_PKG_EDIT') }} :: {{ PKG_NAME }}</h1>
    {% endif %}

<form id="add_edit_pkg" method="post" action="{{ U_ACTION }}">
    <fieldset>
        <legend>{{ lang('ACP_GROUPSUB_PKG_DETAILS')}}</legend>
        <dl>
            <dt><label for="pkg_enabled">{{ lang('ACP_GROUPSUB_PKG_ENABLE') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_ENABLE_EXPLAIN') }}</span></dt>
            <dd><label><input type="radio" id="pkg_enabled" name="pkg_enabled" value="1"{% if PKG_ENABLED %} checked{% endif %}> {{ lang('YES') }}</label><label><input type="radio" name="pkg_enabled" value="0"{% if not PKG_ENABLED %} checked{% endif %}> {{ lang('NO') }}</label></dd>
        </dl>
        <dl>
            <dt><label for="pkg_name">{{ lang('ACP_GROUPSUB_PKG_NAME') ~ lang('COLON') }}</label></dt>
            <dd><input class="text medium" type="text" id="pkg_name" name="pkg_name" value="{{ PKG_NAME }}" maxlength="255"></dd>
        </dl>
        <dl>
            <dt><label for="pkg_ident">{{ lang('ACP_GROUPSUB_PKG_IDENT') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_IDENT_EXPLAIN') }}</span></dt>
            <dd><input class="text medium{% if not S_ADD_PKG %} disabled{% endif %}" type="text" id="pkg_ident" name="pkg_ident" value="{{ PKG_IDENT }}" width="20" maxlength="30"{% if not S_ADD_PKG %} disabled{% endif %}></dd>
        </dl>
        <dl>
            <dt><label for="pkg_desc">{{ lang('ACP_GROUPSUB_PKG_DESC') ~ lang('COLON') }}</label></dt>
            <dd><textarea id="pkg_desc" name="pkg_desc" rows="5" cols="45" data-bbcode="true">{{ PKG_DESC }}</textarea></dd>
            <dd>
                <label><input type="checkbox" class="radio" name="parse_bbcode"{% if S_PARSE_BBCODE_CHECKED %} checked{% endif %}> {{ lang('PARSE_BBCODE') }}</label>
                <label><input type="checkbox" class="radio" name="parse_smilies"{% if S_PARSE_SMILIES_CHECKED %} checked{% endif %}> {{ lang('PARSE_SMILIES') }}</label>
                <label><input type="checkbox" class="radio" name="parse_magic_url"{% if S_PARSE_MAGIC_URL_CHECKED %} checked{% endif %}> {{ lang('PARSE_URLS') }}</label>
            </dd>
        </dl>
    </fieldset>
    <fieldset>
        <legend>{{ lang('ACP_GROUPSUB_PKG_START')}}</legend>
        <dl>
            <dt><label for="pkg_groups_start_add">{{ lang('ACP_GROUPSUB_PKG_GROUPS_ADD') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_GROUPS_ADD_EXPLAIN') }}</span></dt>
            <dd>
                <select name="pkg_groups_start_add[]" id="pkg_groups_start_add" multiple size="10">
    {% for g in group %}
                    <option value="{{ g.ID }}"{% if g.S_SELECTED_START_ADD %} selected{% endif %}>{{ g.NAME }}</option>
    {% endfor %}
                </select>
            </dd>
        </dl>
        <dl>
            <dt><label for="pkg_groups_start_remove">{{ lang('ACP_GROUPSUB_PKG_GROUPS_REMOVE') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_GROUPS_REMOVE_EXPLAIN') }}</span></dt>
            <dd>
                <select name="pkg_groups_start_remove[]" id="pkg_groups_start_remove" multiple size="10">
    {% for g in group %}
                    <option value="{{ g.ID }}"{% if g.S_SELECTED_START_REMOVE %} selected{% endif %}>{{ g.NAME }}</option>
    {% endfor %}
                </select>
            </dd>
        </dl>
        <dl>
            <dt><label for="pkg_default_group_start">{{ lang('ACP_GROUPSUB_PKG_DEFAULT_GROUP') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_DEFAULT_GROUP_EXPLAIN') }}</span></dt>
            <dd>
                <select name="pkg_default_group_start" id="pkg_default_group_start">
                    <option value="0"></option>
    {% for g in group %}
                    <option value="{{ g.ID }}"{% if g.S_SELECTED_START_DEFAULT %} selected{% endif %}>{{ g.NAME }}</option>
    {% endfor %}
                </select>
            </dd>
        </dl>
        <!-- EVENT stevotvr_groupsub_acp_start_actions_after -->
    </fieldset>
    <fieldset>
        <legend>{{ lang('ACP_GROUPSUB_PKG_END')}}</legend>
        <dl>
            <dt><label for="pkg_groups_end_add">{{ lang('ACP_GROUPSUB_PKG_GROUPS_ADD') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_GROUPS_ADD_EXPLAIN') }}</span></dt>
            <dd>
                <select name="pkg_groups_end_add[]" id="pkg_groups_end_add" multiple size="10">
    {% for g in group %}
                    <option value="{{ g.ID }}"{% if g.S_SELECTED_END_ADD %} selected{% endif %}>{{ g.NAME }}</option>
    {% endfor %}
                </select>
            </dd>
        </dl>
        <dl>
            <dt><label for="pkg_groups_end_remove">{{ lang('ACP_GROUPSUB_PKG_GROUPS_REMOVE') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_GROUPS_REMOVE_EXPLAIN') }}</span></dt>
            <dd>
                <select name="pkg_groups_end_remove[]" id="pkg_groups_end_remove" multiple size="10">
    {% for g in group %}
                    <option value="{{ g.ID }}"{% if g.S_SELECTED_END_REMOVE %} selected{% endif %}>{{ g.NAME }}</option>
    {% endfor %}
                </select>
            </dd>
        </dl>
        <dl>
            <dt><label for="pkg_default_group_end">{{ lang('ACP_GROUPSUB_PKG_DEFAULT_GROUP') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_DEFAULT_GROUP_EXPLAIN') }}</span></dt>
            <dd>
                <select name="pkg_default_group_end" id="pkg_default_group_end">
                    <option value="0"></option>
    {% for g in group %}
                    <option value="{{ g.ID }}"{% if g.S_SELECTED_END_DEFAULT %} selected{% endif %}>{{ g.NAME }}</option>
    {% endfor %}
                </select>
            </dd>
        </dl>
        <!-- EVENT stevotvr_groupsub_acp_end_actions_after -->
    </fieldset>
    <fieldset>
        <legend>{{ lang('ACP_GROUPSUB_PKG_TERMS') }}</legend>
        <table class="table1 zebra-table responsive" id="term_table">
            <thead>
                <tr>
                    <th>{{ lang('ACP_GROUPSUB_PRICE') }}</th>
                    <th>{{ lang('ACP_GROUPSUB_LENGTH') }}</th>
                    <th class="actions">{{ lang('ACTION') }}</th>
                </tr>
            </thead>
            <tbody>
    {% for t in term %}
                <tr>
                    <td>
                        <input class="text" type="text" name="pkg_price[]" size="6" maxlength="10" value="{{ t.PRICE }}">
                        <select name="pkg_currency[]" id="pkg_currency{{ loop.index }}">
        {% for c in currency %}
                            <option value="{{ c.CURRENCY }}"{% if c.CURRENCY == t.CURRENCY %} selected{% endif %}>{{ c.CURRENCY }} {{ c.SYMBOL }}</option>
        {% endfor %}
                        </select>
                    </td>
                    <td>
                        <input class="text" type="number" name="pkg_length[]" size="4" min="0" value="{{ t.LENGTH }}">
                        <select name="pkg_length_unit[]" id="pkg_length_unit{{ loop.index }}">
        {% for u in time_unit %}
                            <option value="{{ u.ID }}"{% if u.ID == t.LENGTH_UNIT %} selected{% endif %}>{{ u.NAME }}</option>
        {% endfor %}
                        </select>
                    </td>
                    <td class="actions">
                        <span class="up-disabled" style="display:none;">{{ ICON_MOVE_UP_DISABLED }}</span>
                        <span class="up"><a class="move_term_up" href="#">{{ ICON_MOVE_UP }}</a></span>
                        <span class="down-disabled" style="display:none;">{{ ICON_MOVE_DOWN_DISABLED }}</span>
                        <span class="down"><a class="move_term_down" href="#">{{ ICON_MOVE_DOWN }}</a></span>
                        <a class="delete_term" href="#">{{ ICON_DELETE }}</a>
                    </td>
                </tr>
    {% endfor %}
            </tbody>
        </table>
        <fieldset>
            <legend>{{ lang('ACP_GROUPSUB_PKG_TERM_ADD')}}</legend>
            <dl>
                <dt><label for="pkg_price">{{ lang('ACP_GROUPSUB_PKG_PRICE') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_PRICE_EXPLAIN') }}</span></dt>
                <dd>
                    <input class="text" type="text" id="pkg_price" name="pkg_price[]" size="6" maxlength="10" value="{{ PKG_PRICE }}">&nbsp;
                    <select name="pkg_currency[]" id="pkg_currency">
    {% for c in currency %}
                            <option value="{{ c.CURRENCY }}"{% if c.S_DEFAULT %} selected{% endif %}>{{ c.CURRENCY }} ({{ c.SYMBOL }})</option>
    {% endfor %}
                    </select>
                </dd>
            </dl>
            <dl>
                <dt><label for="pkg_length">{{ lang('ACP_GROUPSUB_PKG_LENGTH') ~ lang('COLON') }}</label><br><span>{{ lang('ACP_GROUPSUB_PKG_LENGTH_EXPLAIN') }}</span></dt>
                <dd>
                    <input class="text" type="number" id="pkg_length" name="pkg_length[]" size="4" min="0" value="{{ PKG_LENGTH }}">&nbsp;
                    <select name="pkg_length_unit[]" id="pkg_length_unit">
    {% for u in time_unit %}
                            <option value="{{ u.ID }}">{{ u.NAME }}</option>
    {% endfor %}
                    </select>
                </dd>
            </dl>
            <input class="button2" type="submit" name="add_term" value="{{ lang('ACP_GROUPSUB_PKG_TERM_ADD') }}">
        </fieldset>
    </fieldset>
    <fieldset class="submit-buttons">
        <input class="button1" type="submit" id="submit" name="submit" value="{{ lang('SUBMIT') }}">&nbsp;
        <input class="button2" type="reset" id="reset" name="reset" value="{{ lang('RESET') }}">
        {{ S_FORM_TOKEN }}
    </fieldset>
</form>

{% else %}

<h1>{{ lang('ACP_GROUPSUB_MANAGE_PKGS_TITLE') }}</h1>

<p>{{ lang('ACP_GROUPSUB_MANAGE_PKGS_EXPLAIN') }}</p>

    {% INCLUDECSS '@stevotvr_groupsub/groupsub.css' %}

<table class="table1 zebra-table responsive">
    <thead>
        <tr>
            <th width="10%">{{ lang('ACP_GROUPSUB_PKG') }}</th>
            <th>{{ lang('ACP_GROUPSUB_NAME') }}</th>
            <th width="30%">{{ lang('ACP_GROUPSUB_TERMS') }}</th>
            <th width="10%">{{ lang('ACTION') }}</th>
        </tr>
    </thead>
    <tbody>
    {% for p in package %}
        <tr>
            <td valign="top">{{ p.IDENT }}</td>
            <td valign="top"><strong><a href="{{ p.U_EDIT }}">{{ p.NAME }}</a></strong></td>
            <td>
            {% if p.term %}
                <div class="divtable">
                {% for t in p.term|slice(0, 4) %}
                    <div class="divtr">
                        <div class="divtd divtd1">{{ t.PRICE }}</div>
                        <div class="divtd divtd2">{% if t.LENGTH %}{{ t.LENGTH }}{% else %}<i>{{ lang('ACP_GROUPSUB_EXPIRES_UNLIMITED') }}</i>{% endif %}</div>
                    </div>
                {% endfor %}
                {% if p.term|length > 4 %}
                    <div class="divtr divtrtd">{{ lang('ACP_GROUPSUB_MORE', p.term|length - 4) }}</div>
                {% endif %}
                </div>
            {% endif %}
            </td>
            <td class="actions">
                <span class="up-disabled" style="display:none;">{{ ICON_MOVE_UP_DISABLED }}</span>
                <span class="up"><a href="{{ p.U_MOVE_UP }}" data-ajax="row_up">{{ ICON_MOVE_UP }}</a></span>
                <span class="down-disabled" style="display:none;">{{ ICON_MOVE_DOWN_DISABLED }}</span>
                <span class="down"><a href="{{ p.U_MOVE_DOWN }}" data-ajax="row_down">{{ ICON_MOVE_DOWN }}</a></span>
                <a href="{{ p.U_EDIT }}">{{ ICON_EDIT }}</a>
                <a href="{{ p.U_DELETE }}" data-ajax="row_delete">{{ ICON_DELETE }}</a>
            </td>
        </tr>
    {% else %}
        <tr><td colspan="4" style="text-align: center;">{{ lang('ACP_GROUPSUB_NO_PKGS') }}</td></tr>
    {% endfor %}
    </tbody>
</table>

<form id="pkg_add" method="post" action="{{ U_ADD_PKG }}">
    <fieldset class="quick">
        <input class="button2" type="submit" name="add" value="{{ lang('ACP_GROUPSUB_PKG_ADD') }}">
    </fieldset>
</form>

{% endif %}

{% include 'overall_footer.html' %}