Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ho-man-chan committed Sep 13, 2022
2 parents 20642f9 + fd22e1d commit dac7cf2
Show file tree
Hide file tree
Showing 56 changed files with 26,003 additions and 3,879 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14' ]
node: [ '14', '16' ]
name: Node ${{ matrix.node }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Cache Node modules
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/standards-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
php: [ 7.4 ]
os: [ ubuntu-20.04 ]
wordpress: [ 5.9.3, latest ]
wordpress: [ 6.0.2, latest ]
experimental: [ false ]
include:
- php: 8.0
Expand All @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v2
Expand All @@ -41,7 +41,7 @@ jobs:
run: sudo systemctl start mysql.service

- name: Cache PHP dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
if: matrix.experimental == false

- name: Upload Coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
uses: codecov/codecov-action@v3
if: matrix.experimental == false

- name: Prepare Build
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/update-pot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,22 @@ on:
paths:
- '**.php'
- '**.js'
workflow_dispatch:

jobs:
update-pot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer, wp-cli
- name: Install dependencies
run: |
wp package install wp-cli/i18n-command:2.2.8
cd /home/runner/.wp-cli/packages/
composer config repositories.wp-cli '{"type": "composer","url": "https://wp-cli.org/package-index/","canonical": false}'
cd ./
wp package install pressbooks/pb-cli:2.1.0
composer require jenssegers/blade:1.1.0
php-version: '7.4'
tools: composer, wp-cli/wp-cli-bundle
- name: Update POT file
run: wp pb make-pot . languages/pressbooks-aldine.pot --require=vendor/autoload.php --domain=pressbooks-aldine --slug=pressbooks-aldine --package-name="Aldine" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-aldine/issues\"}"
run: wp i18n make-pot . languages/pressbooks-aldine.pot --domain=pressbooks-aldine --slug=pressbooks-aldine --package-name="Aldine" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-aldine/issues\"}"
- name: Commit updated POT file
uses: stefanzweifel/git-auto-commit-action@v4.13.1
uses: stefanzweifel/git-auto-commit-action@v4.1.1
with:
commit_message: 'chore(l10n): update languages/pressbooks-aldine.pot'
file_pattern: '*.pot'
13 changes: 8 additions & 5 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
update-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }}
- name: Install Transifex Client
Expand All @@ -15,12 +15,15 @@ jobs:
run: tx pull --all --force --minimum-perc=25
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Install xgettext
run: sudo apt-get install -y gettext
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer, wp-cli/wp-cli-bundle
- name: Generate MO files
run: for file in languages/*.po ; do msgfmt $file -o `echo $file | sed 's/\(.*\.\)po/\1mo/'` ; done
run: wp i18n make-mo languages
- name: Commit updated translation files
uses: stefanzweifel/git-auto-commit-action@v4.13.1
with:
commit_message: 'chore(l10n): update translations'
file_pattern: '*.mo *.po'
file_pattern: '*.mo'
41 changes: 28 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,54 @@
[![PHP from Packagist](https://img.shields.io/packagist/php-v/pressbooks/pressbooks-aldine.svg)](https://packagist.org/packages/pressbooks/pressbooks-aldine)

[![Packagist](https://img.shields.io/packagist/dt/pressbooks/pressbooks-aldine.svg)](https://packagist.org/packages/pressbooks/pressbooks-aldine)
[![Build Status](https://travis-ci.org/pressbooks/pressbooks-aldine.svg?branch=dev)](https://travis-ci.org/pressbooks/pressbooks-aldine)
[![Translate Aldine](https://img.shields.io/badge/dynamic/json.svg?label=translated&url=https%3A%2F%2Ftenpercent.now.sh%2F%3Forganization%3Dpressbooks%26project%3Daldine&query=%24.status&colorB=e05d44&suffix=%25)](https://www.transifex.com/pressbooks/aldine/translate/)

**Tags:** publishing, catalog, pressbooks, default-theme

**Requires at least:** 5.9.3
**Tested up to:** 5.9.3
**Stable tag:** 1.14.1
**License:** GNU General Public License v3 or later
**License URI:** LICENSE
Contributors: conner_bw, greatislander, steelwagstaff
Tags: publishing, catalog, pressbooks, default-theme
Requires at least: 6.0.2
Tested up to: 6.0.2
Stable tag: 1.15.0
Requires PHP: 7.4
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Aldine is the default theme for the home page of Pressbooks networks. It is named for the Aldine Press, founded by Aldus Manutius in 1494, who is regarded by many as the world’s first publisher.


## Description

Aldine is the default theme for the home page of [Pressbooks](https://pressbooks.org) networks. It is named for the Aldine Press, founded by Aldus Manutius in 1494, who is regarded by many as the world’s first publisher. Aldine is based on [Underscores](https://underscores.me/).


## Installation

1. In your admin panel, go to Appearance > Themes and click the Add New button.
2. Click Upload Theme and Choose File, then select the theme's [.zip file](https://github.com/pressbooks/pressbooks-aldine/releases/latest/). Click Install Now.
3. Click Activate to use your new theme right away.


## Changelog

### 1.14.1
### 1.15.0

* See: https://github.com/pressbooks/pressbooks-aldine/releases/tag/1.14.1
* See: https://github.com/pressbooks/pressbooks-aldine/releases/tag/1.15.0
* Full release history available at: https://github.com/pressbooks/pressbooks-aldine/releases

## Upgrade Notice

### 1.14.1

- Aldine requires Pressbooks >= 5.34.1

### 1.14.0

- Aldine requires Pressbooks >= 5.33.0

### 1.13.0

- Aldine requires Pressbooks >= 5.32.0

### 1.8.3

- Aldine requires Pressbooks >= 5.17.0

## Credits

- Based on [Underscores](https://underscores.me/), (C) 2012-2017 Automattic, Inc., [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)
2 changes: 1 addition & 1 deletion assets/scripts/aldine.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const routes = new Router( {
// Home page
home,
// Catalog page
catalog,
pageTemplatePageCatalog: catalog,
} );

// Load Events
Expand Down
1 change: 1 addition & 0 deletions assets/scripts/call-to-action.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
( function () {
tinymce.create( 'tinymce.plugins.aldine_call_to_action', {
/**
Expand Down
1 change: 1 addition & 0 deletions assets/scripts/page-section.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
( function () {
tinymce.create( 'tinymce.plugins.aldine_page_section', {
/**
Expand Down
28 changes: 14 additions & 14 deletions assets/scripts/routes/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
// Give each <h3> a toggle button child
heading.innerHTML = `
<button type="button" aria-expanded="false">
${heading.textContent}
${ heading.textContent }
<svg aria-hidden="true" focusable="false" class="arrow" width="13" height="8" viewBox="0 0 13 8" xmlns="http://www.w3.org/2000/svg"><path d="M6.255 8L0 0h12.51z" fill="currentColor" fill-rule="evenodd"></path></svg>
</button>
`;
Expand Down Expand Up @@ -85,7 +85,7 @@ export default {
// Give each <h3> a toggle button child
heading.innerHTML = `
<button type="button" aria-expanded="false">
${heading.innerHTML}
${ heading.innerHTML }
<svg class="arrow" width="13" height="8" viewBox="0 0 13 8" xmlns="http://www.w3.org/2000/svg"><path d="M6.255 8L0 0h12.51z" fill="currentColor" fill-rule="evenodd"></path></svg>
</button>
`;
Expand Down Expand Up @@ -175,16 +175,16 @@ export default {
}

const subject = subjects.querySelector( 'input[type="radio"]:checked' ).value
? `[data-subject="${subjects.querySelector( 'input[type="radio"]:checked' ).value}"]`
? `[data-subject="${ subjects.querySelector( 'input[type="radio"]:checked' ).value }"]`
: '';
const institution = institutions.querySelector( 'input[type="radio"]:checked' ).value
? `[data-institution*="${institutions.querySelector( 'input[type="radio"]:checked' ).value}"]`
? `[data-institution*="${ institutions.querySelector( 'input[type="radio"]:checked' ).value }"]`
: '';
const license = event.target.value
? `[data-license="${event.target.value}"]`
? `[data-license="${ event.target.value }"]`
: '';

const filterValue = subject || license || institution ? `${subject}${license}${institution}` : '*';
const filterValue = subject || license || institution ? `${ subject }${ license }${ institution }` : '*';

$grid.isotope( { filter: filterValue } );
} );
Expand All @@ -194,16 +194,16 @@ export default {
}

const subject = subjects.querySelector( 'input[type="radio"]:checked' ).value
? `[data-subject="${subjects.querySelector( 'input[type="radio"]:checked' ).value}"]`
? `[data-subject="${ subjects.querySelector( 'input[type="radio"]:checked' ).value }"]`
: '';
const license = licenses.querySelector( 'input[type="radio"]:checked' ).value
? `[data-license="${licenses.querySelector( 'input[type="radio"]:checked' ).value}"]`
? `[data-license="${ licenses.querySelector( 'input[type="radio"]:checked' ).value }"]`
: '';
const institution = event.target.value
? `[data-institution*="${event.target.value}"]`
? `[data-institution*="${ event.target.value }"]`
: '';

const filterValue = subject || license || institution ? `${subject}${license}${institution}` : '*';
const filterValue = subject || license || institution ? `${ subject }${ license }${ institution }` : '*';

$grid.isotope( { filter: filterValue } );
} );
Expand All @@ -213,16 +213,16 @@ export default {
}

const license = licenses.querySelector( 'input[type="radio"]:checked' ).value
? `[data-license="${licenses.querySelector( 'input[type="radio"]:checked' ).value}"]`
? `[data-license="${ licenses.querySelector( 'input[type="radio"]:checked' ).value }"]`
: '';
const institution = institutions.querySelector( 'input[type="radio"]:checked' ).value
? `[data-institution*="${institutions.querySelector( 'input[type="radio"]:checked' ).value}"]`
? `[data-institution*="${ institutions.querySelector( 'input[type="radio"]:checked' ).value }"]`
: '';
const subject = event.target.value
? `[data-subject="${event.target.value}"]`
? `[data-subject="${ event.target.value }"]`
: '';

const filterValue = subject || license || institution ? `${subject}${license}${institution}` : '*';
const filterValue = subject || license || institution ? `${ subject }${ license }${ institution }` : '*';

$grid.isotope( { filter: filterValue } );
} );
Expand Down
6 changes: 3 additions & 3 deletions assets/scripts/util/camelCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* @returns {string} String converted to camel-case, e.g., camelCaseIsHard
*/
export default str =>
`${str.charAt( 0 ).toLowerCase()}${str
`${ str.charAt( 0 ).toLowerCase() }${ str
.replace( /[\W_]/g, '|' )
.split( '|' )
.map( part => `${part.charAt( 0 ).toUpperCase()}${part.slice( 1 )}` )
.map( part => `${ part.charAt( 0 ).toUpperCase() }${ part.slice( 1 ) }` )
.join( '' )
.slice( 1 )}`;
.slice( 1 ) }`;
2 changes: 1 addition & 1 deletion assets/styles/aldine.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Prefix your imports with `~` to grab from node_modules/
* @see https://github.com/webpack-contrib/sass-loader#imports
*/
@import "~aetna/assets/styles/aetna.scss";
@import "~aetna/assets/styles/aetna";

