Commit Graph

53 Commits

Author SHA1 Message Date
42e0da1aa0 feat: add city and weather art models
- Create City model with attributes: name, country, latitude, longitude, and featured.
- Create WeatherArt model with attributes: weather_date, weather_condition, description, and prompt.
- Add migration files for creating cities and weather arts tables.
- Include fixture files for cities and weather arts for testing.
- Add basic test files for both models.

These changes introduce new models and database tables to support
city and weather art data, enabling future features related to
weather information and city management.
2025-01-17 18:05:42 +08:00
81843f0c08 chore: remove unused jQuery and Bootstrap dependencies
- Deleted the `add_jquery.js` file as jQuery is no longer needed.
- Removed references to Bootstrap from the Gemfile and package.json.
- Updated the application layout to reflect the removal of Bootstrap styles.
- Adjusted the paginator HTML to use a class that aligns with the new styling.

These changes streamline the asset pipeline by eliminating unused libraries,
which can improve load times and reduce potential security vulnerabilities.
The application now relies on alternative styling and JavaScript solutions.
2025-01-17 17:08:07 +08:00
0335ef4ed6 refactor: replace list items with buttons in pagination
- Changed pagination elements from <li> to <button> for better accessibility.
- Updated the paginator structure to use a <div> instead of <ul>.
- Ensured that all pagination links are now buttons, improving the user experience.

These changes enhance the semantic structure of the pagination, making it more intuitive and accessible for users, especially those using assistive technologies.
2025-01-17 15:22:13 +08:00
8c598ce3dc chore: remove flowbite dependency
- Remove Flowbite import from application.js
- Update tailwind.config.js to exclude Flowbite
- Delete package-lock.json to reflect the removal of Flowbite

This commit cleans up the project by removing the Flowbite library, which was previously included but is no longer needed. This helps streamline the codebase and may improve performance.
2025-01-17 15:06:51 +08:00
87e0c2eec6 feat: add theme switching and toast notifications
- Implement theme switching functionality with a new ThemeController
- Add ToastController for displaying notifications
- Update various views for improved layout and styling
- Introduce animations for toast notifications

These changes enhance the user experience by allowing users to switch between light and dark themes and receive feedback through toast notifications. The UI has been improved for better accessibility and aesthetics.
2025-01-17 15:02:25 +08:00
42d8d5ce1d feat: enhance layout responsiveness and style
- Update footer layout to improve styling and center alignment
- Change header theme control from 'synthwave' to 'light'
- Enhance home page layout with hero and background styles
- Refactor user sign-up form with better styling and structure
- Add copyright notice and responsive design to the footer

These changes focus on enhancing the overall user experience with a
more modern layout and improved responsiveness across devices. The
footer now includes copyright information and a cleaner design, while
the sign-up form has additional styling to improve usability.
2025-01-17 00:01:13 +08:00
9ce9feafb7 feat: update layouts and styles
- Update the footer layout to include copyright information and navigation links
- Improve the header layout with a responsive theme switcher
- Configure Tailwind CSS to use light and dark themes

This change enhances the project's user interface and user experience by providing a more visually appealing and responsive design. It includes updates to the footer and header layouts, making it easier for users to navigate the site. Additionally, it configures Tailwind CSS to use light and dark themes, allowing users to customize their experience to suit their preferences.
2025-01-16 21:02:13 +08:00
5456e8ff91 feat: update header layout and add daisyUI
- Refactor header layout from a fixed to a responsive design using
  a navbar component.
- Integrate daisyUI for improved styling and utility classes.
- Ensure that all existing links and dropdown functionalities are
  preserved.
- Modify tailwind.config.js to include daisyUI plugin with
  appropriate theme settings.
- Update package.json to include daisyUI as a dev dependency.

