Merge branch 'main' into expand-activity-columns

This commit is contained in:
Jorge Manrubia
2025-11-21 10:25:39 +01:00
71 changed files with 1063 additions and 262 deletions
+20
View File
@@ -0,0 +1,20 @@
class Admin::StatsController < AdminController
disallow_account_scope
layout "public"
def show
@accounts_total = Account.count
@accounts_last_7_days = Account.where(created_at: 7.days.ago..).count
@accounts_last_24_hours = Account.where(created_at: 24.hours.ago..).count
@identities_total = Identity.count
@identities_last_7_days = Identity.where(created_at: 7.days.ago..).count
@identities_last_24_hours = Identity.where(created_at: 24.hours.ago..).count
@top_accounts = Account
.where("cards_count > 0")
.order(cards_count: :desc)
.limit(20)
end
end
+1 -1
View File
@@ -22,7 +22,7 @@ module Authorization
end
def ensure_staff
head :forbidden unless Current.user.staff?
head :forbidden unless Current.identity.staff?
end
def ensure_can_access_account
+6 -2
View File
@@ -29,10 +29,14 @@ class JoinCodesController < ApplicationController
private
def set_join_code
@join_code ||= Account::JoinCode.active.find_by(code: params.expect(:code), account: Current.account)
@join_code ||= Account::JoinCode.find_by(code: params.expect(:code), account: Current.account)
end
def ensure_join_code_is_valid
head :not_found unless @join_code&.active?
if @join_code.nil?
head :not_found
elsif !@join_code.active?
render :inactive, status: :gone
end
end
end
+1 -1
View File
@@ -1,6 +1,6 @@
class My::PinsController < ApplicationController
def index
@pins = Current.user.pins.includes(:card).ordered.limit(20)
fresh_when @pins
fresh_when etag: [ @pins, @pins.collect(&:card) ]
end
end
+1 -1
View File
@@ -1,6 +1,6 @@
class SessionsController < ApplicationController
# FIXME: Remove this before launch!
if Rails.env.remote?
unless Rails.env.local?
http_basic_authenticate_with \
name: Rails.application.credentials.account_signup_http_basic_auth.name,
password: Rails.application.credentials.account_signup_http_basic_auth.password,