From 9f0be25e760e5f51910479a78e2c785cf74bb6f5 Mon Sep 17 00:00:00 2001 From: Echo Date: Tue, 27 Jan 2026 01:54:22 -0500 Subject: [PATCH] Improve code formatting and indentation (#863) --- app/views/admin/admin_api_keys/index.html.erb | 19 +- app/views/admin/admin_api_keys/new.html.erb | 15 +- app/views/admin/admin_api_keys/show.html.erb | 37 +- .../admin_users/_search_results.html.erb | 29 +- app/views/admin/admin_users/index.html.erb | 82 +-- .../admin/deletion_requests/index.html.erb | 40 +- .../admin/oauth_applications/edit.html.erb | 35 +- .../admin/oauth_applications/index.html.erb | 3 +- app/views/admin/timeline/show.html.erb | 411 +++++------- .../trust_level_audit_logs/index.html.erb | 121 ++-- .../trust_level_audit_logs/show.html.erb | 68 +- app/views/auth_mailer/sign_in_email.html.erb | 14 +- app/views/deletion_requests/show.html.erb | 22 +- app/views/docs/index.html.erb | 81 +-- app/views/docs/show.html.erb | 4 +- .../applications/_delete_form.html.erb | 8 +- .../doorkeeper/applications/_form.html.erb | 27 +- .../doorkeeper/applications/index.html.erb | 3 +- .../doorkeeper/applications/show.html.erb | 14 +- .../authorizations/form_post.html.erb | 2 +- .../doorkeeper/authorizations/new.html.erb | 4 +- .../doorkeeper/authorizations/show.html.erb | 3 +- .../_delete_form.html.erb | 4 +- .../authorized_applications/index.html.erb | 4 +- .../verify_email.html.erb | 17 +- app/views/errors/show.html.erb | 12 +- app/views/extensions/index.html.erb | 8 +- app/views/layouts/application.html.erb | 242 +++---- app/views/layouts/doorkeeper/admin.html.erb | 12 +- .../layouts/doorkeeper/application.html.erb | 36 +- app/views/layouts/errors.html.erb | 4 +- app/views/leaderboards/_entries.html.erb | 26 +- .../leaderboards/_mini_leaderboard.html.erb | 38 +- .../_mini_leaderboard_loading.html.erb | 4 +- app/views/leaderboards/index.html.erb | 43 +- .../_archive_modal.html.erb | 21 +- .../_edit_modal.html.erb | 34 +- .../_unarchive_modal.html.erb | 25 +- .../my/project_repo_mappings/edit.html.erb | 20 +- .../my/project_repo_mappings/index.html.erb | 12 +- app/views/profiles/_activity.html.erb | 2 +- app/views/profiles/_languages.html.erb | 2 +- app/views/profiles/_project_cards.html.erb | 10 +- app/views/profiles/_projects.html.erb | 2 +- app/views/profiles/not_found.html.erb | 2 +- app/views/profiles/show.html.erb | 12 +- .../_first_streak_achieved.html.erb | 2 +- .../physical_mail/_mail_sent.html.erb | 2 +- .../user/_coding_session.html.erb | 5 +- .../user/_first_heartbeat.html.erb | 2 +- .../user/_first_signup.html.erb | 2 +- .../user/_started_working.html.erb | 2 +- app/views/sessions/close_window.html.erb | 4 +- app/views/shared/_interval_selector.html.erb | 58 +- app/views/shared/_modal.html.erb | 25 +- app/views/shared/_multi_select.html.erb | 9 +- app/views/shared/_nav.html.erb | 32 +- app/views/shared/_skeleton_loader.html.erb | 7 - app/views/shared/_user_mention.html.erb | 15 +- app/views/shared/_video_on_hover.html.erb | 10 +- .../static_pages/_active_users_graph.html.erb | 5 +- .../static_pages/_activity_graph.html.erb | 36 +- .../_filterable_dashboard.html.erb | 634 +++++++++--------- .../_filterable_dashboard_content.html.erb | 61 +- .../static_pages/_project_durations.html.erb | 43 +- app/views/static_pages/index.html.erb | 47 +- app/views/static_pages/minimal_login.html.erb | 6 +- .../static_pages/what_is_hackatime.html.erb | 85 +-- .../_timezone_leaderboard_toggle.html.erb | 11 +- .../users/_wakatime_config_display.html.erb | 7 +- .../users/_wakatime_mirror_section.html.erb | 10 +- app/views/users/edit.html.erb | 457 +++++-------- app/views/users/wakatime_setup.html.erb | 160 +++-- .../users/wakatime_setup_step_3.html.erb | 219 +++--- .../users/wakatime_setup_step_4.html.erb | 21 +- 75 files changed, 1461 insertions(+), 2150 deletions(-) diff --git a/app/views/admin/admin_api_keys/index.html.erb b/app/views/admin/admin_api_keys/index.html.erb index 14bc665..229f751 100644 --- a/app/views/admin/admin_api_keys/index.html.erb +++ b/app/views/admin/admin_api_keys/index.html.erb @@ -7,9 +7,7 @@

admin api keys

fraud team is gonna foam at the mouth for this shit

- <%= link_to "spawn in a new key", - new_admin_admin_api_key_path, - class: "bg-primary hover:bg-red text-white px-4 py-2 rounded-lg font-medium transition-colors" %> + <%= link_to "spawn in a new key", new_admin_admin_api_key_path, class: "bg-primary hover:bg-red text-white px-4 py-2 rounded-lg font-medium transition-colors" %> @@ -36,7 +34,7 @@
<% if api_key.user.avatar_url %> - + key creator avatar <% end %>
<%= h(api_key.user.display_name) %>
@@ -48,18 +46,11 @@ <%= api_key.created_at.strftime("%b %d, %Y at %I:%M %p") %> - - <%= api_key.token[0..12] %>... - + <%= api_key.token[0..12] %>... - <%= link_to "inspect", - admin_admin_api_key_path(api_key), - class: "text-blue-400 hover:text-blue-300" %> - <%= link_to "nuke", - admin_admin_api_key_path(api_key), - data: { "turbo-method": :delete }, - class: "text-red-400 hover:text-red-300" %> + <%= link_to "inspect", admin_admin_api_key_path(api_key), class: "text-blue-400 hover:text-blue-300" %> + <%= link_to "nuke", admin_admin_api_key_path(api_key), data: { "turbo-method": :delete }, class: "text-red-400 hover:text-red-300" %> <% end %> diff --git a/app/views/admin/admin_api_keys/new.html.erb b/app/views/admin/admin_api_keys/new.html.erb index 79ee5c8..3efbb63 100644 --- a/app/views/admin/admin_api_keys/new.html.erb +++ b/app/views/admin/admin_api_keys/new.html.erb @@ -7,9 +7,7 @@

spawn in a new key

its geting real

- <%= link_to "← get me outta here", - admin_admin_api_keys_path, - class: "text-gray-400 hover:text-white" %> + <%= link_to "← get me outta here", admin_admin_api_keys_path, class: "text-gray-400 hover:text-white" %>
@@ -28,9 +26,7 @@
<%= f.label :name, class: "block text-md font-medium text-white mb-2" %> - <%= f.text_field :name, - placeholder: "put down something good please", - class: "w-full px-3 py-2 bg-darkless rounded text-white focus:border-primary focus:ring-1 focus:ring-primary" %> + <%= f.text_field :name, placeholder: "put down something good please", class: "w-full px-3 py-2 bg-darkless rounded text-white focus:border-primary focus:ring-1 focus:ring-primary" %>
@@ -38,11 +34,8 @@
- <%= link_to "fuck no imma head out", - admin_admin_api_keys_path, - class: "px-4 py-2 text-gray-400 hover:text-white" %> - <%= f.submit "okay lets do this thing", - class: "px-6 py-2 bg-primary hover:bg-red text-white rounded-lg font-medium transition-colors" %> + <%= link_to "fuck no imma head out", admin_admin_api_keys_path, class: "px-4 py-2 text-gray-400 hover:text-white" %> + <%= f.submit "okay lets do this thing", class: "px-6 py-2 bg-primary hover:bg-red text-white rounded-lg font-medium transition-colors" %>
<% end %> diff --git a/app/views/admin/admin_api_keys/show.html.erb b/app/views/admin/admin_api_keys/show.html.erb index 2403cb9..6beaf57 100644 --- a/app/views/admin/admin_api_keys/show.html.erb +++ b/app/views/admin/admin_api_keys/show.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Admin API Key Details" %> +<% content_for :title, 'Admin API Key Details' %>
@@ -7,9 +7,7 @@

lookin at <%= @admin_api_key.name %>

get the deets

- <%= link_to "← Back to API Keys", - admin_admin_api_keys_path, - class: "text-gray-400 hover:text-white" %> + <%= link_to '← Back to API Keys', admin_admin_api_keys_path, class: 'text-gray-400 hover:text-white' %>
@@ -19,23 +17,15 @@
- - <%= @admin_api_key.token[0..20] %>... - + <%= @admin_api_key.token[0..20] %>... <% unless flash[:api_key_token] %> -

- you cant see the full thing again, we showed it when you created it ya doofus -

+

you cant see the full thing again, we showed it when you created it ya doofus

<% end %>
-

- most likely you are not crazy enough to build your own api client but you can use rowan's fraud check tool to use the admin api. -

-

- if you are building your own client, just use the token as a bearer token in the auth header of your requests, check the actual source code for more details. or you could just be normal and use the fraud check tool i already made for you. -

+

most likely you are not crazy enough to build your own api client but you can use rowan's fraud check tool to use the admin api.

+

if you are building your own client, just use the token as a bearer token in the auth header of your requests, check the actual source code for more details. or you could just be normal and use the fraud check tool i already made for you.

@@ -45,13 +35,9 @@ <% if @show_token %>

heres ya key, copy it now!

-

- copy it now, its not gonna be shown again silly -

+

copy it now, its not gonna be shown again silly

- - <%= @admin_api_key.token %> - + <%= @admin_api_key.token %>
<% end %> @@ -76,7 +62,7 @@
-
<%= @admin_api_key.created_at.strftime("%B %d, %Y at %I:%M %p") %>
+
<%= @admin_api_key.created_at.strftime('%B %d, %Y at %I:%M %p') %>
@@ -85,10 +71,7 @@
- <%= link_to "nuke it", - admin_admin_api_key_path(@admin_api_key), - data: { "turbo-method": :delete }, - class: "bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg font-medium transition-colors" %> + <%= link_to 'nuke it', admin_admin_api_key_path(@admin_api_key), data: { 'turbo-method': :delete }, class: 'bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg font-medium transition-colors' %> diff --git a/app/views/admin/admin_users/_search_results.html.erb b/app/views/admin/admin_users/_search_results.html.erb index 74217e5..7eea67a 100644 --- a/app/views/admin/admin_users/_search_results.html.erb +++ b/app/views/admin/admin_users/_search_results.html.erb @@ -7,29 +7,28 @@
<%= user.display_name %> <% if user.admin_level != "default" %> - "> <%= user.admin_level %> <% end %> -
<%= user.slack_uid || "No Slack ID" %>
+
<%= user.slack_uid || 'No Slack ID' %>
- <%= button_to "→ Superadmin", admin_admin_user_path(user, admin_level: "superadmin"), - method: :patch, - class: "px-3 py-1 bg-red-600 hover:bg-red-500 text-white text-sm font-medium rounded transition-colors cursor-pointer" %> - <%= button_to "→ Admin", admin_admin_user_path(user, admin_level: "admin"), - method: :patch, - class: "px-3 py-1 bg-yellow-600 hover:bg-yellow-500 text-white text-sm font-medium rounded transition-colors cursor-pointer" %> - <%= button_to "→ Viewer", admin_admin_user_path(user, admin_level: "viewer"), - method: :patch, - class: "px-3 py-1 bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium rounded transition-colors cursor-pointer" %> + <%= button_to '→ Superadmin', admin_admin_user_path(user, admin_level: 'superadmin'), method: :patch, class: 'px-3 py-1 bg-red-600 hover:bg-red-500 text-white text-sm font-medium rounded transition-colors cursor-pointer' %> + <%= button_to '→ Admin', admin_admin_user_path(user, admin_level: 'admin'), method: :patch, class: 'px-3 py-1 bg-yellow-600 hover:bg-yellow-500 text-white text-sm font-medium rounded transition-colors cursor-pointer' %> + <%= button_to '→ Viewer', admin_admin_user_path(user, admin_level: 'viewer'), method: :patch, class: 'px-3 py-1 bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium rounded transition-colors cursor-pointer' %>
<% end %> diff --git a/app/views/admin/admin_users/index.html.erb b/app/views/admin/admin_users/index.html.erb index 10f5446..090ddac 100644 --- a/app/views/admin/admin_users/index.html.erb +++ b/app/views/admin/admin_users/index.html.erb @@ -7,12 +7,7 @@

Promote

- +
@@ -41,22 +36,13 @@ <% end %> - <%= user.slack_uid || "N/A" %> + <%= user.slack_uid || 'N/A' %> <% if user.id != @current_user_id %>
- <%= button_to "→ Admin", admin_admin_user_path(user, admin_level: "admin"), - method: :patch, - class: "px-3 py-1 bg-yellow-600 hover:bg-yellow-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Demote #{user.display_name} to Admin?" } %> - <%= button_to "→ Viewer", admin_admin_user_path(user, admin_level: "viewer"), - method: :patch, - class: "px-3 py-1 bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Demote #{user.display_name} to Viewer?" } %> - <%= button_to "→ Default", admin_admin_user_path(user, admin_level: "default"), - method: :patch, - class: "px-3 py-1 bg-gray-600 hover:bg-gray-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Remove #{user.display_name}'s admin privileges?" } %> + <%= button_to '→ Admin', admin_admin_user_path(user, admin_level: 'admin'), method: :patch, class: 'px-3 py-1 bg-yellow-600 hover:bg-yellow-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Demote #{user.display_name} to Admin?" } %> + <%= button_to '→ Viewer', admin_admin_user_path(user, admin_level: 'viewer'), method: :patch, class: 'px-3 py-1 bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Demote #{user.display_name} to Viewer?" } %> + <%= button_to '→ Default', admin_admin_user_path(user, admin_level: 'default'), method: :patch, class: 'px-3 py-1 bg-gray-600 hover:bg-gray-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Remove #{user.display_name}'s admin privileges?" } %>
<% else %> Cannot modify yourself @@ -93,21 +79,12 @@ <%= user.display_name %> - <%= user.slack_uid || "N/A" %> + <%= user.slack_uid || 'N/A' %>
- <%= button_to "→ Superadmin", admin_admin_user_path(user, admin_level: "superadmin"), - method: :patch, - class: "px-3 py-1 bg-red-600 hover:bg-red-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Promote #{user.display_name} to Superadmin?" } %> - <%= button_to "→ Viewer", admin_admin_user_path(user, admin_level: "viewer"), - method: :patch, - class: "px-3 py-1 bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Demote #{user.display_name} to Viewer?" } %> - <%= button_to "→ Default", admin_admin_user_path(user, admin_level: "default"), - method: :patch, - class: "px-3 py-1 bg-gray-600 hover:bg-gray-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Remove #{user.display_name}'s admin privileges?" } %> + <%= button_to '→ Superadmin', admin_admin_user_path(user, admin_level: 'superadmin'), method: :patch, class: 'px-3 py-1 bg-red-600 hover:bg-red-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Promote #{user.display_name} to Superadmin?" } %> + <%= button_to '→ Viewer', admin_admin_user_path(user, admin_level: 'viewer'), method: :patch, class: 'px-3 py-1 bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Demote #{user.display_name} to Viewer?" } %> + <%= button_to '→ Default', admin_admin_user_path(user, admin_level: 'default'), method: :patch, class: 'px-3 py-1 bg-gray-600 hover:bg-gray-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Remove #{user.display_name}'s admin privileges?" } %>
@@ -141,21 +118,12 @@ <%= user.display_name %> - <%= user.slack_uid || "N/A" %> + <%= user.slack_uid || 'N/A' %>
- <%= button_to "→ Superadmin", admin_admin_user_path(user, admin_level: "superadmin"), - method: :patch, - class: "px-3 py-1 bg-red-600 hover:bg-red-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Promote #{user.display_name} to Superadmin?" } %> - <%= button_to "→ Admin", admin_admin_user_path(user, admin_level: "admin"), - method: :patch, - class: "px-3 py-1 bg-yellow-600 hover:bg-yellow-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Promote #{user.display_name} to Admin?" } %> - <%= button_to "→ Default", admin_admin_user_path(user, admin_level: "default"), - method: :patch, - class: "px-3 py-1 bg-gray-600 hover:bg-gray-500 text-white text-sm font-medium rounded transition-colors cursor-pointer", - data: { confirm: "Remove #{user.display_name}'s viewer privileges?" } %> + <%= button_to '→ Superadmin', admin_admin_user_path(user, admin_level: 'superadmin'), method: :patch, class: 'px-3 py-1 bg-red-600 hover:bg-red-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Promote #{user.display_name} to Superadmin?" } %> + <%= button_to '→ Admin', admin_admin_user_path(user, admin_level: 'admin'), method: :patch, class: 'px-3 py-1 bg-yellow-600 hover:bg-yellow-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Promote #{user.display_name} to Admin?" } %> + <%= button_to '→ Default', admin_admin_user_path(user, admin_level: 'default'), method: :patch, class: 'px-3 py-1 bg-gray-600 hover:bg-gray-500 text-white text-sm font-medium rounded transition-colors cursor-pointer', data: { confirm: "Remove #{user.display_name}'s viewer privileges?" } %>
@@ -170,29 +138,29 @@ diff --git a/app/views/admin/trust_level_audit_logs/index.html.erb b/app/views/admin/trust_level_audit_logs/index.html.erb index a4fcce2..fafbff8 100644 --- a/app/views/admin/trust_level_audit_logs/index.html.erb +++ b/app/views/admin/trust_level_audit_logs/index.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "admin aboose logs" %> +<% content_for :title, 'admin aboose logs' %>
@@ -10,42 +10,25 @@ <%= form_with url: admin_trust_level_audit_logs_path, method: :get, local: true, class: "space-y-4" do |form| %>
- <%= form.label :user_search, "user lookup", class: "block text-sm font-medium text-gray-300 mb-2" %> - <%= form.text_field :user_search, - value: @user_search, - placeholder: "just put anything here or something", - class: "w-full px-3 py-2 bg-darkless rounded-md text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" %> + <%= form.label :user_search, 'user lookup', class: 'block text-sm font-medium text-gray-300 mb-2' %> + <%= form.text_field :user_search, value: @user_search, placeholder: 'just put anything here or something', class: 'w-full px-3 py-2 bg-darkless rounded-md text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent' %>
- <%= form.label :admin_search, "admin lookup", class: "block text-sm font-medium text-gray-300 mb-2" %> - <%= form.text_field :admin_search, - value: @admin_search, - placeholder: "just put anything here or something", - class: "w-full px-3 py-2 bg-darkless rounded-md text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" %> + <%= form.label :admin_search, 'admin lookup', class: 'block text-sm font-medium text-gray-300 mb-2' %> + <%= form.text_field :admin_search, value: @admin_search, placeholder: 'just put anything here or something', class: 'w-full px-3 py-2 bg-darkless rounded-md text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent' %>
- <%= form.label :trust_level_filter, "filter by trust updates", class: "block text-sm font-medium text-gray-300 mb-2" %> - <%= form.select :trust_level_filter, - options_for_select([ - ['All Changes', 'all'], - ['🔴 Set to Convicted', 'to_convicted'], - ['🟢 Set to Trusted', 'to_trusted'], - ['🟡 Set to Suspected', 'to_suspected'], - ['🔵 Set to Unscored', 'to_unscored'] - ], @trust_level_filter || 'all'), - {}, - { class: "w-full px-3 py-2 bg-darkless rounded-md text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" } %> + <%= form.label :trust_level_filter, 'filter by trust updates', class: 'block text-sm font-medium text-gray-300 mb-2' %> + <%= form.select :trust_level_filter, options_for_select([['All Changes', 'all'], ['🔴 Set to Convicted', 'to_convicted'], ['🟢 Set to Trusted', 'to_trusted'], ['🟡 Set to Suspected', 'to_suspected'], ['🔵 Set to Unscored', 'to_unscored']], @trust_level_filter || 'all'), {}, { class: 'w-full px-3 py-2 bg-darkless rounded-md text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent' } %>
- <%= form.submit "run that shit", class: "bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md font-medium transition-colors" %> - <%= link_to "alt+f4", admin_trust_level_audit_logs_path, class: "bg-gray-600 hover:bg-darkless text-white px-4 py-2 rounded-md font-medium transition-colors" %> - - found <%= @audit_logs.length %> result<%= @audit_logs.length == 1 ? '' : 's' %> - + <%= form.submit 'run that shit', class: 'bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md font-medium transition-colors' %> + <%= link_to 'alt+f4', admin_trust_level_audit_logs_path, class: 'bg-gray-600 hover:bg-darkless text-white px-4 py-2 rounded-md font-medium transition-colors' %> + found <%= @audit_logs.length %> result<%= @audit_logs.length == 1 ? '' : 's' %>
<% end %>
@@ -65,9 +48,7 @@

