From f17cf35d11730e8361f0c3f978ec98e4e68546cd Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Wed, 4 Apr 2018 08:32:40 +0100 Subject: [PATCH 1/7] Resolve content header list wrapping --- .../patterns/organisms/content-header.scss | 51 +++++++++++-------- .../content-headers/content-header.mustache | 11 ++-- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/assets/sass/patterns/organisms/content-header.scss b/assets/sass/patterns/organisms/content-header.scss index f62dae9c5..5eba31628 100644 --- a/assets/sass/patterns/organisms/content-header.scss +++ b/assets/sass/patterns/organisms/content-header.scss @@ -455,17 +455,32 @@ $iconlist: cc oa; display: block; } -.content-header__author:after { - content: ", "; +.content-header__author_separator { + .content-header__author--last-non-excess + & { + display: none; + + .content-header__author_list--expanded & { + display: inline; + } + } +} + +li.content-header__author_list_item--last .content-header__author_separator { + display: none; } -.content-header__author--last-non-excess:after { - content: ""; +.content-header__institution_separator { + .content-header__institution--last-non-excess + & { + display: none; - .content-header__author_list--expanded & { - content: ", "; + .content-header__institution_list--expanded & { + display: inline; + } } +} +li.content-header__institution_list_item--last .content-header__institution_separator { + display: none; } .content-header__author_link { @@ -483,10 +498,6 @@ $iconlist: cc oa; vertical-align: text-top; } -li.content-header__author_list_item--last .content-header__author:after { - content: ""; -} - .content-header__author--single { @include author-typeg(); } @@ -503,12 +514,8 @@ li.content-header__author_list_item--last .content-header__author:after { padding: 0; } -.content-header__institution:after { - content: "; "; -} - -li.content-header__institution_list_item--last .content-header__institution:after { - content: ""; +.content-header__item_toggle { + white-space: nowrap; } .content-header__item_toggle--author { @@ -527,8 +534,12 @@ li.content-header__institution_list_item--last .content-header__institution:afte @media only all and (min-width: #{get-rem-from-px($bkpt-site--medium)}em) { - .content-header__author--last-non-excess:after { - content: ""; + .content-header__author--last-non-excess .content-header__author_separator { + display: none; + } + + .content-header__institution--last-non-excess .content-header__institution_separator { + display: none; } .content-header__item_toggle { @@ -555,10 +566,6 @@ li.content-header__institution_list_item--last .content-header__institution:afte cursor: pointer; } - .content-header__institution--last-non-excess:after { - content: ""; - } - } .content-header__cta { diff --git a/source/_patterns/02-organisms/content-headers/content-header.mustache b/source/_patterns/02-organisms/content-headers/content-header.mustache index 27a7056cf..b375ef95d 100644 --- a/source/_patterns/02-organisms/content-headers/content-header.mustache +++ b/source/_patterns/02-organisms/content-headers/content-header.mustache @@ -116,13 +116,15 @@
    {{#authors.list}}
  1. - {{#url}}{{/url}}{{name}}{{#url}}{{/url}}{{#isCorresponding}} - + {{#url}}{{/url}}{{name}}{{#url}}{{/url}}{{#isCorresponding}} {{! + }} Is a corresponding author - {{/isCorresponding}} + {{/isCorresponding}}{{! + }} +
  2. {{/authors.list}}
@@ -131,7 +133,8 @@
    {{#institutions.list}}
  1. - {{{name}}} + {{{name}}}{{! + }}
  2. {{/institutions.list}}
From 7030257bf012c6667cf464abe2e3d63248a77d85 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Thu, 5 Apr 2018 14:32:50 +0100 Subject: [PATCH 2/7] Actually prevent wrapping --- assets/sass/patterns/organisms/content-header.scss | 4 ++++ .../02-organisms/content-headers/content-header.mustache | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/assets/sass/patterns/organisms/content-header.scss b/assets/sass/patterns/organisms/content-header.scss index f8d15eeef..e4f032432 100644 --- a/assets/sass/patterns/organisms/content-header.scss +++ b/assets/sass/patterns/organisms/content-header.scss @@ -466,6 +466,10 @@ $iconlist: cc oa; display: block; } +.content-header__author_suffix { + white-space: nowrap; +} + .content-header__author_separator { .content-header__author--last-non-excess + & { display: none; diff --git a/source/_patterns/02-organisms/content-headers/content-header.mustache b/source/_patterns/02-organisms/content-headers/content-header.mustache index 3ca1dd4c7..f0e39e05e 100644 --- a/source/_patterns/02-organisms/content-headers/content-header.mustache +++ b/source/_patterns/02-organisms/content-headers/content-header.mustache @@ -121,15 +121,15 @@
    {{#authors.list}}
  1. - {{#url}}{{/url}}{{name}}{{#url}}{{/url}}{{#isCorresponding}} {{! + {{#url}}{{/url}}{{name}}{{#url}}{{/url}}{{#isCorresponding}} {{! }} Is a corresponding author - {{/isCorresponding}}{{! + {{/isCorresponding}}{{! }} - +
  2. {{/authors.list}}
From 4b4b230f63614b84947e768720de43fd2b2cf564 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Fri, 6 Apr 2018 14:54:25 +0100 Subject: [PATCH 3/7] Fix JS/non-JS commas --- assets/js/components/ContentHeader.js | 4 ++++ .../sass/patterns/organisms/content-header.scss | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/assets/js/components/ContentHeader.js b/assets/js/components/ContentHeader.js index 9bb2b0fcb..3bd36f7e9 100644 --- a/assets/js/components/ContentHeader.js +++ b/assets/js/components/ContentHeader.js @@ -256,9 +256,13 @@ module.exports = class ContentHeader { if (newState === 'expanded') { this.$elm.querySelector('.content-header__author_list').classList .add('content-header__author_list--expanded'); + this.$elm.querySelector('.content-header__institution_list').classList + .add('content-header__institution_list--expanded'); } else { this.$elm.querySelector('.content-header__author_list').classList .remove('content-header__author_list--expanded'); + this.$elm.querySelector('.content-header__institution_list').classList + .remove('content-header__institution_list--expanded'); } } diff --git a/assets/sass/patterns/organisms/content-header.scss b/assets/sass/patterns/organisms/content-header.scss index e4f032432..5a46e4d16 100644 --- a/assets/sass/patterns/organisms/content-header.scss +++ b/assets/sass/patterns/organisms/content-header.scss @@ -478,10 +478,10 @@ $iconlist: cc oa; display: inline; } } -} - -li.content-header__author_list_item--last .content-header__author_separator { - display: none; + li.content-header__author_list_item:last-child &, + li.content-header__author_list_item--last & { + display: none; + } } .content-header__institution_separator { @@ -492,10 +492,10 @@ li.content-header__author_list_item--last .content-header__author_separator { display: inline; } } -} - -li.content-header__institution_list_item--last .content-header__institution_separator { - display: none; + li.content-header__institution_list_item:last-child &, + li.content-header__institution_list_item--last & { + display: none; + } } .content-header__author_link { From ffbcc793d591490bfbc3066e4246ee48a2d71247 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Fri, 6 Apr 2018 15:06:18 +0100 Subject: [PATCH 4/7] More fixes --- assets/sass/patterns/organisms/content-header.scss | 4 ++-- .../02-organisms/content-headers/content-header.mustache | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/sass/patterns/organisms/content-header.scss b/assets/sass/patterns/organisms/content-header.scss index 5a46e4d16..c7c11c790 100644 --- a/assets/sass/patterns/organisms/content-header.scss +++ b/assets/sass/patterns/organisms/content-header.scss @@ -471,7 +471,7 @@ $iconlist: cc oa; } .content-header__author_separator { - .content-header__author--last-non-excess + & { + .content-header__author--last-non-excess & { display: none; .content-header__author_list--expanded & { @@ -485,7 +485,7 @@ $iconlist: cc oa; } .content-header__institution_separator { - .content-header__institution--last-non-excess + & { + .content-header__institution--last-non-excess & { display: none; .content-header__institution_list--expanded & { diff --git a/source/_patterns/02-organisms/content-headers/content-header.mustache b/source/_patterns/02-organisms/content-headers/content-header.mustache index f0e39e05e..183b18670 100644 --- a/source/_patterns/02-organisms/content-headers/content-header.mustache +++ b/source/_patterns/02-organisms/content-headers/content-header.mustache @@ -138,8 +138,9 @@
    {{#institutions.list}}
  1. - {{{name}}}{{! + {{{name}}}{{! }} +
  2. {{/institutions.list}}
From 98748e54c93ae893bb21d46ca8c3ae15911121d5 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Tue, 10 Apr 2018 11:20:38 +0100 Subject: [PATCH 5/7] Do we need to avoid copying sources/assets? --- Dockerfile.assets | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile.assets b/Dockerfile.assets index b6c10876a..4633cbd4b 100644 --- a/Dockerfile.assets +++ b/Dockerfile.assets @@ -54,7 +54,12 @@ RUN gulp --environment ${environment} img COPY --chown=elife:elife assets/js/ ${PROJECT_FOLDER}/assets/js RUN gulp --environment ${environment} js -COPY --chown=elife:elife source/ ${PROJECT_FOLDER}/source +COPY --chown=elife:elife \ + source/_data/ \ + source/_patterns/ \ + source/non-pattern-schema/ \ + source/favicon.ico \ + ${PROJECT_FOLDER}/source/ COPY --chown=elife:elife assets/sass ${PROJECT_FOLDER}/assets/sass RUN gulp --environment ${environment} generateStyles From a85ee4030b87a5affd896dc9c36dc935a696e8df Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Tue, 10 Apr 2018 11:56:31 +0100 Subject: [PATCH 6/7] Revert "Do we need to avoid copying sources/assets?" This reverts commit 98748e54c93ae893bb21d46ca8c3ae15911121d5. --- Dockerfile.assets | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Dockerfile.assets b/Dockerfile.assets index 4633cbd4b..b6c10876a 100644 --- a/Dockerfile.assets +++ b/Dockerfile.assets @@ -54,12 +54,7 @@ RUN gulp --environment ${environment} img COPY --chown=elife:elife assets/js/ ${PROJECT_FOLDER}/assets/js RUN gulp --environment ${environment} js -COPY --chown=elife:elife \ - source/_data/ \ - source/_patterns/ \ - source/non-pattern-schema/ \ - source/favicon.ico \ - ${PROJECT_FOLDER}/source/ +COPY --chown=elife:elife source/ ${PROJECT_FOLDER}/source COPY --chown=elife:elife assets/sass ${PROJECT_FOLDER}/assets/sass RUN gulp --environment ${environment} generateStyles From 28d31fef1d018baa04b9314989330742c3963094 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Tue, 10 Apr 2018 13:25:12 +0100 Subject: [PATCH 7/7] Set commit argument --- docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 92758444b..aa1d12038 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,8 @@ services: build: context: . dockerfile: Dockerfile + args: + commit: ${IMAGE_TAG} image: elifesciences/pattern-library:${IMAGE_TAG} ports: - "8889:80" @@ -22,6 +24,8 @@ services: build: context: . dockerfile: Dockerfile.ci + args: + commit: ${IMAGE_TAG} image: elifesciences/pattern-library_ci:${IMAGE_TAG} command: /bin/bash depends_on: