Skip to content

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

Switch from bootstrap to materialize form

Paweł Kowalewskif5a65281d371
diff --git a/saleor/dashboard/templates/dashboard/customer/list.html b/saleor/dashboard/templates/dashboard/customer/list.html
index 1de5be9b44..a35a0150dc 100644
--- a/saleor/dashboard/templates/dashboard/customer/list.html
+++ b/saleor/dashboard/templates/dashboard/customer/list.html
@@ -2,7 +2,7 @@
{% load i18n %}
{% load prices_i18n %}
-{% load bootstrap %}
+{% load materializecss %}
{% block title %}{% trans "Customers" %} - {{ block.super }}{% endblock %}
@@ -15,19 +15,16 @@
<div class="panel panel-default">
<div class="panel-heading">{% trans "Search customers" %}</div>
<div class="panel-body">
- <form method="get" class="form-inline">
- <div class="form-group">
- <label class="control-label"for="amount">{% trans "Email" %}</label>
- {% render_widget form.email class="form-control" %}
- </div>
- <div class="form-group">
- <label class="control-label"for="amount">{% trans "Name" %}</label>
- {% render_widget form.name class="form-control" %}
+ <form method="get" class="row">
+ {{ form.email|materializecss:"m4" }}
+ {{ form.name|materializecss:"m4" }}
+
+ <div class="col s12">
+ <button type="submit" class="btn btn-default"><i class="mdi-action-search"></i> Search</button>
+ {% if form.is_bound %}
+ <a class="btn btn-default" href="{% url 'dashboard:customers' %}"><i class="mdi-content-clear"></i> {% trans "Clear" %}</a>
+ {% endif %}
</div>
- <button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-search"></i> Search</button>
- {% if form.is_bound %}
- <a class="btn btn-default" href="{% url 'dashboard:customers' %}"><i class="glyphicon glyphicon-remove"></i> {% trans "Clear" %}</a>
- {% endif %}
</form>
</div>
</div>
diff --git a/saleor/dashboard/templates/dashboard/includes/_status_filters.html b/saleor/dashboard/templates/dashboard/includes/_status_filters.html
index 09b1caf83f..021903b1bf 100644
--- a/saleor/dashboard/templates/dashboard/includes/_status_filters.html
+++ b/saleor/dashboard/templates/dashboard/includes/_status_filters.html
@@ -1,11 +1,13 @@
{% load i18n %}
-<ul class="tabs">
- <li class="tab">
- <a href="{{ request.path }}"{% if not active_filter %} class="active"{% endif %}>{% trans "All" %}</a>
- </li>
- {% for status, verbose_status in available_filters %}
- <li class="tab">
- <a href="?status={{ status }}"{% if active_filter == status %} class="active"{% endif %}>{{ verbose_status }}</a>
- </li>
- {% endfor %}
-</ul>
+<form method="get">
+ <div class="input-field row">
+ <select id="status-filter" class="col s6" name="status">
+ <option value=""{% if not active_filter %} selected{% endif %}>{% trans "All" %}</option>
+ {% for status, verbose_status in available_filters %}
+ <option value="{{ status }}"{% if active_filter == status %} selected{% endif %}>{{ verbose_status }}</option>
+ {% endfor %}
+ </select>
+ <label for="status-filter">{% trans "Shipment status" %}</label>
+ </div>
+ <button type="submit" class="btn">{% trans "Filter" %}</button>
+</form>
diff --git a/saleor/dashboard/templates/dashboard/order/address-edit.html b/saleor/dashboard/templates/dashboard/order/address-edit.html
index 02ac05aae0..ac3479055b 100644
--- a/saleor/dashboard/templates/dashboard/order/address-edit.html
+++ b/saleor/dashboard/templates/dashboard/order/address-edit.html
@@ -1,38 +1,29 @@
{% extends "dashboard/base.html" %}
{% load i18n %}
+{% load materializecss %}
{% block title %}{% blocktrans %}Edit {{ address_type }} address{% endblocktrans %} - {{ block.super }}{% endblock %}
-{% load as_vertical_form from bootstrap %}
+{% block page_title %}
+ {% if address_type == "shipping" %}
+ {% trans "Edit shipping address" %}
+ {% else %}
+ {% trans "Edit billing address" %}
+ {% endif %}
+{% endblock %}
{% block content %}
-<div class="row">
- <div class="col-lg-12">
- {% if address_type == "shipping" %}
- <h1 class="page-header">{% trans "Edit shipping address" %}</h1>
- {% else %}
- <h1 class="page-header">{% trans "Edit billing address" %}</h1>
- {% endif %}
+<form class="row" method="post">
+ <div class="col m6">
+ {% csrf_token %}
+ {{ form|materializecss }}
</div>
-</div>
-
-<form class="form form-vertical" method="post">
- <div class="row">
- <div class="col-md-6">
- {% csrf_token %}
- <fieldset>
- {{ form|as_vertical_form }}
- </fieldset>
- </div>
- </div>
- <div class="row">
- <div class="col-lg-12">
- <p>
- <button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-refresh"></i> {% trans "Update" %}</button>
- <a href="{% url 'dashboard:order-details' pk=order.pk %}" class="btn btn-default"><i class="glyphicon glyphicon-remove"></i> {% trans "Cancel" %}</a>
- </p>
- </div>
+ <div class="col s12">
+ <p>
+ <button type="submit" class="btn btn-primary"><i class="mdi-content-save"></i> {% trans "Update" %}</button>
+ <a href="{% url 'dashboard:order-details' pk=order.pk %}" class="btn btn-default"><i class="mdi-content-clear"></i> {% trans "Cancel" %}</a>
+ </p>
</div>
</form>
{% endblock content %}
diff --git a/saleor/dashboard/templates/dashboard/order/detail.html b/saleor/dashboard/templates/dashboard/order/detail.html
index 9fef47536c..89e3500d60 100644
--- a/saleor/dashboard/templates/dashboard/order/detail.html
+++ b/saleor/dashboard/templates/dashboard/order/detail.html
@@ -1,7 +1,7 @@
{% extends "dashboard/base.html" %}
{% load prices_i18n %}
{% load i18n %}
-{% load bootstrap %}
+{% load materializecss %}
{% load status %}
{% block title %}{{ order }} - {% trans "Orders" %} - {{ block.super }}{% endblock %}
@@ -125,11 +125,11 @@
<small>{% trans "There are no notes associated with this order." %}</small>
{% endif %}
<div id="add-order-note" class="collapse">
- <form class="form-horizontal" role="form" method="post">
+ <form class="row" role="form" method="post">
{% csrf_token %}
- {{ note_form|as_vertical_form }}
- <div class="form-group">
- <button name='note_form' type="submit" class="btn btn-success"><i class="glyphicon glyphicon-plus"></i> {% trans "Save note" %}</button>
+ {{ note_form|materializecss }}
+ <div class="col s12">
+ <button name='note_form' type="submit" class="btn btn-success"><i class="mdi-content-save"></i> {% trans "Save note" %}</button>
</div>
</form>
</div>
diff --git a/saleor/settings.py b/saleor/settings.py
index 1d5e082094..cce8ab14b6 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -127,7 +127,8 @@ INSTALLED_APPS = [
'emailit',
'mptt',
'payments',
- 'selectable'
+ 'selectable',
+ 'materializecssform',
]
LOGGING = {
diff --git a/setup.py b/setup.py
index b0c4f7d3b7..0fb1f9f328 100755
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,8 @@ setup(
'prices>=0.5,<0.6a0',
'requests>=1.2.0',
'satchless>=1.1.2,<1.2a0',
- 'unidecode'
+ 'unidecode',
+ 'django-materializecss-form==0.0.64',
],
extras_require={
'PaaS': [