This commit enhances the visual layout and user experience of the
header by making it responsive while streamlining component usage
with daisyUI, which also provides additional UI features.
This change ensures better usability across devices.
2025-01-16 21:02:06 +08:00
cafe820a64 feat: add tailwindcss integration and demo page
- Add tailwindcss-rails gem to Gemfile
- Create application.tailwind.css for Tailwind styles
- Update Procfile.dev for Tailwind CSS watch command
- Add demo action and view for showcasing features
- Update application layout to use Tailwind CSS classes
- Refactor footer and header for improved styling

This commit introduces Tailwind CSS for styling the application, enhancing the UI with utility-first CSS. A new demo page is also added to showcase the application features.
2025-01-16 18:17:08 +08:00
6ebc85c77a chore: update default email in application mailer
- Change default from email to a placeholder value
- This avoids using sensitive environment variables during development

This change ensures that the application does not expose sensitive
information while still allowing for email functionality in a
development environment.
2025-01-09 17:39:27 +08:00
7cf8411afa style: format strings in password resets controller
- Standardize string quotes in the PasswordResetsController
- Ensure consistent formatting for better readability

This commit improves the code style by changing single quotes to double
quotes for string literals in the PasswordResetsController. This change
is purely cosmetic and does not affect the functionality of the code.
2025-01-09 17:22:32 +08:00
f1f5e37d7b fix: improve email activation error handling
- Add logging for successful email delivery
- Implement error handling for email sending failures
- Raise exceptions for further handling

This change improves the robustness of the email activation
process by logging outcomes and handling potential errors,
allowing for better debugging and monitoring of email
notifications.
2025-01-08 18:00:25 +08:00
c130ffef90 fix: change flash message type for errors
- Update flash message from `:error` to `:danger` in the
  user creation process.

This change improves the clarity of the flash message type,
aligning it with Bootstrap's alert system, which uses
`danger` for error notifications. This helps in providing
better user feedback during the registration process.
2025-01-08 17:52:45 +08:00
812073b148 fix: handle user activation email errors
- Wrap the activation email sending in a begin-rescue block
- Log error messages if sending fails
- Provide user feedback with an error message and render the new user form again

This change improves the user experience by handling potential
errors during the user activation email process. If an error
occurs, it logs the issue and informs the user to try again,
preventing confusion and enhancing the robustness of the
registration flow.
2025-01-08 17:46:07 +08:00
a3f6c9770f fix: correct link_to syntax in account activation email
- Updated the link_to helper in the account activation email view
- Changed the order of parameters in edit_account_activation_url

This change corrects the syntax for the link_to method, ensuring
that the activation link is generated properly with the correct
parameters. This fix improves the functionality of the account
activation process for users.
2025-01-08 17:39:46 +08:00
f52155f7be style: clean up account activation email template
- Remove redundant paragraph containing the activation URL
- Keep only the link for activation

This change enhances the clarity of the email template by eliminating
unnecessary elements, making it easier to maintain and understand.
2025-01-08 17:32:10 +08:00
2c7e4970f3 fix: correct account activation link parameter
- Change activation token parameter from `activation_token` to `id` in the account activation link.
- This ensures the link correctly references the user activation token for account activation.
2025-01-08 16:31:08 +08:00
299e930d1a style: format account activation email template
- Remove unnecessary line breaks in the activation link
- Clean up the formatting of the email template

This commit improves the readability of the account activation
email template by removing redundant line breaks and ensuring
consistent formatting. No functional changes were made to the
link or its behavior.
2025-01-08 14:13:45 +08:00
1f2c66300a style: format email link for consistency
- Adjust spacing in the email parameter of the link_to helper
- Ensure consistent formatting in the account activation email

This change improves the readability of the code by ensuring
consistent spacing in the parameters, which can help prevent
errors in future modifications.
2025-01-08 13:59:25 +08:00
eefe9984ac fix: update default from email in ApplicationMailer
- Change default from email to use ENV variable
- Fetch SMTP username from Rails credentials

