Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Edited Volumes and Other Contributor Types #981

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
8 changes: 8 additions & 0 deletions assets/src/styles/layouts/_cover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
}
}

.book-header__contributor {
@extend .book-header__author;
}

.book-header__author + .book-header__contributor {
@extend .book-header__author;
}

.book-header__cover {
align-self: center;
margin-bottom: 1.5rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ meta[name="pb-authors"] {
string-set: book-author attr('content');
}

meta[name="pb-editors"] {
string-set: book-editor attr('content');
}

meta[name="pb-publisher"] {
string-set: book-publisher attr('content');
}
Expand Down
9 changes: 9 additions & 0 deletions partials/content-cover-book-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
<?php if ( ! empty( $book_information['pb_authors'] ) ) { ?>
<p class="book-header__author"><span class="screen-reader-text"><?php echo translate_nooped_plural( _n_noop( 'Author', 'Authors', 'pressbooks-book' ), \PressbooksBook\Helpers\count_items( $book_information['pb_authors'] ), 'pressbooks-book' ); ?>: </span><?php echo $book_information['pb_authors']; ?></p>
<?php } ?>
<?php if ( ! empty( $book_information['pb_editors'] ) ) { ?>
<p class="book-header__contributor"><?php _e( 'Edited By ', 'pressbooks-book' ); ?> <?php echo $book_information['pb_editors']; ?></p>
<?php } ?>
<?php if ( ! empty( $book_information['pb_translators'] ) ) { ?>
<p class="book-header__contributor"><?php _e( 'Translated By ', 'pressbooks-book' ); ?> <?php echo $book_information['pb_translators']; ?></p>
<?php } ?>
<?php if ( ! empty( $book_information['pb_illustrators'] ) ) { ?>
<p class="book-header__contributor"><?php _e( 'Illustrated By ', 'pressbooks-book' ); ?> <?php echo $book_information['pb_illustrators']; ?></p>
<?php } ?>
<div class="book-header__cover">
<?php if ( ! empty( $book_information['pb_cover_image'] ) ) { ?>
<div class="book-header__cover__image">
Expand Down
8 changes: 7 additions & 1 deletion partials/content-cover-book-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@
</div>
<div class="block-info__inner__content">
<div class="block-info__subsection block-info__lead-author">
<h3 class="block__subtitle"><?php echo _n( 'Author', 'Authors', \PressbooksBook\Helpers\count_items( $book_information['pb_authors'] ), 'pressbooks-book' ); ?></h3>
<?php if ( ! empty( $book_information['pb_authors'] ) ) { ?>
<h3 class="block__subtitle"><?php echo _n( 'Author', 'Authors', \PressbooksBook\Helpers\count_items( $book_information['pb_authors'] ), 'pressbooks-book' ); ?></h3>
<div class="block-info__authors">
<?php // TODO add author photo ?>
<span class="block-info__author__names"><?php echo $book_information['pb_authors']; ?></span>
</div>
<?php } elseif ( ! empty( $book_information['pb_editors'] ) ) { ?>
<h3 class="block__subtitle"><?php echo _n( 'Editor', 'Editors', \PressbooksBook\Helpers\count_items( $book_information['pb_editors'] ), 'pressbooks-book' ); ?></h3>
<div class="block-info__authors">
<?php // TODO add editor photo ?>
<span class="block-info__author__names"><?php echo $book_information['pb_editors']; ?></span>
</div>
<?php } ?>
</div>
<?php if ( ! empty( $book_information['pb_contributing_authors'] ) ) { ?>
Expand Down