Merge branch 'develop' of https://github.com/tainacan/tainacan-theme into develop

This commit is contained in:
mateuswetah 2021-04-22 09:57:37 -03:00
commit 1f0e7c45ea
17 changed files with 57 additions and 71 deletions

View File

@ -1,19 +1,16 @@
# tainacan-theme
Default Tainacan Theme, to be used with tainacan plugin
# Instalação no WordPress
- Copiar o arquivo `build-config-sample.cfg` para `build-config.cfg`
- Ajustar o `PATH` da variável `destination` para o caminho desejado correspondente
- Instalar o SASS
- sudo apt install ruby-full rubygems autogen autoconf libtool make
- sudo gem install sass
- `sudo apt install ruby-full rubygems autogen autoconf libtool make`
- `sudo gem install sass`
- Instalar o Composer
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- HASH="$(wget -q -O - https://composer.github.io/installer.sig)"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
- `php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"`
- `HASH="$(wget -q -O - https://composer.github.io/installer.sig)"`
- `php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"`
- `sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer`
- Execute o build
- ./build.sh
#Teste Commit
- ./build.sh

View File

@ -1,11 +1,16 @@
#!/bin/sh
## Run the build script whenever there is a change in src folder
echo 'Watching changes on src/'
current_OS=`uname`
while inotifywait -qqr src -e create,move,modify,delete; do
echo
echo 'Change detected, running build'
./build.sh
done
# For macOS (Darwin), you can install fsevents-tools via Homebrew: `brew install fsevents-tools`
if [ $current_OS == "Darwin" ]; then
notifyloop src ./build.sh
else
while inotifywait -qqr src -e create,move,modify,delete; do
echo
echo 'Change detected, running build'
./build.sh
done
fi

View File

@ -19,19 +19,19 @@ echo "Compiling Sass..."
#cd ../../../../assets/scss
cd src/assets/scss
sass -E 'UTF-8' style.scss:../../style.css
echo "Style of Tainacan Compiled";
echo "Tainacan's style compiled.";
sass -E 'UTF-8' editor-style.scss:../../editor-style.css
echo "Style of Tainacan for Gutenberg Editor Compiled";
echo "Tainacan's Gutenberg Editor style compiled";
sass bootstrap_custom.scss:../vendor/bootstrap/scss/bootstrap.min.css --style compressed
echo "Bootstrap Compiled";
echo "Bootstrap style compiled";
rm -rf .sass-cache
cd ../vendor/slick
sass slick.scss:slick.min.css --style compressed
sass slick-theme.scss:slick-theme.min.css --style compressed
echo "Slick for slider carousel Compiled";
echo "Slick for slider carousel compiled";
rm -rf slick-theme.min.css.map slick.min.css.map .sass-cache/
cd ../../../

View File