This change improves the security of the application by avoiding
hardcoded email addresses and allows for easier configuration
across different environments.
2025-01-08 13:30:54 +08:00
32ec61fe00 feat: add password reset functionality
- Implement password reset request and form
- Add user validation and expiration checks
- Create integration tests for password reset process

This commit introduces a complete password reset feature, allowing
users to reset their passwords securely. It includes necessary
validations to ensure the user is valid and the reset token has
not expired. Additionally, integration tests have been added to
verify the functionality and edge cases, enhancing overall
application security and user experience.
2025-01-08 11:44:42 +08:00
8bb7615cb1 fix: correct user activation and password reset logic
- Change `user.send(:activate)` to `user.activate` for clarity.
- Fix typo in email parameter from `emial` to `email` in password reset.
- Update render calls to include status codes for better error handling.
- Modify password reset email method to accept a user parameter.
- Update tests to reflect changes in password reset functionality.

These changes improve the clarity of the user activation process and
ensure that the password reset functionality works correctly with
proper error handling and user feedback.
2025-01-08 10:14:36 +08:00
43d39c3010 feat: add password reset functionality
- Implement PasswordResetsController with new and create actions
- Add views for new and edit password reset forms
- Update routes to include password reset paths
- Create migration to add reset_digest and reset_send_at to users

This commit introduces a complete password reset feature, allowing
users to request a password reset via email. It includes the
necessary controller actions, views, and database schema updates.
The user experience is enhanced with a link to the password reset
form on the login page.
2025-01-07 18:09:44 +08:00
a54ebdbf23 feat: add account activation feature
- Implement AccountActivationsController for activation logic
- Create UserMailer for sending activation emails
- Update SessionsController to handle unactivated users
- Modify UsersController to restrict access to activated users
- Add activation fields to User model and database migration
- Create views for account activation emails
- Add tests for account activation functionality
2025-01-06 18:38:39 +08:00
286ca3419f fix: set unprocessable entity status on login failure
- Change the render method to include a status of
  :unprocessable_entity when the email/password combination
  is invalid.
- This change improves the API response for invalid login
  attempts, allowing clients to better handle errors.
2025-01-06 17:02:17 +08:00
f2c7d02eed feat: add user deletion functionality
- Implement user destroy action in UsersController
- Add admin check for user deletion
- Update user view to include delete link for admins
- Add migration to add admin attribute to users
- Update tests to cover new admin functionality

This commit introduces the ability for admin users to delete
other users from the system. It includes necessary checks to
ensure that only admins can perform this action, along with
updates to the user interface and tests to validate the
new behavior.
2025-01-05 18:27:13 +08:00
022eae3029 feat: add pagination to user index view
- Integrate Kaminari for pagination of users
- Update users_controller to paginate users
- Add pagination views for first, last, next, and previous pages
- Seed database with example users for testing

This commit introduces pagination to the user index view, allowing
for better navigation through large sets of users. The Kaminari gem
is utilized to handle pagination, improving the user experience by
reducing load times and enhancing usability. Additionally, the
seeding script has been updated to create multiple users for
better testing of the pagination feature.
2025-01-05 17:50:33 +08:00
5b7f75b5a8 style: remove unnecessary empty line in SessionsController
This commit removes an empty line in the SessionsController class.

- Improves code readability
- Follows style guidelines for cleaner code
2025-01-05 02:00:20 +08:00
cf76756f55 feat: add user index page and update navigation
- Implement users index action in UsersController
- Create view for displaying all users with gravatar
- Update header to link to users index
- Add styles for user list display

This commit introduces a new feature that allows logged-in users to
view a list of all registered users. It includes necessary
controller actions, view templates, and styling to improve the
user interface.
2025-01-05 01:59:05 +08:00
97c91fc8f3 refactor: simplify user signup view
- Remove unnecessary turbo frame tag from the signup form
- Directly render the form within the column div