<% end %>
- <%= link_to "fuckin abort", - admin_trust_level_audit_logs_path, - class: "text-sm bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded" %> + <%= link_to 'fuckin abort', admin_trust_level_audit_logs_path, class: 'text-sm bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded' %> <% end %> @@ -77,31 +58,19 @@ - - - - - - + + + + + + <% @audit_logs.each do |log| %> @@ -122,19 +89,29 @@
<% - previous_emoji = case log.previous_trust_level - when "blue" then "🔵" - when "red" then "🔴" - when "green" then "🟢" - when "yellow" then "🟡" - end + previous_emoji = + case log.previous_trust_level + when 'blue' + '🔵' + when 'red' + '🔴' + when 'green' + '🟢' + when 'yellow' + '🟡' + end - new_emoji = case log.new_trust_level - when "blue" then "🔵" - when "red" then "🔴" - when "green" then "🟢" - when "yellow" then "🟡" - end + new_emoji = + case log.new_trust_level + when 'blue' + '🔵' + when 'red' + '🔴' + when 'green' + '🟢' + when 'yellow' + '🟡' + end %> <%= previous_emoji %> <%= log.previous_trust_level.capitalize %> → @@ -151,17 +128,11 @@
<%= log.changed_by.display_name %> <% if log.changed_by.admin_level == "superadmin" %> - - supa admin - + supa admin <% elsif log.changed_by.admin_level == "admin" %> - - admin - + admin <% elsif log.changed_by.admin_level == "viewer" %> - - viewer - + viewer <% end %>
@@ -177,9 +148,7 @@ <% end %> <% end %> diff --git a/app/views/admin/trust_level_audit_logs/show.html.erb b/app/views/admin/trust_level_audit_logs/show.html.erb index 6f3610f..fa562c2 100644 --- a/app/views/admin/trust_level_audit_logs/show.html.erb +++ b/app/views/admin/trust_level_audit_logs/show.html.erb @@ -4,9 +4,7 @@

