Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Improve styles and markup

Paweł Kowalewski9a6174597cb6
diff --git a/saleor/dashboard/templates/dashboard/base.html b/saleor/dashboard/templates/dashboard/base.html
index 7467fd4e75..79d66acbf7 100644
--- a/saleor/dashboard/templates/dashboard/base.html
+++ b/saleor/dashboard/templates/dashboard/base.html
@@ -20,36 +20,38 @@
<nav class="top-nav">
<div class="container">
<div class="nav-wrapper">
- <span class="page-title">{% block page_title %}{% trans "Dashboard" %}{% endblock %}</span>
- <a href="#" data-activates="side-menu" class="button-collapse"><i class="mdi-navigation-menu"></i></a>
+ {% block page_header %}
+ <span class="page-title">{% block page_title %}{% trans "Dashboard" %}{% endblock %}</span>
+ <a href="#" data-activates="side-menu" class="button-collapse"><i class="mdi-navigation-menu"></i></a>
+ {% endblock %}
</div>
</div>
+ <ul class="side-nav fixed" id="side-menu">
+ <li class="side-nav-user">
+ <ul class="collapsible collapsible-accordion">
+ <li>
+ <a class="waves-effect waves-teal collapsible-header">
+ <i class="mdi-action-account-circle"></i>{{ request.user }} <i class="mdi-navigation-arrow-drop-down"></i>
+ </a>
+ <div class="collapsible-body">
+ <ul>
+ <li><a href="/" class="waves-effect waves-teal">{% trans "Visit storefront" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="{% url 'registration:logout' %}" class="waves-effect waves-teal">{% trans "Log out" %}</a></li>
+ </ul>
+ </div>
+ </li>
+ </ul>
+ </li>
+ <li class="brand-logo"><a href="{% url 'dashboard:index' %}">Saleor</a></li>
+ <li><a href="{% url 'dashboard:index' %}" class="waves-effect waves-teal">Home</a></li>
+ <li><a href="{% url 'dashboard:orders' %}" class="waves-effect waves-teal">Orders</a></li>
+ <li><a href="{% url 'dashboard:products' %}" class="waves-effect waves-teal">Products</a></li>
+ <li><a href="{% url 'dashboard:categories' %}" class="waves-effect waves-teal">Categories</a></li>
+ <li><a href="{% url 'dashboard:customers' %}" class="waves-effect waves-teal">Customers</a></li>
+ <li><a href="{% url 'dashboard:payments' %}" class="waves-effect waves-teal">Payments</a></li>
+ </ul>
</nav>
- <ul class="side-nav fixed" id="side-menu">
- <li class="brand-logo"><a href="{% url 'dashboard:index' %}">Saleor</a></li>
- <li><a href="{% url 'dashboard:index' %}" class="waves-effect waves-teal">Home</a></li>
- <li><a href="{% url 'dashboard:orders' %}" class="waves-effect waves-teal">Orders</a></li>
- <li><a href="{% url 'dashboard:products' %}" class="waves-effect waves-teal">Products</a></li>
- <li><a href="{% url 'dashboard:categories' %}" class="waves-effect waves-teal">Categories</a></li>
- <li><a href="{% url 'dashboard:customers' %}" class="waves-effect waves-teal">Customers</a></li>
- <li><a href="{% url 'dashboard:payments' %}" class="waves-effect waves-teal">Payments</a></li>
- <li class="side-nav-user">
- <ul class="collapsible collapsible-accordion">
- <li>
- <a class="waves-effect waves-teal collapsible-header">
- <i class="mdi-action-account-circle"></i>{{ request.user }} <i class="mdi-navigation-arrow-drop-down"></i>
- </a>
- <div class="collapsible-body">
- <ul>
- <li><a href="/" class="waves-effect waves-teal">{% trans "Visit storefront" %}</a></li>
- <li class="divider"></li>
- <li><a href="{% url 'registration:logout' %}" class="waves-effect waves-teal">{% trans "Log out" %}</a></li>
- </ul>
- </div>
- </li>
- </ul>
- </li>
- </ul>
</header>
<main class="main">
diff --git a/saleor/dashboard/templates/dashboard/includes/_orders_table.html b/saleor/dashboard/templates/dashboard/includes/_orders_table.html
index 818f0c030a..74e98583a7 100644
--- a/saleor/dashboard/templates/dashboard/includes/_orders_table.html
+++ b/saleor/dashboard/templates/dashboard/includes/_orders_table.html
@@ -2,7 +2,7 @@
{% load prices_i18n %}
{% load status %}
-<table class="striped">
+<table class="striped hoverable responsive">
<thead>
<tr>
<th>{% trans "Number" %}</th>
diff --git a/saleor/dashboard/templates/dashboard/order/detail.html b/saleor/dashboard/templates/dashboard/order/detail.html
index 89e3500d60..92e4181c08 100644
--- a/saleor/dashboard/templates/dashboard/order/detail.html
+++ b/saleor/dashboard/templates/dashboard/order/detail.html
@@ -27,49 +27,49 @@
<table class="table">
<thead>
<tr>
- <th class="col-sm-5">{% trans "Item" %}</th>
- <th class="col-sm-2 text-right">{% trans "Price" %}</th>
- <th class="col-sm-2 text-right">{% trans "Quantity" %}</th>
- <th class="col-sm-2 text-right">{% trans "Total" %}</th>
- <th class="col-sm-1"></th>
+ <th class="col s5">{% trans "Item" %}</th>
+ <th class="col s2 right-align">{% trans "Price" %}</th>
+ <th class="col s2 right-align">{% trans "Quantity" %}</th>
+ <th class="col s2 right-align">{% trans "Total" %}</th>
+ <th class="col s1"></th>
</tr>
</thead>
<tfoot>
{% if group.shipping_price.gross or group.is_shipping_required %}
<tr>
- <td colspan="3">
+ <td colspan="3" class="col s9">
{% trans "Shipping" %} ({{ order.shipping_method }})
</td>
- <td class="text-right">
+ <td class="right-align col s2">
{% gross group.shipping_price %}
</td>
- <td class="text-right">
+ <td class="right-align col s1">
{% if group.is_shipping_required %}
- <a class="btn btn-default btn-sm" data-target="#base-modal" href="{% url 'dashboard:ship-delivery-group' pk=group.pk %}" data-toggle="modal" {% if not group.can_ship %}disabled{% endif %}><i class="glyphicon glyphicon-plane"></i> {% trans "Ship" %}</a>
+ <a data-target="#base-modal" href="{% url 'dashboard:ship-delivery-group' pk=group.pk %}" data-toggle="modal" {% if not group.can_ship %}disabled{% endif %}><i class="mdi-maps-local-shipping"></i> {% trans "Ship" %}</a>
{% endif %}
</td>
</tr>
{% endif %}
<tr>
- <th colspan="3">{% trans "Total" %}</th>
- <td class="text-right">
+ <th colspan="3" class="col s9">{% trans "Total" %}</th>
+ <td class="right-align col s2">
<strong>{% gross group.get_total %}</strong>
</td>
- <td></td>
+ <td class="col s1"></td>
</tr>
</tfoot>
<tbody>
{% for item in group.items.all %}
<tr>
- <td>
+ <td class="col s5">
{% if item.product %}<a href="{% url "dashboard:product-update" pk=item.product.id %}">{{ item.product_name }}</a>{% else %}{{ item.product_name }}{% endif %}<br>
<strong>SKU:</strong> {{ item.product_sku }}
</td>
- <td class="text-right">{% gross item.get_price_per_item %}</td>
- <td class="text-right">{{ item.quantity }}</td>
- <td class="text-right">{% gross item.get_total %}</td>
- <td class="text-right">
- <a class="btn btn-primary btn-sm" data-target="#base-modal" href="{% url 'dashboard:order-line-edit' pk=item.pk %}" data-toggle="modal" {% if group.status != 'new' %}disabled{% endif %} title="{% trans "Edit" %}"><i class="glyphicon glyphicon-pencil"></i></a>
+ <td class="right-align col s2">{% gross item.get_price_per_item %}</td>
+ <td class="right-align col s2">{{ item.quantity }}</td>
+ <td class="right-align col s2">{% gross item.get_total %}</td>
+ <td class="right-align col s1">
+ <a data-target="#base-modal" href="{% url 'dashboard:order-line-edit' pk=item.pk %}" data-toggle="modal" {% if group.status != 'new' %}disabled{% endif %} title="{% trans "Edit" %}"><i class="mdi-content-create"></i></a>
</td>
</tr>
{% endfor %}
@@ -106,12 +106,15 @@
{% endif %}
</div>
</div>
- <div class="panel panel-default" id="order-notes">
- <div class="panel-heading">
- <span class="panel-title">Order notes</span>
- <span class="pull-right"><a data-toggle="collapse" href="#add-order-note"><i class="glyphicon glyphicon-plus"></i> Add note</a></span>
- </div>
- <div class="panel-body">
+ <div class="card grey lighten-4" id="order-notes">
+ <div class="card-content">
+ <span class="card-title black-text">
+ Order notes
+ </span>
+ <span class="right">
+ <a data-toggle="collapse" href="#add-order-note"><i class="mdi-content-add"></i> Add note</a>
+ </span>
+
{% if notes %}
<ul class="list-unstyled">
{% for note in notes %}
@@ -137,21 +140,19 @@
</div>
</div>
<div class="col l4">
- <div class="panel panel-default">
- <div class="panel-heading">
- <span class="panel-title">Order summary</span>
- </div>
- <div class="panel-body">
+ <div class="card grey lighten-3">
+ <div class="card-content">
+ <span class="card-title black-text">Order summary</span>
+
<p>Order date: {{ order.created }}</p>
<p>Order status: {% render_status order.status order.get_status_display %}</p>
<p>Payment status: {% if payment %}{% render_status payment.status payment.get_status_display %}{% else %}{% trans "N/A" %}{% endif %}</p>
</div>
</div>
- <div class="panel panel-default">
- <div class="panel-heading">
- <span class="panel-title">{% trans "Customer" %}</span>
- </div>
- <div class="panel-body">
+ <div class="card grey lighten-3">
+ <div class="card-content">
+ <span class="card-title black-text">{% trans "Customer" %}</span>
+
<div class="address">
{% if order.user %}
<div>{% trans "Account" %}: <a href="{% url "dashboard:customer-details" pk=order.user.pk %}">{{ order.user }}</a></div>
@@ -161,31 +162,31 @@
</div>
</div>
</div>
- <div class="panel panel-default">
- {% with order.billing_address as address %}
- <div class="panel-heading">
- <span class="panel-title">{% trans "Billing address" %}</span>
- <span class="pull-right"><a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="billing" %}"><i class="glyphicon glyphicon-pencil"></i> Edit</a></span>
- </div>
- <div class="panel-body">
- {% include 'dashboard/includes/_address.html' with address=address only %}
- <div>
- <i class="glyphicon glyphicon-envelope"></i> <a href="mailto:{{ order.get_user_email }}">{{ order.get_user_email }}</a>
+ <div class="card grey lighten-3">
+ <div class="card-content">
+ {% with order.billing_address as address %}
+ <span class="card-title black-text">{% trans "Billing address" %}</span>
+ <span class="right"><a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="billing" %}"><i class="mdi-content-create"></i> Edit</a></span>
+
+ {% include 'dashboard/includes/_address.html' with address=address only %}
+ <div>
+ <i class="mdi-content-mail"></i> <a href="mailto:{{ order.get_user_email }}">{{ order.get_user_email }}</a>
+ </div>
</div>
+ {% endwith %}
</div>
- {% endwith %}
</div>
{% with order.shipping_address as address %}
{% if address %}
- <div class="panel panel-default">
- <div class="panel-heading">
+ <div class="card grey lighten-3">
+ <div class="card-content">
<span class="panel-title">{% trans "Shipping address" %}</span>
- <span class="pull-right"><a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="shipping" %}"><i class="glyphicon glyphicon-pencil"></i> Edit</a></span>
+ <span class="pull-right"><a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="shipping" %}"><i class="mdi-content-create"></i> Edit</a></span>
</div>
<div class="panel-body">
{% include 'dashboard/includes/_address.html' with address=address only %}
<div>
- <i class="glyphicon glyphicon-envelope"></i> <a href="mailto:{{ order.get_user_email }}">{{ order.get_user_email }}</a>
+ <i class="mdi-content-mail"></i> <a href="mailto:{{ order.get_user_email }}">{{ order.get_user_email }}</a>
</div>
</div>
</div>
diff --git a/saleor/dashboard/templates/dashboard/product/list.html b/saleor/dashboard/templates/dashboard/product/list.html
index ec813812c8..1d321e8330 100644
--- a/saleor/dashboard/templates/dashboard/product/list.html
+++ b/saleor/dashboard/templates/dashboard/product/list.html
@@ -5,12 +5,29 @@
{% block title %}{% trans "Products" %} - {{ block.super }}{% endblock %}
-{% block page_title %}{% trans "Products" %}{% endblock %}
+{% block page_header %}
+ <span class="page-title">{% block page_title %}{% trans "Products" %}{% endblock %}</span>
+ <a href="#" data-activates="side-menu" class="button-collapse"><i class="mdi-navigation-menu"></i></a>
+ <a class="btn-fab btn-floating btn-large waves-effect waves-light teal dropdown-button"
+ data-activates="dropdown-type" data-constrainwidth="false">
+ <i class="mdi-content-add"></i>
+ </a>
+ <div id="dropdown-type" class="dropdown-content dropdown-type">
+ <form class="col s6 l4" method="post" action=".">
+ {% csrf_token %}
+ {% render_widget form.cls_name %}
+ <label for="cls_name">{% trans "Product type" %}</label>
+ <button class="btn" type="submit">
+ <i class="mdi-content-create left"></i> {% trans "Create new" %}
+ </button>
+ </form>
+ </div>
+{% endblock %}
{% block content %}
<div class="row">
<div class="col s12">
- <h5>{% trans "Add new product" %}</h5>
+ {% comment %}<h5>{% trans "Add new product" %}</h5>
<form class="row" method="post" action=".">
{% csrf_token %}
<div class="input-field col s4">
@@ -20,13 +37,25 @@
<i class="mdi-content-add left"></i> {% trans "New product" %}
</button>
</div>
- </form>
+ </form>{% endcomment %}
+
+ <ul class="collection">
+ {% for product in products %}
+ <li class="collection-item avatar">
+ <img src="{{ product.images.first.image.crop.50x50 }}" alt="" class="circle teal">
+ <a class="title" href="{% url 'dashboard:product-update' pk=product.pk %}">{{ product.name }}</a>
+ <p>{{ product.collection }}</p>
+ <p class="secondary-content">{% gross product.price %}</p>
+ </li>
+ {% endfor %}
+ </ul>
+
<table class="striped">
<thead>
<tr>
<th colspan="2" class="col-sm-6">{% trans "Name" %}</th>
<th class="col-sm-4">{% trans "Collection" %}</th>
- <th class="col-sm-2 text-right">{% trans "Price" %}</th>
+ <th class="col-sm-2 right-align">{% trans "Price" %}</th>
</tr>
</thead>
<tbody>
diff --git a/saleor/static/js_src/dashboard.js b/saleor/static/js_src/dashboard.js
index e72169c631..1d440a74a7 100644
--- a/saleor/static/js_src/dashboard.js
+++ b/saleor/static/js_src/dashboard.js
@@ -1,2 +1,3 @@
$(".button-collapse").sideNav();
$("select").material_select();
+$('.modal-trigger').leanModal();
diff --git a/saleor/static/less/dashboard.less b/saleor/static/less/dashboard.less
index 5d3a5a0ea1..a79074b10b 100644
--- a/saleor/static/less/dashboard.less
+++ b/saleor/static/less/dashboard.less
@@ -1,7 +1,7 @@
@import "../components/bootstrap/less/bootstrap";
@import "../components/components-font-awesome/less/font-awesome";
-@fa-font-path: "../dist/fonts";
-@icon-font-path: "../dist/fonts/";
+@fa-font-path: "../fonts";
+@icon-font-path: "../fonts/";
/* Global Styles */
diff --git a/saleor/static/less/style.less b/saleor/static/less/style.less
index 1e96a8d743..5851c61df7 100644
--- a/saleor/static/less/style.less
+++ b/saleor/static/less/style.less
@@ -1,7 +1,7 @@
@import "../components/bootstrap/less/bootstrap";
@import "../components/zocial-less/css/zocial";
-@icon-font-path: "../dist/fonts/";
-@zocialPath: "../dist/fonts/";
+@icon-font-path: "../fonts/";
+@zocialPath: "../fonts/";
.navbar {
margin-bottom: 50px;
diff --git a/saleor/static/scss/_app.scss b/saleor/static/scss/_app.scss
index ef7b64e70a..644d692aa7 100644
--- a/saleor/static/scss/_app.scss
+++ b/saleor/static/scss/_app.scss
@@ -1,6 +1,31 @@
-$roboto-font-path: "../dist/fonts/";
+$roboto-font-path: "../fonts/";
$icons-font-path: $roboto-font-path;
+/**
+ * @license
+ * MyFonts Webfont Build ID 2917526, 2014-11-07T07:08:31-0500
+ *
+ * The fonts listed in this notice are subject to the End User License
+ * Agreement(s) entered into by the website owner. All other parties are
+ * explicitly restricted from using the Licensed Webfonts(s).
+ *
+ * You may obtain a valid license at the URLs below.
+ *
+ * Webfont: HurmeGeometricSans4-Black by Hurme Design
+ * URL: http://www.myfonts.com/fonts/hurme-design/hurme-geometric-sans-4/4-black/
+ *
+ *
+ * License: http://www.myfonts.com/viewlicense?type=web&buildid=2917526
+ * Licensed pageviews: 10,000
+ * Webfonts copyright: Copyright (c) 2012 by Toni Hurme. All rights reserved.
+ *
+ * © 2014 MyFonts Inc
+*/
+
+/* @import must be at top of file, otherwise CSS will not work */
+@import url("//hello.myfonts.net/count/2c8496");
+@font-face {font-family: "HurmeGeometricSans4-Black";src: url("#{$roboto-font-path}2C8496_1_0.eot");src: url("#{$roboto-font-path}2C8496_1_0.eot?#iefix") format("embedded-opentype"),url("#{$roboto-font-path}2C8496_1_0.woff2") format("woff2"),url("#{$roboto-font-path}2C8496_1_0.woff") format("woff"),url("#{$roboto-font-path}2C8496_1_0.ttf") format("truetype");}
+
@import "materialize/sass/materialize";
@each $mdi-icon-name, $mdi-icon-value in $mdi-list-icons {
.#{$mdi-prefix}#{$mdi-icon-name}:before {
@@ -29,6 +54,8 @@ $icons-font-path: $roboto-font-path;
}
.side-nav {
+ padding-top: 100px;
+
li {
display: block;
padding: 0;
@@ -44,6 +71,9 @@ $icons-font-path: $roboto-font-path;
}
&.brand-logo {
+ top: 0;
+ width: 100%;
+
&:hover {
background: none;
}
@@ -53,9 +83,22 @@ $icons-font-path: $roboto-font-path;
}
a {
+ font-family: "HurmeGeometricSans4-Black", sans-serif;
font-size: 36px;
height: 100px;
line-height: 100px;
+ letter-spacing: -4px;
+ letter-spacing: -.5vmin;
+ margin-left: -4px;
+ margin-left: -.5vmin;
+ text-align: center;
+ text-transform: uppercase;
+
+ @media (min-width: $large-screen-up) {
+ font-size: 46px;
+ font-size: 4vmin;
+ }
+
}
}
@@ -102,6 +145,25 @@ $icons-font-path: $roboto-font-path;
line-height: 100px;
}
+table {
+ .row {
+ .col {
+ float: none;
+ padding: $gutter-width/2;
+
+ .responsive-img {
+ display: block;
+ }
+ }
+ }
+}
+
+.btn-fab {
+ position: absolute;
+ bottom: -$button-floating-size*1.5/2;
+ right: 0;
+}
+
/* Global Styles */
/* ------------------------------- */