From ba22d2c5964dcf285bcff6a6657b0364b636d770 Mon Sep 17 00:00:00 2001 From: Justin Hayes Date: Thu, 3 Oct 2024 11:06:23 -0400 Subject: [PATCH] Changed address formatting --- CHANGELOG.md | 6 ++++++ bridge-directory/README.txt | 2 +- bridge-directory/assets/js/bridge-directory.js | 9 +++++++-- bridge-directory/bridge-directory.php | 2 +- bridge-directory/package.json | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d80cbd..3206759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [0.2.5] + +### Changed + +- **Address Formatting**: Updated the address formatting in the office cards to display the city, state, and ZIP code on separate lines for improved readability. + ## [0.2.4] ### Fixed diff --git a/bridge-directory/README.txt b/bridge-directory/README.txt index dd642ea..1938af7 100644 --- a/bridge-directory/README.txt +++ b/bridge-directory/README.txt @@ -3,7 +3,7 @@ Contributors: justinh-rahb Tags: real estate, bridge, brokerage, api Requires at least: 5.0 Tested up to: 6.6.2 -Stable tag: 0.2.4 +Stable tag: 0.2.5 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html diff --git a/bridge-directory/assets/js/bridge-directory.js b/bridge-directory/assets/js/bridge-directory.js index bef62d2..3888727 100644 --- a/bridge-directory/assets/js/bridge-directory.js +++ b/bridge-directory/assets/js/bridge-directory.js @@ -60,8 +60,13 @@ parts.push(`

${office.OfficeEmail}

`); } - // Address (always shown) - parts.push(`

${office.OfficeAddress1} ${office.OfficeAddress2}, ${office.OfficeCity}, ${office.OfficeStateOrProvince} ${office.OfficePostalCode}

`); + // Format the address with separate lines + let address = `

${office.OfficeAddress1}

`; + if (office.OfficeAddress2) { + address += `

${office.OfficeAddress2}

`; + } + address += `

${office.OfficeCity}, ${office.OfficeStateOrProvince} ${office.OfficePostalCode}

`; + parts.push(address); // Correct the URL if it doesn't start with http:// or https:// if (office.SocialMediaWebsiteUrlOrId) { diff --git a/bridge-directory/bridge-directory.php b/bridge-directory/bridge-directory.php index 6e066fc..0cb0735 100644 --- a/bridge-directory/bridge-directory.php +++ b/bridge-directory/bridge-directory.php @@ -3,7 +3,7 @@ * Plugin Name: Bridge API Directory * Plugin URI: https://github.com/RAHB-REALTORS-Association/Bridge-Directory-WP * Description: Displays a searchable directory of offices using the Bridge Interactive API. - * Version: 0.2.4 + * Version: 0.2.5 * Author: Cornerstone Association of REALTORS * Author URI: https://www.cornerstone.inc * License: GPL-2.0 diff --git a/bridge-directory/package.json b/bridge-directory/package.json index 12b5adc..bf57c9d 100644 --- a/bridge-directory/package.json +++ b/bridge-directory/package.json @@ -1,6 +1,6 @@ { "name": "bridge-directory", - "version": "0.2.4", + "version": "0.2.5", "description": "A WordPress plugin that displays a searchable directory of offices using the Bridge Interactive API.", "main": "index.js", "scripts": {