looking at a single audit log

- <%= link_to "get me outta here", - admin_trust_level_audit_logs_path, - class: "bg-darkless text-white px-4 py-2 rounded-lg" %> + <%= link_to "get me outta here", admin_trust_level_audit_logs_path, class: "bg-darkless text-white px-4 py-2 rounded-lg" %>
@@ -17,15 +15,11 @@
<%= render "shared/user_mention", user: @audit_log.user %> -
- id: <%= @audit_log.user.id %> -
+
id: <%= @audit_log.user.id %>
- <%= link_to "actions on this goober", - admin_trust_level_audit_logs_path(user_id: @audit_log.user.id), - class: "text-blue-400 hover:text-blue-300" %> + <%= link_to "actions on this goober", admin_trust_level_audit_logs_path(user_id: @audit_log.user.id), class: "text-blue-400 hover:text-blue-300" %>
@@ -37,28 +31,18 @@
<%= render "shared/user_mention", user: @audit_log.changed_by %> <% if @audit_log.changed_by.admin_level == "superadmin" %> - - supa admin - + supa admin <% elsif @audit_log.changed_by.admin_level == "admin" %> - - admin - + admin <% elsif @audit_log.changed_by.admin_level == "viewer" %> - - viewer - + viewer <% end %>
-
- id: <%= @audit_log.changed_by.id %> -
+
id: <%= @audit_log.changed_by.id %>
- <%= link_to "changes by this goober", - admin_trust_level_audit_logs_path(admin_id: @audit_log.changed_by.id), - class: "text-blue-400 hover:text-blue-300" %> + <%= link_to 'changes by this goober', admin_trust_level_audit_logs_path(admin_id: @audit_log.changed_by.id), class: 'text-blue-400 hover:text-blue-300' %>
@@ -71,7 +55,7 @@
- <%= @audit_log.created_at.strftime("%B %d, %Y at %I:%M %p %Z") %> + <%= @audit_log.created_at.strftime('%B %d, %Y at %I:%M %p %Z') %>
@@ -79,12 +63,17 @@
<% - a = case @audit_log.previous_trust_level - when "blue" then "🔵" - when "red" then "🔴" - when "green" then "🟢" - when "yellow" then "🟡" - end + a = + case @audit_log.previous_trust_level + when 'blue' + '🔵' + when 'red' + '🔴' + when 'green' + '🟢' + when 'yellow' + '🟡' + end %> <%= a %> <%= @audit_log.previous_trust_level.capitalize %>
@@ -94,12 +83,17 @@
<% - b = case @audit_log.new_trust_level - when "blue" then "🔵" - when "red" then "🔴" - when "green" then "🟢" - when "yellow" then "🟡" - end + b = + case @audit_log.new_trust_level + when 'blue' + '🔵' + when 'red' + '🔴' + when 'green' + '🟢' + when 'yellow' + '🟡' + end %> <%= b %> <%= @audit_log.new_trust_level.capitalize %>
diff --git a/app/views/auth_mailer/sign_in_email.html.erb b/app/views/auth_mailer/sign_in_email.html.erb index 8fb8d77..1516e74 100644 --- a/app/views/auth_mailer/sign_in_email.html.erb +++ b/app/views/auth_mailer/sign_in_email.html.erb @@ -1,21 +1,15 @@ - +

