Skip to content
Snippets Groups Projects
Unverified Commit b4289e4b authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #556 from OpenTechFund/feature/improved-front-end-stack

Rebuilding the front end stack with gulp 4.
parents 537ad169 0ccc95e7
No related branches found
No related tags found
No related merge requests found
Showing
with 527 additions and 156 deletions
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
version: 2 version: 2
jobs: jobs:
build: build:
branches:
only:
- heroku
docker: docker:
- image: circleci/python:3.6.6-stretch-node - image: circleci/python:3.6.6-stretch-node
environment: environment:
...@@ -15,7 +12,6 @@ jobs: ...@@ -15,7 +12,6 @@ jobs:
PGHOST: localhost PGHOST: localhost
PGUSER: root PGUSER: root
DJANGO_SETTINGS_MODULE: opentech.settings.test DJANGO_SETTINGS_MODULE: opentech.settings.test
NPM_CONFIG_PRODUCTION: false
SEND_MESSAGES: false SEND_MESSAGES: false
- image: circleci/postgres:10.5 - image: circleci/postgres:10.5
...@@ -28,59 +24,57 @@ jobs: ...@@ -28,59 +24,57 @@ jobs:
steps: steps:
- checkout - checkout
# Download and cache dependencies - run:
name: set owner on /usr/local
command: sudo chown -R circleci:circleci /usr/local
- restore_cache: - restore_cache:
keys: keys:
- v1-python-{{ .Branch }}-{{ checksum "requirements.txt" }} - v2-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
- v1-python-{{ .Branch }}- - v2-python-{{ .Branch }}-
- v1-python- - v2-python-
- restore_cache: - restore_cache:
keys: keys:
- v1-yarn-{{ .Branch }}-{{ checksum "opentech/static_src/yarn.lock" }} - v2-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
- v1-yarn-{{ .Branch }}- - v2-npm-{{ .Branch }}-
- v1-yarn- - v2-npm-
- run: - run:
name: install dependencies name: install python dependencies
command: | command: |
sudo apt-get install rsync
python3 -m venv venv python3 -m venv venv
. venv/bin/activate . venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
- run: - run:
name: buils static assets name: install node dependencies
command: | command: |
cd opentech/static_src npm install --quiet
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn npm install -g gulp-cli
npm run build:prod
- save_cache: - save_cache:
paths: paths:
- ./venv - ./venv
key: v1-python-{{ .Branch }}-{{ checksum "requirements.txt" }} key: v2-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
- save_cache: - save_cache:
paths: paths:
- ~/.cache/yarn - ./node_modules
key: v1-yarn-{{ .Branch }}-{{ checksum "opentech/static_src/yarn.lock" }} - /usr/local/lib/node_modules
- /usr/local/bin
key: v2-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
- run:
name: buils static assets
command: gulp deploy
# run tests!
# this example uses Django's built-in test-runner
# other common Python testing frameworks include pytest and nose
# https://pytest.org
# https://nose.readthedocs.io
- run: - run:
name: run tests name: run tests
command: | command: |
. venv/bin/activate . venv/bin/activate
python manage.py createcachetable flake8 ./opentech
python manage.py collectstatic --no-input python manage.py collectstatic --noinput --verbosity=0
python manage.py migrate python manage.py check
python manage.py makemigrations --check --noinput --verbosity=0
python manage.py test python manage.py test
- store_artifacts:
path: test-reports
destination: test-reports
{
"extends": "eslint:recommended",
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"globals": {
"jQuery": true
},
"rules": {
// Errors.
"array-bracket-spacing": [2, "never"],
"block-scoped-var": 2,
"brace-style": [2, "stroustrup", {"allowSingleLine": true}],
"comma-dangle": [2, "never"],
"comma-spacing": 2,
"comma-style": [2, "last"],
"computed-property-spacing": [2, "never"],
"curly": [2, "all"],
"eol-last": 2,
"eqeqeq": [2, "smart"],
"guard-for-in": 2,
"indent": [2, 4, {"SwitchCase": 1}],
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
"keyword-spacing": [2, {"before": true, "after": true}],
"linebreak-style": [2, "unix"],
"lines-around-comment": [2, {"beforeBlockComment": true, "afterBlockComment": false}],
"new-parens": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-catch-shadow": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-parens": [2, "functions"],
"no-implied-eval": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-nested-ternary": 2,
"no-new-func": 2,
"no-new-object": 2,
"no-new-wrappers": 2,
"no-octal-escape": 2,
"no-process-exit": 2,
"no-proto": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-sequences": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"no-undef-init": 2,
"no-undefined": 2,
"no-unused-expressions": 2,
"no-unused-vars": [2, {"vars": "all", "args": "none"}],
"no-with": 2,
"object-curly-spacing": [2, "never"],
"one-var": [2, "never"],
"quote-props": [2, "consistent-as-needed"],
"quotes": [2, "single", "avoid-escape"],
"semi": [2, "always"],
"semi-spacing": [2, {"before": false, "after": true}],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [2, "always"],
"strict": [2, "function"],
"yoda": [2, "never"],
// Warnings.
"max-nested-callbacks": [1, 3],
"valid-jsdoc": [1, {
"prefer": {
"returns": "return",
"property": "prop"
},
"requireReturn": false
}]
}
}
# Documentation for the sass-lint Linters is available at:
# https://github.com/sasstools/sass-lint/tree/master/docs/rules
options:
formatter: stylish
merge-default-rules: true
rules:
# Extends
extends-before-mixins: 2
extends-before-declarations: 2
placeholder-in-extend: 2
# Mixins
mixins-before-declarations:
- 2
- exclude:
- 'media-query'
# Line Spacing
one-declaration-per-line: 2
empty-line-between-blocks:
- 2
- ignore-single-line-rulesets: false
single-line-per-selector: 2
# Disallows
no-attribute-selectors: 0
no-color-hex: 2
no-color-keywords: 2
no-color-literals: 2
no-combinators: 0
no-css-comments: 0
no-debug: 2
no-disallowed-properties: 2
no-duplicate-properties: 2
no-empty-rulesets: 0
no-extends: 0
no-ids: 2
no-important: 2
no-invalid-hex: 2
no-mergeable-selectors: 2
no-misspelled-properties:
- 2
- extra-properties:
- '*font-family'
- '*height'
- 'interpolation-mode'
- '*margin-left'
- '*vertical-align'
- '*width'
no-qualifying-elements: 0
no-trailing-whitespace: 2
no-trailing-zero: 2
no-transition-all: 0
no-universal-selectors: 0
no-url-protocols: 2
no-vendor-prefixes: 2
no-warn: 0
property-units: 0
# Nesting
force-attribute-nesting: 0
force-element-nesting: 0
force-pseudo-nesting: 0
# Name Formats
class-name-format:
- 2
- convention: hyphenatedbem
function-name-format: 2
id-name-format: 2
mixin-name-format:
- 2
- convention: hyphenatedbem
placeholder-name-format:
- 2
- convention: hyphenatedbem
variable-name-format: 2
# Style Guide
attribute-quotes: 2
bem-depth: 0
border-zero: 2
brace-style:
- 2
- style: stroustrup
- allow-single-line: false
clean-import-paths: 2
empty-args: 0
hex-length: 2
hex-notation: 2
indentation:
- 2
- size: 4
leading-zero: 2
nesting-depth:
- 2
- max-depth: 4
property-sort-order: 0
pseudo-element: 1
quotes: 2
shorthand-values: 2
url-quotes: 2
variable-for-property: 2
zero-unit: 2
# Inner Spacing
space-after-comma: 2
space-before-colon: 2
space-after-colon: 2
space-before-brace: 2
space-before-bang: 2
space-after-bang: 2
space-between-parens: 0
space-around-operator: 0
# Final Items
trailing-semicolon: 2
final-newline: 2
...@@ -34,19 +34,16 @@ install: ...@@ -34,19 +34,16 @@ install:
- pip install -r requirements.txt - pip install -r requirements.txt
# Install node # Install node
- nvm install 8 - nvm install 10
# Move into the static_src folder where we will compile the FE
- cd ./opentech/static_src
# Install node dependencies # Install node dependencies
- npm install --quiet - npm install --quiet
# Build the static files # Install gulp-cli
- npm run build:prod - npm install -g gulp-cli
# Change back to the original folder # Build the static files
- cd - - gulp deploy
# Run the tests # Run the tests
script: script:
......
...@@ -37,16 +37,25 @@ This will make the site available on the host machine at: http://127.0.0.1:8000/ ...@@ -37,16 +37,25 @@ This will make the site available on the host machine at: http://127.0.0.1:8000/
# Updating front-end files # Updating front-end files
Any changes made to sass or js files will need to be recompiled using: Any changes to sass and js files need to be made within the `opentech/static_src` directory. They then need to be compiled with the help of "gulp".
Start a vagrant SSH session and go to the project root directory.
``` bash
vagrant ssh
cd /vagrant
```
Here you can run a number of different "gulp" commands. The two most useful are likely:
``` bash ``` bash
yarn build gulp watch
``` ```
Alternatively you can run the watcher that will rebuild on change to files: That will watch all fles for changes and build them with maps etc., perfect for development. (It will also run the "collecstatic" command, useful when running the site with a production server and not the built in dev server.)
``` bash ``` bash
yarn start gulp build
``` ```
Both commands should be run from within the `opentech/static_src` folder in the vagrant box. This will build all the files for production. For more command see the `gulpfile.js` file.
'use strict';
var importOnce = require('node-sass-import-once');
var options = {};
// #############################
// Edit these paths and options.
// #############################
// The root paths are used to construct all the other paths in this
// configuration. The "project" root path is where this gulpfile.js is located.
options.rootPath = {
project : __dirname + '/',
app : __dirname + '/opentech/',
theme : __dirname + '/opentech/static_src/'
};
options.theme = {
root : options.rootPath.theme,
sass : options.rootPath.theme + 'src/sass/',
js : options.rootPath.theme + 'src/javascript/',
img : options.rootPath.theme + 'src/images/',
font : options.rootPath.theme + 'src/fonts/',
dest : options.rootPath.app + 'static_compiled/',
css : options.rootPath.app + 'static_compiled/css/',
js_dest : options.rootPath.app + 'static_compiled/js/',
img_dest : options.rootPath.app + 'static_compiled/images/',
font_dest : options.rootPath.app + 'static_compiled/fonts/'
};
// Define the node-sass configuration. The includePaths is critical!
options.sass = {
importer: importOnce,
includePaths: [
options.theme.sass,
],
outputStyle: 'expanded'
};
// Define the paths to the JS files to lint.
options.eslint = {
files : [
options.theme.js + '**/*.js',
'!' + options.theme.js + '**/*.min.js'
]
};
// If your files are on a network share, you may want to turn on polling for
// Gulp watch. Since polling is less efficient, we disable polling by default.
options.gulpWatchOptions = {interval: 600};
// options.gulpWatchOptions = {interval: 1000, mode: 'poll'};
// Load Gulp and tools we will use.
var gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
del = require('del'),
// gulp-load-plugins will report "undefined" error unless you load gulp-sass manually.
sass = require('gulp-sass'),
cleanCSS = require('gulp-clean-css'),
touch = require('gulp-touch-cmd'),
exec = require('child_process').exec;
// The sass files to process.
var sassFiles = [
options.theme.sass + '**/*.scss',
// Do not open Sass partials as they will be included as needed.
'!' + options.theme.sass + '**/_*.scss'
];
// Clean CSS files.
gulp.task('clean:css', function clean () {
return del([
options.theme.css + '**/*.css',
options.theme.css + '**/*.map'
], {force: true});
});
// Clean JavaScript files.
gulp.task('clean:js', function clean () {
return del([
options.theme.js_dest + '**/*.js',
options.theme.js_dest + '**/*.map'
], {force: true});
});
// Clean all directories.
gulp.task('clean', gulp.parallel('clean:css', 'clean:js'));
// Lint JavaScript.
gulp.task('lint:js', function lint () {
return gulp.src(options.eslint.files)
.pipe($.eslint())
.pipe($.eslint.format());
});
// Lint JavaScript and throw an error for a CI to catch.
gulp.task('lint:js-with-fail', function lint () {
return gulp.src(options.eslint.files)
.pipe($.eslint())
.pipe($.eslint.format())
.pipe($.eslint.failOnError());
});
// Lint Sass.
gulp.task('lint:sass', function lint () {
return gulp.src(options.theme.sass + '**/*.scss')
.pipe($.sassLint())
.pipe($.sassLint.format());
});
// Lint Sass and throw an error for a CI to catch.
gulp.task('lint:sass-with-fail', function lint () {
return gulp.src(options.theme.sass + '**/*.scss')
.pipe($.sassLint())
.pipe($.sassLint.format())
.pipe($.sassLint.failOnError());
});
// Lint Sass and JavaScript.
gulp.task('lint', gulp.parallel('lint:sass', 'lint:js'));
// Build CSS.
gulp.task('styles', gulp.series('clean:css', function css () {
return gulp.src(sassFiles)
.pipe($.sourcemaps.init())
.pipe(sass(options.sass).on('error', sass.logError))
.pipe($.size({showFiles: true}))
.pipe($.sourcemaps.write('./'))
.pipe(gulp.dest(options.theme.css))
.pipe(touch());
}));
gulp.task('styles:production', gulp.series('clean:css', function css () {
return gulp.src(sassFiles)
.pipe(sass(options.sass).on('error', sass.logError))
.pipe(cleanCSS({rebase: false}))
.pipe($.size({showFiles: true}))
.pipe(gulp.dest(options.theme.css))
.pipe(touch());
}));
// Build JavaScript.
gulp.task('scripts', gulp.series('clean:js', function js () {
return gulp.src(options.theme.js + '**/*.js')
.pipe($.sourcemaps.init())
.pipe($.babel({presets: ['@babel/env']}))
.pipe($.size({showFiles: true}))
.pipe($.sourcemaps.write('./'))
.pipe(gulp.dest(options.theme.js_dest));
}));
// Build JavaScript.
gulp.task('scripts:production', gulp.series('clean:js', function js () {
return gulp.src(options.theme.js + '**/*.js')
.pipe($.babel({presets: ['@babel/env']}))
.pipe($.uglify())
.pipe($.size({showFiles: true}))
.pipe(gulp.dest(options.theme.js_dest));
}));
// Copy images.
gulp.task('images', function copy () {
return gulp.src(options.theme.img + '**/*.*').pipe(gulp.dest(options.theme.img_dest));
});
// Copy fonts.
gulp.task('fonts', function copy () {
return gulp.src(options.theme.font + '**/*.*').pipe(gulp.dest(options.theme.font_dest));
});
// Run Djangos collectstatic command.
gulp.task('collectstatic', function (collect) {
exec('python manage.py collectstatic --no-post-process --noinput --verbosity 0', function (err, stdout, stderr) {
collect(err);
// console.log(stdout);
// console.log(stderr);
});
});
// Watch for changes and rebuild.
gulp.task('watch:css', gulp.series('styles', function watch () {
return gulp.watch(options.theme.sass + '**/*.scss', options.gulpWatchOptions, gulp.series('styles'));
}));
gulp.task('watch:lint:sass', gulp.series('lint:sass', function watch () {
return gulp.watch(options.theme.sass + '**/*.scss', options.gulpWatchOptions, gulp.series('lint:sass'));
}));
gulp.task('watch:lint:js', gulp.series('lint:js', function watch () {
return gulp.watch(options.eslint.files, options.gulpWatchOptions, gulp.series('lint:js'));
}));
gulp.task('watch:js', gulp.series('scripts', function watch () {
return gulp.watch(options.eslint.files, options.gulpWatchOptions, gulp.series('scripts'));
}));
gulp.task('watch:images', gulp.series('images', function watch () {
return gulp.watch(options.theme.img + '**/*.*', options.gulpWatchOptions, gulp.series('images'));
}));
gulp.task('watch:fonts', gulp.series('fonts', function watch () {
return gulp.watch(options.theme.font + '**/*.*', options.gulpWatchOptions, gulp.series('fonts'));
}));
gulp.task('watch:static', function watch () {
return gulp.watch(options.theme.dest + '**/*.*', options.gulpWatchOptions, gulp.series('collectstatic'));
});
gulp.task('watch', gulp.parallel('watch:css', 'watch:lint:sass', 'watch:js', 'watch:lint:js', 'watch:images', 'watch:fonts', 'watch:static'));
// Build everything.
gulp.task('build', gulp.series(gulp.parallel('styles:production', 'scripts:production', 'images', 'fonts', 'lint'), 'collectstatic'));
// Deploy everything.
gulp.task('deploy', gulp.parallel('styles:production', 'scripts:production', 'images', 'fonts'));
// The default task.
gulp.task('default', gulp.series('build'));
{% extends "base-apply.html" %} {% extends "base-apply.html" %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% load wagtailcore_tags workflow_tags %} {% load static wagtailcore_tags workflow_tags %}
{% block title %}Submission Dashboard{% endblock %} {% block title %}Submission Dashboard{% endblock %}
...@@ -51,3 +51,7 @@ ...@@ -51,3 +51,7 @@
</div> </div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/submission-tooltips.js' %}"></script>
{% endblock %}
{% extends "base-apply.html" %} {% extends "base-apply.html" %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% load static %}
{% block title %}Dashboard{% endblock %} {% block title %}Dashboard{% endblock %}
...@@ -37,3 +38,7 @@ ...@@ -37,3 +38,7 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/submission-tooltips.js' %}"></script>
{% endblock %}
{% extends "base-apply.html" %} {% extends "base-apply.html" %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% load static %}
{% block title %}OTF reviewer Dashboard{% endblock %} {% block title %}OTF reviewer Dashboard{% endblock %}
...@@ -35,3 +36,7 @@ ...@@ -35,3 +36,7 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/submission-tooltips.js' %}"></script>
{% endblock %}
{% extends "base-apply.html" %} {% extends "base-apply.html" %}
{% load bleach_tags %} {% load static bleach_tags %}
{% block title %}Create a determination{% endblock %} {% block title %}Create a determination{% endblock %}
{% block content %} {% block content %}
<div class="admin-bar"> <div class="admin-bar">
...@@ -46,3 +46,9 @@ ...@@ -46,3 +46,9 @@
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}
{# Skip this until the script is improved.
{% block extra_js %}
<script src="{% static 'js/apply/determination-template.js' %}"></script>
{% endblock %}
#}
{% extends "funds/applicationsubmission_detail.html" %} {% extends "funds/applicationsubmission_detail.html" %}
{% load workflow_tags review_tags determination_tags %} {% load static workflow_tags review_tags determination_tags %}
{% block extra_css %}
<link rel="stylesheet" href="{% static 'css/apply/fancybox.css' %}">
{{ reviewer_form.media.css }}
{% endblock %}
{% block admin_actions %} {% block admin_actions %}
{% include "funds/includes/actions.html" with mobile=True %} {% include "funds/includes/actions.html" with mobile=True %}
...@@ -32,5 +37,10 @@ ...@@ -32,5 +37,10 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
{{ reviewer_form.media }} {{ reviewer_form.media.js }}
<script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.4.1/jquery.fancybox.min.js"></script>
<script src="{% static 'js/apply/fancybox-global.js' %}"></script>
<script src="{% static 'js/apply/tabs.js' %}"></script>
<script src="{% static 'js/apply/toggle-actions-panel.js' %}"></script>
<script src="{% static 'js/apply/toggle-reviewers.js' %}"></script>
{% endblock %} {% endblock %}
{% extends "base-apply.html" %} {% extends "base-apply.html" %}
{% load workflow_tags %} {% load static workflow_tags %}
{% block title %}{{ object.title }}{% endblock %} {% block title %}{{ object.title }}{% endblock %}
{% block body_class %}{% endblock %} {% block body_class %}{% endblock %}
{% block content %} {% block content %}
...@@ -128,3 +128,8 @@ ...@@ -128,3 +128,8 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/tabs.js' %}"></script>
{% endblock %}
{% extends "base-apply.html" %} {% extends "base-apply.html" %}
{% load static %}
{% block title %}Editing: {{object.title }}{% endblock %} {% block title %}Editing: {{object.title }}{% endblock %}
{% block content %} {% block content %}
<div class="admin-bar"> <div class="admin-bar">
...@@ -30,3 +31,7 @@ ...@@ -30,3 +31,7 @@
</div> </div>
{% endblock %} {% endblock %}
{% block extra_js %}
<script src="{% static 'js/apply/list-input-files.js' %}"></script>
{% endblock %}
{% extends "base-apply.html" %} {% extends "base-apply.html" %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% load static %}
{% block title %}Submissions{% endblock %} {% block title %}Submissions{% endblock %}
{% block extra_css %} {% block extra_css %}
...@@ -55,4 +56,9 @@ ...@@ -55,4 +56,9 @@
{% block extra_js %} {% block extra_js %}
{{ filter.form.media.js }} {{ filter.form.media.js }}
<script src="{% static 'js/apply/tabs.js' %}"></script>
<script src="{% static 'js/apply/all-submissions-table.js' %}"></script>
<script src="{% static 'js/apply/submission-filters.js' %}"></script>
<script src="{% static 'js/apply/submission-tooltips.js' %}"></script>
<script src="{% static 'js/apply/activity-feed.js' %}"></script>
{% endblock %} {% endblock %}
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
{{ field }} {{ field }}
{% endfor %} {% endfor %}
<div class="form-actions form-wrapper"> <div class="form-actions form-wrapper">
<input type="submit" value="Sign up" class="form-submit link link--button-transparent link--footer-signup"> <input type="submit" value="Sign up" class="form-submit button button--transparent--wide link--footer-signup">
</div> </div>
</div> </div>
</form> </form>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<a class="card-slim" href="{% pageurl subpage %}"> <a class="card-slim" href="{% pageurl subpage %}">
<div class="card-slim__contents"> <div class="card-slim__contents">
<div> <div>
<h3 class="heading heading--no-margin">{{ subpage.listing_title|default:subpage.title }}</h3> <h3 class="heading heading--small-margin">{{ subpage.listing_title|default:subpage.title }}</h3>
{% if subpage.listing_summary or subpage.introduction %} {% if subpage.listing_summary or subpage.introduction %}
<p class="card-slim__summary">{{ subpage.listing_summary|default:subpage.introduction }}</p> <p class="card-slim__summary">{{ subpage.listing_summary|default:subpage.introduction }}</p>
{% endif %} {% endif %}
......
from .production import * # noqa from .base import * # noqa
# Should only include explicit testing settings # Should only include explicit testing settings
......
{
"presets": [
[ "env", { "modules": false } ]
],
"plugins": ["external-helpers"]
}
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"globals": {
"someGlobalVariable": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}
#########################
## Sample Sass Lint File
#########################
# Linter Options
options:
# Don't merge default rules
# merge-default-rules: false
# Set the formatter to 'html'
# formatter: html
# Output file instead of logging results
# output-file: 'linters/sass-lint.html'
# File Options
files:
ignore:
- 'src/sass/vendor/**/*.*'
- 'src/sass/config/_grid.scss'
- 'src/sass/scaffolding.scss'
# include:
# - 'src/src/_source/sass/**/*.s+(a|c)ss'
# Rule Configuration
rules:
bem-depth:
- 1
- max-depth: 3
extends-before-mixins: 2
extends-before-declarations: 2
placeholder-in-extend: 2
empty-line-between-blocks:
- 2
- include: true
mixins-before-declarations:
- 2
- exclude:
- media-query
no-warn: 0
no-debug: 0
indentation:
- 1
- size: 4
variable-for-property:
- 0
no-css-comments: 0
class-name-format:
- 1
- convention: hyphenatedbem
force-pseudo-nesting: 0
nesting-depth: 0
force-attribute-nesting: 0
force-element-nesting: 1
no-qualifying-elements: 0
leading-zero:
- 1
- include: true
no-vendor-prefixes:
- 1
mixin-name-format:
- 1
- convention: hyphenatedlowercase
no-color-keywords: 0
no-color-literals: 0
property-sort-order:
- 1
-
order: recess
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment