Permalink
Browse files

refactored manufacturers

  • Loading branch information...
1 parent 6ddb4d6 commit c43ccfa63dfcac71482755446e0b09e65920d957 @pigletto pigletto committed May 13, 2012
@@ -60,6 +60,11 @@ em {
font-style: italic;
}
+/* Contain floats: nicolasgallagher.com/micro-clearfix-hack/ */
+.clearfix:before, .clearfix:after { content: ""; display: table; }
+.clearfix:after { clear: both; }
+.clearfix { zoom: 1;}
+
/* Forms */
form label {
font-weight: bold;
@@ -465,6 +470,10 @@ div.product-quantity {
padding-right: 5px;
}
+.lfs-pagination a{
+ text-decoration: none;
+}
+
/* Category
___________________________________________________________________________ */
@@ -514,18 +523,101 @@ a.current, span.current {
cursor: pointer;
}
-.category .products-navigation {
+.category .lfs-pagination {
float:left;
}
-.category .products-navigation a {
+.category .lfs-pagination a {
text-decoration: none;
}
.category .description {
padding-bottom: 20px;
}
+
+/* Manufacturers
+___________________________________________________________________________ */
+.manufacturers div.manufacturer {
+ margin-bottom: 10px;
+ display: table-row;
+}
+
+.manufacturers div.manufacturer.odd{
+ background-color: #f8f8f8;
+}
+
+.manufacturers div.manufacturer a{
+ display: block;
+}
+
+.manufacturers div.manufacturer div.img{
+ display: table-cell;
+ padding: 5px;
+}
+
+.manufacturers div.manufacturer div.img img{
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.manufacturers div.manufacturer div.description h2{
+ margin-top: 0px;
+ margin-bottom: 2px;
+}
+
+.manufacturers div.manufacturer div.description h2 a{
+ text-decoration: none;
+}
+
+.manufacturers div.manufacturer div.description h2 a:hover{
+ text-decoration: underline;
+}
+
+.manufacturers div.manufacturer div.description {
+ display: table-cell;
+ padding: 5px;
+ vertical-align: top;
+}
+
+.manufacturers div.manufacturer div.products-count{
+ font-size: 0.8em;
+ color: #888888;
+}
+
+.manufacturer div.description{
+ margin-bottom: 10px;
+}
+
+.manufacturer .manufacturer-image,
+.manufacturer .product-image {
+ margin-right: 40px;
+ padding-bottom: 10px;
+ width: 100px;
+ height: 100px;
+ float: left;
+}
+
+.manufacturer .product-row {
+ border-bottom: 1px solid #eae5e2;
+}
+
+.manufacturer .product-data {
+ padding-top: 10px;
+}
+
+.manufacturer .products {
+ clear: both;
+ padding-top: 10px;
+}
+
+.manufacturer .product-data:hover, .manufacturers div.manufacturer:hover {
+ background-color: #f9f9f9;
+ cursor: pointer;
+}
+
+
/* Product
___________________________________________________________________________ */
@@ -1,6 +1,6 @@
{% load i18n %}
{% if pagination.total_pages > 1 %}
-<div class="products-navigation">
+<div class="lfs-pagination">
{% if pagination.first_page %}
<span class="first-page">
<a href="{{ pagination.url }}?{{ pagination.getparam }}={{ pagination.first_page }}{{ pagination.getvars }}">{% trans "First page" %}</a>
@@ -32,12 +32,10 @@
</span>
{% endif %}
- <span class="products-total">
- {% blocktrans count counter=amount_of_products %}
- ({{ amount_of_products }} product)
- {% plural %}
- ({{ amount_of_products }} products)
- {% endblocktrans %}
- </span>
+ {% if pagination.total_text %}
+ <span class="total-text">
+ ({{ pagination.total_text }})
+ </span>
+ {% endif %}
</div>
-{% endif %}
+{% endif %}
@@ -32,9 +32,9 @@
{% product_navigation product %}
<div class="overview">
- {% current_category product %}
- <a href="{{ current_category.get_absolute_url }}">
- {% trans 'Back to overview' %}
+ {% come_from_page product %}
+ <a href="{{ come_from_page.get_absolute_url }}">
+ {% trans 'Back to overview' %}
</a>
</div>
@@ -0,0 +1,25 @@
+{% extends "lfs/base.html" %}
+{% load lfs_tags portlets_tags lfs_theme_tags %}
+
+{% block title %}
+ {{ manufacturer.get_meta_title }} - {{ block.super }}
+{% endblock %}
+
+{% block section %}manufacturer{% endblock %}
+
+{% block head %}
+ {% if manufacturer.get_meta_keywords %}
+ <meta name="keywords" content="{{ manufacturer.get_meta_keywords }}" />
+ {% endif %}
+ {% if manufacturer.get_meta_description %}
+ <meta name="description" content="{{ manufacturer.get_meta_description }}" />
+ {% endif %}
+{% endblock %}
+
+{% block breadcrumbs %}
+ {% breadcrumbs manufacturer %}
+{% endblock %}
+
+{% block content %}
+ {{ manufacturer_inline|safe }}
+{% endblock %}
@@ -0,0 +1,45 @@
+{% extends "lfs/base.html" %}
+{% load i18n lfs_tags portlets_tags lfs_theme_tags %}
+
+{% block section %}manufacturers{% endblock %}
+
+{% block breadcrumbs %}
+ {% breadcrumbs _("Manufacturers") %}
+{% endblock %}
+
+{% block content %}
+{% include "lfs/catalog/categories/product/products_navigation.html" %}
+
+<h1>{% trans "Manufacturers" %}</h1>
+
+{% for manufacturer in manufacturers %}
+ <div class="manufacturer clearfix {% cycle "even" "odd" %}" data-href="{{ manufacturer.get_absolute_url }}">
+ <div class="img">
+ {% if manufacturer.get_image %}
+ <a href="{{ manufacturer.get_absolute_url }}">
+ <img src="{{ manufacturer.get_image.url_60x60 }}" alt="{{ manufacturer.name }}" />
+ </a>
+ {% endif %}
+ </div>
+ <div class="description">
+ <h2><a href="{{ manufacturer.get_absolute_url }}">{{ manufacturer.name }}</a></h2>
+ {% with manufacturer.get_all_products.count as products_count %}
+ {% if products_count %}
+ <div class="products-count">
+ {% blocktrans count counter=products_count %}{{ counter }} product{% plural %}{{ counter }} products{% endblocktrans %}
+ </div>
+ {% endif %}
+ {% endwith %}
+ <p>{{ manufacturer.short_description|safe }}</p>
+ </div>
+ </div>
+{% endfor %}
+<script type="text/javascript">
+ $(function() {
+ $('div.manufacturer').click(function(){
+ window.location = $(this).data('href');
+ return false;
+ });
+ });
+</script>
+{% endblock %}
@@ -0,0 +1,82 @@
+{% load i18n lfs_tags %}
+
+{% include "lfs/catalog/categories/product/products_navigation.html" %}
+
+{% sorting %}
+
+<h1 class="first-heading">
+ {{ manufacturer.name }}
+</h1>
+<div class="description">
+ {{ manufacturer.description|safe }}
+</div>
+<div id="products">
+ <table class="lfs-default">
+ {% for col in products %}
+ <tr class="product-row">
+ {% for product in col %}
+ <td class="product-data"
+ onclick="window.location='{% url lfs.catalog.views.product_view product.slug %}'">
+ <div class="product-image">
+ <a href="{% url lfs.catalog.views.product_view product.slug %}">
+ {% if product.image.url_100x100 %}
+ <img alt="{{ product.name }}"
+ src="{{ product.image.url_100x100 }}" />
+ {% endif %}
+ </a>
+ </div>
+ <div>
+ <div class="product-title">{{ product.name }}</div>
+ <div class="product-description">{{ product.obj.short_description|safe }}</div>
+ </div>
+
+ {% category_product_prices_gross product.obj.id %}
+
+ <div class="product-price">
+ {% if price_starting_from %}
+ {% trans "Starting at" %}
+ {% endif %}
+ {% if product.obj.get_for_sale %}
+ <span class="for-sale-standard-price">{{ standard_price|currency:request }}*</span>
+ <span class="for-sale-price">{{ price|currency:request }}*</span>
+ {% else %}
+ <span class="standard-price">{{ price|currency:request }}*</span>
+ {% endif %}
+ {% if product.price_unit %}
+ / {{ product.price_unit }}
+ {% endif %}
+ {% if product.obj.get_active_packing_unit %}
+ <div class="base-price">
+ {{ base_packing_price|currency:request }}* / {{ product.obj.get_packing_info.1 }}
+ </div>
+ {% endif %}
+ {% if product.obj.get_active_base_price %}
+ <div class="base-price">
+ {% if base_price_starting_from %}
+ {% trans "Starting at" %}
+ {% endif %}
+ {{ base_price|currency:request }}*
+ {% if product.obj.get_base_price_unit %}
+ / {{ product.obj.get_base_price_unit }}
+ {% endif %}
+ </div>
+ {% endif %}
+ <div class="price-disclaimer">
+ {% if product.price_includes_tax %}
+ {% trans '*inc. VAT' %}
+ {% else %}
+ {% trans '*exc. VAT' %}
+ {% endif %}
+ </div>
+ </div>
+ <div class="details-button">
+ <a class="button emphasized"
+ href="{% url lfs_product product.slug %}">{% trans 'Details' %}
+ </a>
+ </div>
+ </td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </table>
+</div>

0 comments on commit c43ccfa

Please sign in to comment.