diff --git a/README.md b/README.md index 20a9bb3..5506bcd 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,15 @@ 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 +- 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 +- Execute o build + - ./build.sh + + #Teste Commit diff --git a/compile-sass.sh b/compile-sass.sh index 744af46..279043e 100755 --- a/compile-sass.sh +++ b/compile-sass.sh @@ -1,5 +1,7 @@ #!/bin/bash + +#Teste commit # Executa o comando 'sass' para verificar se existe (veja http://stackoverflow.com/a/677212/329911) command -v sass >/dev/null 2>&1 || { echo >&2 "REQUIRE: SASS installed to compile the SCSS archives to CSS."; diff --git a/install.sh b/install.sh index 1daaaeb..46e5613 100644 --- a/install.sh +++ b/install.sh @@ -2,9 +2,9 @@ php -r ' echo "\n ..::Tainacan Theme::..\n"; -echo "\nStarting installation with composer ... please wait!!\n"; +echo "\nInitiating the installation with composer ... please wait!!\n"; -echo "\nStarting Copying Files...\n\n"; +echo "\nInitiating the copying of files...\n\n"; echo "\nCopy Frameword CSS - Bootstrap ...\n\n"; diff --git a/src/assets/js/tainacan-interface-truncate.js b/src/assets/js/tainacan-interface-truncate.js index d6d5169..4a50dde 100644 --- a/src/assets/js/tainacan-interface-truncate.js +++ b/src/assets/js/tainacan-interface-truncate.js @@ -1,8 +1,15 @@ (function($) { $.fn.tainacan_interface_truncate = function (settings) { + if(window.innerWidth <= 576) { + count = 150; + }else if(window.innerWidth <= 360) { + count = 87; + } else { + count = 350; + } var config = { - showChars: 350, - minChars: 100, + showChars: count, + minChars: count, ellipsesText: "...", moreText: tainacan_trucanteVars.moreText, lessText: tainacan_trucanteVars.lessText @@ -15,8 +22,8 @@ var minimized_elements = $( this ); minimized_elements.each(function(){ - var t = $( this ).text(); - if (t.length < config.minChars) { return }; + var t = minimized_elements.html(); + if (t.length <= config.minChars) { return }; $( this ).html( t.slice( 0,config.showChars ) + '' + config.ellipsesText + ' [ ' + config.moreText + ' ]' + '' + t.slice( config.showChars,t.length ) + ' [ ' + config.lessText + ' ]' diff --git a/src/assets/scss/_home-collection.scss b/src/assets/scss/_home-collection.scss index 85bbfe6..0685e45 100644 --- a/src/assets/scss/_home-collection.scss +++ b/src/assets/scss/_home-collection.scss @@ -98,7 +98,7 @@ margin-top: 0.5rem; } &.tainacan-interface-truncate { - height: 65px; + min-height: 65px; margin-bottom: 2rem; .tainacan-interface-more, .tainacan-interface-less { color: rgba(255, 255, 255, 0.60); diff --git a/src/assets/scss/_post.scss b/src/assets/scss/_post.scss index 78e8a0d..d847bc6 100644 --- a/src/assets/scss/_post.scss +++ b/src/assets/scss/_post.scss @@ -336,13 +336,14 @@ } } .tainacan-embed-container{ - @media only screen and (min-width: 768px){ - iframe { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; + iframe { + position: relative; + top: 0; + left: 0; + + @media only screen and (min-width: 768px){ + width: 70vw; + height: 70vh; } } } @@ -417,11 +418,14 @@ } .s-item-collection--metadata{ div { - /* -webkit-column-break-inside: avoid; - -moz-column-break-inside:avoid; - -moz-page-break-inside:avoid; + -webkit-column-break-inside: avoid; page-break-inside: avoid; - break-inside: avoid-column; */ + break-inside: avoid; + &:last-child { + -webkit-column-break-inside: auto; + page-break-inside: auto; + break-inside: auto; + } } @media only screen and (min-width: 768px){ -moz-column-count: 2; diff --git a/src/functions.php b/src/functions.php index 4525320..c173f21 100644 --- a/src/functions.php +++ b/src/functions.php @@ -11,6 +11,9 @@ if ( ! function_exists( 'tainacan_setup' ) ) { * Observe que esta função está conectada ao gancho after_setup_theme, que é executado antes do gancho de init. */ function tainacan_setup() { + + load_theme_textdomain( 'tainacan-interface', get_template_directory() . '/languages' ); + /** * Display in gutenberg plugin the full width for image */ @@ -24,10 +27,10 @@ if ( ! function_exists( 'tainacan_setup' ) ) { */ $header_args = array( //'default-text-color' => '000', - 'width' => 1280, + 'width' => 2000, 'height' => 280, 'header-text' => false, - 'flex-width' => false, + 'flex-width' => true, 'flex-height' => true, ); add_theme_support( 'custom-header', $header_args ); diff --git a/src/functions/customizer.php b/src/functions/customizer.php index d5f60f8..23a0fb8 100644 --- a/src/functions/customizer.php +++ b/src/functions/customizer.php @@ -706,6 +706,24 @@ function tainacan_get_color_scheme_css( $colors ) { color: {$colors['tainacan_link_color']} !important; } + .slide-control-arrow .icon .mdi::before { + color: {$colors['tainacan_link_color']}; + } + #tainacan-slide-container .tainacan-slide-item.active-item img { + border-bottom: 4px solid {$colors['tainacan_link_color']}; + } + .metadata-menu .metadata-menu-header hr { + background-color: {$colors['backtransparent']}; + } + + .slide-title-area .play-button .icon { + border: 3px solid {$colors['tainacan_link_color']}; + } + + #return-to-top { + background-color: {$colors['tainacan_link_color']}; + } + {$filter} CSS; diff --git a/src/functions/enqueues.php b/src/functions/enqueues.php index 041bdac..3431ef0 100644 --- a/src/functions/enqueues.php +++ b/src/functions/enqueues.php @@ -47,8 +47,8 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) { */ wp_enqueue_script( 'tainacan_tainacanTruncate', get_template_directory_uri() . '/assets/js/tainacan-interface-truncate.js', array( 'jquery' ), '1.0', false ); wp_localize_script( 'tainacan_tainacanTruncate', 'tainacan_trucanteVars', array( - 'moreText' => __( 'More', 'tainacan-interface' ), - 'lessText' => __( 'Less', 'tainacan-interface' ), + 'moreText' => __( 'Show more', 'tainacan-interface' ), + 'lessText' => __( 'Show less', 'tainacan-interface' ), )); wp_register_style( 'tainacan_tainacanStyle', get_stylesheet_uri(), array( 'tainacan_bootstrap4CSS' ) ); diff --git a/src/functions/single-functions.php b/src/functions/single-functions.php index d266461..ddd256e 100644 --- a/src/functions/single-functions.php +++ b/src/functions/single-functions.php @@ -99,15 +99,19 @@ function tainacan_social_meta() { if ( is_single() || is_tax() || is_archive() ) { $logo = get_template_directory_uri() . '/assets/images/social-logo.png'; + $excerpt = get_bloginfo( 'description' ); + $url_src = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; global $wp; - if ( is_post_type_archive( 'tainacan-collection' ) ) { - // TODO: this is wrong, we should check if it a archive of collection items, not archive of collections - $title = tainacan_get_the_collection_name(); - $img_info = ( has_post_thumbnail( tainacan_get_collection_id() ) ) ? wp_get_attachment_image_src( get_post_thumbnail_id( tainacan_get_collection_id() ), 'full' ) : $logo; - $url_src = home_url( $wp->request ); - $excerpt = tainacan_get_the_collection_description(); - } else { + if ( is_post_type_archive() ) { + $collection_id = tainacan_get_collection_id(); + if ($collection_id) { + $title = tainacan_get_the_collection_name(); + $img_info = ( has_post_thumbnail( tainacan_get_collection_id() ) ) ? wp_get_attachment_image_src( get_post_thumbnail_id( tainacan_get_collection_id() ), 'full' ) : $logo; + $url_src = home_url( $wp->request ); + $excerpt = tainacan_get_the_collection_description(); + } + } elseif ( is_singular() ) { global $post; if ( !is_object($post) ) { return; } @@ -119,9 +123,38 @@ function tainacan_social_meta() { if ( $content ) { $excerpt = strip_tags( $content ); $excerpt = str_replace( '', "'", $excerpt ); - } else { - $excerpt = get_bloginfo( 'description' ); + } + } elseif ( is_tax() ) { + $term = get_queried_object(); + $tainacan_term = tainacan_get_term(); + + $title = $term->name; + $excerpt = $term->description; + + $url_src = get_term_link($term->term_id, $term->taxonomy); + + if ($tainacan_term) { + $_term = new \Tainacan\Entities\Term( $tainacan_term ); + $img_id = $_term->get_header_image_id(); + if ($img_id) { + $img_info = wp_get_attachment_image_src( $img_id, 'full' ); + } } + + } else { + + if ( is_day() ) : + $title = sprintf( __( 'Daily Archives: %s', 'tainacan-interface' ), get_the_date() ); + elseif ( is_month() ) : + $title = sprintf( __( 'Monthly Archives: %s', 'tainacan-interface' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'tainacan-interface' ) ) ); + elseif ( is_year() ) : + $title = sprintf( __( 'Yearly Archives: %s', 'tainacan-interface' ), get_the_date( _x( 'Y', 'yearly archives date format', 'tainacan-interface' ) ) ); + elseif ( is_author() ) : + $title = get_the_author(); + else : + $title = get_the_archive_title(); + endif; + } $image = array( diff --git a/src/languages/pt_BR.mo b/src/languages/pt_BR.mo new file mode 100644 index 0000000..18b4fd3 Binary files /dev/null and b/src/languages/pt_BR.mo differ diff --git a/src/languages/tainacan-theme-pt_BR.po b/src/languages/pt_BR.po similarity index 98% rename from src/languages/tainacan-theme-pt_BR.po rename to src/languages/pt_BR.po index 4a1d7f7..acc1c15 100644 --- a/src/languages/tainacan-theme-pt_BR.po +++ b/src/languages/pt_BR.po @@ -21,7 +21,7 @@ msgstr "" "_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c," "_nc:4c,1,2\n" "X-Poedit-Basepath: ..\n" -"X-Generator: Poedit 2.0.3\n" +"X-Generator: Poedit 1.8.7.1\n" "X-Poedit-SearchPath-0: .\n" #: 404.php:9 @@ -135,10 +135,8 @@ msgid "Collection Background Color" msgstr "Cor de fundo da coleção" #: functions/collection-color.php:48 -#, fuzzy -#| msgid "Collection Text Color" msgid "Collection header fill color" -msgstr "Cor de texto da coleção" +msgstr "Cor de preenchimento do cabeçalho da coleção" #: functions/collection-color.php:53 msgid "Suggested colors" @@ -185,8 +183,6 @@ msgid "Upload a logo to the footer" msgstr "Suba uma imagem de logo para o rodapé" #: functions/customizer.php:86 -#, fuzzy -#| msgid "Display \"Proudly Powered by\"" msgid "Display \"Proudly Powered by...\"" msgstr "Exibir \"Orgulhosamente feito com...\"" diff --git a/src/languages/tainacan-theme.pot b/src/languages/tainacan-interface.pot similarity index 100% rename from src/languages/tainacan-theme.pot rename to src/languages/tainacan-interface.pot diff --git a/src/languages/tainacan-theme-pt_BR.mo b/src/languages/tainacan-theme-pt_BR.mo deleted file mode 100644 index d81c05e..0000000 Binary files a/src/languages/tainacan-theme-pt_BR.mo and /dev/null differ diff --git a/src/screenshot.jpg b/src/screenshot.jpg index b1b3162..4046ccb 100644 Binary files a/src/screenshot.jpg and b/src/screenshot.jpg differ diff --git a/src/template-parts/bannerheader.php b/src/template-parts/bannerheader.php index d017a36..2c3f4d1 100644 --- a/src/template-parts/bannerheader.php +++ b/src/template-parts/bannerheader.php @@ -27,6 +27,7 @@ } } ?> + diff --git a/src/template-parts/headercollection.php b/src/template-parts/headercollection.php index ce83cc4..57bb261 100644 --- a/src/template-parts/headercollection.php +++ b/src/template-parts/headercollection.php @@ -1,11 +1,5 @@ -.t-bg-collection .t-collection--info .t-collection--info-description-text.dotmore .toggle::before { - content: "[ ' . __( 'Show more', 'tainacan-interface' ) . ' ]"; -} -.t-bg-collection .t-collection--info .t-collection--info-description-text.dotmore.full-story .toggle::before { - content: "[ ' . __( 'Show less', 'tainacan-interface' ) . ' ]"; -} nav.menu-belowheader #menubelowHeader ul.dropdown-menu { min-width: 10rem !important; }'; @@ -95,11 +89,8 @@ echo '';
- + -
diff --git a/src/template-parts/headertaxonomy.php b/src/template-parts/headertaxonomy.php index 4aa9fbb..5185201 100644 --- a/src/template-parts/headertaxonomy.php +++ b/src/template-parts/headertaxonomy.php @@ -1,10 +1,4 @@ - .t-bg-collection .t-collection--info .t-collection--info-description-text.dotmore .toggle::before { - content: "[ ' . __( 'Show more', 'tainacan-interface' ) . ' ]"; - } - .t-bg-collection .t-collection--info .t-collection--info-description-text.dotmore.full-story .toggle::before { - content: "[ ' . __( 'Show less', 'tainacan-interface' ) . ' ]"; - } nav.menu-belowheader #menubelowHeader ul.dropdown-menu { min-width: 10rem !important; } @@ -31,7 +25,7 @@ $taxonomy = get_taxonomy( $term->taxonomy ); -
+
diff --git a/src/template-parts/loop-singular.php b/src/template-parts/loop-singular.php index 487550d..dafd76f 100644 --- a/src/template-parts/loop-singular.php +++ b/src/template-parts/loop-singular.php @@ -13,10 +13,12 @@
-
- Previous', 'tainacan-interface' ) ); ?> - ', 'tainacan-interface' ) ); ?> -
+ +
+ Previous', 'tainacan-interface' ) ); ?> + ', 'tainacan-interface' ) ); ?> +
+