diff --git a/.travis.yml b/.travis.yml index 72c723d2..afa90380 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ sudo: enabled language: php php: +- 5.6 - 7.1 - hhvm - nightly matrix: allow_failures: - - php: 7.1 - php: hhvm - php: nightly fast_finish: true @@ -16,7 +16,6 @@ addons: apt: packages: - sshpass -#teste deploy services: - mysql before_install: @@ -30,7 +29,7 @@ before_install: before script: install: -- composer install +- composer install --no-dev script: "./run-tests.sh" after_success: - eval "$(ssh-agent -s)" @@ -45,7 +44,7 @@ deploy: script: sshpass -p '$pass_user_server_prod_rhs' ssh $user_server_prod_rhs@$host_server_prod_rhs "sh $path_deploy_server_prod_rhs/wp-rhs/deploy.sh" skip_cleanup: true on: - branch: develop + branch: master cache: directories: - vendor diff --git a/public/wp-content/themes/rhs/assets/js/publicar_postagens.js b/public/wp-content/themes/rhs/assets/js/publicar_postagens.js index fcc8e8ec..41d2948d 100644 --- a/public/wp-content/themes/rhs/assets/js/publicar_postagens.js +++ b/public/wp-content/themes/rhs/assets/js/publicar_postagens.js @@ -31,13 +31,16 @@ jQuery(document).ready(function() { var ms = jQuery('#input-tags').magicSuggest({ - placeholder: 'Select...', + placeholder: 'Digite...', allowFreeEntries: true, selectionPosition: 'bottom', selectionStacked: true, selectionRenderer: function(data){ return data.name; }, + minCharsRenderer: function(num) { + return "Digite no mínimo " + num + " caracteres!" + }, data: post_vars.ajaxurl, dataUrlParams: { action: 'get_tags', diff --git a/public/wp-content/themes/rhs/assets/js/valida-form-registro.js b/public/wp-content/themes/rhs/assets/js/valida-form-registro.js index 159214b8..a5efbd48 100644 --- a/public/wp-content/themes/rhs/assets/js/valida-form-registro.js +++ b/public/wp-content/themes/rhs/assets/js/valida-form-registro.js @@ -62,7 +62,7 @@ jQuery( function( $ ) { check_email_exist: "E-mail já existente, escolha outro." }, mail_confirm: { - required: "Favor confirmar seu e-mail!", + required: "Favor confirmar seu e-mail.", email: valid_mail_msg, equalTo: "Atenção: A confirmação do e-mail não corresponde ao e-mail informado" }, @@ -84,10 +84,10 @@ jQuery( function( $ ) { required: "Preencha com o seu estado." }, municipio: { - required: "Preencha com o seu municipio." + required: "Preencha com o seu município." }, hiddenRecaptcha: { - required: "Valide o Captcha primeiro." + required: "Valide o captcha primeiro." } }, invalidHandler: function (event, validator) {}, @@ -444,7 +444,7 @@ jQuery( function( $ ) { }, messages: { title: { - required: 'Preencha o titulo.' + required: 'Preencha o título.' }, 'category[]': { required: 'Selecione uma categoria.' @@ -507,6 +507,12 @@ jQuery( function( $ ) { email: true, required: true }, + confirm_email: { + email: true, + required: true, + check_email_exist: true, + equalTo: "input[name='email']" + }, category: { required: true }, @@ -536,9 +542,14 @@ jQuery( function( $ ) { required: 'Preencha seu nome.' }, email: { - email: 'Formato de e-mail inválido.', + email: valid_mail_msg, required: 'Informe seu e-mail.' }, + confirm_email: { + required: 'Confirme seu e-mail.', + email: valid_mail_msg, + equalTo: "Atenção: A confirmação do e-mail não corresponde ao e-mail informado" + }, category: { required: 'Selecione a categoria que melhor se adequa ao seu contato!' }, diff --git a/public/wp-content/themes/rhs/assets/scss/_busca-page.scss b/public/wp-content/themes/rhs/assets/scss/_busca-page.scss index 48435ebd..08b5dba4 100644 --- a/public/wp-content/themes/rhs/assets/scss/_busca-page.scss +++ b/public/wp-content/themes/rhs/assets/scss/_busca-page.scss @@ -4,6 +4,18 @@ * ************/ .busca-page { + padding: 10px; + form { + padding-top: 10px !important; + + .uf-city { + padding-bottom: 20px; + } + + .tags-categories { + padding-top: 10px !important; + } + } .nav-tabs{ li{ a{ @@ -28,10 +40,12 @@ #posts, #user { .formulario { padding: 15px 0; - margin: 15px 0; - margin-bottom: 0; + //margin: 15px 5px; + margin-bottom: 10px; background: transparent; - border: 1px solid lightgray; + //border: 1px solid lightgray; + float: left; + width: 100%; label { color: $primeira_cor_fundo; } @@ -45,9 +59,7 @@ .col2{ text-align: center; } - #municipio{ - width: 194px !important; - } + //#municipio{ width: 194px !important; } } @media only screen and (width: 1024px) and (height: 1366px){ .form-inline{ @@ -93,11 +105,11 @@ padding: 0; } } - .filtro{ + .filtro { float: right; - margin: 10px 30px 0 0; + margin: 0 15px 0 0; padding: 10px 16px; - box-shadow: 3px 4px 0px 0px #d8d8d8; + box-shadow: 1px 3px 0px 0px #d8d8d8; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; @@ -105,37 +117,54 @@ transition: all 0.3s ease; } } - .resultado{ + .resultado { padding: 15px; padding-top: 0; - .retorno{ - background: aliceblue; + + @media only screen and (min-width: 991px) { + .search-header-common { + background: aliceblue; + border-bottom: 1px solid $primeira_cor_fundo; + } + } + + .retorno { padding: 22px; margin: 0 -15px 0 15px; border-top-left-radius: 8px; font-weight: 500; } - .classificar{ - background: aliceblue; - margin: 0 15px 0 -15px; + .classificar { padding: 14px; + padding-right: 0; border-top-right-radius: 8px; } } } - #user{ + #posts { + .formulario { + .filtro { + margin-right: 25px; + margin-top: 10px; + } + } + } + #user { @media only screen and (min-width: 780px){ - .input-daterange{ + .input-daterange { input{ margin-right: 15px !important; width: 110px; } } - #keyword{ - width: 230px !important; - } + // #keyword { width: 230px !important; } } } + + div.membros { + float: left; + width: 100%; + } } #exportModal{ diff --git a/public/wp-content/themes/rhs/assets/scss/_contato-page.scss b/public/wp-content/themes/rhs/assets/scss/_contato-page.scss index 5c7e911c..04b0fb71 100644 --- a/public/wp-content/themes/rhs/assets/scss/_contato-page.scss +++ b/public/wp-content/themes/rhs/assets/scss/_contato-page.scss @@ -37,6 +37,7 @@ } text-align: left; } + span.required { color: red; } } table { thead { diff --git a/public/wp-content/themes/rhs/assets/scss/_login-panel.scss b/public/wp-content/themes/rhs/assets/scss/_login-panel.scss index 7769a536..73b69e5a 100644 --- a/public/wp-content/themes/rhs/assets/scss/_login-panel.scss +++ b/public/wp-content/themes/rhs/assets/scss/_login-panel.scss @@ -16,6 +16,13 @@ display: none; } + .form-group { + .block-error { + padding-top: 8px; + font-size: 14px; + } + } + #u_login, #confirm_email, #phone { position: absolute; left: -999em; diff --git a/public/wp-content/themes/rhs/assets/scss/_page.scss b/public/wp-content/themes/rhs/assets/scss/_page.scss index 4dac144a..aca59404 100644 --- a/public/wp-content/themes/rhs/assets/scss/_page.scss +++ b/public/wp-content/themes/rhs/assets/scss/_page.scss @@ -38,4 +38,38 @@ } padding: 13px 20px; margin: 20px 10px; +} + +.rhs-publish-post { + .titulo-page { + box-shadow: none; + border-bottom: 1px solid; + margin-bottom: 0; + } + + span.form-required { + color: darkred; + } + + .set_img_destacada { + border: 1px solid $primeira_cor_texto; + color: $primeira_cor_texto; + } +} + +.rhs-publish-sidebar { + label.strong { + color: black; + font-weight: bolder; + } +} + +.no-posts { + color: black; + background: white; + float: left; + width: 100%; + text-align: center; + padding: 20px 0; + border-bottom: 1px solid; } \ No newline at end of file diff --git a/public/wp-content/themes/rhs/assets/scss/_sidebar.scss b/public/wp-content/themes/rhs/assets/scss/_sidebar.scss index bba7b2fb..b16dd0b4 100644 --- a/public/wp-content/themes/rhs/assets/scss/_sidebar.scss +++ b/public/wp-content/themes/rhs/assets/scss/_sidebar.scss @@ -166,12 +166,12 @@ } .publish_post_sidebox_city_state{ padding: 13px 20px 0 21px; - border: 1px solid #F2F2F2; + border-top: 1px solid #F2F2F2; + border-bottom: 1px solid #F2F2F2; margin-bottom: 10px; } .publish_post_sidebox{ padding: 13px 20px 0 7px; - border: 1px solid #F2F2F2; margin-bottom: 10px; .checkbox{ label{ diff --git a/public/wp-content/themes/rhs/assets/scss/_variavels.scss b/public/wp-content/themes/rhs/assets/scss/_variavels.scss index 959a0a16..6623c026 100644 --- a/public/wp-content/themes/rhs/assets/scss/_variavels.scss +++ b/public/wp-content/themes/rhs/assets/scss/_variavels.scss @@ -98,4 +98,8 @@ $seguir_mensagem_mobile: inline-grid; margin: 0; background: white; } -} \ No newline at end of file +} + +.no-padding { padding: 0 !important; } +.no-padding-left { padding-left: 0 !important; } +.no-padding-right { padding-right: 0 !important; } \ No newline at end of file diff --git a/public/wp-content/themes/rhs/contato.php b/public/wp-content/themes/rhs/contato.php index f8158ff2..112eaaee 100644 --- a/public/wp-content/themes/rhs/contato.php +++ b/public/wp-content/themes/rhs/contato.php @@ -8,14 +8,14 @@ ?> -
-
-