Welcome back to Hackatime!

-

- Click the link below to sign in to your account: -

+

Click the link below to sign in to your account:

<%= link_to 'Sign in to Hackatime', auth_token_url(@token.token) %>

-

- This link will expire in 30 minutes and can only be used once. -

-

- If you didn't request this email, you can safely ignore it. -

+

This link will expire in 30 minutes and can only be used once.

+

If you didn't request this email, you can safely ignore it.

diff --git a/app/views/deletion_requests/show.html.erb b/app/views/deletion_requests/show.html.erb index 25be7d0..9373a59 100644 --- a/app/views/deletion_requests/show.html.erb +++ b/app/views/deletion_requests/show.html.erb @@ -15,7 +15,8 @@
Status - "> <%= @deletion_request.status.humanize %> @@ -23,29 +24,24 @@
Requested - <%= @deletion_request.requested_at.strftime("%B %d, %Y at %I:%M %p") %> + <%= @deletion_request.requested_at.strftime('%B %d, %Y at %I:%M %p') %>
<% if @deletion_request.pending? %>
-

- Your deletion request is pending approval. During this time, we will review your request and get back to you as soon as possible. -

+

Your deletion request is pending approval. During this time, we will review your request and get back to you as soon as possible.

<% elsif @deletion_request.approved? %>
Deletion Date - <%= @deletion_request.scheduled_deletion_at.strftime("%B %d, %Y") %> + <%= @deletion_request.scheduled_deletion_at.strftime('%B %d, %Y') %> (<%= @deletion_request.days_until_deletion %> days remaining)
-

