Skip to content

Commit

Permalink
Merge pull request #302 from haricot/patch-18
Browse files Browse the repository at this point in the history
Swicth bs3demo to bs4demo
  • Loading branch information
jrief committed Nov 10, 2018
2 parents 3cc060f + afd1d4d commit c4f6442
Show file tree
Hide file tree
Showing 22 changed files with 68 additions and 58 deletions.
10 changes: 0 additions & 10 deletions examples/bs3demo/static/bs3demo/css/_variables.scss

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
class Badge(CascadePluginBase):
"""
This is a simple example of a plugin suitable for the djangocms-cascade system.
It contains one single field: `content` rendered via the template `bs3demo/badge.html`.
It contains one single field: `content` rendered via the template `bs4demo/badge.html`.
"""
name = _("Badge")
require_parent = False
allow_children = False
render_template = 'bs3demo/badge.html'
render_template = 'bs4demo/badge.html'

content = GlossaryField(
widgets.TextInput(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def cascade(request):
Adds additional context variables to the default context.
"""
context = {
'DJANGO_CLIENT_FRAMEWORK': settings.CMSPLUGIN_CASCADE['bootstrap3'].get('template_basedir'),
'DJANGO_CLIENT_FRAMEWORK': settings.CMSPLUGIN_CASCADE['bootstrap4'].get('template_basedir'),
}
return context
File renamed without changes.
29 changes: 15 additions & 14 deletions examples/bs3demo/settings.py → examples/bs4demo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

SITE_ID = 1

ROOT_URLCONF = 'bs3demo.urls'
ROOT_URLCONF = 'bs4demo.urls'

SECRET_KEY = 'secret'

Expand Down Expand Up @@ -53,15 +53,15 @@
'cmsplugin_cascade.sharable',
'cmsplugin_cascade.segmentation',
'cms',
'cms_bootstrap3',
'cms_bootstrap',
'adminsortable2',
'menus',
'treebeard',
'filer',
'easy_thumbnails',
'sass_processor',
'sekizai',
'bs3demo',
'bs4demo',
]

MIDDLEWARE_CLASSES = [
Expand Down Expand Up @@ -125,7 +125,7 @@
'django.contrib.messages.context_processors.messages',
'sekizai.context_processors.sekizai',
'cms.context_processors.cms_settings',
'bs3demo.context_processors.cascade',
'bs4demo.context_processors.cascade',
),
},
}]
Expand Down Expand Up @@ -185,8 +185,8 @@
)
else:
CMS_TEMPLATES = (
('bs3demo/main.html', "Main Content"),
('bs3demo/wrapped.html', "Wrapped Bootstrap Column"),
('bs4demo/main.html', "Main Content"),
('bs4demo/wrapped.html', "Wrapped Bootstrap Column"),
)

CMS_SEO_FIELDS = True
Expand All @@ -202,8 +202,8 @@
'cmsplugin_cascade.generic',
'cmsplugin_cascade.leaflet',
'cmsplugin_cascade.link',
'cmsplugin_cascade.bootstrap3',
'bs3demo',
'cmsplugin_cascade.bootstrap4',
'bs4demo',
)

CMSPLUGIN_CASCADE = {
Expand All @@ -222,14 +222,15 @@
}

CASCADE_WORKAREA_GLOSSARY = {
'breakpoints': ['xs', 'sm', 'md', 'lg'],
'container_max_widths': {'xs': 750, 'sm': 750, 'md': 970, 'lg': 1170},
'breakpoints': ['xs', 'sm', 'md', 'lg','xl'],
'container_max_widths': {'xs': 576,'sm': 768,'md': 992, 'lg': 1200, 'xl': 1980,},
'fluid': False,
'media_queries': {
'xs': ['(max-width: 768px)'],
'sm': ['(min-width: 768px)', '(max-width: 992px)'],
'md': ['(min-width: 992px)', '(max-width: 1200px)'],
'lg': ['(min-width: 1200px)'],
'xs': ['(max-width: 576px)'],
'sm': ['(min-width: 576px)', '(max-width: 768px)'],
'md': ['(min-width: 768px)', '(max-width: 992px)'],
'lg': ['(min-width: 992px)', '(max-width: 1200px)'],
'xl': ['(min-width: 1200px)'],
},
}

Expand Down
8 changes: 8 additions & 0 deletions examples/bs4demo/static/bs4demo/css/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import "bootstrap/scss/_functions";
@import "bootstrap/scss/_variables";
@import "bootstrap/scss/mixins/_breakpoints.scss";

// footer
$body-footer-height: 200px;
$body-footer-color: $yiq-text-light;
$body-footer-bg: $dark;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "variables";
@import "bootstrap-sass/assets/stylesheets/bootstrap";
@import "bootstrap/scss/bootstrap";
@import "footer";

body {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load sekizai_tags sass_tags %}
{% addtoblock "css" %}<link rel="stylesheet" href="{% sass_src 'bs3demo/css/badge.scss' %}" type="text/css" />{% endaddtoblock %}
{% addtoblock "css" %}<link rel="stylesheet" href="{% sass_src 'bs4demo/css/badge.scss' %}" type="text/css" />{% endaddtoblock %}
{% with inline_styles=instance.inline_styles %}
<div class="badge-ribbon"{% if inline_styles %} style="{{ inline_styles }}"{% endif %}>{{ instance.glossary.content }}</div>
{% endwith %}
{% endwith %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% load static cms_tags sekizai_tags %}

<!doctype html>
<html lang="de">

Expand All @@ -20,16 +19,16 @@
<main>
{% block main %}{% endblock %}
</main>
<footer id="footer">
<footer id="footer" class="border border-light">
<div class="container">
<div class="row">
<div class="col-xs-4">
<div class="col-6">
<h3>About</h3>
<p>Lorem Ipsum</p>
<p>Incididunt ut labore</p>
<p>Quis nostrud exercitat</p>
</div>
<div class="col-xs-4">
<div class="col-6">
<h3>Services</h3>
<p>Conse ctetur adipisicing</p>
<p>Elit sed do eiusmod tempor</p>
Expand All @@ -41,13 +40,17 @@ <h3>Services</h3>
{% if DJANGO_CLIENT_FRAMEWORK == 'angular-ui' %}
<script src="{% static 'node_modules/angular/angular.min.js' %}" type="text/javascript"></script>
<script src="{% static 'node_modules/angular-animate/angular-animate.min.js' %}" type="text/javascript"></script>
<script src="{% static 'node_modules/angular-ui-bootstrap/ui-bootstrap-tpls.min.js' %}" type="text/javascript"></script>
<script src="{% static 'node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js' %}" type="text/javascript"></script>
<script type="text/javascript">
angular.module('cascadeDemo', ['ngAnimate', 'ui.bootstrap']);
angular.module('cascadeDemo', ['ngAnimate', 'ui.bootstrap'])
</script>
<style>
.nav, .pagination, .carousel, .card-title a { cursor: pointer; }
</style>
{% else %}
<script src="{% static 'node_modules/jquery/dist/jquery.min.js' %}" type="text/javascript"></script>
<script src="{% static 'node_modules/bootstrap-sass/assets/javascripts/bootstrap.min.js' %}" type="text/javascript"></script>
<script src="{% static 'node_modules/popper.js/dist/umd/popper.js' %}" type="text/javascript"></script>
<script src="{% static 'node_modules/bootstrap/dist/js/bootstrap.min.js' %}" type="text/javascript"></script>
{% endif %}
{% render_block "js" %}
</body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
{% extends "bs3demo/base.html" %}
{% extends "bs4demo/base.html" %}
{% load static cms_tags bootstrap_tags sekizai_tags sass_tags %}

{% block head %}
{% addtoblock "css" %}<link rel="stylesheet" href="{% sass_src 'bs3demo/css/main.scss' %}" type="text/css" />{% endaddtoblock %}
{% addtoblock "css" %}<link rel="stylesheet" href="{% sass_src 'bs4demo/css/main.scss' %}" type="text/css" />{% endaddtoblock %}
{% endblock head %}

{% block header %}
{% if DJANGO_CLIENT_FRAMEWORK == 'angular-ui' %}
{% include "bootstrap/includes/ng-nav-navbar.html" with navbar_classes="navbar-default navbar-static-top" %}
{% else %}
{% include "bootstrap/includes/nav-navbar.html" with navbar_classes="navbar-default navbar-static-top" %}
{% endif %}
{% include "bootstrap4/includes/ng-nav-navbar.html" with navbar_classes="navbar-expand-lg navbar-light bg-light fixed-top" %}
{% else %}
{% include "bootstrap4/includes/nav-navbar.html" with navbar_classes="navbar-expand-lg navbar-light bg-light fixed-top" role="navigation" %}
{% endif %}

{% if cms_version >= "3.5.0" and request.toolbar %}
<style>
body { padding-top:46px; }
.fixed-top { top: 46px !important;}
</style>
{% endif %}

{% endblock header %}

{% block main %}{% placeholder "Main Content" or %}
<div class="container">
<div class="row starter-template">
<div class="col-xs-12">
<div class="col-12">
<h1>Add Bootstrap container here</h1>
<p class="lead">Use this placeholder as a quick way to start editing a new CMS page.</p>
<p>All you have to do is to append <code>?edit</code> to the URL, switch to “Structure” mode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% extends "bs3demo/main.html" %}
{% extends "bs4demo/main.html" %}
{% load cascade_tags %}

{% block main %}
<div class="container">
<div class="row starter-template">
<div class="col-xs-12">
<p>Content is rendered using the templatetag {% verbatim %}<code>{% render_cascade "bs3demo/cascades/strides.json" %}</code>{% endverbatim %}</p>
<div class="col-12">
<p>Content is rendered using the templatetag {% verbatim %}<code>{% render_cascade "bs4demo/cascades/strides.json" %}</code>{% endverbatim %}</p>
</div>
</div>
</div>
{% render_cascade "bs3demo/cascades/strides.json" %}
{% render_cascade "bs4demo/cascades/strides.json" %}
{% endblock main %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "bs3demo/main.html" %}
{% extends "bs4demo/main.html" %}
{% load cms_tags %}

{% block main %}
<div class="container">
<div class="row starter-template">
<div class="col-xs-12">
<div class="col-12">
{% placeholder "Bootstrap Column" or %}
<h1>Add some Bootstrap plugins here</h1>
<p class="lead">Use this placeholder as a quick way to start editing a new CMS page.</p>
Expand Down
2 changes: 1 addition & 1 deletion examples/bs3demo/urls.py → examples/bs4demo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.views.generic import TemplateView

class CascadeDemoView(TemplateView):
template_name = 'bs3demo/strides.html'
template_name = 'bs4demo/strides.html'


admin.autodiscover()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
if __name__ == "__main__":
from django.core.management import execute_from_command_line

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bs3demo.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bs4demo.settings')
execute_from_command_line(sys.argv)
6 changes: 3 additions & 3 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"angular": "^1.5.11",
"angular-animate": "^1.5.11",
"angular-sanitize": "^1.5.11",
"angular-ui-bootstrap": "^0.14.3",
"bootstrap": "^3.3.7",
"bootstrap-sass": "^3.3.7",
"ui-bootstrap4": "^3.0.5",
"bootstrap": "^4.1.3",
"jquery": "^3.2.1",
"leaflet": "^1.2.0",
"leaflet-easybutton": "^2.2.0",
"picturefill": "^3.0.2",
"popper.js": "^1.12.9",
"select2": "^4.0.3"
},
"devDependencies": {},
Expand Down
4 changes: 2 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Pillow==3.3.0
Pillow==3.3.2
Unidecode==0.4.18
argparse==1.2.1
django-admin-sortable2==0.6.19
django-classy-tags==0.8.0
django-cms==3.4.6
django-cms>=3.4.6,<=3.6
django-filer==1.3.2
django-mptt==0.8.7
django-sass-processor==0.6
Expand Down
2 changes: 1 addition & 1 deletion requirements/django111.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Django==1.11.15
Django>=1.11.15,<2.0
-r base.txt

0 comments on commit c4f6442

Please sign in to comment.