From 1815efd10415e30e64039106cea0d24238757b66 Mon Sep 17 00:00:00 2001 From: Lieu Le Date: Fri, 27 Sep 2019 13:57:08 +0700 Subject: [PATCH] update --- assets/opalestate.css | 50 +++++++++++------- assets/scss/opalestate/_dashboard.scss | 51 ++++++++++++------- inc/admin/settings/property.php | 11 ++++ inc/class-opalestate-enqueue.php | 3 +- inc/property/class-opalestate-property.php | 3 +- inc/template-hook-functions.php | 33 +++++++++--- .../custom-fields/iconpicker/iconpicker.php | 50 +++++++++--------- templates/content-single-agency.php | 10 ++-- templates/content-single-agent.php | 12 ++++- templates/single-property/amenities.php | 32 ++++++++---- templates/single-property/information.php | 8 ++- templates/single-property/video.php | 11 ++-- templates/single-property/virtualtour.php | 17 +++++-- templates/user-management.php | 13 ++--- templates/user/profile.php | 15 ++++-- 15 files changed, 213 insertions(+), 106 deletions(-) diff --git a/assets/opalestate.css b/assets/opalestate.css index 70c58dfd..b07af0a3 100755 --- a/assets/opalestate.css +++ b/assets/opalestate.css @@ -3702,14 +3702,12 @@ header#masthead { display: flex; } .opalestate-user-greeting .howdy { - float: right; - padding-left: 5px; + padding-right: 5px; padding-top: 5px; font-weight: 700; } -.opalestate-user-greeting .opalestate-popup -.popup-head { - float: left; } +.opalestate-user-greeting .popup-head { + float: right; } .opalestate-user-greeting .popup-head a { color: #FFF; @@ -3733,11 +3731,28 @@ header#masthead { padding: 0; margin: 0; list-style: none; } + .opalestate-user-greeting ul li:hover .count { + background-color: #2f73e9; + color: #FFF; } + +.opalestate-user-greeting .count { + color: #2f73e9; + padding: 3px 8px; + font-size: 11px; + min-width: 20px; + text-align: center; + background-color: #ebebeb; + border-radius: 50%; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; + margin-left: 5px; } .dashboard-navbar { background-color: #1d2329; padding: 20px 30px; - border-left: 1px solid #282d33; + border-left: 1px solid #181c21; margin-bottom: 15px; } .dashboard-navbar ul { margin-bottom: 0; } @@ -3794,7 +3809,7 @@ header#masthead { content: ""; z-index: 2; transform: translateX(-50%); - right: 25%; + right: -15px; top: -14px; border-bottom: 25px solid white; border-left: 20px solid transparent; @@ -3894,17 +3909,15 @@ header#masthead { background-color: #1d2329; min-height: 900px; position: fixed; - left: 0; width: 251px; height: 100%; z-index: 100; - top: 0px; } + top: 0px; + left: 0; + border-right: 1px solid #21272e; } .opalestate-user-management .user-dasboard-sidebar .navbar-brand { text-align: center; - margin: 50px 0 60px 0; } - .opalestate-user-management .user-dasboard-sidebar .navbar-brand .custom-logo-link { - padding: 60px 30px; - border-bottom: 1px solid rgba(255, 255, 255, 0.1); } + margin: 30px 0; } .opalestate-user-management .user-dasboard-sidebar .user-dasboard-sidebar-inner { padding-top: 20px; } .opalestate-user-management .navbar-brand { @@ -3948,15 +3961,16 @@ header#masthead { -o-border-radius: 50%; margin-left: 5px; } .opalestate-user-management .account-links a:hover, .opalestate-user-management .account-links a:focus { - color: #fff; } + color: #FFF; } .opalestate-user-management .account-links a:hover i, .opalestate-user-management .account-links a:focus i { - color: #fff; } + color: #FFF; } .opalestate-user-management .account-links li.active a { - color: #fff; } + color: #FFF; } .opalestate-user-management .account-links li.active a i { - color: #fff; } + color: #FFF; } .opalestate-user-management .site-main { - padding-top: 15px; } + padding-top: 60px; + padding-bottom: 60px; } .opalestate-my-reviews .commentlist { margin: 0; } diff --git a/assets/scss/opalestate/_dashboard.scss b/assets/scss/opalestate/_dashboard.scss index fb40448d..febbd45b 100755 --- a/assets/scss/opalestate/_dashboard.scss +++ b/assets/scss/opalestate/_dashboard.scss @@ -81,13 +81,12 @@ .opalestate-user-greeting { .howdy { - float: right; - padding-left: 5px; + padding-right: 5px; padding-top: 5px; font-weight: 700; - }.opalestate-popup + } .popup-head { - float:left; + float:right; } .popup-head a { color:$white; @@ -114,6 +113,25 @@ padding:0; margin :0 ; list-style:none; + li { + &:hover { + .count { + background-color:$primary; + color:$white; + } + } + } + } + + .count { + color:$primary; + padding:3px 8px; + font-size: 11px; + min-width: 20px; + text-align: center; + background-color: $border-color; + @include border-radius(50%); + margin-left:5px; } } @@ -121,7 +139,7 @@ .dashboard-navbar { background-color: #1d2329; padding:20px $grid-gutter-width; - border-left: 1px solid #282d33; + border-left: 1px solid #181c21; margin-bottom: $grid-gutter-width/2; ul{ margin-bottom: 0; @@ -198,7 +216,7 @@ content: ""; z-index: 2; transform: translateX(-50%); - right:25%; + right:-15px; top: -14px; border-bottom: 25px solid rgb(255, 255, 255); border-left: 20px solid transparent; @@ -321,18 +339,15 @@ background-color:#1d2329; min-height:900px; position:fixed; - left:0; width:251px; height:100%; z-index:100; top:0px; + left:0; + border-right:1px solid #21272e; .navbar-brand { text-align: center; - margin: 50px 0 60px 0; - .custom-logo-link { - padding: $grid-gutter-width*2 $grid-gutter-width; - border-bottom:1px solid rgba(255,255,255, 0.1); - } + margin: $grid-gutter-width 0; } .user-dasboard-sidebar-inner{ padding-top:20px; @@ -385,26 +400,26 @@ &:hover, &:focus { //background-color:#0073aa; - color:#fff; + color:$white; i { - color:#fff; + color:$white; } } } li.active { a { //background-color:#0073aa; - color:#fff; + color:$white; i { - color:#fff; + color:$white; } } } } .site-main { - padding-top:$padding-base; - $padding-bottom:$padding-base; + padding-top: $grid-gutter-width*2; + padding-bottom: $grid-gutter-width*2; } } diff --git a/inc/admin/settings/property.php b/inc/admin/settings/property.php index 9954d355..6568d919 100755 --- a/inc/admin/settings/property.php +++ b/inc/admin/settings/property.php @@ -346,6 +346,17 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab { ], ]; + $fields[] = [ + 'name' => esc_html__( 'Show Virtual Tour tab', 'opalestate-pro' ), + 'desc' => esc_html__( 'Show Virtual Tour tab in the single property page.', 'opalestate-pro' ), + 'id' => 'enable_single_virtual_tour', + 'type' => 'switch', + 'options' => [ + 'on' => esc_html__( 'Enable', 'opalestate-pro' ), + 'off' => esc_html__( 'Disable', 'opalestate-pro' ), + ], + ]; + $fields[] = [ 'name' => esc_html__( 'Show Map tab', 'opalestate-pro' ), 'desc' => esc_html__( 'Show Map tab in the single property page.', 'opalestate-pro' ), diff --git a/inc/class-opalestate-enqueue.php b/inc/class-opalestate-enqueue.php index 823b8b3d..bd4633f7 100755 --- a/inc/class-opalestate-enqueue.php +++ b/inc/class-opalestate-enqueue.php @@ -62,7 +62,8 @@ class OpalEstate_Enqueue { /** * Enqueue 3rd. */ - wp_enqueue_style( 'fontawesome', OPALESTATE_PLUGIN_URL . 'assets/3rd/fontawesome/css/all.min.css', null, '5.11.2', false ); + wp_register_style( 'fontawesome', OPALESTATE_PLUGIN_URL . 'assets/3rd/fontawesome/css/all.min.css', null, '5.11.2', false ); + wp_enqueue_style( 'fontawesome' ); wp_enqueue_style( 'hint', OPALESTATE_PLUGIN_URL . 'assets/3rd/hint/hint.min.css', null, '1.3', false ); wp_enqueue_style( 'select2', OPALESTATE_PLUGIN_URL . 'assets/3rd/select2/css/select2.min.css', null, '1.3', false ); wp_enqueue_script( 'select2', OPALESTATE_PLUGIN_URL . 'assets/3rd/select2/js/select2.min.js', null, '1.3', false ); diff --git a/inc/property/class-opalestate-property.php b/inc/property/class-opalestate-property.php index 09a01b69..5914dd3f 100755 --- a/inc/property/class-opalestate-property.php +++ b/inc/property/class-opalestate-property.php @@ -140,6 +140,7 @@ class Opalestate_Property { 'attachments', 'facilities', 'video', + 'virtual_tour', 'map', 'nearby', 'walkscores', @@ -189,7 +190,7 @@ class Opalestate_Property { $value = get_post_meta( $this->post_id, $field['id'], true ); } - $value = isset( $field['unit'] ) ? $value . ' ' . $field['unit'] : $value; + $value = isset( $field['unit'] ) && $field['unit'] ? $value . ' ' . $field['unit'] : $value; $this->metabox_info[ $id ] = [ 'label' => $field['name'], 'value' => $value ]; } diff --git a/inc/template-hook-functions.php b/inc/template-hook-functions.php index 446684dc..7bbb38ff 100755 --- a/inc/template-hook-functions.php +++ b/inc/template-hook-functions.php @@ -27,7 +27,11 @@ function opalestate_single_property_layout_default() { add_action( 'opalestate_after_single_property_summary', 'opalestate_property_views_statistics', 50 ); // add_action( 'opalestate_after_single_property_summary', '', 55 ); add_action( 'opalestate_after_single_property_summary', 'opalestate_property_tags', 60 ); - add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + + if ( opalestate_get_option( 'enable_property_reviews' ) ) { + add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + } + add_action( 'opalestate_after_single_property_summary_v2', 'opalestate_property_map_v2', 5 ); ////// sidebar //////// @@ -70,7 +74,11 @@ function opalestate_single_property_layout_v2() { // add_action( 'opalestate_after_single_property_summary', 'opalestate_property_author', 55 ); add_action( 'opalestate_after_single_property_summary', 'opalestate_property_tags', 60 ); - add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + + if ( opalestate_get_option( 'enable_property_reviews' ) ) { + add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + } + add_action( 'opalestate_after_single_property_summary_v2', 'opalestate_property_map_v2', 5 ); @@ -107,7 +115,11 @@ function opalestate_single_property_layout_v3() { // add_action( 'opalestate_after_single_property_summary', 'opalestate_property_author', 55 ); add_action( 'opalestate_after_single_property_summary', 'opalestate_property_tags', 60 ); - add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + + if ( opalestate_get_option( 'enable_property_reviews' ) ) { + add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + } + add_action( 'opalestate_after_single_property_summary_v2', 'opalestate_property_map_v2', 5 ); add_action( 'opalestate_single_property_sidebar', 'opalestate_property_author_v2', 5 ); @@ -129,7 +141,6 @@ function opalestate_single_property_layout_v4() { add_action( 'opalestate_single_property_summary', 'opalestate_property_facilities', 17 ); add_action( 'opalestate_single_property_summary', 'opalestate_property_attachments', 18 ); - add_action( 'opalestate_after_single_property_summary', 'opalestate_property_video', 20 ); add_action( 'opalestate_after_single_property_summary', 'opalestate_property_virtual_tour', 25 ); add_action( 'opalestate_after_single_property_summary', 'opalestate_property_map', 30 ); @@ -139,9 +150,12 @@ function opalestate_single_property_layout_v4() { add_action( 'opalestate_after_single_property_summary', 'opalestate_property_apartments', 45 ); add_action( 'opalestate_after_single_property_summary', 'opalestate_property_views_statistics', 50 ); - // add_action( 'opalestate_after_single_property_summary', 'opalestate_property_author', 55 ); add_action( 'opalestate_after_single_property_summary', 'opalestate_property_tags', 60 ); - add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + + if ( opalestate_get_option( 'enable_property_reviews' ) ) { + add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + } + add_action( 'opalestate_after_single_property_summary_v2', 'opalestate_property_map_v2', 5 ); add_action( 'opalestate_single_property_sidebar', 'opalestate_property_author_v2', 5 ); @@ -176,7 +190,11 @@ function opalestate_single_property_layout_v5() { add_action( 'opalestate_after_single_property_summary', 'opalestate_property_views_statistics', 50 ); add_action( 'opalestate_after_single_property_summary', 'opalestate_property_tags', 60 ); - add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + + if ( opalestate_get_option( 'enable_property_reviews' ) ) { + add_action( 'opalestate_after_single_property_summary', 'comments_template', 65 ); + } + add_action( 'opalestate_after_single_property_summary_v2', 'opalestate_property_map_v2', 5 ); add_filter( 'opalestate_thumbnail_nav_column', function () { @@ -229,6 +247,7 @@ function opalestate_single_property_layout( $layout ) { break; } } + add_action( 'opalestate_single_property_layout', 'opalestate_single_property_layout' ); /** diff --git a/inc/vendors/cmb2-plugins/custom-fields/iconpicker/iconpicker.php b/inc/vendors/cmb2-plugins/custom-fields/iconpicker/iconpicker.php index 561df76a..57581e7c 100755 --- a/inc/vendors/cmb2-plugins/custom-fields/iconpicker/iconpicker.php +++ b/inc/vendors/cmb2-plugins/custom-fields/iconpicker/iconpicker.php @@ -17,7 +17,7 @@ class Opalestate_Field_Iconpicker { const VERSION = '1.0.0'; /** - * Initialize the plugin by hooking into CMB2 + * Initialize the plugin by hooking into CMB2. */ public function __construct() { add_filter( 'cmb2_render_opal_iconpicker', [ $this, 'render_iconpicker' ], 10, 5 ); @@ -28,14 +28,16 @@ class Opalestate_Field_Iconpicker { $fontawesome_key = 'opalestate_fontawesome_data'; $icon_data = []; + if ( false === ( $fontawesome_icons = get_transient( $fontawesome_key ) ) ) { - $fontawesome = new Opalestate_Iconpicker_Fontawesome(); + $fontawesome = new Opalestate_Iconpicker_Fontawesome(); $fontawesome_icons = $fontawesome->get_icons(); set_transient( $fontawesome_key, $fontawesome_icons, 24 * 7 * HOUR_IN_SECONDS ); - $icon_data[] = $fontawesome_icons; } - var_dump($icon_data); - return $icon_data; + + $icon_data = array_merge( $icon_data, $fontawesome_icons ); + + return apply_filters( 'opalestate_get_font_data', $icon_data ); } /** @@ -44,44 +46,44 @@ class Opalestate_Field_Iconpicker { public function render_iconpicker( $field, $field_escaped_value, $field_object_id, $field_object_type, $field_type_object ) { $this->setup_admin_scripts(); - $users = $field->value; + $output = sprintf( + '', - // sanitize_key( $this->form->form_id . $args['id'] ), - // esc_attr( $args['class'] ), - // esc_attr( $args['id'] ) - // ); - // - // foreach ( $this->icon_data as $icon_item ) { - // $full_icon_class = $icon_item['prefix'] . ' ' . $icon_item['class']; - // $output .= ''; - // } - // - // $output .= ''; - // - // echo $output; + $output .= ''; + echo '