Contato

-
- ', '', null, 'btn btn-default' ); ?> -
-
+
+
+

Contato

+
+ ', '', null, 'btn btn-default' ); ?>
+
+
@@ -69,10 +69,15 @@
- +
+
+ + +
+
diff --git a/public/wp-content/themes/rhs/inc/captcha/captcha.php b/public/wp-content/themes/rhs/inc/captcha/captcha.php index 07cb71fd..089f3729 100644 --- a/public/wp-content/themes/rhs/inc/captcha/captcha.php +++ b/public/wp-content/themes/rhs/inc/captcha/captcha.php @@ -78,7 +78,7 @@ function display_captcha_secret_key_element() { ?> function display_recuperar_captcha() { ?> -
+
getKey()}"]); + if (isset($_SESSION)) { + unset($_SESSION["messages_{$class_name}_{$this->getKey()}"]); + } } diff --git a/public/wp-content/themes/rhs/inc/search/search.php b/public/wp-content/themes/rhs/inc/search/search.php index 27718647..f338377a 100644 --- a/public/wp-content/themes/rhs/inc/search/search.php +++ b/public/wp-content/themes/rhs/inc/search/search.php @@ -115,10 +115,6 @@ function pre_get_posts(&$wp_query) { $wp_query->set('s', $keyword); } - if( $full_term == "true" ) { - $wp_query->set('exact', true); - } - // DATAS if (!empty($date_from) || !empty($date_to)) { $date_query = []; @@ -138,7 +134,6 @@ function pre_get_posts(&$wp_query) { $date_query['inclusive'] = true; $wp_query->set('date_query', [$date_query]); } - } $meta_query = []; @@ -157,8 +152,7 @@ function pre_get_posts(&$wp_query) { ]; $has_meta_query = true; } - - + } if (!empty($uf) && !isset($meta_query['municipio']) /* se já tem municipio não precisa filtrar por estado tb */ ) { @@ -175,7 +169,6 @@ function pre_get_posts(&$wp_query) { } } - } // ORDER @@ -218,6 +211,10 @@ function pre_get_posts(&$wp_query) { $meta_query['relation'] = 'AND'; $wp_query->set('meta_query', [$meta_query]); } + + if( $full_term == "true" ) { + add_action('posts_search', array(&$this,'busca_termo_completo'), 20, 2); + } $wp_query->set('order', $q_order); $wp_query->set('orderby', $q_order_by); @@ -226,6 +223,33 @@ function pre_get_posts(&$wp_query) { } } + + function busca_termo_completo( $busca, $wp_query ) { + if (empty($busca)) + return $busca; + + global $wpdb; + $params = $wp_query->query_vars; + $termos_busca = (array) $params['search_terms']; + + $busca = $searchand = ''; + if (is_array($termos_busca) && count($termos_busca) > 0 ) { + foreach ($termos_busca as $term ) { + $term = esc_sql($wpdb->esc_like($term)); + $busca .= "{$searchand}($wpdb->posts.post_title REGEXP '[[:<:]]{$term}[[:>:]]') OR ($wpdb->posts.post_content REGEXP '[[:<:]]{$term}[[:>:]]')"; + + $searchand = ' AND '; + } + + if (!empty($busca)) { + $busca = " AND ({$busca}) "; + if ( ! is_user_logged_in() ) + $busca .= " AND ($wpdb->posts.post_password = '') "; + } + } + + return $busca; + } /** * Faz parse de uma string de data no formato YYYY-MM-DD e retorna @@ -319,10 +343,13 @@ static public function get_param($param) { * @return Object WP_User_Query */ public function search_users($params = array()) { - $users_per_page = self::USERS_PER_PAGE; $meta_query = []; $has_meta_query = false; + + if (empty($_GET)) + $is_index = true; + $_filters = array_merge([ 'uf' => $this->get_param('uf'), @@ -371,31 +398,35 @@ public function search_users($params = array()) { $q_has_publish_posts = false; - switch ($rhs_order) { - case 'name': - $q_order = 'ASC'; - $q_order_by = 'display_name'; - break; - - case 'register_date': - $q_order = 'DESC'; - $q_order_by = 'registered'; - break; - - case 'posts': - $q_order = 'DESC'; - $q_order_by = 'post_count'; - $q_has_publish_posts = true; - break; - - case 'votes': - $q_order_meta = RHSVote::META_TOTAL_VOTES; - break; - - default: - $q_order_by = 'display_name'; - $q_order = 'ASC'; - break; + if (isset($is_index) && $is_index) { + $q_order_meta = RHSLogin::META_KEY_LAST_LOGIN; + $q_order = 'DESC'; + $q_order_by = 'meta_value'; + } else { + switch ($rhs_order) { + case 'register_date': + $q_order = 'DESC'; + $q_order_by = 'registered'; + break; + case 'posts': + $q_order = 'DESC'; + $q_order_by = 'post_count'; + $q_has_publish_posts = true; + break; + case 'votes': + $q_order_meta = RHSVote::META_TOTAL_VOTES; + break; + case 'last_login': + $q_order_meta = RHSLogin::META_KEY_LAST_LOGIN; + $q_order = 'DESC'; + $q_order_by = 'meta_value'; + break; + case 'name': + default: + $q_order = 'ASC'; + $q_order_by = 'display_name'; + break; + } } if (!empty($q_order_meta)) { @@ -835,7 +866,7 @@ function exibir_resultado_post() { if ($final > $total) $final = $total; echo "Exibindo $initial a $final de $total resultados"; } else { - _e("Nenhum post encontrado com estes termos de busca!", "rhs"); + _e("Nenhum post encontrado com estes filtros de busca!", "rhs"); } } @@ -854,10 +885,14 @@ function exibir_resultado_user(){ $final = $per_page * $paged; - $initial = $final - ($per_page-1); - if ($final > $total) $final = $total; + if($total > 0) { + $initial = $final - ($per_page - 1); + if ($final > $total) $final = $total; - echo "Exibindo $initial a $final de $total resultados"; + echo "Exibindo $initial a $final de $total resultados"; + } else { + _e("Nenhum usuário encontrado com estes filtros de busca!", "rhs"); + } } function return_value_or_zero($value){ diff --git a/public/wp-content/themes/rhs/inc/uf-municipio/uf-municipio.php b/public/wp-content/themes/rhs/inc/uf-municipio/uf-municipio.php index 911456ee..ca944ab0 100644 --- a/public/wp-content/themes/rhs/inc/uf-municipio/uf-municipio.php +++ b/public/wp-content/themes/rhs/inc/uf-municipio/uf-municipio.php @@ -394,26 +394,25 @@ static function the_user($user_id) { static $mun_html, $uf_html, $uf_link; if ($meta['uf']['id']) { - $uf_link = self::get_uf_link($meta['uf']['id'], 'user', $meta['uf']); $uf_html = "".$meta['uf']['sigla'].""; //$uf_html = $meta['uf']['sigla']; // REMOVER ESSA LINHA QUANDO FIZERMOS OS LINKS FUNCIONAREM - } if ($meta['mun']['id']) { - $mun_link = self::get_mun_link($meta['mun']['id'], 'user', $meta['mun']); $mun_html = "".$meta['mun']['nome'].""; //$mun_html = $meta['mun']['nome']; // REMOVER ESSA LINHA QUANDO FIZERMOS OS LINKS FUNCIONAREM - } - echo $mun_html; - echo ', '; - echo $uf_html; + if (isset($mun_html)) { + echo $mun_html; + } + if (isset($uf_html)) { + echo ", " . $uf_html; + } } diff --git a/public/wp-content/themes/rhs/partes-templates/header_search_post.php b/public/wp-content/themes/rhs/partes-templates/header_search_post.php index b516e1b8..d98c828b 100644 --- a/public/wp-content/themes/rhs/partes-templates/header_search_post.php +++ b/public/wp-content/themes/rhs/partes-templates/header_search_post.php @@ -1,67 +1,63 @@ -
-
-
+
+ -
+
-
- -
+
-
-
- - -
-
- - 'Selecione uma Categoria', - 'selected' => RHSSearch::get_param('cat'), - 'option_none_value' => '', - 'orderby' => 'name', - 'class' => 'form-control ' - ] ); ?> -
+
+
+ +
-
- -
- -
- -
-
- -
até
- -
+
+ + 'Filtre por categoria', + 'selected' => RHSSearch::get_param('cat'), + 'option_none_value' => '', + 'orderby' => 'name', + 'class' => 'form-control' + ]; + wp_dropdown_categories($dropdown_options); ?>
-
- -
- -
- -
- - name="full-term"> +
+ +
+
+ +
+
+
a partir de
+ +
até
+
+
+
+
+ +
+
-
-
-
-
+
+ + name="full-term">
+
- +
+ +
+ + - -
+
\ No newline at end of file diff --git a/public/wp-content/themes/rhs/partes-templates/header_search_users.php b/public/wp-content/themes/rhs/partes-templates/header_search_users.php index 945a8cfe..612ff384 100644 --- a/public/wp-content/themes/rhs/partes-templates/header_search_users.php +++ b/public/wp-content/themes/rhs/partes-templates/header_search_users.php @@ -1,17 +1,13 @@ -
+
-
-
- -
+ +
+
-
-
-
- - -
-
+ +
+ +
diff --git a/public/wp-content/themes/rhs/partes-templates/none.php b/public/wp-content/themes/rhs/partes-templates/none.php index b881f27a..6655f95b 100644 --- a/public/wp-content/themes/rhs/partes-templates/none.php +++ b/public/wp-content/themes/rhs/partes-templates/none.php @@ -1,13 +1,3 @@ -
-
-
-

- - -

-

- -

-
-
-
+
+ +
\ No newline at end of file diff --git a/public/wp-content/themes/rhs/partes-templates/search_common.php b/public/wp-content/themes/rhs/partes-templates/search_common.php new file mode 100644 index 00000000..07673fa2 --- /dev/null +++ b/public/wp-content/themes/rhs/partes-templates/search_common.php @@ -0,0 +1,84 @@ +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
\ No newline at end of file diff --git a/public/wp-content/themes/rhs/publicar-postagem.php b/public/wp-content/themes/rhs/publicar-postagem.php index 4f340c06..b7a6e91c 100644 --- a/public/wp-content/themes/rhs/publicar-postagem.php +++ b/public/wp-content/themes/rhs/publicar-postagem.php @@ -8,14 +8,13 @@ getId()): ?> -
+

getId() ? 'Editar' : 'Criar'; ?> Post

-
-
+
messages() as $type => $messages){ ?>
@@ -28,8 +27,13 @@
- +
+ +
+ +
+
-
-
-