commit 04102d7a09c3d1e32f399a56da74a4d1c7739ff7 Author: fefa4ka Date: Mon Jul 6 02:17:49 2015 +0300 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1151254 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +media/* +static/* +*.pyc +frontend/static/* +zsite/static/vendor/* \ No newline at end of file diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..e75f64a --- /dev/null +++ b/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zsite.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8e25ed5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +aldryn-newsblog \ No newline at end of file diff --git a/zsite/__init__.py b/zsite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/zsite/menu.py b/zsite/menu.py new file mode 100644 index 0000000..e69de29 diff --git a/zsite/settings.py b/zsite/settings.py new file mode 100644 index 0000000..e31e0fd --- /dev/null +++ b/zsite/settings.py @@ -0,0 +1,239 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +import os +gettext = lambda s: s +DATA_DIR = os.path.dirname(os.path.dirname(__file__)) +""" +Django settings for zsite project. + +For more information on this file, see +https://docs.djangoproject.com/en/1.7/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.7/ref/settings/ +""" + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '=%%a@whz46w1#=8ffk^a+8vya5fg-kz0ztyz!_@hdg-(5a9q+s' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + + + + + +ROOT_URLCONF = 'zsite.urls' + +WSGI_APPLICATION = 'zsite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.7/ref/settings/#databases + + + +# Internationalization +# https://docs.djangoproject.com/en/1.7/topics/i18n/ + +LANGUAGE_CODE = 'ru' + +TIME_ZONE = 'Europe/Moscow' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.7/howto/static-files/ + +STATIC_URL = '/static/' +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(DATA_DIR, 'media') +STATIC_ROOT = os.path.join(DATA_DIR, 'static') + +STATICFILES_DIRS = ( + os.path.join(BASE_DIR, 'zsite', 'static'), +) +STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'pipeline.finders.PipelineFinder', +) +PIPELINE_COMPILERS = ( + 'pipeline.compilers.less.LessCompiler', +) +PIPELINE_JS = { + 'main': { + 'source_filenames': ( + 'js/app.js', + ), + 'output_filename': 'js/*.js', + }, + 'vendor': { + 'source_filenames': ( + 'vendor/angular/angular.js', + 'vendor/angular-bootstrap/ui-bootstrap.js' + ), + 'output_filename': 'js/vendor.js', + } + +} + +PIPELINE_CSS = { + 'main': { + 'source_filenames': ( + 'less/*.less', + ), + 'output_filename': 'css/main.css', + } +} +SITE_ID = 1 + +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + 'django.template.loaders.eggs.Loader' +) + +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'cms.middleware.user.CurrentUserMiddleware', + 'cms.middleware.page.CurrentPageMiddleware', + 'cms.middleware.toolbar.ToolbarMiddleware', + 'cms.middleware.language.LanguageCookieMiddleware' +) + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + 'django.core.context_processors.i18n', + 'django.core.context_processors.debug', + 'django.core.context_processors.request', + 'django.core.context_processors.media', + 'django.core.context_processors.csrf', + 'django.core.context_processors.tz', + 'sekizai.context_processors.sekizai', + 'django.core.context_processors.static', + 'cms.context_processors.cms_settings' +) + +TEMPLATE_DIRS = ( + os.path.join(BASE_DIR, 'zsite', 'templates'), +) + +INSTALLED_APPS = ( + 'djangocms_admin_style', + 'djangocms_text_ckeditor', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.admin', + 'django.contrib.sites', + 'django.contrib.sitemaps', + 'django.contrib.staticfiles', + 'django.contrib.messages', + 'cms', + 'menus', + 'sekizai', + 'treebeard', + 'djangocms_style', + 'djangocms_column', + 'djangocms_file', + 'djangocms_flash', + 'djangocms_googlemap', + 'djangocms_inherit', + 'djangocms_link', + 'djangocms_picture', + 'djangocms_teaser', + 'djangocms_video', + 'reversion', + 'pipeline', + 'zsite' +) + +LANGUAGES = ( + ## Customize this + ('ru', u'Русский'), + ('en', u'English'), +) + +CMS_LANGUAGES = { + ## Customize this + 'default': { + 'public': True, + 'hide_untranslated': False, + 'redirect_on_fallback': True, + }, + 1: [ + { + 'public': True, + 'code': 'ru', + 'hide_untranslated': False, + 'name': u'Русский', + 'redirect_on_fallback': True, + }, + { + 'public': True, + 'code': 'en', + 'hide_untranslated': False, + 'name': u'English', + 'redirect_on_fallback': True, + }, + ], +} + +CMS_TEMPLATES = ( + ## Customize this + ('page.html', 'Page'), + ('feature.html', 'Page with Feature') +) + +CMS_PERMISSION = True + +CMS_PLACEHOLDER_CONF = {} + +DATABASES = { + 'default': + {'ENGINE': 'django.db.backends.mysql', 'NAME': u'zuykov', 'HOST': u'localhost', 'USER': u'root', 'PASSWORD': '', 'PORT': ''} +} + +MIGRATION_MODULES = { + 'djangocms_column': 'djangocms_column.migrations_django', + 'djangocms_flash': 'djangocms_flash.migrations_django', + 'djangocms_googlemap': 'djangocms_googlemap.migrations_django', + 'djangocms_inherit': 'djangocms_inherit.migrations_django', + 'djangocms_link': 'djangocms_link.migrations_django', + 'djangocms_style': 'djangocms_style.migrations_django', + 'djangocms_file': 'djangocms_file.migrations_django', + 'djangocms_picture': 'djangocms_picture.migrations_django', + 'djangocms_teaser': 'djangocms_teaser.migrations_django', + 'djangocms_video': 'djangocms_video.migrations_django' +} diff --git a/zsite/static/.bowerrc b/zsite/static/.bowerrc new file mode 100644 index 0000000..a6509c2 --- /dev/null +++ b/zsite/static/.bowerrc @@ -0,0 +1,4 @@ +{ + "directory": "vendor", + "json": "bower.json" +} diff --git a/zsite/static/bower.json b/zsite/static/bower.json new file mode 100644 index 0000000..e73e3ab --- /dev/null +++ b/zsite/static/bower.json @@ -0,0 +1,10 @@ +{ + "name": "zuykov", + "version": "0.1.0", + "devDependencies": { + "angular": "1.3.6", + "bootstrap": "3.3.5", + "angular-bootstrap": "~0.10.0" + }, + "dependencies": {} +} diff --git a/zsite/static/imgs/logo_en.svg b/zsite/static/imgs/logo_en.svg new file mode 100644 index 0000000..2bf93dd --- /dev/null +++ b/zsite/static/imgs/logo_en.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/zsite/static/imgs/logo_ru.png b/zsite/static/imgs/logo_ru.png new file mode 100644 index 0000000..dfabaae Binary files /dev/null and b/zsite/static/imgs/logo_ru.png differ diff --git a/zsite/static/imgs/logo_ru.svg b/zsite/static/imgs/logo_ru.svg new file mode 100644 index 0000000..e900e36 --- /dev/null +++ b/zsite/static/imgs/logo_ru.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/zsite/static/imgs/pattern.svg b/zsite/static/imgs/pattern.svg new file mode 100644 index 0000000..b5e73ab --- /dev/null +++ b/zsite/static/imgs/pattern.svg @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + ® + + + + + + + + + © + + + © + + + © + + + + + + + + + + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + ® + + + + + + + + + © + + + © + + + © + + + © + + + + + + + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + ® + + + + + + + + + + + + © + + + © + + + + + + + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + ® + + + + + + + + + © + + + © + + + © + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + ® + + + + + + + + + © + + + © + + + © + + + + + + + + + + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + ® + + + + + + + + + © + + + © + + + © + + + © + + + + + + + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + ® + + + + + + + + + + + + © + + + © + + + + + + + + + + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + ® + + + + + + + + + © + + + © + + + © + + + + + + + + + + + + ® + + + ® + + + ® + + + + + + © + + + © + + + + + + + + + + + + + + + + + + ® + + + ® + + + ® + + + + + + + + + © + + + © + + + © + + + © + + + + + + + + \ No newline at end of file diff --git a/zsite/static/js/app.js b/zsite/static/js/app.js new file mode 100644 index 0000000..303e7b5 --- /dev/null +++ b/zsite/static/js/app.js @@ -0,0 +1 @@ +console.log('Yep'); \ No newline at end of file diff --git a/zsite/static/less/grid.less b/zsite/static/less/grid.less new file mode 100644 index 0000000..46f1c81 --- /dev/null +++ b/zsite/static/less/grid.less @@ -0,0 +1,135 @@ +@grid-columns: 12; +@grid-gutter-width: 30px; +@grid-float-breakpoint: 728px; + +// Creates a wrapper for a series of columns +.make-row(@gutter: @grid-gutter-width) { + // Then clear the floated columns + .clearfix(); + + @media (min-width: @screen-sm-min) { + margin-left: (@gutter / -2); + margin-right: (@gutter / -2); + } + + // Negative margin nested rows out to align the content of columns + .row { + margin-left: (@gutter / -2); + margin-right: (@gutter / -2); + } +} + +// Generate the extra small columns +.make-xs-column(@columns; @gutter: @grid-gutter-width) { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: (@gutter / 2); + padding-right: (@gutter / 2); + + // Calculate width based on number of columns available + @media (min-width: @grid-float-breakpoint) { + float: left; + width: percentage((@columns / @grid-columns)); + } +} + +// Generate the small columns +.make-sm-column(@columns; @gutter: @grid-gutter-width) { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: (@gutter / 2); + padding-right: (@gutter / 2); + + // Calculate width based on number of columns available + @media (min-width: @screen-sm-min) { + float: left; + width: percentage((@columns / @grid-columns)); + } +} + +// Generate the small column offsets +.make-sm-column-offset(@columns) { + @media (min-width: @screen-sm-min) { + margin-left: percentage((@columns / @grid-columns)); + } +} +.make-sm-column-push(@columns) { + @media (min-width: @screen-sm-min) { + left: percentage((@columns / @grid-columns)); + } +} +.make-sm-column-pull(@columns) { + @media (min-width: @screen-sm-min) { + right: percentage((@columns / @grid-columns)); + } +} + +// Generate the medium columns +.make-md-column(@columns; @gutter: @grid-gutter-width) { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: (@gutter / 2); + padding-right: (@gutter / 2); + + // Calculate width based on number of columns available + @media (min-width: @screen-md-min) { + float: left; + width: percentage((@columns / @grid-columns)); + } +} + +// Generate the medium column offsets +.make-md-column-offset(@columns) { + @media (min-width: @screen-md-min) { + margin-left: percentage((@columns / @grid-columns)); + } +} +.make-md-column-push(@columns) { + @media (min-width: @screen-md-min) { + left: percentage((@columns / @grid-columns)); + } +} +.make-md-column-pull(@columns) { + @media (min-width: @screen-md-min) { + right: percentage((@columns / @grid-columns)); + } +} + +// Generate the large columns +.make-lg-column(@columns; @gutter: @grid-gutter-width) { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: (@gutter / 2); + padding-right: (@gutter / 2); + + // Calculate width based on number of columns available + @media (min-width: @screen-lg-min) { + float: left; + width: percentage((@columns / @grid-columns)); + } +} + +// Generate the large column offsets +.make-lg-column-offset(@columns) { + @media (min-width: @screen-lg-min) { + margin-left: percentage((@columns / @grid-columns)); + } +} +.make-lg-column-push(@columns) { + @media (min-width: @screen-lg-min) { + left: percentage((@columns / @grid-columns)); + } +} +.make-lg-column-pull(@columns) { + @media (min-width: @screen-lg-min) { + right: percentage((@columns / @grid-columns)); + } +} \ No newline at end of file diff --git a/zsite/static/less/main.less b/zsite/static/less/main.less new file mode 100644 index 0000000..174697f --- /dev/null +++ b/zsite/static/less/main.less @@ -0,0 +1,18 @@ +@import '../vendor/bootstrap/less/bootstrap.less'; + +@import 'grid.less'; + +.wrapper { + .make-row(); +} +.header-logo { + .make-lg-column(8); +} +.header-contacts { + .make-lg-column(3); + .make-lg-column-offset(1); +} + +.logo { + height: 100px; +} \ No newline at end of file diff --git a/zsite/templates/base.html b/zsite/templates/base.html new file mode 100644 index 0000000..3786a30 --- /dev/null +++ b/zsite/templates/base.html @@ -0,0 +1,41 @@ +{% load cms_tags staticfiles sekizai_tags menu_tags i18n %} +{% load pipeline %} + + + + + {% block title %}Zuykov and partners{% endblock title %} + + + {% stylesheet 'main' %} + {% javascript 'vendor' %} + {% javascript 'main' %} + + {% render_block "css" %} + + + {% cms_toolbar %} +
+
+ +
+ {% language_chooser 'language_chooser.html' %} + {% page_attribute "page_title" "about" %} +
+
+ + {% block content %}{% endblock content %} +
+ {% render_block "js" %} + + diff --git a/zsite/templates/feature.html b/zsite/templates/feature.html new file mode 100644 index 0000000..73bf355 --- /dev/null +++ b/zsite/templates/feature.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% load cms_tags %} + +{% block title %}{% page_attribute "page_title" %}{% endblock title %} + +{% block content %} +
+ {% placeholder "feature" %} +
+
+ {% placeholder "content" %} +
+{% endblock content %} diff --git a/zsite/templates/language_chooser.html b/zsite/templates/language_chooser.html new file mode 100644 index 0000000..a3aaf0b --- /dev/null +++ b/zsite/templates/language_chooser.html @@ -0,0 +1,9 @@ +{% load i18n menu_tags %} + +{% if languages|length > 1 %} + {% for language in languages %} + {% ifnotequal current_language language.0 %} + {{ language.1 }} + {% endifnotequal %} + {% endfor %} +{% endif %} \ No newline at end of file diff --git a/zsite/templates/mainpage.html b/zsite/templates/mainpage.html new file mode 100644 index 0000000..459c821 --- /dev/null +++ b/zsite/templates/mainpage.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% load cms_tags %} + +{% block content %} +
+ {% placeholder "feature" %} +
+
+ {% placeholder "content" %} +
+{% endblock content %} diff --git a/zsite/templates/menu.html b/zsite/templates/menu.html new file mode 100644 index 0000000..378a412 --- /dev/null +++ b/zsite/templates/menu.html @@ -0,0 +1,19 @@ +{% load i18n menu_tags cache %} + +{% for child in children %} + + {% if class and forloop.last and not forloop.parentloop %}{% endif %} +{% endfor %} diff --git a/zsite/templates/page.html b/zsite/templates/page.html new file mode 100644 index 0000000..b095172 --- /dev/null +++ b/zsite/templates/page.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% load cms_tags %} + +{% block title %}{% page_attribute "page_title" %}{% endblock title %} + +{% block content %} + {% placeholder "content" %} +{% endblock content %} diff --git a/zsite/urls.py b/zsite/urls.py new file mode 100644 index 0000000..f518a71 --- /dev/null +++ b/zsite/urls.py @@ -0,0 +1,24 @@ +from __future__ import print_function +from cms.sitemaps import CMSSitemap +from django.conf.urls import * # NOQA +from django.conf.urls.i18n import i18n_patterns +from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.contrib import admin +from django.conf import settings + +admin.autodiscover() + +urlpatterns = i18n_patterns('', + url(r'^admin/', include(admin.site.urls)), # NOQA + url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', + {'sitemaps': {'cmspages': CMSSitemap}}), + url(r'^select2/', include('django_select2.urls')), + url(r'^', include('cms.urls')), +) + +# This is only needed when using runserver. +if settings.DEBUG: + urlpatterns = patterns('', + url(r'^media/(?P.*)$', 'django.views.static.serve', # NOQA + {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), + ) + staticfiles_urlpatterns() + urlpatterns # NOQA diff --git a/zsite/wsgi.py b/zsite/wsgi.py new file mode 100644 index 0000000..76eb5e8 --- /dev/null +++ b/zsite/wsgi.py @@ -0,0 +1,14 @@ +""" +WSGI config for zsite project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ +""" + +import os +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zsite.settings") + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application()