This change simplifies the user signup view by removing the
unneeded turbo frame, which was not contributing to the
functionality. The form is now rendered directly, making the
code cleaner and easier to understand.
2025-01-05 01:41:45 +08:00
712cd10894 style: standardize quotation marks and spacing
- Updated single quotes to double quotes for consistency
- Adjusted spacing in array definitions for better readability
- Ensured consistent use of quotes in flash messages and method parameters

These changes enhance the overall code style without altering any functionality.
2025-01-04 10:21:22 +08:00
5ff05c3dc4 fix: allow storing location for head requests
- Update store_location method to handle HEAD requests
- Ensure session forwarding URL is set for both GET and HEAD requests

This change enhances the session management by allowing the
application to store the original URL for HEAD requests,
which is useful for certain types of HTTP interactions.
2025-01-04 10:09:27 +08:00
2b03661431 feat: add user authentication and authorization
- Implement friendly forwarding for user login
- Add correct_user method to ensure users can only edit their own profiles
- Update sessions_controller to handle forwarding URL
- Enhance user controller tests to verify redirection for unauthorized access

These changes improve user experience by allowing users to be redirected
back to their intended page after logging in. Additionally, the new
correct_user method enhances security by preventing users from editing
other users' profiles, ensuring proper authorization checks are in place.
2025-01-03 13:48:59 +08:00
23992ec4b2 feat: add user authentication checks
- Implement before_action to ensure users are logged in
- Add logged_in_user method to handle redirection
- Update user fixture to include new user
- Enhance integration tests to check for login requirement

This commit introduces user authentication checks for the edit and
update actions in the UsersController. It ensures that only logged-in
users can access these actions, improving the security of the
application. Additionally, integration tests have been updated to
verify that users are redirected to the login page if they attempt
to edit or update their information without being logged in.
2025-01-03 11:12:51 +08:00
978c44b682 feat: add user profile editing functionality
- Implemented edit and update actions in UsersController
- Created edit user view and form partial
- Updated user model validation to allow nil password
- Modified header to link to user settings
- Added integration tests for successful and unsuccessful edits

This commit introduces the ability for users to edit their profile
information, including name and email. It also includes validation
updates to allow users to update their profiles without changing
their password. Integration tests ensure that both successful and
unsuccessful edit attempts are handled correctly.
2025-01-03 10:55:42 +08:00
63cebef027 feat: add remember me functionality to login
- Implement remember me checkbox in login form
- Update sessions controller to handle remember me logic
- Enhance session management to prevent session hijacking
- Add tests for remember me functionality

This commit introduces a "Remember me" feature that allows users to
stay logged in across sessions. It includes updates to the login
form, session handling in the controller, and additional tests to
ensure the functionality works as expected. The changes also
improve security by validating session tokens to prevent session
hijacking.
2025-01-02 17:49:06 +08:00
f110f26c0b fix: ensure user logout only if logged in
- Update `destroy` action in `SessionsController` to log out
  only if the user is currently logged in.
- Add a check in the `authenticated?` method of the `User`
  model to return false if `remember_digest` is nil.
- Enhance integration tests to simulate logout in another
  browser session and verify that the logout link is not
  present after logging out.

These changes improve the robustness of the session management
by preventing unnecessary logout attempts and ensuring that
authentication checks are more reliable.
2025-01-02 17:17:09 +08:00
ccd6b02a98 feat: add remember me functionality for user sessions
- Implement remember method in User model to generate and store a remember token
- Update SessionsController to call remember on successful login
- Enhance current_user method to retrieve user from cookies if session is not present
- Add forget method to clear remember token on logout
- Create migration to add remember_digest column to users table
2025-01-02 16:47:26 +08:00
a69a4a5177 fix: correct typos and improve logout link
- Change "Log out" link to use `data: { turbo_method: :delete }`
- Update "Login in" to "Log in" for consistency
- Fix typo in sign-up prompt from "SIgn up now!" to "Sign up now!"
- Ensure proper indentation in error messages partial
- Add turbo frame to user signup form for better performance
- Adjust routes for consistency by adding leading slashes

