diff --git a/app/assets/images/default_banner.jpg b/app/assets/images/default_banner.jpg new file mode 100644 index 0000000..413f2d7 Binary files /dev/null and b/app/assets/images/default_banner.jpg differ diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 0000000..14955fc --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,7 @@ +# app/controllers/users_controller.rb +class UsersController < ApplicationController + + def index + @users = User.all + end +end diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb new file mode 100644 index 0000000..1f722f5 --- /dev/null +++ b/app/views/users/index.html.erb @@ -0,0 +1,42 @@ +
+

User Directory

+ +
+ <% @users.each do |user| %> +
+
+ <% avatar_path = "/avatars/#{user.username}_avatar#{File.extname(user.avatar || '')}" %> + + + <%= link_to user_links_path(user.username), target: "_blank" do %> + <% if File.exist?(Rails.root.join('public' + avatar_path)) %> + <%= image_tag avatar_path, alt: user.email, class: "rounded-full object-cover w-24 h-24 mx-auto" %> + <% elsif user.avatar.present? %> + <%= image_tag user.avatar, alt: user.email, class: "rounded-full object-cover w-24 h-24 mx-auto" %> + <% end %> + <% end %> +
+ + +

+ <%= link_to user.full_name, user_links_path(user.username), target: "_blank", class: "hover:underline" %> +

+

@<%= user.username %>

+ + <% if user.parsed_tags.any? %> +
+ <% user.parsed_tags.each do |tag| %> + <%= tag %> + <% end %> +
+ <% end %> + + <% if user.description.present? %> +
+

<%= user.description %>

+
+ <% end %> +
+ <% end %> +
+
diff --git a/config/routes.rb b/config/routes.rb index cb4eb19..ac25e5c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,9 @@ Rails.application.routes.draw do # Static and more specific routes first - get 'analytics/index' + + # Routes for users directory (static) + resources :users, only: [:index] # Devise routes for user registration devise_for :users, controllers: { @@ -16,6 +18,7 @@ # Health check route get 'up' => 'rails/health#show', as: :rails_health_check + # Routes for waiting lists resources :waiting_lists, only: [:create] # Root route @@ -35,5 +38,5 @@ get '/:username/analytics', to: 'analytics#index', as: :user_analytics # Dynamic user-specific routes must be last to avoid conflicts with static routes - get '/:username(/:theme)', to: 'links#user_links', as: :user_links, constraints: { theme: /retro|win95|win98/ } + get '/:username(/:theme)', to: 'links#user_links', as: :user_links, constraints: { username: /(?!users).*/, theme: /retro|win95|win98/ } end diff --git a/public/404.html b/public/404.html index 2be3af2..42da4a0 100644 --- a/public/404.html +++ b/public/404.html @@ -1,67 +1,22 @@ - + - The page you were looking for doesn't exist (404) - - + + + 404 - Page Not Found + - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

+ +
+

404

+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+ + Return to Homepage + +
+
+ Linkarooie
diff --git a/public/422.html b/public/422.html index c08eac0..fb5986c 100644 --- a/public/422.html +++ b/public/422.html @@ -1,67 +1,21 @@ - + - The change you wanted was rejected (422) - - + + + 422 - Unprocessable Entity + - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

+ +
+

422

+

The request was well-formed but was unable to be followed due to semantic errors.

+ + Return to Homepage + +
+
+ Linkarooie
diff --git a/public/500.html b/public/500.html index 78a030a..1889309 100644 --- a/public/500.html +++ b/public/500.html @@ -1,66 +1,22 @@ - + - We're sorry, but something went wrong (500) - - + + + 500 - Internal Server Error + - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

+ +
+

500

+

Oops! Something went wrong on our end.

+

We're working to fix it. Please try again later.

+ + Return to Homepage + +
+
+ Linkarooie