- Your account will be permanently deleted on <%= @deletion_request.scheduled_deletion_at.strftime("%B %d, %Y") %>. - After deletion, your email address will be retained on file, but all other personal information will be removed or anonymized. -

+

Your account will be permanently deleted on <%= @deletion_request.scheduled_deletion_at.strftime('%B %d, %Y') %>. After deletion, your email address will be retained on file, but all other personal information will be removed or anonymized.

<% end %> @@ -63,11 +59,7 @@ <% end %> <% if @deletion_request.can_be_cancelled? %> - <%= button_to "I changed my mind", - cancel_deletion_path, - method: :delete, - form: { class: "w-full" }, - class: "w-full px-4 py-3 bg-primary hover:bg-red-600 text-white font-medium rounded text-center transition-colors duration-200 cursor-pointer" %> + <%= button_to "I changed my mind", cancel_deletion_path, method: :delete, form: { class: "w-full" }, class: "w-full px-4 py-3 bg-primary hover:bg-red-600 text-white font-medium rounded text-center transition-colors duration-200 cursor-pointer" %> <% else %>
<% end %> diff --git a/app/views/docs/index.html.erb b/app/views/docs/index.html.erb index f3a5e7e..2080d6d 100644 --- a/app/views/docs/index.html.erb +++ b/app/views/docs/index.html.erb @@ -3,26 +3,15 @@
- -

