Adds document to new gallery list.

This commit is contained in:
mateuswetah 2020-04-07 14:49:01 -03:00
parent 98fe0e83ca
commit c2594590cc
4 changed files with 46 additions and 29 deletions

View File

@ -69,7 +69,6 @@ jQuery( document ).ready(function( $ ) {
slidesToScroll: 1, slidesToScroll: 1,
arrows: false, arrows: false,
fade: true, fade: true,
adaptiveHeight: true,
asNavFor: '.single-item-collection--gallery-items' asNavFor: '.single-item-collection--gallery-items'
}); });
@ -79,6 +78,8 @@ jQuery( document ).ready(function( $ ) {
nextArrow: '<button type="button" data-role="none" class="single-item-collection--attachments-next" aria-label="Next" role="button" style="display: block;"><i class="tainacan-icon tainacan-icon-arrowright"></i></button>', nextArrow: '<button type="button" data-role="none" class="single-item-collection--attachments-next" aria-label="Next" role="button" style="display: block;"><i class="tainacan-icon tainacan-icon-arrowright"></i></button>',
slidesToShow: 7, slidesToShow: 7,
slidesToScroll: 1, slidesToScroll: 1,
centerMode: true,
focusOnSelect: true,
autoplay: false, autoplay: false,
autoplaySpeed: 2000, autoplaySpeed: 2000,
responsive: [ { responsive: [ {

View File

@ -395,6 +395,7 @@
display: block; display: block;
height: auto; height: auto;
margin: 0 auto; margin: 0 auto;
border: none;
} }
> audio { > audio {
width: 100%; width: 100%;
@ -463,8 +464,20 @@
} }
} }
.single-item-collection--gallery { .single-item-collection--gallery {
margin-bottom: 24px;
.slick-track {
display: flex;
align-items: center;
}
.tainacan-content { .tainacan-content {
margin: 0; margin: 0;
max-height: 75vh;
img {
max-height: 60vh;
}
}
.slick-slide {
max-height: 60vh;
} }
} }
.single-item-collection--gallery-items, .single-item-collection--gallery-items,

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@
</div> </div>
</header> </header>
<?php if ( tainacan_has_document() && !get_theme_mod( 'tainacan_single_item_gallery_mode', false )) : ?> <?php if ( tainacan_has_document() && !get_theme_mod( 'tainacan_single_item_gallery_mode', false )) : ?>
<h1 class="title-content-items"><?php _e( 'Document', 'tainacan-interface' ); ?></h1> <h2 class="title-content-items"><?php _e( 'Document', 'tainacan-interface' ); ?></h2>
<section class="tainacan-content single-item-collection margin-two-column"> <section class="tainacan-content single-item-collection margin-two-column">
<div class="single-item-collection--document"> <div class="single-item-collection--document">
<?php tainacan_the_document(); ?> <?php tainacan_the_document(); ?>
@ -51,7 +51,7 @@
<?php do_action( 'tainacan-interface-single-item-after-document' ); ?> <?php do_action( 'tainacan-interface-single-item-after-document' ); ?>
<?php if ( tainacan_has_document() ) : ?> <?php if ( tainacan_has_document() && !get_theme_mod( 'tainacan_single_item_gallery_mode', false )) : ?>
<div class="tainacan-title my-5"> <div class="tainacan-title my-5">
<div class="border-bottom border-silver tainacan-title-page" style="border-width: 1px !important;"> <div class="border-bottom border-silver tainacan-title-page" style="border-width: 1px !important;">
</div> </div>
@ -78,11 +78,11 @@
?> ?>
<?php if ( ! empty( $attachments ) ) : ?> <?php if ( !empty( $attachments ) || get_theme_mod( 'tainacan_single_item_gallery_mode', false && tainacan_has_document()) ) : ?>
<div class="mt-3 tainacan-single-post"> <div class="mt-3 tainacan-single-post">
<article role="article"> <article role="article">
<h1 class="title-content-items"> <h2 class="title-content-items">
<?php <?php
if (get_theme_mod( 'tainacan_single_item_gallery_mode', false )) { if (get_theme_mod( 'tainacan_single_item_gallery_mode', false )) {
_e( 'Document and Attachments', 'tainacan-interface' ); _e( 'Document and Attachments', 'tainacan-interface' );
@ -90,32 +90,37 @@
_e( 'Attachments', 'tainacan-interface' ); _e( 'Attachments', 'tainacan-interface' );
} }
?> ?>
</h1> </h2>
<section class="tainacan-content single-item-collection margin-two-column"> <section class="tainacan-content single-item-collection margin-two-column">
<?php if (get_theme_mod( 'tainacan_single_item_gallery_mode', false )): ?> <?php if (get_theme_mod( 'tainacan_single_item_gallery_mode', false )): ?>
<div class="single-item-collection--gallery"> <div class="single-item-collection--gallery">
<?php if ( tainacan_has_document() ) : ?>
<section class="tainacan-content single-item-collection margin-two-column">
<div class="single-item-collection--document">
<?php tainacan_the_document(); ?>
</div>
</section>
<?php endif; ?>
<?php foreach ( $attachments as $attachment ) { ?> <?php foreach ( $attachments as $attachment ) { ?>
<?php <section class="tainacan-content single-item-collection margin-two-column">
if ( function_exists('tainacan_get_attachment_html_url') ) { <div class="single-item-collection--document">
$href = tainacan_get_attachment_html_url($attachment->ID); <?php
} else { if ( function_exists('tainacan_get_single_attachment_as_html') ) {
$href = wp_get_attachment_url($attachment->ID, 'large'); tainacan_get_single_attachment_as_html($attachment->ID);
} }
?> ?>
<section class="tainacan-content single-item-collection margin-two-column"> </div>
<div class="single-item-collection--document"> </section>
<?php <?php } ?>
if ( function_exists('tainacan_get_single_attachment_as_html') ) {
tainacan_get_single_attachment_as_html($attachment->ID);
}
?>
</div>
</section>
<?php }
?>
</div> </div>
<div class="single-item-collection--gallery-items"> <div class="single-item-collection--gallery-items">
<div class="single-item-collection--attachments-file">
<?php
tainacan_the_document();
echo get_the_title( $attachment->ID );
?>
</div>
<?php foreach ( $attachments as $attachment ) { ?> <?php foreach ( $attachments as $attachment ) { ?>
<?php <?php
if ( function_exists('tainacan_get_attachment_html_url') ) { if ( function_exists('tainacan_get_attachment_html_url') ) {
@ -125,9 +130,7 @@
} }
?> ?>
<div class="single-item-collection--attachments-file"> <div class="single-item-collection--attachments-file">
<a <a class="<?php if (!wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments')) echo'attachment-without-image'; ?>">
class="<?php if (!wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments')) echo'attachment-without-image'; ?>"
href="<?php echo $href; ?>">
<?php <?php
echo wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments', true ); echo wp_get_attachment_image( $attachment->ID, 'tainacan-interface-item-attachments', true );
echo get_the_title( $attachment->ID ); echo get_the_title( $attachment->ID );
@ -178,7 +181,7 @@
<div class="mt-3 tainacan-single-post"> <div class="mt-3 tainacan-single-post">
<article role="article"> <article role="article">
<!-- <h1 class="title-content-items"><?php _e( 'Information', 'tainacan-interface' ); ?></h1> --> <!-- <h2 class="title-content-items"><?php _e( 'Information', 'tainacan-interface' ); ?></h2> -->
<section class="tainacan-content single-item-collection margin-two-column"> <section class="tainacan-content single-item-collection margin-two-column">
<div class="single-item-collection--information justify-content-center"> <div class="single-item-collection--information justify-content-center">
<div class="row"> <div class="row">