Adds option to hide thumbnail and begins implementing section labels options.

This commit is contained in:
mateuswetah 2020-09-29 18:38:03 -03:00
parent 872562f319
commit cbdc6683df
10 changed files with 221 additions and 127 deletions

View File

@ -9,7 +9,15 @@ if (! isset($is_bbpress)) {
}
$options = [
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/title-metadata.php', [
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/show-title-metadata.php', [
'prefix' => $post_type->name . '_single',
'enabled' => 'yes'
], false),
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/show-thumbnail.php', [
'prefix' => $post_type->name . '_single',
'enabled' => 'no'
], false),
blocksy_get_options(get_stylesheet_directory() . '/inc/options/single-elements/section-labels.php', [
'prefix' => $post_type->name . '_single',
'enabled' => 'yes'
], false)

View File

@ -0,0 +1,35 @@
<?php
if (! isset($prefix)) {
$prefix = '';
} else {
$prefix = $prefix . '_';
}
if (! isset($enabled)) {
$enabled = 'yes';
}
$options = [
$prefix . 'display_section_labels' => [
'label' => __( 'Display section labels', 'blocksy' ),
'type' => 'ct-panel',
'switch' => true,
'value' => $enabled,
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix,
]),
'inner-options' => [
// $prefix . 'test_title_metadata' => [
// 'label' => __( 'Test title in the metadata list', 'blocksy-tainacan' ),
// 'type' => 'ct-switch',
// 'value' => 'yes',
// 'setting' => [ 'transport' => 'postMessage' ],
// 'desc' => __( 'Toggle to hide or not the core title from the metadada list, as it already appears on the page title.', 'blocksy' ),
// 'sync' => blocksy_sync_single_post_container([
// 'prefix' => $prefix
// ])
// ]
],
],
];

View File

@ -0,0 +1,24 @@
<?php
if (! isset($prefix)) {
$prefix = '';
} else {
$prefix = $prefix . '_';
}
if (! isset($enabled)) {
$enabled = 'no';
}
$options = [
$prefix . 'show_thumbnail' => [
'label' => __( 'Item thumbnail in the metadata list', 'blocksy-tainacan' ),
'type' => 'ct-switch',
'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to show or not the item thumbnail on the metadada list.', 'blocksy' ),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
]
];

View File