' . $field->args( 'description' ) . '

'; + echo $output; } /** * Sanitize data. */ public function sanitize( $override_value, $value, $object_id, $field_args ) { - return $value; + return sanitize_text_field( $value ); } /** * Enqueue scripts and styles. */ public function setup_admin_scripts() { + wp_register_style( 'fontawesome', OPALESTATE_PLUGIN_URL . 'assets/3rd/fontawesome/css/all.min.css', null, '5.11.2', false ); + // Iconpicker. wp_register_style( 'fonticonpicker', plugins_url( 'assets/css/jquery.fonticonpicker.min.css', __FILE__ ), [], self::VERSION ); - wp_register_style( 'fonticonpicker-grey-theme', plugins_url( 'assets/themes/grey-theme/jquery.fonticonpicker.grey.min.css', __FILE__ ), [], self::VERSION ); + wp_register_style( 'fonticonpicker-grey-theme', plugins_url( 'assets/themes/grey-theme/jquery.fonticonpicker.grey.min.css', __FILE__ ), [ 'fontawesome' ], self::VERSION ); wp_enqueue_style( 'fonticonpicker' ); wp_enqueue_style( 'fonticonpicker-grey-theme' ); + + wp_enqueue_script( 'fonticonpicker', plugins_url( 'assets/js/jquery.fonticonpicker.min.js', __FILE__ ), [], '2.0.0' ); + wp_enqueue_script( 'opalestate-fonticonpicker', plugins_url( 'assets/js/script.js', __FILE__ ), [ 'fonticonpicker' ], self::VERSION ); } } diff --git a/templates/content-single-agency.php b/templates/content-single-agency.php index b8c3fab2..cb64508c 100755 --- a/templates/content-single-agency.php +++ b/templates/content-single-agency.php @@ -99,7 +99,7 @@ $id = time();