- Welcome to Hackatime -

-

- Tracks your coding time - made by Hack Club -

+

Welcome to Hackatime

+

Tracks your coding time - made by Hack Club

-

- Hackatime is a free tool from Hack Club. It shows you how much time you spend coding. You can see what other Hack Clubbers are building too! -

+

Hackatime is a free tool from Hack Club. It shows you how much time you spend coding. You can see what other Hack Clubbers are building too!

-

- Why we made this: The more time you spend making things, the better you get at building cool projects! -

+

Why we made this: The more time you spend making things, the better you get at building cool projects!

-

- Hackatime is totally free. Anyone can see the code. It's like WakaTime but free and open source. -

+

Hackatime is totally free. Anyone can see the code. It's like WakaTime but free and open source.

🎯 How to Start

@@ -35,15 +24,11 @@
-
- 💡 Tip: The setup page does everything for you. No hard stuff to figure out! -
+
💡 Tip: The setup page does everything for you. No hard stuff to figure out!

🔌 What Code Editors Work

-

- Hackatime works with any editor that has WakaTime. Just add the WakaTime plugin to your editor: -

+

Hackatime works with any editor that has WakaTime. Just add the WakaTime plugin to your editor:

@@ -106,66 +91,32 @@ Not seeing your time? Go to the setup page to check if everything is working.

-