/** Import theme styles */
@import "common/global";
Expand Down
9 changes: 7 additions & 2 deletions assets/styles/components/_book.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
margin: 0 0 2rem;
padding: 1.5rem 1rem 2rem;
@media #{$breakpoint-not-small} { padding: 1.5rem 1.85rem 2.1875rem; }

border: solid 2px var(--accent);
background: var(--accent);

Expand All @@ -27,6 +28,7 @@
margin: 0;
font-size: 1.25rem;
@media #{$breakpoint-not-small} { font-size: 1.75rem; }

font-weight: 500;
line-height: 1.2;
text-align: left;
Expand All @@ -38,14 +40,15 @@
@media #{$breakpoint-not-small} {
font-size: 1rem;
}

text-align: left;
}

&__institutions {
margin: .5rem 0 0 0;
margin: .5rem 0 0;
font-size: 0.875rem;
text-align: left;
display: -webkit-box;
display: box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
Expand All @@ -55,6 +58,7 @@
margin: auto 0 0;
font-size: 1rem;
@media #{$breakpoint-not-small} { font-size: 1.125rem; }

text-align: left;

a {
Expand All @@ -66,6 +70,7 @@
height: 1.125rem;
margin-left: 0.5rem;
}

vertical-align: middle;
}
}
Expand Down
4 changes: 2 additions & 2 deletions assets/styles/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ textarea {
font-weight: 600;
font-family: $font-family-sans-serif;
background: transparent;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;

&:focus {
outline: none;
Expand Down Expand Up @@ -88,6 +87,7 @@ input[type="submit"] {
font-size: 0.75rem;
}
}

&.error {
border-bottom: solid 2px var(--error);

Expand Down
10 changes: 6 additions & 4 deletions assets/styles/editor.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@import '~aetna/assets/styles/common/_variables.scss';
@import '~aetna/assets/styles/common/_global.scss';
@import '~aetna/assets/styles/common/variables';
@import '~aetna/assets/styles/common/global';

body#tinymce {
margin: 12px !important;
@import '~aetna/assets/styles/components/_buttons.scss';
@import '~aetna/assets/styles/layouts/_page-sections.scss';
/* stylelint-disable no-invalid-position-at-import-rule */
@import '~aetna/assets/styles/components/buttons';
@import '~aetna/assets/styles/layouts/page-sections';
/* stylelint-enable */
}
Loading

0 comments on commit dac7cf2

Please sign in to comment.