- +
@@ -109,7 +109,7 @@ $id = time();

- +
@@ -118,7 +118,11 @@ $id = time(); - +
diff --git a/templates/content-single-agent.php b/templates/content-single-agent.php index de91594d..095b0650 100755 --- a/templates/content-single-agent.php +++ b/templates/content-single-agent.php @@ -14,7 +14,11 @@ $id = time();
  • -
  • + + +
  • + +
@@ -101,7 +105,11 @@ $id = time();
- + diff --git a/templates/single-property/amenities.php b/templates/single-property/amenities.php index d44fddc7..a8e28379 100755 --- a/templates/single-property/amenities.php +++ b/templates/single-property/amenities.php @@ -1,22 +1,36 @@ get_amenities(); +$amenities = $property->get_amenities(); ?> get_block_setting( 'amenities' ) && $amenities ): ?>
-
+
-
- term_id, 'opalestate_amt_image_id', true )) { - echo wp_get_attachment_image( $image_id ); - } - ?> - name ); ?> + term_id, 'opalestate_amenities', $post ) ) { + continue; + } + ?> +
+
+ term_id, 'opalestate_amt_icon', true ) ) { + echo ''; + } elseif ( $image_id = get_term_meta( $amenity->term_id, 'opalestate_amt_image_id', true ) ) { + echo wp_get_attachment_image( $image_id ); + } + ?> + name ); ?>  + term_id, 'opalestate_amenities', $post ) ) : ?> + ' ); ?> + + ' ); ?> + +
diff --git a/templates/single-property/information.php b/templates/single-property/information.php index cacc6889..8237bc73 100755 --- a/templates/single-property/information.php +++ b/templates/single-property/information.php @@ -2,9 +2,13 @@ global $property; $infos = $property->get_meta_fullinfo(); -$taxs = $property->get_types_tax(); +$taxs = $property->get_types_tax(); +if ( ! $infos && ! $taxs ) { + return; +} ?> +
@@ -33,4 +37,4 @@ $taxs = $property->get_types_tax();
-
+
diff --git a/templates/single-property/video.php b/templates/single-property/video.php index ccf3a903..caa569ef 100755 --- a/templates/single-property/video.php +++ b/templates/single-property/video.php @@ -5,15 +5,18 @@ if ( ! $property->get_block_setting( 'video' ) ) { return; } -$videoURL = $property->get_video_url(); +$video_url = $property->get_video_url(); + +if ( ! $video_url ) { + return; +} ?> - +

