- Change `by_popularity` method in `City` model to use `start_time` for filtering views.
- Update `by_popularity` in `WeatherArt` model to limit results and incorporate the correct popularity calculation.
- Adjust `HomeController` to define `@popular_shuffle_arts` and `@latest_arts` with appropriate scopes.
These changes improve the accuracy of popularity retrieval for both cities and weather arts, simplifying the logic in the controller and leveraging updated model methods for performance.
- Introduce filtering of cities by selected country
- Retrieve current country using friendly find method
- Apply city filtering if country is provided in parameters
This change allows users to efficiently filter cities based on the
selected country, providing a more tailored experience and
encouraging better navigation through the list of cities.
- Update buttons to include data attribute for Turbo frames
- Ensure proper behavior of navigation with turbo-enabled requests
This change enhances the functionality of the buttons by allowing them
to interact with Turbo frames, improving performance and user
experience when transitioning between different views on the application.
- 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.
- 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.
- Implement new scope in City model to fetch popular cities
- Query modified to consider different time periods: today, week, month, and year
- Update Ahoy Dashboard to show top cities for each time period
This change enhances the dashboard, providing insights into city popularity over varying durations, facilitating better data analysis.
- Change 'belongs_to :country' association to be optional
- Change 'belongs_to :state' association to be optional
This refactoring allows a City record to exist without having
an associated Country or State, thus increasing the flexibility
of the data model for various use cases.
- Add requirements for clearer and brighter images
- Specify maintenance of brightness even in overcast conditions
- Include enhancements for sunny day imagery
- Revise output prompt to remove unnecessary prefix and suffix
These changes improve the clarity and effectiveness of prompts
used in AI-generated imagery. The additional specifications help
guide the AI in producing visually appealing and contextually
relevant images for various weather conditions.
- Refactor prompt generation to separate location
description functionality
- Update user prompt generation for DALL-E 3
- Improve AI service's response handling
This change enhances the AiService by creating a more
modular approach to generating prompts. The introduction
of a `generate_location_desc` method improves the
detail and context provided in the generated prompts.
Furthermore, the `ask_ai` method centralizes AI request
logic, allowing for cleaner and more organized code.
These adjustments should improve the overall robustness
and readability of the prompt generation process.
- Include state, country, and region in the DALL-E prompt
- Enhance context for the generated weather scene
This change improves the specificity of the prompts generated
for the AI, providing more contextual information such as
state, country, and region alongside the city name. This
enhancement can lead to more accurate and relevant outputs
from the DALL-E 3 model for weather scenes.
- Clean up trailing whitespace in app/admin/state.rb
- Clean up trailing whitespace in app/admin/subregions.rb
- Clean up trailing whitespace in app/admin/users.rb
- Adjust formatting in cities_controller.rb for consistency
These changes improve code readability and maintainability by
removing unnecessary whitespace. It is a small clean-up that prepares
files for better version control parsing and reduces the diff clutter.
- Change generation interval from 24 hours to 36 hours
This change provides more flexibility in scheduling weather arts generation, which could lead to better resource management or accommodate changes in data availability.
- Update menu labels for cities, countries, and regions
- Introduce new entities for states and subregions in Admin Panel
- Implement admin authentication for weather art generation
- Modify application controller to check for admin user
- Refactor view to display admin panel based on user permissions
- Update routes to include weather art generation action
These changes enhance the admin interface for better management of cities
and related entities. The new admin checks ensure that only authorized users
can generate weather art, improving security and functionality.
- Implemented a new admin panel that allows administrators to view
statistics and manage weather art. The panel includes:
- A card displaying total images and today's images
- Buttons to generate new art and edit the city
- Added `admin?` helper method to check if the current user is an
administrator.
- Updated database configuration to use safer credentials lookup
method `dig` for development database URL instead of the
previous method, improving reliability in accessing nested
credentials.
- Updated confirmation, password, unlock, and session views to use a
card-based layout for improved visual appeal.
- Added responsive design features to ensure compatibility across devices.
- Enhanced usability by providing clear placeholders in form fields.
These changes improve the user experience during account recovery and
management processes. The design promotes a modern interface while
maintaining functionality.
- Add confirmable and lockable modules to user model
- Update error messages display with improved UI
- Modify navbar links for better accessibility and styling
- Add unique indexes for confirmation and unlock tokens in migration
These changes improve user management and user experience by
adding features for account activation and security, along
with styling enhancements for the authentication views.
- 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.
- Improve the user registration form layout with card styling.
- Add input classes for better design consistency.
- Introduce a new navbar partial for better component management.
- Removed the old navbar code to streamline application layout.
These changes provide a more modern and user-friendly experience during
user registration and improve the overall site's navigation structure.
- Integrate Devise for user authentication
- Create User model and necessary views
- Implement email confirmation and password reset functionality
- Add routing for user sign-up and login
- Customize error messages display
This commit initiates user authentication in the application
using the Devise gem. It includes user registration, login,
password reset, and email confirmation features. Additionally,
the necessary views and mailer templates are included to
support these functionalities. This enhances the security
and usability of the application by allowing users to create
accounts and manage their passwords effectively.
- Change displayed time from weather_date to created_at in
cities and weather arts show templates. This ensures that the
time shown reflects when the record was created instead of the
weather date which may not be accurate for representation.
- Change column header from '访问(日/周/年)' to '访问(DWMY)' to reflect
updated metrics.
- Adjust metrics to include monthly view count alongside daily,
weekly, and yearly counts.
This modification improves clarity by explicitly indicating the
metrics being displayed in the dashboard, thereby aiding users in
understanding the data better.
- Update view_count method to accept different time periods
- Modify ahoy_dashboard to display views per day, week, and year
These changes provide a more granular view of city visits, allowing for
better analytics and insights on user engagement over time.
- Add '图像个数' column to show the count of weather arts.
- Add '最后更新时间' column to display the last weather fetch time.
These additions enhance the information displayed in the Ahoy Dashboard and
Cities admin panel, providing more context for each city.
- Add display of activated and non-activated city counts
- Introduce a new scope for inactive cities in City model
- Update Ahoy Dashboard to show the total count of both active and inactive cities
This update provides better insights into city activation status within the
Ahoy Dashboard. It introduces a new function in the City model and updates
the dashboard to reflect these statistics, assisting in better monitoring
of city status.
- Removed user_id, city, country, and region columns
- Added visit_id, visit_token, referrer, landing_page,
browser, os, and device_type columns
This refactor improves the administrative interface for Ahoy
models by updating the displayed attributes to better suit
the current application requirements. It also aligns the
displayed data with the available attributes in the Ahoy
tracking system, making it easier for administrators to
review relevant information.
- Add ID column to least popular active cities table
- Improve region display in cities table
- Remove commented-out code section for cleaner view
This update enhances the Ahoy dashboard by providing more
information in the cities listing, specifically the ID
of each city and a clearer representation of the region
it belongs to. Additionally, it removes outdated code to
improve maintainability.
- Change return condition in add_watermark method from
'return' to 'nil'.
- Ensure that the method correctly acknowledges the
presence of an existing watermark image, allowing for
further processing if necessary.
This change improves the clarity and functionality of the
add_watermark method by explicitly indicating when no
further action should be taken.
- Removed the limit on City queries in the Ahoy Dashboard
- Updated table_for calls for least popular active and most popular inactive cities to fetch all records instead of limiting to 10
This change allows the dashboard to display all relevant cities without
artificial limits, providing a more comprehensive overview of city
activity. The previous limitations may have hidden important data for
analysis and reporting purposes.
- Remove unused `ruby-vips` gem from Gemfile
- Update Dockerfile to remove `libvips42` package, which is no longer needed
- Comment out legacy watermarking code in `AddWatermarkToWeatherArtWorker`
These changes streamline the dependencies, making the
project lighter and reduce potential security issues with
unused gems and packages. The watermarking functionality is now
commented out for potential future use but is not currently
needed.
- Change table to display cities based on popularity
- Modify button logic to toggle between "停用" (disable) and "激活" (activate) based on current city status
This update improves the usability of the Ahoy Dashboard by providing
clearer management options for city statuses. Users can now easily
activate or deactivate cities from the dashboard, enhancing overall
administrative efficiency.
- Implement a new panel in the Ahoy Dashboard
- Display least popular active cities along with their visit counts
- Include action buttons to toggle city statuses with confirmations
This addition enhances the admin dashboard by providing insights into
city rankings based on user visits. It allows administrators to
manage city statuses directly from the dashboard, improving usability
and functionality.
- Change ordering of previous weather art to use 'id' descending
- Change ordering of next weather art to use 'id' ascending
- Remove unnecessary blank line in seeds file
These changes enhance the consistency of the weather art
navigation by using 'id' for ordering, ensuring the
correct retrieval of records.
- Implement previous and next weather art navigation
- Update weather arts controller to fetch adjacent weather arts
- Modify show view to include navigation links
This update enhances the user experience by allowing users to
navigate through weather arts seamlessly. The previous and
next buttons improve accessibility, providing a smoother
browsing experience. The implementation also accounts for
situations where no adjacent weather arts exist, ensuring
clarity for users.
- Remove unnecessary image tag
- Add city name to weather art title
- Improve image scaling effect
These changes aim to enhance the user experience by providing a clearer and more visually appealing representation of the weather art, including the location it represents.
- Change latest weather art limit from 6 to 20
- Shuffle the collection and display the last 10 items
- Update the section title to reflect the shuffling
This commit enhances the visibility of the latest weather art by
increasing the limit of displayed items. It randomizes the selection
of the latest art pieces for a more dynamic user experience, while the
UI title is updated to clarify this feature. This change improves user
engagement with the content.
- Introduce BATCH_SIZE constant to limit processed cities
- Shuffle and limit eligible cities processing to enhance worker efficiency
This update improves the performance of the BatchGenerateWeatherArtsWorker
by ensuring that only a set number of cities are processed within the
allotted time, reducing the risk of timeouts and making the overall
system more responsive.
- Update image link to use original blob instead of a resized variant
- Remove the resizing option for the image tag for better fidelity
- Modify CSS class for a smoother hover effect without scaling issues
This refactor improves the image loading behavior by allowing
full-resolution images to be loaded directly. The previous resizing
was limiting image quality, and this change enhances user experience
when viewing weather art.
- Change button classes from `btn` to `btn btn-xs` for all pagination buttons
- Ensure consistent styling across all pagination elements
These changes standardize the button sizes in the pagination component, improving the visual uniformity. The adjustment enhances user experience by making the pagination buttons more appropriately sized within the interface, without affecting functionality.
- 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.
- 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.
- Include actual update time in weather report
- Rename watermark worker file for clarity
This commit enhances the weather data report by
updating the format to include the actual update time
retrieved from the weather service API. Additionally,
the watermark worker file has been renamed to improve
readability and consistency in the naming convention.
- Include the image_processing gem to handle image manipulation
- Create a background worker for adding watermarks to weather art images
- Update WeatherArt model to attach watermark images
- Add a new watermark image asset
This commit enhances the WeatherArt feature by allowing images to
have watermarks added asynchronously, improving the visual
presentation of the art. It ensures sufficient image dimensions
before processing and includes error handling for the worker.
- Implement city status toggle functionality in the Ahoy Dashboard
- Add buttons for activating and deactivating cities
- Update the UI to show the current status of cities
This commit enhances the admin dashboard by allowing
administrators to toggle the activation status of cities.
The buttons provide confirmation prompts before executing
state changes, improving user experience and preventing
accidental actions.
- Delete BatchGenerateWeatherArtsJob which queued jobs for generating
weather art for eligible cities.
- Remove CleanAhoyDataJob responsible for cleaning up old Ahoy events
and visits.
- Eliminate GenerateWeatherArtJob that managed the generation
and attachment of weather art images.
- Drop RefreshSitemapJob which created and uploaded XML sitemaps.
These removals suggest a shift in how these functionalities will be
handled, possibly indicating a move towards a different architecture
or integration with another service.
- Update localized_name method to provide a default value for
missing translations
- Modify timezone display in city show view to show a message
when the timezone is undefined
These changes improve user experience by ensuring that the city
localization falls back to the city name itself if a translation
is not found, and they handle potentially missing timezone data
more gracefully.
- Simplify query for most popular inactive cities in City model
- Minor layout changes in Admin Dashboards for Ahoy and Sidekiq tasks
This refactoring improves code organization, reducing complexity in the City model and making it easier to read. Additionally, the Admin dashboard layouts have been simplified for a better user experience.
- Introduce a new admin dashboard for viewing Ahoy statistics.
- Display total visits, event counts, and unique visitors.
- List most popular and least popular active cities with their visit counts.
- Add a panel for recent events.
- Modify existing dashboard to include a section for inactive cities.
This commit introduces a comprehensive dashboard that helps
admin users monitor the traffic and engagement statistics of
various cities. The changes include functionality to show
active and inactive cities based on their popularity,
allowing for better insights into user engagement across
the application.
- Rename task label from 'Batch Generate Weather Arts' to 'Generate Weather Arts' for better understanding.
- Add a new button for manual task execution of 'BatchGenerateWeatherArts'.
- Update task value in form submissions to be more descriptive, enhancing maintainability.
These changes improve the usability of the Sidekiq tasks management interface, making it more intuitive for users to identify and execute tasks. The renamed button and the clear distinction between tasks aim to reduce confusion and assist in better workflow management.