Source

django-lfs / lfs / templates / manage / marketing / featured_inline.html

Full commit
{% load i18n lfs_tags %}

<form id="add-featured-form"
      action="{% url lfs_manage_add_featured %}"
      method="post">
    
    {% if page.has_previous %}
        <a class="featured-page-link"
           href="{% url lfs_manage_featured_inline %}?page=1">{% trans 'First' %}</a>
        <a class="featured-page-link"
           href="{% url lfs_manage_featured_inline %}?page={{page.previous_page_number}}">{% trans 'Previous' %}</a>
    {% else %}
        <span>{% trans 'First' %}</span>
        <span>{% trans 'Previous' %}</span>
    {% endif %}

    {{page.number}} / {{paginator.num_pages}}

    {% if page.has_next %}
        <a class="featured-page-link"
           href="{% url lfs_manage_featured_inline %}?page={{page.next_page_number}}">{% trans 'Next' %}</a>
        <a class="featured-page-link"
           href="{% url lfs_manage_featured_inline %}?page={{paginator.num_pages}}">{% trans 'Last' %}</a>
       
    {% else %}
        <span>{% trans 'Next' %}</span>
        <span>{% trans 'Last' %}</span>
    {% endif %}

    <table class="lfs-manage-table middle">
        <tr>
            <th class="checkbox">
                <input type="checkbox"
                       class="select-all-1" />
            </th>
            <th>
                {% trans 'Name' %}
            </th>
            <th class="middle">
                {% trans 'SKU' %}
            </th>
            <th class="small">
                {% trans 'Active' %}
            </th>
            <th class="middle">
                {% trans 'Sub type' %}
            </th>
            <th class="small number">
                {% trans 'Price' %}
            </th>                    
            <th class="tiny right">
                {% trans 'Edit' %}
            </th>
        </tr>
        {% for product in page.object_list %}
            <tr class="{% cycle 'even' 'odd' %}">
                <td>
                    <input type="checkbox"
                           name="product-{{product.id}}"
                           class="select-1" />
                </td>
                <td>
                    {{product.get_name}}
                </td>
                <td>
                    {{ product.get_sku }}
                </td>
                <td>
					{% if product.is_active %}
						<img src="{{ STATIC_URL }}lfs/icons/tick.png" />
					{% else %}
						<img src="{{ STATIC_URL }}lfs/icons/cross.png" />
					{% endif %}
                </td>
                <td>
                    {{product.sub_type|sub_type_name}}
                </td>
                <td class="number">
                    {{product.price|currency}}
                </td>
				<td class="right">
					<a href="{% url lfs_product product.slug %}">
                        <img src="{{ STATIC_URL }}lfs/icons/zoom.png"
                             alt="Edit"
                             title="{% trans 'Edit product' %}" />
					</a>
					<a href="{% url lfs_manage_product product.id %}">
                        <img src="{{ STATIC_URL }}lfs/icons/pencil.png"
                             alt="Edit"
                             title="{% trans 'Edit product' %}" />
					</a>
				</td>
            </tr>
        {% endfor %}
    </table>

    <input type="hidden"
           name="keep-filters"
           value="1" />

    <input type="submit"
           id="add-featured-button"
           value="{% trans 'Add to Featured Products' %}" />

</form>

<h2 class="heading-middle">{% trans 'Featured' %}</h2>
    <form id="featured-update-form"
          action="{% url lfs_manage_update_featured %}"
          method="post">

        <table class="lfs-manage-table middle">
            <tr>
                <th class="checkbox">
                    <input type="checkbox"
                           class="select-all-2" />
                </th>
                <th>
                    {% trans 'Name' %}
                </th>
                <th class="small">
                    {% trans 'Position' %}
                </th>          
                <th class="middle">
                    {% trans 'SKU' %}
                </th>
                <th class="small">
                    {% trans 'Active' %}
                </th>                
                <th class="middle">
                    {% trans 'Sub type' %}
                </th>
                <th class="small number">
                    {% trans 'Price' %}
                </th>
                <th class="tiny right">
                    {% trans 'Edit' %}
                </th>
            </tr>
    
            {% for ts in featured %}
                <tr>
                    <td>
                        <input type="checkbox"
                               name="product-{{ts.id}}"
                               class="select-2" />
                    </td>
                    <td>
                        {{ts.product.get_name}}
                    </td>
                    <td>
                        <input class="number"
                               type="text"
                               size="3"
                               name="position-{{ts.id}}"
                               value="{{ts.position}}" />
                    </td>   
                    <td>
                        {{ ts.product.get_sku }}
                    </td>
                    <td>
						{% if ts.product.is_active %}
							<img src="{{ STATIC_URL }}lfs/icons/tick.png" />
						{% else %}
							<img src="{{ STATIC_URL }}lfs/icons/cross.png" />
						{% endif %}
                    </td>
                    <td>
                        {{ts.product.sub_type|sub_type_name}}
                    </td>
                    <td class="number">
                        {{ts.product.price|currency}}
                    </td>                                                

					<td class="right">
						<a href="{% url lfs_product ts.product.slug %}">
	                        <img src="{{ STATIC_URL }}lfs/icons/zoom.png"
	                             alt="Edit"
	                             title="{% trans 'Edit product' %}" />
						</a>
						<a href="{% url lfs_manage_product ts.product.id %}">
	                        <img src="{{ STATIC_URL }}lfs/icons/pencil.png"
	                             alt="Edit"
	                             title="{% trans 'Edit product' %}" />
						</a>
					</td>
                </tr>
            {% endfor %}
        </table>    

        <input type="hidden"
               name="keep-filters"
               value="1" />

        <input type="submit"
               class="featured-update-button"
               name="save"
               value="{% trans 'Save Featured' %}" />

        <input type="submit"
               class="featured-update-button" 
               name="remove"
               value="{% trans 'Remove from Featured' %}" />
    </form>