From e2bf1130bb4c21a18a4b06ff625a594df8e7770e Mon Sep 17 00:00:00 2001 From: Mikhail Podgurskiy Date: Thu, 19 May 2016 15:39:45 +0600 Subject: [PATCH] Gulp css build integration --- .babelrc | 3 + .gitignore | 3 +- .npmrc | 1 + demo/examples/accounting/apps.py | 2 +- demo/examples/sales/apps.py | 2 +- demo/forms.py | 54 +- demo/templates/admin/base_site.html | 5 +- gulpfile.babel.js | 55 + material/admin/apps.py | 2 +- .../admin/static/admin/js/SelectFilter2.js | 4 +- .../admin/static/material/admin/css/base.css | 27 +- .../admin/auth/user/change_password.html | 4 +- material/admin/templates/admin/base.html | 8 +- material/admin/templates/admin/base_site.html | 2 +- .../admin/templates/admin/change_list.html | 2 +- .../templates/admin/change_list_results.html | 4 +- .../admin/delete_selected_confirmation.html | 2 +- .../admin/includes/material_css.html | 2 +- material/admin/templates/admin/login.html | 4 +- .../admin/templates/admin/search_form.html | 2 +- .../material/admin/edit_inline/#tabular.html# | 59 - .../material/admin/edit_inline/.#tabular.html | 1 - .../material/admin/edit_inline/stacked.html | 2 +- .../material/admin/edit_inline/tabular.html | 4 +- .../fields/django_adminsplitdatetime.html | 4 +- .../fields/django_foreignkeyrawidwidget.html | 2 +- .../fields/django_manytomanyrawidwidget.html | 2 +- .../django_relatedfieldwidgetwrapper.html | 6 +- material/admin/templatetags/material_admin.py | 8 +- material/frontend/apps.py | 4 +- .../static/material/frontend/css/frontend.css | 28 +- .../templates/material/frontend/base.html | 8 +- .../templates/registration/login.html | 4 +- material/static/material/css/forms.css | 7 +- .../css/material-design-iconic-font.css | 5166 ------- material/static/material/css/materialize.css | 11252 +++++----------- .../Material-Design-Iconic-Font.eot | Bin 42495 -> 0 bytes .../Material-Design-Iconic-Font.svg | 787 -- .../Material-Design-Iconic-Font.ttf | Bin 99212 -> 0 bytes .../Material-Design-Iconic-Font.woff | Bin 50312 -> 0 bytes .../Material-Design-Iconic-Font.woff2 | Bin 38384 -> 0 bytes .../font/material-design-icons/LICENSE.txt | 428 - .../Material-Design-Icons.eot | Bin 102112 -> 0 bytes .../Material-Design-Icons.svg | 769 -- .../Material-Design-Icons.ttf | Bin 101892 -> 0 bytes .../Material-Design-Icons.woff | Bin 101968 -> 0 bytes .../Material-Design-Icons.woff2 | Bin 33220 -> 0 bytes .../MaterialIcons-Regular.eot | Bin 0 -> 143258 bytes .../MaterialIcons-Regular.ijmap | 1 + .../MaterialIcons-Regular.svg | 2373 ++++ .../MaterialIcons-Regular.ttf | Bin 0 -> 128180 bytes .../MaterialIcons-Regular.woff | Bin 0 -> 57620 bytes .../MaterialIcons-Regular.woff2 | Bin 0 -> 44300 bytes .../fonts/material-design-icons/README.md | 9 + .../fonts/material-design-icons/codepoints | 932 ++ .../material-design-icons/material-icons.css | 38 + .../{font => fonts}/roboto/Roboto-Bold.eot | Bin .../{font => fonts}/roboto/Roboto-Bold.ttf | Bin .../{font => fonts}/roboto/Roboto-Bold.woff | Bin .../{font => fonts}/roboto/Roboto-Bold.woff2 | Bin .../{font => fonts}/roboto/Roboto-Light.eot | Bin .../{font => fonts}/roboto/Roboto-Light.ttf | Bin .../{font => fonts}/roboto/Roboto-Light.woff | Bin .../{font => fonts}/roboto/Roboto-Light.woff2 | Bin .../{font => fonts}/roboto/Roboto-Medium.eot | Bin .../{font => fonts}/roboto/Roboto-Medium.ttf | Bin .../{font => fonts}/roboto/Roboto-Medium.woff | Bin .../roboto/Roboto-Medium.woff2 | Bin .../{font => fonts}/roboto/Roboto-Regular.eot | Bin .../{font => fonts}/roboto/Roboto-Regular.ttf | Bin .../roboto/Roboto-Regular.woff | Bin .../roboto/Roboto-Regular.woff2 | Bin .../{font => fonts}/roboto/Roboto-Thin.eot | Bin .../{font => fonts}/roboto/Roboto-Thin.ttf | Bin .../{font => fonts}/roboto/Roboto-Thin.woff | Bin .../{font => fonts}/roboto/Roboto-Thin.woff2 | Bin material/static/material/js/materialize.js | 371 +- .../static/material/sass/materialize.scss | 1 + .../fields/django_splitdatetimewidget.html | 4 +- .../fields/material_formsetwidget.html | 6 +- .../material/includes/material_css.html | 1 + .../material/layout/inline_tabular.html | 6 +- package.json | 18 + 83 files changed, 6814 insertions(+), 15675 deletions(-) create mode 100644 .babelrc create mode 100644 .npmrc create mode 100644 gulpfile.babel.js delete mode 100644 material/admin/templates/material/admin/edit_inline/#tabular.html# delete mode 120000 material/admin/templates/material/admin/edit_inline/.#tabular.html delete mode 100644 material/static/material/css/material-design-iconic-font.css delete mode 100644 material/static/material/font/material-design-iconic/Material-Design-Iconic-Font.eot delete mode 100644 material/static/material/font/material-design-iconic/Material-Design-Iconic-Font.svg delete mode 100644 material/static/material/font/material-design-iconic/Material-Design-Iconic-Font.ttf delete mode 100644 material/static/material/font/material-design-iconic/Material-Design-Iconic-Font.woff delete mode 100644 material/static/material/font/material-design-iconic/Material-Design-Iconic-Font.woff2 delete mode 100644 material/static/material/font/material-design-icons/LICENSE.txt delete mode 100644 material/static/material/font/material-design-icons/Material-Design-Icons.eot delete mode 100644 material/static/material/font/material-design-icons/Material-Design-Icons.svg delete mode 100644 material/static/material/font/material-design-icons/Material-Design-Icons.ttf delete mode 100644 material/static/material/font/material-design-icons/Material-Design-Icons.woff delete mode 100644 material/static/material/font/material-design-icons/Material-Design-Icons.woff2 create mode 100644 material/static/material/fonts/material-design-icons/MaterialIcons-Regular.eot create mode 100644 material/static/material/fonts/material-design-icons/MaterialIcons-Regular.ijmap create mode 100644 material/static/material/fonts/material-design-icons/MaterialIcons-Regular.svg create mode 100644 material/static/material/fonts/material-design-icons/MaterialIcons-Regular.ttf create mode 100644 material/static/material/fonts/material-design-icons/MaterialIcons-Regular.woff create mode 100644 material/static/material/fonts/material-design-icons/MaterialIcons-Regular.woff2 create mode 100644 material/static/material/fonts/material-design-icons/README.md create mode 100644 material/static/material/fonts/material-design-icons/codepoints create mode 100644 material/static/material/fonts/material-design-icons/material-icons.css rename material/static/material/{font => fonts}/roboto/Roboto-Bold.eot (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Bold.ttf (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Bold.woff (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Bold.woff2 (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Light.eot (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Light.ttf (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Light.woff (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Light.woff2 (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Medium.eot (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Medium.ttf (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Medium.woff (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Medium.woff2 (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Regular.eot (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Regular.ttf (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Regular.woff (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Regular.woff2 (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Thin.eot (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Thin.ttf (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Thin.woff (100%) rename material/static/material/{font => fonts}/roboto/Roboto-Thin.woff2 (100%) create mode 100644 material/static/material/sass/materialize.scss create mode 100644 package.json diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..2303342a --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2016"] +} diff --git a/.gitignore b/.gitignore index d8be7266..250a6265 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ db*.sqlite3 deploy build/ dist/ +node_modules/ django_material.egg-info/ -tests/visual/screenshots_test/ +tests/visual/screenshots_test/ \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..fb97ace4 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +prefix=.npm-modules diff --git a/demo/examples/accounting/apps.py b/demo/examples/accounting/apps.py index d09c6b59..13d298fb 100644 --- a/demo/examples/accounting/apps.py +++ b/demo/examples/accounting/apps.py @@ -4,4 +4,4 @@ class Accounting(ModuleMixin, AppConfig): name = "demo.examples.accounting" - icon = '' + icon = 'payment' diff --git a/demo/examples/sales/apps.py b/demo/examples/sales/apps.py index 2bbaecbe..bde06c4b 100644 --- a/demo/examples/sales/apps.py +++ b/demo/examples/sales/apps.py @@ -4,4 +4,4 @@ class Sales(ModuleMixin, AppConfig): name = "demo.examples.sales" - icon = '' + icon = 'call_end' diff --git a/demo/forms.py b/demo/forms.py index 79c8a2da..9aec024a 100644 --- a/demo/forms.py +++ b/demo/forms.py @@ -142,8 +142,8 @@ class LoginForm(forms.Form): template = Template(""" {% form %} - {% part form.email prefix %}{% endpart %} - {% part form.password prefix %}{% endpart %} + {% part form.email prefix %}email{% endpart %} + {% part form.password prefix %}lock{% endpart %} {% attr form.keep_logged 'group' class append %}right-align{% endattr %} {% endform %} """) @@ -180,9 +180,9 @@ class RegistrationForm(forms.Form): template = Template(""" {% form %} - {% part form.username prefix %}{% endpart %} - {% part form.email prefix %}{% endpart %} - {% part form.password prefix %}{% endpart %} + {% part form.username prefix %}account_box{% endpart %} + {% part form.email prefix %}email{% endpart %} + {% part form.password prefix %}lock_open{% endpart %} {% endform %} """) @@ -203,10 +203,10 @@ class ContactForm(forms.Form): template = Template(""" {% form %} - {% part form.name prefix %}{% endpart %} - {% part form.email prefix %}{% endpart %} - {% part form.subject prefix %}{% endpart %} - {% part form.message prefix %}{% endpart %} + {% part form.name prefix %}account_box{% endpart %} + {% part form.email prefix %}email{% endpart %} + {% part form.subject prefix %}announcement{% endpart %} + {% part form.message prefix %}message{% endpart %} {% attr form.send_copy 'group' class append %}right-align{% endattr %} {% endform %} """) @@ -241,10 +241,10 @@ class OrderForm(forms.Form): template = Template(""" {% form %} - {% part form.name prefix %}{% endpart %} - {% part form.company prefix %}{% endpart %} - {% part form.email prefix %}{% endpart %} - {% part form.phone prefix %}{% endpart %} + {% part form.name prefix %}account_box{% endpart %} + {% part form.company prefix %}business{% endpart %} + {% part form.email prefix %}email{% endpart %} + {% part form.phone prefix %}call{% endpart %} {% endform %} """) @@ -290,10 +290,10 @@ class CheckoutForm(forms.Form): template = Template(""" {% form %} - {% part form.first_name prefix %}{% endpart %} - {% part form.last_name prefix %}{% endpart %} - {% part form.email prefix %}{% endpart %} - {% part form.phone prefix %}{% endpart %} + {% part form.first_name prefix %}account_box{% endpart %} + {% part form.last_name prefix %}account_box{% endpart %} + {% part form.email prefix %}email{% endpart %} + {% part form.phone prefix %}call{% endpart %} {% part form.card_type label %}{% endpart %} {% endform %} """) @@ -323,10 +323,10 @@ class CommentForm(forms.Form): template = Template(""" {% form %} - {% part form.name prefix %}{% endpart %} - {% part form.email prefix %}{% endpart %} - {% part form.website prefix %}{% endpart %} - {% part form.comment prefix %}{% endpart %} + {% part form.name prefix %}account_box{% endpart %} + {% part form.email prefix %}email{% endpart %} + {% part form.website prefix %}card_travel{% endpart %} + {% part form.comment prefix %}chat{% endpart %} {% endform %} """) @@ -552,15 +552,15 @@ class EmergencyContractForm(forms.Form): Fieldset('Procedural Questions', 'procedural_questions'), Fieldset('Clinical Predictores of Cardiovascular Risk', 'cardiovascular_risks'), Fieldset('Clinical Predictors of sleep Apnia Risk', 'apnia_risks'), - Fieldset('Emergence Numbers', 'emergency_contacts')) + Fieldset('Emergency Contacts', 'emergency_contacts')) template = Template(""" {% form %} - {% part form.registration_date prefix %}{% endpart %} - {% part form.date_of_last_appointment prefix %}{% endpart %} - {% part form.primary_care_physician prefix %}{% endpart %} - {% part form.home_phone prefix %}{% endpart %} - {% part form.work_phone prefix %}{% endpart %} + {% part form.registration_date prefix %}insert_invitation{% endpart %} + {% part form.date_of_last_appointment prefix %}insert_invitation{% endpart %} + {% part form.primary_care_physician prefix %}face{% endpart %} + {% part form.home_phone prefix %}call{% endpart %} + {% part form.work_phone prefix %}call{% endpart %} {% part form.procedural_questions label %}{% endpart %} {% part form.cardiovascular_risks label %}{% endpart %} {% part form.cardiovascular_risks columns %}2{% endpart %} diff --git a/demo/templates/admin/base_site.html b/demo/templates/admin/base_site.html index 6a4084bd..bcaf963e 100644 --- a/demo/templates/admin/base_site.html +++ b/demo/templates/admin/base_site.html @@ -1,7 +1,8 @@ {% extends "admin/base.html" %} {% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %} -{% block branding %}{% endblock %} +{% block branding %}settings_applications{% endblock %} + {% block nav-global %}{% endblock %} {% block extrajs %} @@ -14,5 +15,5 @@ {% block back_link %} -
  • Back to website
  • +
  • arrow_back Back to website
  • {% endblock %} diff --git a/gulpfile.babel.js b/gulpfile.babel.js new file mode 100644 index 00000000..8149d8d1 --- /dev/null +++ b/gulpfile.babel.js @@ -0,0 +1,55 @@ +import autoprefixer from 'autoprefixer'; +import gulp from 'gulp'; +import postcss from 'gulp-postcss'; +import sass from 'gulp-sass'; + +gulp.task('material-icons.font', () => { + return gulp.src('./node_modules/material-design-icons/iconfont/*') + .pipe(gulp.dest('./material/static/material/fonts/material-design-icons/')); +}); + + +gulp.task('roboto.font', () => { + return gulp.src('./node_modules/materialize-css/fonts/roboto/*') + .pipe(gulp.dest('./material/static/material/fonts/roboto/')); +}); + + + +gulp.task('materialize.js', () => { + return gulp.src('./node_modules/materialize-css/dist/js/materialize.js') + .pipe(gulp.dest('./material/static/material/js/')); +}); + + +gulp.task('materialize.css', () => { + return gulp.src('./material/static/material/sass/*.scss') + .pipe(sass({ + includePaths: './node_modules/' + }).on( + 'error', sass.logError + )) + .pipe(postcss([ + autoprefixer({ + browsers: [ + 'Chrome >= 50', + 'Firefox >= 46', + 'Explorer >= 11', + 'Safari >= 9', + 'ChromeAndroid >= 50', + 'FirefoxAndroid >= 46', + ] + }) + ])) + .pipe(gulp.dest( + './material/static/material/css/' + )); +}); + + +gulp.task("default", [ + "materialize.js", + "materialize.css", + "roboto.font", + "material-icons.font" +]); diff --git a/material/admin/apps.py b/material/admin/apps.py index e62c0862..c7d3af63 100644 --- a/material/admin/apps.py +++ b/material/admin/apps.py @@ -11,7 +11,7 @@ class MaterialAdminConfig(ModuleMixin, AppConfig): name = 'material.admin' label = "material_admin" - icon = '' + icon = 'settings_application' verbose_name = _("Administration") order = 1000 diff --git a/material/admin/static/admin/js/SelectFilter2.js b/material/admin/static/admin/js/SelectFilter2.js index 36d68e4d..be7e9e27 100644 --- a/material/admin/static/admin/js/SelectFilter2.js +++ b/material/admin/static/admin/js/SelectFilter2.js @@ -55,9 +55,9 @@ window.SelectFilter = { selector_chooser.className = 'selector-chooser col s12'; var add_link = quickElement('a', quickElement('li', selector_chooser), '', 'title', gettext('Choose'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_link'); add_link.className = 'selector-add btn-floating btn-flat green lighten-2'; - quickElement('i', add_link).className = 'mdi-navigation-chevron-right'; + quickElement('i', add_link, 'chevron_right').className = 'material-icons'; var remove_link = quickElement('a', quickElement('li', selector_chooser), '', 'title', gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_link'); - quickElement('i', remove_link).className = 'mdi-navigation-chevron-left'; + quickElement('i', remove_link, 'chevron_left').className = 'material-icons'; remove_link.className = 'selector-remove btn-floating btn-flat green lighten-2'; //
    diff --git a/material/admin/static/material/admin/css/base.css b/material/admin/static/material/admin/css/base.css index 338e000e..31eccf45 100644 --- a/material/admin/static/material/admin/css/base.css +++ b/material/admin/static/material/admin/css/base.css @@ -33,10 +33,6 @@ th { display: table-cell; } -nav img[class*="mdi-"] { - height: 35px; -} - nav ul a:hover { background-color: rgba(0, 0, 0, 0); } @@ -125,16 +121,22 @@ ul.side-nav.fixed.module-menu li a { overflow: hidden; } -ul.side-nav.module-menu .collapsible-body li.active, .side-nav.fixed .collapsible-body li.active { - background: #4CAF50; +ul.side-nav.module-menu a.collapsible-header { + padding-left: 15px; + padding-right: 15px; } -ul.side-nav.module-menu li a { - margin-left: 0; +ul.side-nav.module-menu .collapsible-header i.material-icons { + font-size: 1.6rem; + margin-right: 1rem; } -ul.side-nav.module-menu .collapsible-body li .collapsible-body a { - margin-left: 45px; +.side-nav.fixed .collapsible-body .collapsible-body li a { + padding-left: 4rem; +} + +ul.side-nav.module-menu .collapsible-body li.active, .side-nav.fixed .collapsible-body li.active { + background: #4CAF50; } ul.side-nav.module-menu li.active>a>span.badge { @@ -391,10 +393,11 @@ ul.side-nav.module-menu li.active>a>span.badge { white-space: nowrap; } -.fixedHeader-floating thead .zmdi, -.results thead .zmdi { +.fixedHeader-floating thead i.material-icons, +.results thead i.material-icons { line-height: 15px; margin-left:-19px; + font-size: 15px; } .results table.collapsed td, diff --git a/material/admin/templates/admin/auth/user/change_password.html b/material/admin/templates/admin/auth/user/change_password.html index 25e0fb67..60874442 100644 --- a/material/admin/templates/admin/auth/user/change_password.html +++ b/material/admin/templates/admin/auth/user/change_password.html @@ -13,8 +13,8 @@ {% csrf_token %} {% if is_popup %}{% endif %} {% form %} - {% part form.password1 prefix %}{% endpart %} - {% part form.password2 prefix %}{% endpart %} + {% part form.password1 prefix %}lock{% endpart %} + {% part form.password2 prefix %}lock{% endpart %} {% endform %}
    diff --git a/material/admin/templates/admin/base.html b/material/admin/templates/admin/base.html index 1f24cb6f..b06822c1 100644 --- a/material/admin/templates/admin/base.html +++ b/material/admin/templates/admin/base.html @@ -39,11 +39,11 @@
    diff --git a/material/admin/templates/material/admin/edit_inline/tabular.html b/material/admin/templates/material/admin/edit_inline/tabular.html index 48e35863..ebb30cb4 100644 --- a/material/admin/templates/material/admin/edit_inline/tabular.html +++ b/material/admin/templates/material/admin/edit_inline/tabular.html @@ -43,7 +43,7 @@ {% if element.inline.formset.can_delete %}
    {{ inline_admin_form.deletion_field.field }}
    - + {% endif %} @@ -53,7 +53,7 @@ {% endfor %} - + {{ element.inline.formset.management_form }} diff --git a/material/admin/templates/material/fields/django_adminsplitdatetime.html b/material/admin/templates/material/fields/django_adminsplitdatetime.html index cf305bbd..248d95eb 100644 --- a/material/admin/templates/material/fields/django_adminsplitdatetime.html +++ b/material/admin/templates/material/fields/django_adminsplitdatetime.html @@ -13,7 +13,7 @@ style="margin-top:-7px" {% endattrs %}> {% part field prefix %}{% endpart %}{% part field control %} - + view_module
    - + query_builder {{ bound_field.label }} {% endpart %} - + search
    diff --git a/material/admin/templates/material/fields/django_manytomanyrawidwidget.html b/material/admin/templates/material/fields/django_manytomanyrawidwidget.html index d100c3d7..483267d0 100644 --- a/material/admin/templates/material/fields/django_manytomanyrawidwidget.html +++ b/material/admin/templates/material/fields/django_manytomanyrawidwidget.html @@ -21,7 +21,7 @@ {% endattrs %}>{{ bound_field.label }} {% endpart %} - + search
    diff --git a/material/admin/templates/material/fields/django_relatedfieldwidgetwrapper.html b/material/admin/templates/material/fields/django_relatedfieldwidgetwrapper.html index 74ff1286..e9067227 100644 --- a/material/admin/templates/material/fields/django_relatedfieldwidgetwrapper.html +++ b/material/admin/templates/material/fields/django_relatedfieldwidgetwrapper.html @@ -12,7 +12,7 @@ data-href-template="{{ bound_field_urls.change_related_template_url }}?{{ bound_field_urls.url_params }}" id="change_id_{{ bound_field.html_name }}" title="{% blocktrans %}Change selected {{ bound_field_urls.model }}{% endblocktrans %}"> - + create {% endif %} {% if bound_field_urls.can_add_related %} @@ -20,7 +20,7 @@ href="{{ bound_field_urls.add_related_url }}?{{ bound_field_urls.url_params }}" id="add_id_{{ bound_field.html_name }}" title="{% blocktrans %}Add another {{ bound_field_urls.model }}{% endblocktrans %}"> - + add {% endif %} {% if bound_field_urls.can_delete_related %} @@ -28,7 +28,7 @@ data-href-template="{{ bound_field_urls.delete_related_template_url }}?{{ bound_field_urls.url_params }}" id="add_id_{{ bound_field.html_name }}" title="{% blocktrans %}Delete selected {{ bound_field_urls.model }}{% endblocktrans %}"> - + remove {% endif %} diff --git a/material/admin/templatetags/material_admin.py b/material/admin/templatetags/material_admin.py index afaa79f9..ea168131 100644 --- a/material/admin/templatetags/material_admin.py +++ b/material/admin/templatetags/material_admin.py @@ -152,16 +152,16 @@ def paginator_number(cl, i): current_page = cl.paginator.page(cl.page_num+1) if i == 'prev': if current_page.has_previous(): - return format_html('
  • ', + return format_html('
  • chevron_left
  • ', cl.get_query_string({PAGE_VAR: current_page.previous_page_number()})) else: - return format_html('
  • ') + return format_html('
  • chevron_left
  • ') elif i == 'next': if current_page.has_next(): - return format_html('
  • ', + return format_html('
  • chevron_right
  • ', cl.get_query_string({PAGE_VAR: current_page.next_page_number()})) else: - return format_html('
  • ') + return format_html('
  • chevron_right
  • ') elif i == '.': return mark_safe('
  • ...
  • ') elif i == cl.page_num: diff --git a/material/frontend/apps.py b/material/frontend/apps.py index d5d890cf..7822c376 100644 --- a/material/frontend/apps.py +++ b/material/frontend/apps.py @@ -25,7 +25,7 @@ class ModuleMixin(object): class Sales(ModuleMixin, AppConfig): name = 'sales' - icon = '' + icon = 'call' The application have to have /urls.py file, with a single no-parametrized url with name='index', ex:: @@ -50,7 +50,7 @@ class Sales(ModuleMixin, AppConfig): """ order = 10 - icon = 'receipt' @property def verbose_name(self): diff --git a/material/frontend/static/material/frontend/css/frontend.css b/material/frontend/static/material/frontend/css/frontend.css index 86034df3..fdb2a97a 100644 --- a/material/frontend/static/material/frontend/css/frontend.css +++ b/material/frontend/static/material/frontend/css/frontend.css @@ -10,10 +10,6 @@ nav ul a:hover { background-color: rgba(0, 0, 0, 0); } -nav img[class*="mdi-"] { - height: 35px; -} - nav ul a span.badge { position: absolute; line-height: 44px; @@ -72,22 +68,30 @@ ul.side-nav.fixed.module-menu li a { overflow: hidden; } -ul.side-nav.module-menu .collapsible-body li.active, .side-nav.fixed .collapsible-body li.active { - background: #4CAF50; +ul.side-nav.module-menu a.collapsible-header { + padding-left: 15px; + padding-right: 15px; +} + +ul.side-nav.module-menu .collapsible-header i.material-icons { + font-size: 1.6rem; + margin-right: 1rem; } -ul.side-nav.module-menu li a { - margin-left: 0; +.side-nav.fixed .collapsible-body .collapsible-body li a { + padding-left: 4rem; } -ul.side-nav.module-menu .collapsible-body li .collapsible-body a { - margin-left: 45px; + +ul.side-nav.module-menu .collapsible-body .collapsible-body .collapsible-body li a { + padding-left: 7rem; } -ul.side-nav.module-menu .collapsible-body .collapsible-body .collapsible-body a { - margin-left: 70px; +ul.side-nav.module-menu .collapsible-body li.active, .side-nav.fixed .collapsible-body li.active { + background: #4CAF50; } + ul.side-nav.module-menu li.active>a>span.badge { color: #fff; } diff --git a/material/frontend/templates/material/frontend/base.html b/material/frontend/templates/material/frontend/base.html index 6a49335b..2a8e3212 100644 --- a/material/frontend/templates/material/frontend/base.html +++ b/material/frontend/templates/material/frontend/base.html @@ -13,7 +13,7 @@ - + {% endblock %} {% block js %} @@ -33,7 +33,7 @@ {% if user.is_authenticated %}{% block user_menu %}{% include 'material/frontend/includes/user_menu.html' %}{% endblock %}{% endif %}