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,
arrows: false,
fade: true,
adaptiveHeight: true,
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>',
slidesToShow: 7,
slidesToScroll: 1,
centerMode: true,
focusOnSelect: true,
autoplay: false,
autoplaySpeed: 2000,
responsive: [ {

View File

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

File diff suppressed because one or more lines are too long

View File

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