From 0e5436505923f4226fbe1aa7aad8fa5e4f57a312 Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Fri, 21 Nov 2025 18:23:42 -0500 Subject: [PATCH] Add extensions page (#648) --- app/controllers/extensions_controller.rb | 4 ++++ app/helpers/extensions_helper.rb | 2 ++ app/views/extensions/index.html.erb | 19 +++++++++++++++++++ app/views/shared/_nav.html.erb | 13 +++++++++---- config/routes.rb | 2 ++ 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 app/controllers/extensions_controller.rb create mode 100644 app/helpers/extensions_helper.rb create mode 100644 app/views/extensions/index.html.erb diff --git a/app/controllers/extensions_controller.rb b/app/controllers/extensions_controller.rb new file mode 100644 index 0000000..c386b4f --- /dev/null +++ b/app/controllers/extensions_controller.rb @@ -0,0 +1,4 @@ +class ExtensionsController < ApplicationController + def index + end +end diff --git a/app/helpers/extensions_helper.rb b/app/helpers/extensions_helper.rb new file mode 100644 index 0000000..383b12c --- /dev/null +++ b/app/helpers/extensions_helper.rb @@ -0,0 +1,2 @@ +module ExtensionsHelper +end diff --git a/app/views/extensions/index.html.erb b/app/views/extensions/index.html.erb new file mode 100644 index 0000000..022b513 --- /dev/null +++ b/app/views/extensions/index.html.erb @@ -0,0 +1,19 @@ +
+

Extensions

+ These are third-party extensions that can be used with Hackatime. Everything in the list is community made and not guaranteed to work! + +
+
+

Hackatime Desktop

+

Desktop app for Hackatime. Runs on Mac, Windows, and Linux.

+ <%= link_to "Source", "https://github.com/hackclub/hackatime-desktop", class: "text-primary hover:underline", allow_host: true %> | + <%= link_to "Install", "https://github.com/hackclub/hackatime-desktop/releases", class: "text-primary hover:underline", allow_host: true %> +
+
+

Cattatime

+

A Tamagotchi system for Hackatime. Code, fill your cup, and get your pet rewards. Windows only.

+ <%= link_to "Source", "https://github.com/joysudo/catatime/tree/master", class: "text-primary hover:underline", allow_host: true %> | + <%= link_to "Install", "https://github.com/joysudo/catatime/releases/", class: "text-primary hover:underline", allow_host: true %> +
+
+
diff --git a/app/views/shared/_nav.html.erb b/app/views/shared/_nav.html.erb index eee3276..18c2de3 100644 --- a/app/views/shared/_nav.html.erb +++ b/app/views/shared/_nav.html.erb @@ -42,6 +42,11 @@ Docs <% end %> +
+ <%= link_to extensions_path, class: "block px-2 py-1 rounded-lg transition #{current_page?(extensions_path) ? 'bg-primary/50 text-primary' : 'hover:bg-[#23272a]'}", data: { action: "click->nav#clickLink" } do %> + Extensions + <% end %> +
<%= link_to "/what-is-hackatime", class: "block px-2 py-1 rounded-lg transition #{current_page?('/what-is-hackatime') ? 'bg-primary/50 text-primary' : 'hover:bg-[#23272a]'}", data: { action: "click->nav#clickLink" } do %> What is Hackatime? @@ -59,11 +64,11 @@ Docs <% end %>
- <% superadmin_tool(nil, "div") do %> - <%= link_to my_mailing_address_path, class: "block px-2 py-1 rounded-lg transition #{current_page?(my_mailing_address_path) ? 'bg-primary/50 text-primary' : 'hover:bg-[#23272a]'}", data: { action: "click->nav#clickLink" } do %> - Mailing Address +
+ <%= link_to extensions_path, class: "block px-2 py-1 rounded-lg transition #{current_page?(extensions_path) ? 'bg-primary/50 text-primary' : 'hover:bg-[#23272a]'}", data: { action: "click->nav#clickLink" } do %> + Extensions <% end %> - <% end %> +
<%= link_to my_mailroom_path, class: "block px-2 py-1 rounded-lg transition #{current_page?(my_mailroom_path) ? 'bg-primary/50 text-primary' : 'hover:bg-[#23272a]'}", data: { action: "click->nav#clickLink" } do %> Mailroom diff --git a/config/routes.rb b/config/routes.rb index d2f9d46..5a5439a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -15,6 +15,8 @@ Rails.application.routes.draw do root "static_pages#index" + resources :extensions, only: [ :index ] + constraints AdminLevelConstraint.new(:superadmin) do mount GoodJob::Engine => "good_job" mount AhoyCaptain::Engine => "/ahoy_captain"