- +
- diff --git a/templates/single-property/virtualtour.php b/templates/single-property/virtualtour.php index af49dc23..6bd7c199 100755 --- a/templates/single-property/virtualtour.php +++ b/templates/single-property/virtualtour.php @@ -1,15 +1,22 @@ get_virtual_tour(); +if ( ! $property->get_block_setting( 'virtual_tour' ) ) { + return; +} + +$virtual_tour = $property->get_virtual_tour(); + +if ( ! $virtual_tour ) { + return; +} ?> - +
-

+

- +
- diff --git a/templates/user-management.php b/templates/user-management.php index 29c72a8d..a7c7b8e6 100755 --- a/templates/user-management.php +++ b/templates/user-management.php @@ -17,17 +17,12 @@ if ( ! class_exists( 'OpalEstate_User' ) ) { return; } -get_header( 'no-sidebar' ); $user_id = get_current_user_id(); $current_user = wp_get_current_user(); -$user_info = "{$current_user->display_name}"; - -if ( $current_user->display_name !== $current_user->user_login ) { - $user_info .= "{$current_user->user_login}"; -} ?> +
-
+
+ +
@@ -146,5 +143,5 @@ if ( $current_user->display_name !== $current_user->user_login ) {
+ - diff --git a/templates/user/profile.php b/templates/user/profile.php index 8e5a8c06..be1bbf02 100755 --- a/templates/user/profile.php +++ b/templates/user/profile.php @@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) { -
+
({$current_user->user_login})"; } ?> -

 

+
+ +   + +
-
+
-

+
+ + +