From 2108b640c12d9da63464d8caad70d7e42373b635 Mon Sep 17 00:00:00 2001 From: fefa4ka Date: Wed, 8 Jul 2015 10:29:55 +0300 Subject: [PATCH] lots menu, breadcrumb, people, newsblog, layout --- zsite/locale/ru/LC_MESSAGES/django.mo | Bin 1670 -> 1608 bytes zsite/locale/ru/LC_MESSAGES/django.po | 23 +- zsite/menu.py | 19 ++ zsite/settings.py | 2 +- zsite/static/less/footer.less | 68 ++++++ zsite/static/less/header.less | 105 ++++++++++ zsite/static/less/main.less | 198 +----------------- zsite/static/less/people.less | 12 ++ zsite/static/less/sub_content.less | 61 ++++++ zsite/static/less/variables.less | 28 +++ .../aldryn_newsblog/article_list.html | 19 ++ zsite/templates/aldryn_newsblog/base.html | 8 + .../aldryn_newsblog/includes/article.html | 72 +++++++ .../templates/aldryn_newsblog/two_column.html | 16 ++ .../aldryn_people/includes/breadcrumb.html | 5 + .../aldryn_people/includes/people_item.html | 29 ++- .../aldryn_people/includes/people_items.html | 7 +- .../aldryn_people/person_detail.html | 20 +- .../plugins/standard/people_list.html | 5 +- zsite/templates/base.html | 2 +- zsite/templates/menu.html | 23 +- zsite/templates/menu/breadcrumb.html | 9 + zsite/templates/menu/sub_menu_title.html | 2 +- zsite/templates/sub_section.html | 24 ++- 24 files changed, 498 insertions(+), 259 deletions(-) create mode 100644 zsite/static/less/footer.less create mode 100644 zsite/static/less/header.less create mode 100644 zsite/static/less/people.less create mode 100644 zsite/static/less/sub_content.less create mode 100644 zsite/static/less/variables.less create mode 100644 zsite/templates/aldryn_newsblog/article_list.html create mode 100644 zsite/templates/aldryn_newsblog/base.html create mode 100644 zsite/templates/aldryn_newsblog/includes/article.html create mode 100644 zsite/templates/aldryn_newsblog/two_column.html create mode 100644 zsite/templates/aldryn_people/includes/breadcrumb.html create mode 100644 zsite/templates/menu/breadcrumb.html diff --git a/zsite/locale/ru/LC_MESSAGES/django.mo b/zsite/locale/ru/LC_MESSAGES/django.mo index 1be54a4dddadcdda2423447c295d898688f6cba1..279314d854757faea0f9b5713d25cae881af8dae 100644 GIT binary patch delta 474 zcmYk&J4?e*6u|MDG<|97quPq1G}OVtibMn-V<*8u5Opgk($Ph5a!9o(73^YgP;e0u z+{AXMMFltAZf3y`;37CUiTFPyg9lE2_a-+dC+9Hvl5pQs)~OnMfF*pD?F#7msO2OPr>lyj-DQaQ{97BH<`rAjQM@Gf@a87|-r#_ZWdat#HwEBCCI4 C4?Rf$ delta 537 zcmYk&ze_?<6u|MTX_h_vVI>7cQiFqq64+oaE)g_ZL~fDN&=4p^E@>pu&=5Q#aI2-I zp;8Bh8gglgu2WkC^$*n85Pi?np#$fA?yq<6J@?5t^5oyVjx$Ag$uaVp94BKoKEw@n z;ceSG4$^O6558hAexM7#aR7f%)){uCI?<0ZA3z_5&`>I`7TOCEIK@N~J-FW&Yf!WSIHPn^MD4B)i0wQdBLjIGGO8ZHv+)YZz3wKy8rMQdrYDTO*AV^gbQvLss=cj1J zJ*=ly@l-04&Sso!Lz1{K=i%*7mNsVlTSp{IlU`BvO92Z`j\n" "Language-Team: Zuykov and partners\n" @@ -19,31 +19,25 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: zsite/templates/aldryn_people/includes/people_item.html:4 -msgctxt "employee name" -msgid "Sergey Zuykov" -msgstr "Сергей Зуйков" - -#: zsite/templates/aldryn_people/includes/people_item.html:12 -#: zsite/templates/aldryn_people/plugins/standart/people_list.html:13 +#: zsite/templates/aldryn_people/includes/people_item.html:11 msgid "Phone:" msgstr "Телефон:" -#: zsite/templates/aldryn_people/includes/people_item.html:13 +#: zsite/templates/aldryn_people/includes/people_item.html:12 msgid "Mobile:" msgstr "Мобильный телефон6" -#: zsite/templates/aldryn_people/includes/people_item.html:14 +#: zsite/templates/aldryn_people/includes/people_item.html:13 msgid "E-Mail:" msgstr "Электропочта:" -#: zsite/templates/aldryn_people/includes/people_item.html:15 +#: zsite/templates/aldryn_people/includes/people_item.html:14 msgid "Download vCard" msgstr "Скачать vCard" -#: zsite/templates/aldryn_people/plugins/standart/people_list.html:14 -msgid "Address:" -msgstr "Адрес:" +#: zsite/templates/aldryn_people/plugins/standard/people_list.html:4 +msgid "Our Team" +msgstr "Наши сотрудники" #: zsite/templates/base.html:24 msgid "Protection of intellectual property" @@ -88,3 +82,4 @@ msgstr "Москва, Россия, 129090" #: zsite/templates/language_chooser.html:6 msgid "Change to language:" msgstr "Изменить язык на:" + diff --git a/zsite/menu.py b/zsite/menu.py index e69de29..74a7694 100644 --- a/zsite/menu.py +++ b/zsite/menu.py @@ -0,0 +1,19 @@ +from menus.base import Menu, NavigationNode +from menus.menu_pool import menu_pool +from django.utils.translation import ugettext_lazy as _ + +# class TestMenu(Menu): + +# def get_nodes(self, request): +# nodes = [] +# n = NavigationNode(_('sample root page'), "/", 1) +# n2 = NavigationNode(_('sample settings page'), "/bye/", 2) +# n3 = NavigationNode(_('sample account page'), "/hello/", 3) +# n4 = NavigationNode(_('sample my profile page'), "/hello/world/", 4, 3) +# nodes.append(n) +# nodes.append(n2) +# nodes.append(n3) +# nodes.append(n4) +# return nodes + +# menu_pool.register_menu(TestMenu) diff --git a/zsite/settings.py b/zsite/settings.py index c3aa1d0..8db0c56 100644 --- a/zsite/settings.py +++ b/zsite/settings.py @@ -103,7 +103,7 @@ PIPELINE_JS = { PIPELINE_CSS = { 'main': { 'source_filenames': ( - 'less/*.less', + 'less/main.less', ), 'output_filename': 'css/main.css', } diff --git a/zsite/static/less/footer.less b/zsite/static/less/footer.less new file mode 100644 index 0000000..d67ef33 --- /dev/null +++ b/zsite/static/less/footer.less @@ -0,0 +1,68 @@ + + +footer { + .make-row(); + + margin-top: 10px; + margin-bottom: 5px; + opacity: 0.5; + + font-size: 12px; + + .background-line-pattern { + opacity: 0.13; + } + + a { + color: #000000; + text-decoration: underline; + } + + li.active { + a { + text-decoration: none; + } + } + + .about { + .make-xs-column(2); + + margin-top: -10px; + + .copyright { + margin-top: 5px; + opacity: 0.7; + } + + ul { + margin-top: 16px; + + li { + line-height: 20px; + } + } + } + + .menu { + .make-xs-column(4); + + h5 { + margin-top: 6px; + margin-bottom: 18px; + } + + li { + line-height: 20px; + } + } + + .contacts { + .make-xs-column(2); + + margin-top: 39px; + + li { + margin-bottom: 10px; + } + } +} diff --git a/zsite/static/less/header.less b/zsite/static/less/header.less new file mode 100644 index 0000000..efd3608 --- /dev/null +++ b/zsite/static/less/header.less @@ -0,0 +1,105 @@ +.wrapper { + .make-row(); + + margin-top: 10px; + margin-bottom: -10px; +} + +.header-logo { + .make-lg-column(8); + .make-md-column(8); + .make-sm-column(6); + .make-xs-column(6); + + .slogan { + position: absolute; + top: 58px; + left: 176px; + width: 160px; + + opacity: 0.5; + + line-height: 17px; + } +} + +.header-contacts { + .make-lg-column(4); + .make-md-column(4); + .make-sm-column(6); + .make-xs-column(6); + + text-align: right; + + margin-top: -4px; + + ul { + margin-right: -5px; + margin-bottom: 0; + } + + p { + margin: 0; + } +} + +.consultation { + h5 { + opacity: 0.5; + + margin-bottom: 3px; + margin-top: 0; + } + + h3 { + margin: 0; + } + + button { + margin-bottom: 5px; + margin-right: -5px; + } +} + + +.logo { + height: 100px; +} + + + +.header-menu-font { + font-family: @font-family-monospace; +} + +.header-menu { + font-size: 16px; + + li { + margin-top: 1px; + font-weight: 400; + + @media (min-width: @screen-md-min) { + margin-right: 22px; + } + + @media (min-width: @screen-lg-min) { + margin-right: 50px; + } + + a { + text-decoration: underline; + } + } + + + + li.active { + font-weight: 700; + a { + color: #000000; + + text-decoration: none; + } + } +} diff --git a/zsite/static/less/main.less b/zsite/static/less/main.less index 4d5f425..5f4619c 100644 --- a/zsite/static/less/main.less +++ b/zsite/static/less/main.less @@ -1,104 +1,19 @@ @import '../vendor/bootstrap/less/bootstrap.less'; +@import 'variables.less'; @import 'grid.less'; -@import url(http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic|Roboto+Slab:700,400&subset=cyrillic-ext,latin); - -@font-family-sans-serif: "PT Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; -@font-family-serif: Georgia, "Times New Roman", Times, serif; -@font-family-monospace: 'Roboto Slab', Menlo, Monaco, Consolas, "Courier New", monospace; -@font-family-base: @font-family-sans-serif; - -@font-size-base: 14px; -@font-size-large: ceil((@font-size-base * 1.25)); // ~18px -@font-size-small: ceil((@font-size-base * 0.85)); // ~12px - -// @font-size-h1: floor((@font-size-base * 2.6)); // ~36px -// @font-size-h2: floor((@font-size-base * 2.15)); // ~30px -@font-size-h1: ceil((@font-size-base * 1.7));// ~24px -@font-size-h2: @font-size-h1; -@font-size-h3: ceil((@font-size-base * 1.55)); // ~22px -@font-size-h4: ceil((@font-size-base * 1.25)); // ~18px -@font-size-h5: @font-size-base; -@font-size-h6: ceil((@font-size-base * 0.85)); // ~12px - -//** Unit-less `line-height` for use in components like buttons. -@line-height-base: 1.428571429; // 20/14 -//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc. -@line-height-computed: floor((@font-size-base * @line-height-base)); // ~20px - -//** By default, this inherits from the ``. -@headings-font-family: inherit; -@headings-font-weight: 500; -@headings-line-height: 1.1; -@headings-color: inherit; - -h5 { - font-weight: 500; -} - -.wrapper { - .make-row(); - - margin-top: 10px; - margin-bottom: -10px; -} - -.header-logo { - .make-lg-column(8); - - .slogan { - position: absolute; - top: 58px; - left: 176px; - width: 160px; +@import 'header.less'; +@import 'footer.less'; - opacity: 0.5; +@import 'sub_content.less'; - line-height: 17px; - } -} - -.header-contacts { - .make-lg-column(3); - .make-lg-column-offset(1); - - text-align: right; - - margin-top: -4px; - - ul { - margin-right: -5px; - margin-bottom: 0; - } - - p { - margin: 0; - } -} +@import 'people.less'; -.consultation { - h5 { - opacity: 0.5; - margin-bottom: 3px; - margin-top: 0; - } - - h3 { - margin: 0; - } - - button { - margin-bottom: 5px; - margin-right: -5px; - } -} +@import url(http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic|Roboto+Slab:700,400&subset=cyrillic-ext,latin); -.logo { - height: 100px; -} .background-line-pattern { @@ -112,104 +27,3 @@ h5 { z-index: -1; left: 0; } - -.header-menu-font { - font-family: @font-family-monospace; -} - -.header-menu { - font-size: 16px; - - li { - margin-top: 1px; - margin-right: 35px; - font-weight: 400; - a { - text-decoration: underline; - } - } - - span.active { - font-weight: 700; - } -} - - -footer { - .make-row(); - - margin-top: 10px; - margin-bottom: 5px; - opacity: 0.5; - - font-size: 12px; - - .background-line-pattern { - opacity: 0.13; - } - - a { - color: #000000; - text-decoration: underline; - } - - li.active { - a { - text-decoration: none; - } - } - - .about { - .make-lg-column(2); - - margin-top: -10px; - - .copyright { - margin-top: 5px; - opacity: 0.7; - } - - ul { - margin-top: 16px; - - li { - line-height: 20px; - } - } - } - - .menu { - .make-lg-column(4); - - h5 { - margin-top: 6px; - margin-bottom: 18px; - } - - li { - line-height: 20px; - } - } - - .contacts { - .make-lg-column(2); - - margin-top: 39px; - - li { - margin-bottom: 10px; - } - } -} - -.sub-content { - .make-row(); - - .menu { - .make-lg-column(2); - } - - .content { - .make-lg-column(10); - } -} \ No newline at end of file diff --git a/zsite/static/less/people.less b/zsite/static/less/people.less new file mode 100644 index 0000000..2dbd387 --- /dev/null +++ b/zsite/static/less/people.less @@ -0,0 +1,12 @@ +.plugin-people { + + .people-detail-visual { + margin-top: 20px; + } + + li.people-item { + width: 150px; + vertical-align: top; + } + +} \ No newline at end of file diff --git a/zsite/static/less/sub_content.less b/zsite/static/less/sub_content.less new file mode 100644 index 0000000..f536571 --- /dev/null +++ b/zsite/static/less/sub_content.less @@ -0,0 +1,61 @@ +.sub-content { + .make-row(); + + .menu { + .make-lg-column(2); + .make-md-column(2); + // .make-sm-column(1); + // В разделе сотрудников заезжает контент + position: relative; + z-index: 100; + + li { + @media (min-width: 320px) { + display: inline-block; + margin-right: 15px; + } + + @media (min-width: @screen-md-min) { + display: block; + margin-bottom: 5px; + } + } + + + h5 { + font-weight: 700; + } + li.active { + display: inline-block; + background: #EDEDED; + padding: 1px 5px; + margin: -5px; + + margin-bottom: 5px; + + @media (min-width: 320px) { + margin-right: 10px; + } + + a { + color: #000000; + + text-decoration: none; + } + } + } + + .content { + .make-lg-column(8); + .make-md-column(10); + .breadcrumb { + padding: 0; + margin-bottom: 0; + background-color: #fff; + border-radius: 0; + + margin-top: 8px; + } + // .make-sm-column(11); + } +} \ No newline at end of file diff --git a/zsite/static/less/variables.less b/zsite/static/less/variables.less new file mode 100644 index 0000000..3a43e66 --- /dev/null +++ b/zsite/static/less/variables.less @@ -0,0 +1,28 @@ +@font-family-sans-serif: "PT Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +@font-family-serif: Georgia, "Times New Roman", Times, serif; +@font-family-monospace: 'Roboto Slab', Menlo, Monaco, Consolas, "Courier New", monospace; +@font-family-base: @font-family-sans-serif; + +@font-size-base: 14px; +@font-size-large: ceil((@font-size-base * 1.25)); // ~18px +@font-size-small: ceil((@font-size-base * 0.85)); // ~12px + +// @font-size-h1: floor((@font-size-base * 2.6)); // ~36px +// @font-size-h2: floor((@font-size-base * 2.15)); // ~30px +@font-size-h1: ceil((@font-size-base * 1.7));// ~24px +@font-size-h2: @font-size-h1; +@font-size-h3: ceil((@font-size-base * 1.55)); // ~22px +@font-size-h4: ceil((@font-size-base * 1.25)); // ~18px +@font-size-h5: @font-size-base; +@font-size-h6: ceil((@font-size-base * 0.85)); // ~12px + +//** Unit-less `line-height` for use in components like buttons. +@line-height-base: 1.428571429; // 20/14 +//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc. +@line-height-computed: floor((@font-size-base * @line-height-base)); // ~20px + +//** By default, this inherits from the ``. +@headings-font-family: inherit; +@headings-font-weight: 500; +@headings-line-height: 1.1; +@headings-color: inherit; diff --git a/zsite/templates/aldryn_newsblog/article_list.html b/zsite/templates/aldryn_newsblog/article_list.html new file mode 100644 index 0000000..771881d --- /dev/null +++ b/zsite/templates/aldryn_newsblog/article_list.html @@ -0,0 +1,19 @@ +{% extends "aldryn_newsblog/two_column.html" %} +{% load i18n cms_tags %} + +{% block newsblog_content %} + {% render_placeholder view.config.list_view_placeholder language placeholder_language %} +
+ {% for article in article_list %} + {% include "aldryn_newsblog/includes/article.html" %} + {% empty %} +

{% trans "No items available" %}

+ {% endfor %} +
+{% endblock %} + +{% block newsblog_footer %} +
+ {% include "aldryn_newsblog/includes/pagination.html" %} +
+{% endblock %} \ No newline at end of file diff --git a/zsite/templates/aldryn_newsblog/base.html b/zsite/templates/aldryn_newsblog/base.html new file mode 100644 index 0000000..a96c81e --- /dev/null +++ b/zsite/templates/aldryn_newsblog/base.html @@ -0,0 +1,8 @@ +{% extends CMS_TEMPLATE %} + +{% block extend_breadcrumb %} + {{ block.super }} + {% block newsblog_breadcrumb %}{% endblock newsblog_breadcrumb %} +{% endblock extend_breadcrumb %} + +{% block content_safe %}{% endblock content_safe %} \ No newline at end of file diff --git a/zsite/templates/aldryn_newsblog/includes/article.html b/zsite/templates/aldryn_newsblog/includes/article.html new file mode 100644 index 0000000..322ffc3 --- /dev/null +++ b/zsite/templates/aldryn_newsblog/includes/article.html @@ -0,0 +1,72 @@ +{% load i18n apphooks_config_tags cms_tags sekizai_tags staticfiles thumbnail %} +{% load url from future %} + + + +{% addtoblock "css" %}{% endaddtoblock %} \ No newline at end of file diff --git a/zsite/templates/aldryn_newsblog/two_column.html b/zsite/templates/aldryn_newsblog/two_column.html new file mode 100644 index 0000000..855802a --- /dev/null +++ b/zsite/templates/aldryn_newsblog/two_column.html @@ -0,0 +1,16 @@ +{% extends "aldryn_newsblog/base.html" %} +{% load i18n cms_tags %} + +{% block content_safe %} + + {% if view.show_header %} + {% render_placeholder view.config.placeholder_base_top %} + {% endif %} +
+ {% block newsblog_title %}{% endblock %} + {% block newsblog_content %}{% endblock %} + {% block newsblog_footer %}{% endblock %} +
+ + +{% endblock content_safe %} \ No newline at end of file diff --git a/zsite/templates/aldryn_people/includes/breadcrumb.html b/zsite/templates/aldryn_people/includes/breadcrumb.html new file mode 100644 index 0000000..ad986f1 --- /dev/null +++ b/zsite/templates/aldryn_people/includes/breadcrumb.html @@ -0,0 +1,5 @@ +{% for ance in ancestors %} +
  • + {{ ance.get_menu_title }} +
  • +{% endfor %} \ No newline at end of file diff --git a/zsite/templates/aldryn_people/includes/people_item.html b/zsite/templates/aldryn_people/includes/people_item.html index b79924d..7090e54 100644 --- a/zsite/templates/aldryn_people/includes/people_item.html +++ b/zsite/templates/aldryn_people/includes/people_item.html @@ -1,17 +1,16 @@ -{% load aldryn_people_tags i18n thumbnail %} +{% load menu_tags aldryn_people_tags i18n thumbnail %} -
    -

    {{ person.name }} {{ person.function }}

    - {% if person.visual %}

    - {% if instance.show_links %}{% endif %} - {{ person.name }} - {% if instance.show_links %}{% endif %} -

    {% endif %} -

    - {% if person.phone %}{% trans "Phone:" %} {{ person.phone|phoneformat }}
    {% endif %} - {% if person.mobile %}{% trans "Mobile:" %} {{ person.mobile|phoneformat }}
    {% endif %} - {% if person.email %}{% trans "E-Mail:" %} {{ person.email }}{% endif %} - {% if instance.show_vcard and person.vcard_enabled %}
    {% trans "Download vCard" %}{% endif %} -

    - {% if person.description %}
    {{ person.description|safe }}
    {% endif %} +{% show_breadcrumb 2 %} + +
    +
    + {% if person.visual %}

    + {{ person.name }} + {% endif %} +

    +
    +

    {{ person.name }}

    +
    {{ person.function }}
    + {% if person.description %}
    {{ person.description|safe }}
    {% endif %} +
    \ No newline at end of file diff --git a/zsite/templates/aldryn_people/includes/people_items.html b/zsite/templates/aldryn_people/includes/people_items.html index cfc54a9..0d9706b 100644 --- a/zsite/templates/aldryn_people/includes/people_items.html +++ b/zsite/templates/aldryn_people/includes/people_items.html @@ -1,16 +1,17 @@ {% load i18n thumbnail %} -
      +
        {% for person in people %}
      • + {% if instance.show_links %}{% endif %} {% if person.visual %}

        - {% if instance.show_links %}{% endif %} {{ person.name }} - {% if instance.show_links %}{% endif %} +

        {% endif %}
        {{ person.name }}
        + {% if instance.show_links %}{% endif %}
        {{ person.function }}
      • {% endfor %} diff --git a/zsite/templates/aldryn_people/person_detail.html b/zsite/templates/aldryn_people/person_detail.html index c5dc573..b7aff57 100644 --- a/zsite/templates/aldryn_people/person_detail.html +++ b/zsite/templates/aldryn_people/person_detail.html @@ -1,9 +1,13 @@ -{% extends "base.html" %} +{% extends CMS_TEMPLATE %} +{% load cms_tags menu_tags %} -{% block content %} -
        -
        - {% include "aldryn_people/includes/people_item.html" with person=person %} -
        -
        -{% endblock content %} \ No newline at end of file +{% block breadcrumb %} + +{% endblock breadcrumb %} + +{% block content_safe %} + {% include "aldryn_people/includes/people_item.html" with person=person %} +{% endblock content_safe %} \ No newline at end of file diff --git a/zsite/templates/aldryn_people/plugins/standard/people_list.html b/zsite/templates/aldryn_people/plugins/standard/people_list.html index a6d94c0..cbfbb88 100644 --- a/zsite/templates/aldryn_people/plugins/standard/people_list.html +++ b/zsite/templates/aldryn_people/plugins/standard/people_list.html @@ -1,13 +1,14 @@ {% load i18n thumbnail %}
        +

        {% trans 'Our Team' %}

        {% if people_groups %} {# Because of hvad I have to activate the plugin's language :( #} - {% language instance.language %} + {% language LANGUAGE_CODE %} {% for group, people_list in people_groups.items %} {% if group.name %}
        -

        {{ group.name }}

        +

        {{ group.name }}

        {{ group.description|safe }}
        {% endif %} diff --git a/zsite/templates/base.html b/zsite/templates/base.html index 5ccd22b..4b474fe 100644 --- a/zsite/templates/base.html +++ b/zsite/templates/base.html @@ -31,7 +31,7 @@

        {% trans 'London' %}

        {% trans 'Free Consultation' %}
        -

        +7 800 700-16-37

        +

        +7 800 700-16-37