These changes enhance the user interface by correcting typographical errors and improving the logout functionality. The use of turbo frames in the signup form aims to optimize the user experience during account creation.
2025-01-02 15:17:27 +08:00
d795de6aa1 feat: update asset management and add bundling tools
- Add cssbundling-rails and jsbundling-rails gems for improved
  asset management.
- Create a Procfile for development with separate processes for
  CSS and JS.
- Remove unused jQuery and Bootstrap assets from the
  application.
- Update .gitignore to exclude build artifacts and node_modules.

These changes streamline the asset pipeline, allowing for
better organization and performance in handling CSS and JS
files. The removal of unused assets reduces clutter and
potential conflicts in the asset management process.
2025-01-02 14:45:44 +08:00
bd5c6ae6bb feat: enhance user session management
- Update session creation to use safe navigation operator
- Implement log_out method in SessionsHelper
- Add session reset and login on user creation
- Improve user login tests for better coverage

These changes improve the user session management by ensuring
that the session is handled more safely and efficiently. The
addition of the log_out method centralizes session termination,
while the updated tests ensure that both login and logout
functionality are thoroughly validated.
2025-01-02 11:59:27 +08:00
cd4239ce17 feat: improve responsive header navigation
- Add a toggle button for collapsing the navbar
- Change the structure of the navbar to ensure it is responsive

This enhancement allows the navigation bar to be more user-friendly
on mobile devices, enabling easy access to navigation links while
saving screen space. The toggle button helps in collapsing or
expanding the menu as needed.
2025-01-02 09:11:42 +08:00
8baa51f611 feat(sample): add session and header 2025-01-01 15:44:50 +08:00
9fac43f46d feat: add user registration functionality
- Implement user creation in UsersController
- Add user registration form in new.html.erb
- Create error messages partial for form validation
- Add gravatar helper for user profile
- Update routes to include resources for users
- Introduce integration tests for signup validation

This commit establishes the foundation for user registration, allowing users to sign up with their details and providing feedback on form errors. It enhances the user experience by integrating visual elements like gravatars and error messages.
2024-12-31 16:34:52 +08:00
cd558466be feat: add user registration functionality
- Add User model with validations for name and email
- Implement UsersController with new action for signup
- Create views for user signup and home page
- Update routes to include signup path
- Add bcrypt gem for password security
- Include tests for user model and controller actions

This commit establishes the foundation for user registration in the application, ensuring proper validation and security measures are in place. It also enhances the user experience by providing a dedicated signup page.
2024-12-31 14:20:22 +08:00
02b7393ed4 add some test 2024-12-31 00:37:02 +08:00
2d8a32478c style: reorganize styles into custom.scss
- Moved universal styles, typography, header, and footer styles
  from application.scss to custom.scss for better organization.
- Introduced SCSS variables for colors to enhance maintainability.
- Updated the hover state for the logo and footer links to use
  the new color variable.

This change improves the structure of the stylesheets, making it
more manageable and easier to maintain in the future.
2024-12-30 18:09:54 +08:00
a91fc8f729 feat: add header and footer layout components
- Implement header and footer partials for better layout
- Create a full_title helper method for dynamic page titles
- Update application layout to use new header and footer
- Add typography styles for improved text presentation

These changes enhance the overall structure of the application by
introducing reusable header and footer components, which improves
maintainability. The full_title helper method allows for dynamic
titles across different pages, providing a consistent user
experience. Additionally, typography styles have been added to
improve readability and aesthetics.
2024-12-30 17:54:42 +08:00
12e39e2eb4 import bootstrap 2024-12-30 17:24:18 +08:00
575fb2e2d6 add website struct 2024-12-30 13:23:22 +08:00