Commit Graph

15 Commits

Author SHA1 Message Date
3f8b0dd231 feat: implement social sharing functionality
- Added `share_controller.js` to handle sharing logic.
- Created `_share_social.html.erb` partial for social sharing buttons.
- Integrated share buttons into city and weather art show pages.
- Added sharer.js dependency.

This feature allows users to share city and weather art pages on
various social media platforms such as Facebook, Twitter, LinkedIn,
Pinterest, Telegram, and WhatsApp, increasing content visibility.
2025-02-16 11:58:25 +08:00
b6635e5a51 fix: fix map marker click and handle null values
-   Comment out marker click listener to fix a bug
-   Update _map.html.erb to handle null values in the city
-   Improve error handling

This commit addresses a bug where clicking the map marker
caused unexpected behavior.  The changes involve commenting out
the click listener to fix the issue, and updating the view
template to handle potential null values in the city object to
prevent unexpected behavior.
2025-02-15 11:48:40 +08:00
daa0ceac3e refactor: replace OpenLayers with Mapbox GL
- Replace OpenLayers with Mapbox GL for map rendering.
- Update CSS for map styling and control visibility.
- Integrate weather art into map popups.
- Add Mapbox token to credentials.yml.enc

This commit replaces the existing OpenLayers map implementation
with Mapbox GL. It also adjusts the styling and adds a
weather art display to the map popup, which enhances the
user experience. The necessary changes include modifying
stylesheets, JavaScript controllers, view templates, and
updating the credentials file. The motivation is to enhance
map rendering performance and user experience.
2025-02-15 11:21:12 +08:00
9ac7dd46af feat: migrate to OpenLayers for map display
Some checks are pending
Docker / docker (push) Waiting to run
- Replaced Leaflet with OpenLayers for improved map rendering
- Added OpenLayers CSS and removed Leaflet CSS
- Updated map controller to use OpenLayers API
- Added marker icon in public directory
- Added scopes and associations for weather art in City model

This change migrates the map display from Leaflet to
OpenLayers, providing better performance and more features.
It also introduces new model associations for weather arts,
allowing to sort cities by latest weather updates.
2025-02-15 00:19:04 +08:00
df456d1031 feat: add map feature to city show page
- Implement MapController for displaying city maps
- Add map rendering in the city show view
- Include weather arts in the city show controller
- Update asset pipeline to include Leaflet CSS and JS

This commit introduces a map feature that allows users to view
geographical information related to cities. The map is integrated
with weather arts data, enhancing the overall functionality of
the city show page.
2025-02-14 18:05:03 +08:00
b01cbe960a fix: round load time to the nearest whole number
- Update load time display to show the rounded value instead of the
  raw measurement.
- This change improves the readability of the load time for end users
  by providing a more user-friendly format.

The adjustment enhances the user experience by presenting the load time
in a cleaner and more comprehensible manner.
2025-02-14 11:09:33 +08:00
496dcf83a9 feat: add page load time tracking and footer
- Introduced PageLoadTimeController to measure and display
  page load times.
- Moved the footer content into a partial for better code
  organization.
- Added 'bullet' gem for performance monitoring.

This commit enhances the application by providing useful
information about load time directly in the UI and
refactoring the layout code for maintainability.
2025-02-14 09:47:01 +08:00
80c2f9a1df feat: add loading spinner and search updates
- Implement loading state in the search input with spinner.
- Optimize the search request to handle pending requests and cancels.
- Add dynamic response handling for Turbo frames to load search results.
- Create a new partial for city search results.
- Update the cities controller to support Turbo stream responses.

These enhancements improve user experience during searches by showing a loading
spinner and addressing potential issues with overlapping requests, ensuring
that the application remains responsive and functional when fetching city
search results.
2025-02-12 14:47:30 +08:00
799f3222a9 feat: add city search functionality
- Implement search_by_name scope in City model
- Add SearchController for handling search input
- Include _search_city partial in cities index view
- Update cities_controller to filter cities based on search query

This commit introduces a new feature that allows users to search for
cities by name using an input field. The search is implemented as a
scope in the City model, and it is integrated into the existing
CitiesController. A dedicated SearchController manages the input
submission with a debouncing mechanism for better performance. The
search field is rendered in the cities index view, enhancing user
interactivity and experience.
2025-02-12 14:00:03 +08:00
0312383bc8 feat: add flash message functionality
- Implement Stimulus controller for closing flash messages
- Replace inline alerts with a partial for better organization
- Enhance styling for user registration and login forms

This update introduces a new flash message component that allows
for user notifications to be displayed on the screen and closed by
the user. The forms also include improved styles for a better
user experience.
2025-02-11 15:52:58 +08:00
05449d1e7f chore: update PhotoSwipe import paths
- Change import for PhotoSwipeLightbox to 'photoswipe/lightbox'
- Change import for PhotoSwipe to 'photoswipe'

These updates reflect the new module structure of the PhotoSwipe library, ensuring that the controller utilizes the correct paths for improved functionality and maintainability.
2025-02-01 14:31:53 +08:00
905ec35fd8 feat: add photo swipe lightbox functionality
- Integrate PhotoSwipe library for enhanced image viewing
- Create PhotoSwipeLightBoxController to manage images
- Register lightbox controller in Stimulus framework
- Update views to include lightbox functionality
- Modify styles to accommodate new design elements

This commit introduces a new way for users to view images with
PhotoSwipe, improving the interactivity of the photo gallery. It
also includes adjustments to the layout and styles for better
presentation and user experience.
2025-02-01 14:19:19 +08:00
032ff0552a feat: add jQuery and UI support
- Introduce jQuery and jQuery UI libraries
- Create an add_jquery.js for global availability
- Import active_admin.js to initialize the setup

These changes integrate jQuery and jQuery UI into the project, which
will facilitate more interactive user interface features. The jQuery
object is made globally accessible to use within other scripts.
2025-01-25 01:11:15 +08:00
d570f43f95 feat: add font styling and enhance city views
- Import Playfair Display and Raleway fonts for better typography
- Add a method to `City` model for fetching the latest weather art
- Revamp city index and show pages for improved layout and usability
- Update styles in the layout and main pages to enhance user experience

These changes promote visual consistency and enhance user interaction within the platform, providing a more engaging experience.
2025-01-20 18:02:28 +08:00
8517905b68 init with rails8 + active-admin 2025-01-19 01:13:59 +08:00