- Have questions? Ask in the Hack Club Slack - (#hackatime-v2 channel) or ask on GitHub. -

+

Have questions? Ask in the Hack Club Slack (#hackatime-v2 channel) or ask on GitHub.

🔧 Supported Editors

-

- Hackatime works with any editor that supports WakaTime. Click on your editor below for setup instructions: -

+

Hackatime works with any editor that supports WakaTime. Click on your editor below for setup instructions:

- <% popular_editors = [ - ['VS Code', 'vs-code'], ['PyCharm', 'pycharm'], ['IntelliJ IDEA', 'intellij-idea'], - ['Sublime Text', 'sublime-text'], ['Vim', 'vim'], ['Neovim', 'neovim'], - ['Android Studio', 'android-studio'], ['Xcode', 'xcode'], ['Unity', 'unity'], - ['Godot', 'godot'], ['Cursor', 'cursor'], ['Zed', 'zed'], - ['Terminal', 'terminal'], ['WebStorm', 'webstorm'], ['Eclipse', 'eclipse'], - ['Emacs', 'emacs'], ['Jupyter', 'jupyter'], ['OnShape', 'onshape'] - ] %> + <% popular_editors = [['VS Code', 'vs-code'], %w[PyCharm pycharm], ['IntelliJ IDEA', 'intellij-idea'], ['Sublime Text', 'sublime-text'], %w[Vim vim], %w[Neovim neovim], ['Android Studio', 'android-studio'], %w[Xcode xcode], %w[Unity unity], %w[Godot godot], %w[Cursor cursor], %w[Zed zed], %w[Terminal terminal], %w[WebStorm webstorm], %w[Eclipse eclipse], %w[Emacs emacs], %w[Jupyter jupyter], %w[OnShape onshape]] %> <% popular_editors.each do |name, slug| %> " class="bg-darkless rounded-lg p-3 hover:bg-primary/75 transition-colors text-center block"> <%= name %>
<%= name %>
<% end %> -
View all 80 supported editors
- <% - # All 80 editors - alphabetically sorted - all_editors = [ - ['Android Studio', 'android-studio'], ['AppCode', 'appcode'], ['Aptana', 'aptana'], ['Arduino IDE', 'arduino-ide'], - ['Azure Data Studio', 'azure-data-studio'], ['Blender', 'blender'], ['Brackets', 'brackets'], ['Brave', 'brave'], - ['C++ Builder', 'c++-builder'], ['Canva', 'canva'], ['Chrome', 'chrome'], ['CLion', 'clion'], - ['Cloud9', 'cloud9'], ['Coda', 'coda'], ['CodeTasty', 'codetasty'], ['Cursor', 'cursor'], - ['DataGrip', 'datagrip'], ['DataSpell', 'dataspell'], ['DBeaver', 'dbeaver'], ['Delphi', 'delphi'], - ['Discord', 'discord'], ['Eclipse', 'eclipse'], ['Edge', 'edge'], ['Emacs', 'emacs'], - ['Eric', 'eric'], ['Excel', 'excel'], ['Figma', 'figma'], ['Firefox', 'firefox'], - ['Gedit', 'gedit'], ['Godot', 'godot'], ['GoLand', 'goland'], ['HBuilder X', 'hbuilder-x'], ['IDA Pro', 'ida-pro'], - ['IntelliJ IDEA', 'intellij-idea'], ['Jupyter', 'jupyter'], ['Kakoune', 'kakoune'], ['Kate', 'kate'], - ['Komodo', 'komodo'], ['Micro', 'micro'], ['MPS', 'mps'], ['Neovim', 'neovim'], - ['NetBeans', 'netbeans'], ['Notepad++', 'notepad++'], ['Nova', 'nova'], ['Obsidian', 'obsidian'], - ['OnShape', 'onshape'], ['Oxygen', 'oxygen'], ['PhpStorm', 'phpstorm'], ['Postman', 'postman'], ['PowerPoint', 'powerpoint'], - ['Processing', 'processing'], ['Pulsar', 'pulsar'], ['PyCharm', 'pycharm'], ['ReClassEx', 'reclassex'], - ['Rider', 'rider'], ['Roblox Studio', 'roblox-studio'], ['RubyMine', 'rubymine'], ['RustRover', 'rustrover'], - ['Safari', 'safari'], ['SiYuan', 'siyuan'], ['Sketch', 'sketch'], ['SlickEdit', 'slickedit'], - ['SQL Server Management Studio', 'sql-server-management-studio'], ['Sublime Text', 'sublime-text'], - ['Terminal', 'terminal'], ['TeXstudio', 'texstudio'], ['TextMate', 'textmate'], ['Trae', 'trae'], - ['Unity', 'unity'], ['Unreal Engine 4', 'unreal-engine-4'], ['Vim', 'vim'], ['Visual Studio', 'visual-studio'], ['VS Code', 'vs-code'], - ['WebStorm', 'webstorm'], ['Windsurf', 'windsurf'], ['Wing', 'wing'], ['Word', 'word'], - ['Xcode', 'xcode'], ['Zed', 'zed'], ['Swift Playgrounds', 'swift-playgrounds'] - ].sort_by { |editor| editor[0] } - %> + <% + # All 80 editors - alphabetically sorted + all_editors = [['Android Studio', 'android-studio'], %w[AppCode appcode], %w[Aptana aptana], ['Arduino IDE', 'arduino-ide'], ['Azure Data Studio', 'azure-data-studio'], %w[Blender blender], %w[Brackets brackets], %w[Brave brave], ['C++ Builder', 'c++-builder'], %w[Canva canva], %w[Chrome chrome], %w[CLion clion], %w[Cloud9 cloud9], %w[Coda coda], %w[CodeTasty codetasty], %w[Cursor cursor], %w[DataGrip datagrip], %w[DataSpell dataspell], %w[DBeaver dbeaver], %w[Delphi delphi], %w[Discord discord], %w[Eclipse eclipse], %w[Edge edge], %w[Emacs emacs], %w[Eric eric], %w[Excel excel], %w[Figma figma], %w[Firefox firefox], %w[Gedit gedit], %w[Godot godot], %w[GoLand goland], ['HBuilder X', 'hbuilder-x'], ['IDA Pro', 'ida-pro'], ['IntelliJ IDEA', 'intellij-idea'], %w[Jupyter jupyter], %w[Kakoune kakoune], %w[Kate kate], %w[Komodo komodo], %w[Micro micro], %w[MPS mps], %w[Neovim neovim], %w[NetBeans netbeans], %w[Notepad++ notepad++], %w[Nova nova], %w[Obsidian obsidian], %w[OnShape onshape], %w[Oxygen oxygen], %w[PhpStorm phpstorm], %w[Postman postman], %w[PowerPoint powerpoint], %w[Processing processing], %w[Pulsar pulsar], %w[PyCharm pycharm], %w[ReClassEx reclassex], %w[Rider rider], ['Roblox Studio', 'roblox-studio'], %w[RubyMine rubymine], %w[RustRover rustrover], %w[Safari safari], %w[SiYuan siyuan], %w[Sketch sketch], %w[SlickEdit slickedit], ['SQL Server Management Studio', 'sql-server-management-studio'], ['Sublime Text', 'sublime-text'], %w[Terminal terminal], %w[TeXstudio texstudio], %w[TextMate textmate], %w[Trae trae], %w[Unity unity], ['Unreal Engine 4', 'unreal-engine-4'], %w[Vim vim], ['Visual Studio', 'visual-studio'], ['VS Code', 'vs-code'], %w[WebStorm webstorm], %w[Windsurf windsurf], %w[Wing wing], %w[Word word], %w[Xcode xcode], %w[Zed zed], ['Swift Playgrounds', 'swift-playgrounds']].sort_by { |editor| editor[0] } + %> <% all_editors.each do |name, slug| %> " class="bg-darkless rounded p-2 hover:bg-primary/75 transition-colors text-center block"> <%= name %> @@ -180,9 +131,7 @@

Found an issue with the docs? - - Edit on GitHub - - we'd love your help making them better! + Edit on GitHub - we'd love your help making them better!

diff --git a/app/views/docs/show.html.erb b/app/views/docs/show.html.erb index ae0406f..d551804 100644 --- a/app/views/docs/show.html.erb +++ b/app/views/docs/show.html.erb @@ -44,7 +44,6 @@ } .prose a:hover { color: var(--color-red) !important; - } <% end %> @@ -65,7 +64,8 @@ <% end %> <% end %> -
<%= form_tag oauth_application_path(application), method: :delete, class: submit_btn_css == 'danger' ? 'w-full' : 'inline' do %> <% if submit_btn_css == 'danger' %> - <% else %> - <% end %> diff --git a/app/views/doorkeeper/authorizations/show.html.erb b/app/views/doorkeeper/authorizations/show.html.erb index ac6297d..d4b1818 100644 --- a/app/views/doorkeeper/authorizations/show.html.erb +++ b/app/views/doorkeeper/authorizations/show.html.erb @@ -11,8 +11,7 @@
<%= params[:code] %> -

<%= application.name %>

-

- Authorized <%= time_ago_in_words(application.created_at) %> ago -

+

Authorized <%= time_ago_in_words(application.created_at) %> ago

diff --git a/app/views/email_verification_mailer/verify_email.html.erb b/app/views/email_verification_mailer/verify_email.html.erb index 9a1b981..26ea243 100644 --- a/app/views/email_verification_mailer/verify_email.html.erb +++ b/app/views/email_verification_mailer/verify_email.html.erb @@ -1,17 +1,8 @@

Verify your email address for Hackatime

-

- Hi <%= h(@user.display_name) %>, -

-

- You've requested to add <%= @verification_request.email %> to your Hackatime account. - Click the link below to verify this email address: -

+

Hi <%= h(@user.display_name) %>,

+

You've requested to add <%= @verification_request.email %> to your Hackatime account. Click the link below to verify this email address:

<%= link_to 'Verify email address', @verification_url %>

-

- This link will expire in 30 minutes and can only be used once. -

-

- If you didn't request this email, you can safely ignore it. -

+

This link will expire in 30 minutes and can only be used once.

+

If you didn't request this email, you can safely ignore it.

diff --git a/app/views/errors/show.html.erb b/app/views/errors/show.html.erb index 51a8278..e514594 100644 --- a/app/views/errors/show.html.erb +++ b/app/views/errors/show.html.erb @@ -9,22 +9,18 @@
- <%= link_to "Go Home", root_path, class: "px-6 py-3 bg-primary text-white rounded-lg font-medium hover:bg-primary/75 transition-colors" %> - + <%= link_to 'Go Home', root_path, class: 'px-6 py-3 bg-primary text-white rounded-lg font-medium hover:bg-primary/75 transition-colors' %> +

If this problem persists, please contact us on - <%= link_to "Slack", "https://hackclub.slack.com", class: "text-primary hover:underline", target: "_blank" %>. + <%= link_to 'Slack', 'https://hackclub.slack.com', class: 'text-primary hover:underline', target: '_blank' %>.

<% if @sentry_event_id.present? %>
-

- Error ID: <%= @sentry_event_id %> -

+

Error ID: <%= @sentry_event_id %>

<% end %>
diff --git a/app/views/extensions/index.html.erb b/app/views/extensions/index.html.erb index 0e03fdf..57f9f48 100644 --- a/app/views/extensions/index.html.erb +++ b/app/views/extensions/index.html.erb @@ -6,14 +6,14 @@

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 %> + <%= 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. Available for windows and mac.

- <%= 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 %> + <%= 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/layouts/application.html.erb b/app/views/layouts/application.html.erb index 61cac55..2a2e272 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ -" data-theme="dark"> + - <%= @page_title || content_for(:title) || "Hackatime" %> + <%= @page_title || content_for(:title) || 'Hackatime' %> @@ -41,124 +41,112 @@ <%= csp_meta_tag %> <% if current_user %> - "> - "> - "> + + + <% end %> <%= yield :head %> <% if request.path == "/" %> - + <% end %> <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %> @@ -171,7 +159,7 @@ <%# Includes all stylesheet files in app/assets/stylesheets %> <%= stylesheet_link_tag :app %> <%= javascript_importmap_tags %> - <%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %> + <%= stylesheet_link_tag 'tailwind', 'data-turbo-track': 'reload' %> <% if Sentry.get_trace_propagation_meta %> <%= sanitize Sentry.get_trace_propagation_meta, tags: %w[meta], attributes: %w[name content] %> <% end %> @@ -179,17 +167,13 @@ <% unless content_for?(:hide_nav) %> - - <%= render "shared/nav" %> + <%= render 'shared/nav' %> <% end %> @@ -198,29 +182,19 @@

- Build <%= link_to Rails.application.config.git_version, Rails.application.config.commit_link, class: "text-inherit underline opacity-80 hover:opacity-100 transition-opacity duration-200" %> - from <%= time_ago_in_words(Rails.application.config.server_start_time) %> ago. + Build <%= link_to Rails.application.config.git_version, Rails.application.config.commit_link, class: 'text-inherit underline opacity-80 hover:opacity-100 transition-opacity duration-200' %> from <%= time_ago_in_words(Rails.application.config.server_start_time) %> ago. <%= pluralize(Heartbeat.recent_count, 'heartbeat') %> - (<%= Heartbeat.recent_imported_count %> imported) - in the past 24 hours. - (DB: <%= pluralize(QueryCount::Counter.counter, "query") %>, <%= QueryCount::Counter.counter_cache %> cached) - (CACHE: <%= cache_stats[:hits] %> hits, <%= cache_stats[:misses] %> misses) - (<%= requests_per_second %>) + (<%= Heartbeat.recent_imported_count %> imported) in the past 24 hours. (DB: <%= pluralize(QueryCount::Counter.counter, 'query') %>, <%= QueryCount::Counter.counter_cache %> cached) (CACHE: <%= cache_stats[:hits] %> hits, <%= cache_stats[:misses] %> misses) (<%= requests_per_second %>)

<% if session[:impersonater_user_id] %> - <%= link_to "Stop impersonating", stop_impersonating_path, class: "text-primary font-bold hover:text-red-300 transition-colors duration-200", data: { turbo_prefetch: "false" } %> + <%= link_to 'Stop impersonating', stop_impersonating_path, class: 'text-primary font-bold hover:text-red-300 transition-colors duration-200', data: { turbo_prefetch: 'false' } %> <% end %>
- <%= render "static_pages/active_users_graph", hours: active_users_graph_data %> + <%= render 'static_pages/active_users_graph', hours: active_users_graph_data %>
-
- time - - goober - - change - - goobed by - - why - - link - timegooberchangegoobed bywhylink
- <%= log.created_at.strftime("%b %d, %Y at %I:%M %p") %> + <%= log.created_at.strftime('%b %d, %Y at %I:%M %p') %>
@@ -112,9 +81,7 @@
<%= log.user.display_name %>
-
- ID: <%= log.user.id %> -
+
ID: <%= log.user.id %>
- <%= link_to "the deets", - admin_trust_level_audit_log_path(log), - class: "text-blue-400 hover:text-blue-300" %> + <%= link_to 'the deets', admin_trust_level_audit_log_path(log), class: 'text-blue-400 hover:text-blue-300' %>