2023-05-21 17:59:36 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class DashboardController < ApplicationController
|
2023-06-19 21:44:41 +00:00
|
|
|
skip_before_action :authenticate_user!, only: %i[index]
|
|
|
|
|
|
2023-05-21 17:59:36 +03:00
|
|
|
def index
|
2023-06-19 21:44:41 +00:00
|
|
|
return render 'pages/landing' unless signed_in?
|
|
|
|
|
|
2023-06-28 00:22:34 +03:00
|
|
|
templates = current_account.templates.active.preload(:author).order(id: :desc)
|
|
|
|
|
|
|
|
|
|
@pagy, @templates = pagy(templates, items: 12)
|
2023-05-21 17:59:36 +03:00
|
|
|
end
|
|
|
|
|
end
|