@ -3,10 +3,9 @@ php -r '
echo "\n ..::Tainacan Theme::..\n";
echo "\nInitiating the installation with composer ... please wait!!\n";
echo "Copying files ...\n";
echo "\nInitiating the copying of files...\n\n";
echo "\nCopy Frameword CSS - Bootstrap ...\n\n";
echo "\nCopying Bootstrap Framework ...\n\n";
if (!file_exists("src/assets/vendor/bootstrap")) {
mkdir("src/assets/vendor/", 0777, true);
@ -18,7 +17,7 @@ echo "\nCopy Frameword CSS - Bootstrap ...\n\n";
copy("vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js", "src/assets/vendor/bootstrap/js/bootstrap.min.js");
recurse_copy("vendor/twbs/bootstrap/js/src", "src/assets/vendor/bootstrap/js/src");
echo "Copy Slick for Slider...\n\n";
echo "Copying Slick Slider...\n\n";
if (!file_exists("src/assets/vendor/slick")) {
mkdir("src/assets/vendor/slick/", 0777, true);
mkdir("src/assets/vendor/slick/css", 0777, true);
@ -27,7 +26,7 @@ echo "Copy Slick for Slider...\n\n";
}
recurse_copy("vendor/fabianobn/slick/slick/", "src/assets/vendor/slick/");
echo "Finish Copy files! \n\n";
echo "Finished copying files! \n\n";
function recurse_copy($src,$dst) {
$dir = opendir($src);
@ -50,12 +49,12 @@ function delete_files($target) {
$files = glob( $target . "*", GLOB_MARK ); //GLOB_MARK adds a slash to directories returned
foreach( $files as $file ){
delete_files( $file );
delete_files( $file );
}
rmdir( $target );
} elseif(is_file($target)) {
unlink( $target );
unlink( $target );
}
}
'

View File

@ -1,5 +1,5 @@
=== Tainacan Interface ===
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, r-guimaraes
Requires at least: WordPress 4.8
Tested up to: WordPress 5.5.3
Version: 2.2.1
@ -17,7 +17,7 @@ For more information about Tainacan and Tainacan Interface please go to http://t
== Copyright ==
Tainacan Interface WordPress Theme, Copyright 2020 Tainacan.org
Tainacan Interface WordPress Theme, Copyright 2021 Tainacan.org
Tainacan Interface is distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify

View File

@ -1,5 +1,7 @@
<?php get_header(); ?>
<?php $view_mode = get_query_var( 'tainacan_collections_viewmode' ); ?>
<!-- Get the banner to display -->
<?php get_template_part( 'template-parts/bannerheader' ); ?>
@ -41,16 +43,16 @@
<span class="d-none d-md-inline"><?php _e( 'View Mode', 'tainacan-interface' ); ?></span>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuViewMode">
<a class="dropdown-item text-black <?php tainacan_active( get_query_var( 'tainacan_collections_viewmode' ), 'cards' ); ?>" href="<?php echo add_query_arg( 'tainacan_collections_viewmode', 'cards' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewcards text-oslo-gray"></i>&nbsp;<?php _e( 'Cards', 'tainacan-interface' ); ?></a>
<a class="dropdown-item text-black <?php tainacan_active( get_query_var( 'tainacan_collections_viewmode' ), 'grid' ); ?>" href="<?php echo add_query_arg( 'tainacan_collections_viewmode', 'grid' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewminiature text-oslo-gray"></i>&nbsp;<?php _e( 'Thumbnails', 'tainacan-interface' ); ?></a>
<a class="dropdown-item text-black <?php tainacan_active( get_query_var( 'tainacan_collections_viewmode' ), 'table' ); ?>" href="<?php echo add_query_arg( 'tainacan_collections_viewmode', 'table' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewtable text-oslo-gray"></i>&nbsp;<?php _e( 'Table', 'tainacan-interface' ); ?></a>
<a class="dropdown-item text-black <?php tainacan_active( $view_mode, 'cards' ); ?>" href="<?php echo add_query_arg( 'tainacan_collections_viewmode', 'cards' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewcards text-oslo-gray"></i>&nbsp;<?php _e( 'Cards', 'tainacan-interface' ); ?></a>
<a class="dropdown-item text-black <?php tainacan_active( $view_mode, 'grid' ); ?>" href="<?php echo add_query_arg( 'tainacan_collections_viewmode', 'grid' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewminiature text-oslo-gray"></i>&nbsp;<?php _e( 'Thumbnails', 'tainacan-interface' ); ?></a>
<a class="dropdown-item text-black <?php tainacan_active( $view_mode, 'table' ); ?>" href="<?php echo add_query_arg( 'tainacan_collections_viewmode', 'table' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewtable text-oslo-gray"></i>&nbsp;<?php _e( 'Table', 'tainacan-interface' ); ?></a>
</div>
</div>
<form role="search" class="ml-auto" method="get" id="tainacan-collection-search">
<input type="hidden" name="orderby" value="<?php echo get_query_var( 'orderby' ); ?>" />
<input type="hidden" name="order" value="<?php echo get_query_var( 'order' ); ?>" />
<input type="hidden" name="tainacan_collections_viewmode" value="<?php echo get_query_var( 'tainacan_collections_viewmode' ); ?>" />
<input type="hidden" name="tainacan_collections_viewmode" value="<?php echo $view_mode; ?>" />
<div class="input-group">
<input class="form-control rounded-0" type="search" name="s" value="<?php echo get_query_var( 's' ); ?>" placeholder="<?php esc_attr_e( 'Search collections', 'tainacan-interface' ); ?>" />
<span class="input-group-append">
@ -62,7 +64,7 @@
</form>
</div>
<?php get_template_part( 'template-parts/loop-tainacan-collection', get_query_var( 'tainacan_collections_viewmode' ) ); ?>
<?php get_template_part( 'template-parts/loop-tainacan-collection', $view_mode ); ?>
</div>
</div><!-- /.row -->
</main>

View File

@ -22,7 +22,6 @@ function fallbackCopyTextToClipboard(text) {
}
function copyTextToClipboard(text) {
if (!navigator.clipboard) {
fallbackCopyTextToClipboard(text);
return;

View File

@ -3,7 +3,6 @@ jQuery( document ).ready(function( $ ) {
$( 'body' ).removeClass('loading-content');
$( '#carouselExample' ).on( 'slide.bs.carousel', function ( e ) {
var $e = $( e.relatedTarget );
var idx = $e.index();
var itemsPerSlide = 3;

View File

@ -3,7 +3,7 @@ Theme Name: Tainacan Interface
Author: Tainacan
Author URI: https://tainacan.org
Theme URI: https://tainacan.org/blog/category/tema/
Description: This is the default theme for the Tainacan project. Use this in conjunction with Tainacan plugin to easily manage and publish you digital collectinons with a beautiful faceted search interface. Ideal for museums, galleries, libraries and anyone who have a digital repository.
Description: This is the default theme for the Tainacan project. Use this in conjunction with Tainacan plugin to easily manage and publish you digital collections with a beautiful faceted search interface. Ideal for museums, galleries, libraries and anyone who have a digital repository.
Version: 2.2.1
Tested up to: 5.5.3
Requires PHP: 5.6
@ -156,7 +156,6 @@ body.loading-content main:before {
background: #4ea2ad;
width: 36px;
height: 36px;
display: block;
text-decoration: none;
-webkit-border-radius: 35px;
-moz-border-radius: 35px;

View File

@ -9,9 +9,9 @@ const TAINACAN_INTERFACE_VERSION = '2.2.1';
if ( ! function_exists( 'tainacan_setup' ) ) {
/**
* Execulta após o tema ser inicializado.
* Executa após o tema ser inicializado.
* Isso é usado para a configuração básica do tema, registro dos recursos do tema e init hooks.
* Observe que esta função está conectada ao gancho after_setup_theme, que é executado antes do gancho de init.
* Observe que esta função está conectada ao gancho (`hook`) `after_setup_theme`, que é executado antes do gancho de init.
*/
function tainacan_setup() {
@ -154,7 +154,7 @@ if ( ! function_exists( 'tainacan_setup' ) ) {
add_editor_style( 'editor-style.css' );
}
} // End if().
} // tainacan_setup check
add_action( 'after_setup_theme', 'tainacan_setup' );
/**
@ -404,9 +404,9 @@ function tainacan_block_patterns_init() {
add_action( 'init', 'tainacan_block_patterns_init' );
/**
* get Logo function
* get Tainacan's logo function HTML
*
* return custom logo or the default logo
* return custom or default Tainacan's logo
*/
function tainacan_get_logo() {
if ( has_custom_logo() ) {
@ -426,7 +426,6 @@ function tainacan_get_logo() {
* @return void
*/
function tainacan_change_logo_class( $html ) {
$html = str_replace( 'custom-logo-link', 'navbar-brand tainacan-logo', $html );
$html = str_replace( 'custom-logo', 'logo', $html );
@ -475,7 +474,6 @@ function tainacan_collections_viewmode( $public_query_vars ) {
add_filter( 'query_vars', 'tainacan_collections_viewmode' );
function tainacan_active( $selected, $current = true, $echo = true ) {
$return = $selected == $current ? 'active' : '';
if ( $echo ) {
@ -483,7 +481,6 @@ function tainacan_active( $selected, $current = true, $echo = true ) {
}
return $return;
}
function tainacan_theme_collection_title( $title ) {

View File

@ -1,26 +1,22 @@
<?php
/** The breadcrump function
/** The breadcrumb function
* Display parent and current page
**/
function tainacan_interface_the_breadcrumb() {
$showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show
$delimiter = '>'; // delimiter between crumbs
$home = __('Home', 'tainacan-interface'); // text for the 'Home' link
$showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show
$before = '<span class="current text-black">'; // tag before the current crumb
$before = '<span class="current text-black"> '; // tag before the current crumb
$after = '</span>'; // tag after the current crumb
global $post;
$homeLink = esc_url( home_url() );
if (is_home() || is_front_page()) {
if ($showOnHome == 1) echo '<nav aria-label="breadcrumb" class="d-none d-md-flex mt-3 border-bottom-0 max-large margin-one-column"><a href="' . $homeLink . '">' . $home . '</a></nav>';
} else {
echo '<nav aria-label="breadcrumb" class="d-md-flex mt-3 mb-3 border-bottom-0 max-large margin-one-column"><a href="' . $homeLink . '">' . $home . '</a>&nbsp;' . $delimiter . '&nbsp;';
if ( is_category() ) {
@ -165,6 +161,5 @@ function tainacan_interface_the_breadcrumb() {
}
echo '</nav>';
}
} // end tainacan_interface_the_breadcrumb()

View File

@ -3,8 +3,6 @@
* Class that hooks in the tainacan plugin (if present) to add new options to Collections
*/
class TainacanThemeCollectionColor {
public $tainacan_background_color = 'tainacan_theme_collection_background_color';
public $tainacan_text_color = 'tainacan_theme_collection_color';
@ -40,7 +38,6 @@ class TainacanThemeCollectionColor {
}
function form() {
if ( ! function_exists( 'tainacan_get_api_postdata' ) ) {
return '';
}
@ -114,9 +111,7 @@ class TainacanThemeCollectionColor {
</div>
<?php
return ob_get_clean();
}
function add_meta_to_response( $extra_meta, $request ) {
@ -142,12 +137,8 @@ class TainacanThemeCollectionColor {
update_post_meta( $object->get_id(), $this->tainacan_text_color, $post->{$this->tainacan_text_color} );
}
}
}
}
new TainacanThemeCollectionColor();
?>

View File

@ -2435,6 +2435,10 @@ add_action( 'wp_head', 'tainacan_single_item_metadata_columns_count_output');
* @see wp_add_inline_style()
*/
function tainacan_items_page_filters_fixed_on_scroll_output() {
if (!defined('TAINACAN_VERSION')) {
_e('Tainacan plugin not activated!', 'tainacan-interface');
return;
}
$should_use_fixed_filters_logic = (version_compare(TAINACAN_VERSION, '0.17RC') >= 0) && get_theme_mod( 'tainacan_items_page_filters_fixed_on_scroll', false );
if (!$should_use_fixed_filters_logic)

View File

@ -5,7 +5,7 @@
if ( ! function_exists( 'tainacan_enqueues' ) ) {
/**
* Inclui os scripts javascript e os styles necessários ao front-end do thema
* Inclui os scripts javascript e os styles necessários ao front-end do tema
*/
function tainacan_enqueues() {
/**
@ -65,7 +65,6 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) {
'linkCopied' => __( 'Copied! Link sent to the transfer area.', 'tainacan-interface' )
));
// Tainacan Icons
wp_register_style( 'TainacanIconsFont', get_template_directory_uri() . '/assets/fonts/tainacan-icons-font/css/tainacanicons.min.css', '', '1.0.3', '' );
wp_enqueue_style( 'TainacanIconsFont' );
@ -77,6 +76,6 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
} // End if().
} // tainacan_enqueues
}
add_action( 'wp_enqueue_scripts', 'tainacan_enqueues' );

View File

@ -3,7 +3,7 @@
<?php
/**
* This template adss Collections details to the header
* This template adds Collections details to the header
*
* It will only work with tainacan plugin enabled.
*

View File

@ -1,6 +1,6 @@
<?php
/**
* This template adss Collections details to the header
* This template adds Collections details to the header
*
* It will only work with tainacan plugin enabled.
*

View File

@ -178,12 +178,12 @@ $next = $adjacent_links['next'];
<?php
if ( !get_theme_mod('tainacan_single_item_hide_item_meta', false) ) {
echo '<span class="time">';
tainacan_meta_date_author();
echo '</span>';
tainacan_meta_date_author();
echo '</span> &nbsp';
}
if ( function_exists('tainacan_the_item_edit_link') ) {
echo '<span class="tainacan-edit-item-collection">';
tainacan_the_item_edit_link(null, ' - ');
tainacan_the_item_edit_link(null, ' - ', ' ');
echo '</span>';
}
?>