- Rename page view variables for consistency:
- `busuanzi_value_page_pv` to `busuanzi_page_pv`
- `busuanzi_value_page_uv` to `busuanzi_page_uv`
- `busuanzi_value_site_pv` to `busuanzi_site_pv`
- `busuanzi_value_site_uv` to `busuanzi_site_uv`
These changes improve the readability of the code by removing redundant parts of the variable names. This ensures that variables accurately reflect their purpose without unnecessary prefixes. The functionality remains unchanged.
- Change visibility of busuanzi_container from hidden to default
This change allows page view counts to be visible to users, improving
transparency regarding page engagement metrics.
- Change font size from 'text-sm' to 'text-xs' for better visibility
This adjustment improves the aesthetics of the footer by ensuring that the
text is appropriately sized and matches the overall design of the page.
- Adjust footer padding for improved spacing
- Change visitor and view statistics display to a more concise
format
- Maintain consistent font sizes for better readability
These changes enhance the visual presentation of the footer
while maintaining the functionality of hidden visitor statistics.
- Update footer padding for better spacing
- Add hidden container for site statistics
- Modify display of page and total site statistics
These changes improve the presentation and organization of site statistics, making it easier for users to understand site traffic and engagement.
- Removed the active_admin.js file from the project as it is no longer needed.
- Added the Busuanzi site statistics script to the application layout for
tracking page views and visitors.
- Updated the footer layout to include site statistics, providing users
with real-time view and visitor counts.
These changes streamline the asset management by removing unused files and
integrate site analytics directly into the footer for better visibility.
- Update layout with improved styles and spacing
- Modify sections for better visual hierarchy
- Add gradient effects and responsive design adjustments
These changes enhance the overall user experience by providing a
more visually appealing and organized layout for the city
weather art view. Adjustments include background effects,
updated navigation, and improved display of weather statistics
and history records.
- Create SitemapsController to serve sitemaps
- Configure AWS S3 storage for sitemaps
- Update routes to include sitemap paths
- Add SitemapsHelper module
- Configure SitemapGenerator with AWS adapter
- Update storage configurations for AWS
This feature adds sitemap functionality to the application, enabling search engines to discover and index its content more efficiently. It includes configuration for AWS S3 storage to host the sitemaps and updates the application's routes to serve them.
- Removed conditional check for production environment in
the initializer to ensure the sitemap refresh worker
always runs at startup.
- Renamed Sidekiq configuration file from sidekiq.yml to
sidekiq_scheduler.yml to better reflect its purpose.
These changes streamline the initialization process
for scheduled tasks and enhance the clarity of the
configuration files used in the project.
- Change stats div to be responsive
- Adjust coordinates display format for better readability
This update enhances the layout of the city show view by making
it more responsive and improving the display of weather and
geographical data. Additionally, the startup task for
refreshing the sitemap is now consistently executed,
removing unnecessary complexity.
- Update `find_resource` method to use `scoped_collection.friendly.find(params[:id])`
This refactoring improves the find_resource method to work with friendly URLs, making it more robust and user-friendly.
- 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.
- Introduce a new filter for selecting cities by country in the
ActiveAdmin interface.
- Update the ransackable attributes to include country_id for
searchable functionality.
This change enhances the Admin UI by allowing easier access to
city data based on country, improving the user experience for
administrators.
- Added country input field to the city form for better user experience.
- Removed unused region and weather-related fields to declutter the form.
This change improves the data captured for cities and enhances the form's usability by focusing on relevant information.
- Change SLEEP_DURATION from 60 seconds to 120 seconds
This change is made to improve resource management
and allow for a more efficient operation of the batch
processing tasks performed by the worker. It helps in
avoiding potential overload on system resources.
- Change generation interval from 6 hours to 24 hours
- Increase sleep duration from 3 seconds to 60 seconds
These adjustments aim to optimize the worker's performance and reduce resource consumption. This change reflects a shift towards longer generation cycles, potentially improving throughput.
- Change the displayed title from 'Today AI Weather Art' to 'Today AI Weather'.
This change refines the branding by removing the word 'Art', making the title more concise and focused. This is a minor modification that does not impact functionality.
- Introduce `weather_description_icon` and `weather_stat_icon`
helper methods for displaying SVG icons based on weather
conditions and statistics.
- Enhance the city show view by using these icons to display
visual weather information such as temperature, wind, humidity,
visibility, pressure, and cloud cover.
- Optimize the visual styling and layout of the weather stats
and cards for better user experience.
- Change title from 'AI Weather Art' to 'Today AI Weather Art'
This change enhances the clarity of the application by specifying that the art relates to today's weather. It does not affect any functionality but improves the user interface.
- Include async script for Google AdSense in the application layout
- Ensure script loads with crossorigin attribute
This change will allow the application to serve ads from Google, potentially generating revenue. The implementation is non-intrusive and maintains existing functionality.
- Added a space in the array passed to `add_index` in the migration
- Removed unused columns `last_weather_fetch` and `last_image_generation` from the `cities` table
- Ensured consistent code style in the `GenerateWeatherArtWorker` and added required newline at the end of files
These changes improve code readability and maintainability while ensuring that
no unnecessary fields exist in the database schema.
- Add logging to track the generation of weather art for each city.
- Refactor image attachment process to streamline the code by removing the
separate method for attaching images.
- Ensure proper handling of the temporary file used for image processing.
These changes improve observability during the weather art generation
process and encapsulate the image attachment logic within the primary
method, reducing the overhead of a method call. The adjustments also
ensure that temporary files are managed correctly to prevent resource
leaks.
- Introduced constants for configuration settings such as generation interval, maximum duration, and sleep duration.
- Updated the `perform` method to utilize these constants for better readability and maintainability.
- Refactored the `perform` method in `GenerateWeatherArtWorker` to improve flow and error handling by creating separate methods for fetching weather data, generating prompts, images, and handling database transactions.
- Cleaned up city seeding data by removing unnecessary fields while maintaining required functionality.
These changes improve the overall readability of the code and make it easier to adjust the behavior of the workers in the future without digging through the logic.
- Implement caching methods for last weather fetch and image generation
- Adjust sleep duration in BatchGenerateWeatherArtsWorker from 10 seconds to 3 seconds
- Remove unused fields `last_weather_fetch` and `last_image_generation` from the cities table
- Add index on the weather_arts table for optimized querying
This refactor improves data retrieval performance for weather data
associated with cities. Caching reduces database load while the
worker modification allows for faster iterations in generating
weather arts without significantly impacting performance.
- Include gtag.js for Google Analytics
- Setup dataLayer for tracking events
- Configure Google Analytics with unique ID
This commit integrates Google Analytics into the web
application to enable tracking of user interactions and
site usage. It sets up the necessary scripts and initializes
the tracking code with the provided unique ID, improving
analytics capabilities.
- update default host in sitemap generator
- refresh sitemap on worker with new host
These changes allow the sitemap to be correctly generated for different environments and to handle the new host correctly, which was the motivation behind this update. No other side effects are expected.
- Ensure consistent use of double quotes for strings in the
Gemfile and sitemap configuration files.
- Add spaces for better readability in array declarations
within the RefreshSitemapWorker.
These changes improve the readability of the code without
changing any functionality. Adhering to a consistent coding
style helps maintainability and team collaboration.
- Introduced `SeoConcern` module to handle SEO meta tags
- Integrated `meta-tags` gem for customizable meta tags
- Created `RefreshSitemapWorker` to automate sitemap updates
- Added relevant meta tags in controllers for weather art and cities
- Configured sitemap generation settings
These changes improve the SEO of the application by ensuring that
pages have appropriate meta tags. Additionally, a sitemap is now
generated and refreshed daily, enhancing site visibility to search
engines.
- Add language attribute to HTML tag
- Update meta viewport attribute for accessibility
- Include Plausible JavaScript tracking script for analytics
This change improves application accessibility by setting the language attribute for the HTML tag, and it enhances data collection capabilities by integrating Plausible analytics tracking.
- Adjust spacing around the quotes in the Gemfile
- Standardize spacing in the arts_controller for improved readability
- Modify routes file for consistent array formatting
These changes enhance the consistency of code style across the project without altering any functionality or behavior.
- Implement pagination for the cities index view.
- Add shared pagination partial to reduce code duplication.
- Modify arts index view to utilize the new pagination.
- Update cities controller to include pagination logic.
These updates improve usability by allowing better navigation through larger datasets, ensuring users can easily access and view items across multiple pages.
- Add region selection for filtering weather arts by region
- Implement sorting options for newest and oldest entries
- Update pagination to show links for each page when applicable
- Adjust the number of items displayed per page to 10
This commit enhances the user experience by allowing users to filter
and sort weather arts based on their preferences. It also improves
the pagination logic to provide more manageable navigation through
large datasets, making it easier for users to find the artworks they
are interested in.
- Introduce ArtsController with index action
- Create index view for displaying weather arts
- Implement Kaminari for pagination functionality
- Add necessary routes for accessing arts
- Update Gemfile to include Kaminari gem
- Create views for pagination controls
This implementation enhances the Weather Arts Gallery, allowing users to view and navigate through a collection of AI-generated weather arts easily. Pagination controls have been added to improve usability.
- Change sleep duration from 1 minute to 10 seconds in
BatchGenerateWeatherArtsWorker.
This change addresses API limitations by reducing the wait time
between job submissions, thereby increasing the efficiency of
the batch processing for generating weather arts.
- Change BatchGenerateWeatherArtsWorker to use city ID instead of city object
- Update API endpoint to accept city ID
- Improve performance by reducing database queries
This change improves the performance of the BatchGenerateWeatherArtsWorker by reducing database queries and increasing efficiency. It is a necessary modification to ensure the worker functions correctly and efficiently.
- Include Sidekiq::Worker for asynchronous task execution
- Implement condition to skip execution if weather data is up to date
These changes enable efficient weather art generation by leveraging
background processing, thereby improving overall application
performance and responsiveness.
- Change from using GenerateWeatherArtJob to GenerateWeatherArtWorker
- Maintain asynchronous job processing
This refactoring improves the clarity of the job class being used
for generating weather art and adheres to project conventions. The
change does not affect the API rate limits as the sleep duration
remains the same.
- Replace synchronous job processing with asynchronous
- Ensure processing does not exceed API rate limits
This change allows for better performance by offloading the
queue management to Sidekiq, enabling more efficient
parallel processing of weather art generation. It also
prevents potential API rate limit violations by maintaining
a delay between requests.
- Renamed `BatchGenerateWeatherArtsJob` to `BatchGenerateWeatherArtsWorker`
- Renamed `GenerateWeatherArtJob` to `GenerateWeatherArtWorker`
- Updated Sidekiq configuration to set Redis URL and logger level
- Modified `sidekiq.yml` to use the new worker class names and added queue configurations
These changes help in aligning the class names with their purpose as
workers in Sidekiq, while also ensuring better configuration for
Redis and logging.
- Standardized quotation marks in Gemfile and Ruby files
- Improved consistency for Sidekiq and Sidekiq Scheduler
- Removed unnecessary blank line in GenerateWeatherArtWorker class
These changes ensure a consistent coding style across the project, making
it easier to read and maintain. Adjustments to the Gemfile update the
formatting without altering the functionality.
- Implement BatchGenerateWeatherArtsWorker to handle batch
processing of weather art generation.
- Create GenerateWeatherArtWorker for individual weather art
generation tasks.
- Update Dockerfile to include redis-tools for Sidekiq support.
- Modify Gemfile to add sidekiq and sidekiq-scheduler gems.
- Configure Sidekiq in initializers and set up routes for
Sidekiq dashboard.
- Include a sidekiq.yml configuration for scheduling jobs.
- Create compose.yaml for Docker services including web,
database, Redis, and Sidekiq workers.
These changes introduce background processing capabilities
using Sidekiq, allowing for efficient generation of weather
art through scheduled and managed job queues, optimizing
performance and scalability.
- Added 'libpq-dev' to the packages installed in the Dockerfile
- Updated the base_uri in WeatherService to use 'dig' for safer access
These changes improve the Docker environment by ensuring that
necessary PostgreSQL development headers are available during
installation. The weather service now safely accesses the
URI from the credentials, reducing the risk of errors when
fetching nested configuration data.
- Adjust formatting for message parameters in the chat call
- Eliminate unnecessary blank lines in generate_prompt_request method
- Ensure consistent styles for arrays and block indentation
These changes improve code readability and maintain consistency in
formatting for better maintainability without altering functionality.
- Created BatchGenerateWeatherArtsJob to process eligible
cities and generate weather art.
- Introduced GenerateWeatherArtJob for generating weather
art and image attachment.
- Added AiService for obtaining prompts and generating
images with OpenAI API.
- Implemented WeatherService to fetch current weather
data from the QWeather API.
- Updated Gemfile with necessary gems (whenever,
ruby-openai, httparty, down, aws-sdk-s3).
This commit introduces a system to create and store
weather art images for various cities based on current
weather conditions, leveraging external APIs for data
and image generation.
- Improve image and main info section for better aesthetics
- Add gradient overlay for text readability
- Include temperature display with feel-like temperature
- Enhance city name and location styling
- Add detailed weather information metrics (Humidity, Wind, Visibility)
- Provide a backup UI for when no image is available
This update enhances the user interface of the city weather card
by improving the layout and adding more detailed weather information.
The gradient overlays and reorganized elements improve readability and
usability. Additionally, a fallback display is included for cases where
weather images are not attached, ensuring consistent design.
- Introduce dropdown menus for region and country selection
- Adjust padding on title section for better layout
- Update filter navigation structure to improve UX
This commit refines the user interface for filtering cities by
allowing users to select regions and countries from dropdown
menus. The filtering options are now easier to navigate and
maintain a consistent aesthetic with adjusted padding for
better visual hierarchies.
- Create a new partial for city card display with weather image
- Update index page to show featured weather art with gradient
- Refactor city listing layout and navigation for improved clarity
This commit introduces a new component for displaying city cards that
includes weather artwork when available. The index page has been
refactored for better visual presentation and usability. Users can
now better navigate through cities and see relevant weather data.
- Add slug column to weather_arts for friendly URLs.
- Update weather arts retrieval in the controller to use slug.
- Implement region and country filtering in cities index view.
- Optimize city queries with scopes for active status and region/country.
- Improve UI layout and design for the cities index page.
These changes allow better user experience by enabling cleaner URLs for weather arts and facilitating efficient filtering of cities based on selected regions and countries.
- Change city name display to localized name in both index and show views
- Modify schema to use bigint for certain foreign keys
- Correct country codes in seeds for accurate data representation
These changes improve the handling of city names, ensuring they are displayed in the appropriate localized format and ensuring well-typed foreign key relationships in the schema.
- Implement Country and Region models
- Establish relationships between City, Country, and Region
- Update ActiveAdmin setup for managing countries and regions
- Add localization support for cities and countries in multiple languages
- Create necessary migrations to support the new schema
This update allows for better categorization of cities under their respective countries and regions, enhancing geographical structure and support for multilingual features.