@ -11,7 +11,7 @@ if (! isset($enabled)) {
}
$options = [
$prefix . '_has_title_metadata' => [
$prefix . 'show_title_metadata' => [
'label' => __( 'Core title in the metadata list', 'blocksy-tainacan' ),
'type' => 'ct-switch',
'value' => $enabled,

View File

@ -29,6 +29,60 @@
"itemslist itemslist itemslist";
}
/* Search control */
.search-control {
grid-area: searchcontrol;
border-radius: 0 0 var(--borderRadius, 3px) var(--borderRadius, 3px);
background-color: var(--tainacan-item-background-color, white);
padding: 20px 20px 6px 20px !important;
margin: 5px;
box-shadow: var(--boxShadow, 0px 12px 18px -6px rgba(34, 56, 101, 0.04));
.search-control-item {
margin-bottom: 20px !important;
}
}
/* Filters panel */
#filters-modal {
grid-area: itemslist;
justify-self: start;
align-self: normal;
width: 100%;
.modal-content {
padding: 16px 10px;
#filters-items-list {
border-radius: var(--borderRadius, 3px);
background-color: var(--tainacan-item-background-color, white);
padding: 20px;
margin: -3px;
box-shadow: var(--boxShadow, 0px 12px 18px -6px rgba(34, 56, 101, 0.04));
.filters-components-list {
margin-bottom: 24px;
}
}
}
}
/* Items list container */
#items-list-area {
grid-area: itemslist;
justify-self: end;
align-self: normal;
width: 100%;
#items-list-results {
.table-container {
min-width: 100%;
padding-top: 14px;
padding-left: 10px;
padding-bottom: 14px;
padding-right: 10px;
}
/* Tainacan items list view modes */
.tainacan-masonry-container .tainacan-masonry-item,
.tainacan-records-container .tainacan-record,
@ -77,60 +131,20 @@
font-size: 0.725em !important;
}
}
/* Search control */
.search-control {
grid-area: searchcontrol;
.tainacan-slide-main-view {
iframe {
border: none;
border-radius: var(--borderRadius, 3px);
background-color: var(--tainacan-item-background-color, white);
padding: 20px 20px 6px 20px !important;
margin: 5px;
box-shadow: var(--boxShadow, 0px 12px 18px -6px rgba(34, 56, 101, 0.04));
.search-control-item {
margin-bottom: 20px !important;
}
}
/* Filters panel */
#filters-modal {
grid-area: itemslist;
justify-self: start;
align-self: normal;
width: 100%;
.modal-content {
padding: 16px 10px;
#filters-items-list {
.tainacan-slides-list {
.swiper-slide img {
border-radius: var(--borderRadius, 3px);
background-color: var(--tainacan-item-background-color, white);
padding: 20px;
margin: -3px;
box-shadow: var(--boxShadow, 0px 12px 18px -6px rgba(34, 56, 101, 0.04));
.filters-components-list {
margin-bottom: 24px;
}
}
padding-bottom: 0;
}
}
/* Items list container */
#items-list-area {
grid-area: itemslist;
justify-self: end;
align-self: normal;
width: 100%;
#items-list-results {
.table-container {
min-width: 100%;
padding-top: 14px;
padding-left: 10px;
padding-bottom: 14px;
padding-right: 10px;
}
/* Pagination */
.pagination-area {
border-top: none;
margin-left: 12px;
@ -227,7 +241,7 @@ body:not(.tainacan-admin-page) {
.tainacan-collection-header__box {
width: var(--maxSiteWidth, 1290px);
border-radius: var(--borderRadius,3px);
border-radius: var(--borderRadius,3px) var(--borderRadius, 3px) 0 0;
background-color: var(--tainacan-item-background-color,#fff);
padding: 20px;
box-shadow: var(--boxShadow,0 12px 18px -6px rgba(34,56,101,.04));

148
style.css
View File

@ -33,7 +33,6 @@
--tainacan-heading-color: var(--headingColor, rgba(44, 62, 80, 1));
--tainacan-label-color: var(--color, rgba(44, 62, 80, 0.9));
--tainacan-info-color: var(--color, rgba(44, 62, 80, 0.9));
/* Tainacan items list view modes */
/* Search control */
/* Filters panel */
/* Items list container */
@ -51,73 +50,9 @@
grid-template-areas: ". searchcontrol ." "itemslist itemslist itemslist";
}
.theme-items-list .tainacan-masonry-container .tainacan-masonry-item,
.theme-items-list .tainacan-records-container .tainacan-record,
.theme-items-list .tainacan-cards-container .tainacan-card,
.theme-items-list .tainacan-list-container .tainacan-list {
border-radius: var(--borderRadius, 3px);
box-shadow: var(--boxShadow, 0px 12px 18px -6px rgba(34, 56, 101, 0.04));
border: var(--border, none);
overflow: hidden;
}
.theme-items-list .tainacan-masonry-container .tainacan-masonry-item .metadata-title p,
.theme-items-list .tainacan-records-container .tainacan-record .metadata-title p,
.theme-items-list .tainacan-cards-container .tainacan-card .metadata-title p,
.theme-items-list .tainacan-list-container .tainacan-list .metadata-title p {
font-weight: 500;
}
.theme-items-list .tainacan-masonry-container .tainacan-masonry-item .metadata-value,
.theme-items-list .tainacan-masonry-container .tainacan-masonry-item .metadata-label,
.theme-items-list .tainacan-records-container .tainacan-record .metadata-value,
.theme-items-list .tainacan-records-container .tainacan-record .metadata-label,
.theme-items-list .tainacan-cards-container .tainacan-card .metadata-value,
.theme-items-list .tainacan-cards-container .tainacan-card .metadata-label,
.theme-items-list .tainacan-list-container .tainacan-list .metadata-value,
.theme-items-list .tainacan-list-container .tainacan-list .metadata-label {
font-size: 0.8125em !important;
}
.theme-items-list .tainacan-records-container .tainacan-record,
.theme-items-list .tainacan-list-container .tainacan-list {
background-color: var(--tainacan-item-background-color, white) !important;
}
.theme-items-list .tainacan-masonry-container .tainacan-masonry-item {
display: flex !important;
flex-direction: column-reverse;
}
.theme-items-list .tainacan-cards-container .tainacan-card {
min-height: 215px;
max-height: 215px;
}
.theme-items-list .tainacan-cards-container .tainacan-card .media .list-metadata {
padding: 0.125em 1.375em !important;
}
.theme-items-list .tainacan-cards-container .tainacan-card .media .list-metadata p.metadata-description {
max-height: 12.75em !important;
line-height: 1.25em;
}
.theme-items-list .tainacan-table {
padding: 0 12px;
}
.theme-items-list .tainacan-table .column-main-content p {
font-weight: 500;
}
.theme-items-list .tainacan-table td p {
font-size: 0.725em !important;
}
.theme-items-list .search-control {
grid-area: searchcontrol;
border-radius: var(--borderRadius, 3px);
border-radius: 0 0 var(--borderRadius, 3px) var(--borderRadius, 3px);
background-color: var(--tainacan-item-background-color, white);
padding: 20px 20px 6px 20px !important;
margin: 5px;
@ -158,6 +93,11 @@
width: 100%;
}
.theme-items-list #items-list-area #items-list-results {
/* Tainacan items list view modes */
/* Pagination */
}
.theme-items-list #items-list-area #items-list-results .table-container {
min-width: 100%;
padding-top: 14px;
@ -166,6 +106,80 @@
padding-right: 10px;
}
.theme-items-list #items-list-area #items-list-results .tainacan-masonry-container .tainacan-masonry-item,
.theme-items-list #items-list-area #items-list-results .tainacan-records-container .tainacan-record,
.theme-items-list #items-list-area #items-list-results .tainacan-cards-container .tainacan-card,
.theme-items-list #items-list-area #items-list-results .tainacan-list-container .tainacan-list {
border-radius: var(--borderRadius, 3px);
box-shadow: var(--boxShadow, 0px 12px 18px -6px rgba(34, 56, 101, 0.04));
border: var(--border, none);
overflow: hidden;
}
.theme-items-list #items-list-area #items-list-results .tainacan-masonry-container .tainacan-masonry-item .metadata-title p,
.theme-items-list #items-list-area #items-list-results .tainacan-records-container .tainacan-record .metadata-title p,
.theme-items-list #items-list-area #items-list-results .tainacan-cards-container .tainacan-card .metadata-title p,
.theme-items-list #items-list-area #items-list-results .tainacan-list-container .tainacan-list .metadata-title p {
font-weight: 500;
}
.theme-items-list #items-list-area #items-list-results .tainacan-masonry-container .tainacan-masonry-item .metadata-value,
.theme-items-list #items-list-area #items-list-results .tainacan-masonry-container .tainacan-masonry-item .metadata-label,
.theme-items-list #items-list-area #items-list-results .tainacan-records-container .tainacan-record .metadata-value,
.theme-items-list #items-list-area #items-list-results .tainacan-records-container .tainacan-record .metadata-label,
.theme-items-list #items-list-area #items-list-results .tainacan-cards-container .tainacan-card .metadata-value,
.theme-items-list #items-list-area #items-list-results .tainacan-cards-container .tainacan-card .metadata-label,
.theme-items-list #items-list-area #items-list-results .tainacan-list-container .tainacan-list .metadata-value,
.theme-items-list #items-list-area #items-list-results .tainacan-list-container .tainacan-list .metadata-label {
font-size: 0.8125em !important;
}
.theme-items-list #items-list-area #items-list-results .tainacan-records-container .tainacan-record,
.theme-items-list #items-list-area #items-list-results .tainacan-list-container .tainacan-list {
background-color: var(--tainacan-item-background-color, white) !important;
}
.theme-items-list #items-list-area #items-list-results .tainacan-masonry-container .tainacan-masonry-item {
display: flex !important;
flex-direction: column-reverse;
}
.theme-items-list #items-list-area #items-list-results .tainacan-cards-container .tainacan-card {
min-height: 215px;
max-height: 215px;
}
.theme-items-list #items-list-area #items-list-results .tainacan-cards-container .tainacan-card .media .list-metadata {
padding: 0.125em 1.375em !important;
}
.theme-items-list #items-list-area #items-list-results .tainacan-cards-container .tainacan-card .media .list-metadata p.metadata-description {
max-height: 12.75em !important;
line-height: 1.25em;
}
.theme-items-list #items-list-area #items-list-results .tainacan-table {
padding: 0 12px;
}
.theme-items-list #items-list-area #items-list-results .tainacan-table .column-main-content p {
font-weight: 500;
}
.theme-items-list #items-list-area #items-list-results .tainacan-table td p {
font-size: 0.725em !important;
}
.theme-items-list #items-list-area #items-list-results .tainacan-slide-main-view iframe {
border: none;
border-radius: var(--borderRadius, 3px);
}
.theme-items-list #items-list-area #items-list-results .tainacan-slides-list .swiper-slide img {
border-radius: var(--borderRadius, 3px);
padding-bottom: 0;
}
.theme-items-list #items-list-area #items-list-results .pagination-area {
border-top: none;
margin-left: 12px;
@ -256,7 +270,7 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
.tainacan-collection-header .tainacan-collection-header__box {
width: var(--maxSiteWidth, 1290px);
border-radius: var(--borderRadius, 3px);
border-radius: var(--borderRadius, 3px) var(--borderRadius, 3px) 0 0;
background-color: var(--tainacan-item-background-color, #fff);
padding: 20px;
box-shadow: var(--boxShadow, 0 12px 18px -6px rgba(34, 56, 101, 0.04));

File diff suppressed because one or more lines are too long

2
style.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,6 @@
$prefix = blocksy_manager()->screen->get_prefix();
?>
<div>
<?php if ( get_theme_mod('tainacan_single_item_metadata_section_label', '') != '') : ?>
<h2 class="title-content-items" id="single-item-metadata-label">
<?php echo esc_html( get_theme_mod('tainacan_single_item_metadata_section_label', '') ); ?>
@ -12,7 +11,7 @@
<div class="single-item-collection--information justify-content-center">
<div class="row">
<div class="col s-item-collection--metadata">
<?php if (has_post_thumbnail() && get_theme_mod( 'tainacan_single_item_display_thumbnail', true )): ?>
<?php if (has_post_thumbnail() && (get_theme_mod($prefix . '_show_thumbnail', 'no') === 'yes') ): ?>
<div class="tainacan-item-thumbnail-container card">
<div class="card-body">
<h3><?php _e( 'Thumbnail', 'blocksy-tainacan' ); ?></h3>
@ -27,7 +26,7 @@
'after_title' => '</h3>',
'before_value' => '<p>',
'after_value' => '</p></div>',
'exclude_title' => (get_theme_mod($prefix . '_has_title_metadata', 'yes') === 'no')
'exclude_title' => (get_theme_mod($prefix . '_show_title_metadata', 'yes') === 'no')
);
tainacan_the_metadata( $args );
?>