2019-08-19 17:41:47 +02:00
|
|
|
class StaticPagesController < ApplicationController
|
2022-07-18 10:47:54 +02:00
|
|
|
skip_before_action :load_tenant_data, only: [:showcase, :pending_tenant, :blocked_tenant]
|
2024-09-11 19:27:13 +02:00
|
|
|
before_action :allow_iframe_embedding, only: [:embedded_roadmap]
|
2022-07-18 10:47:54 +02:00
|
|
|
|
2023-02-05 11:55:38 +01:00
|
|
|
def root
|
|
|
|
|
@board = Board.find_by(id: Current.tenant.tenant_setting.root_board_id)
|
|
|
|
|
|
|
|
|
|
if @board
|
2024-01-26 17:35:00 +01:00
|
|
|
@page_title = @board.name
|
2023-02-05 11:55:38 +01:00
|
|
|
render 'boards/show'
|
|
|
|
|
else
|
2024-01-26 17:35:00 +01:00
|
|
|
@page_title = t('roadmap.title')
|
2023-02-05 11:55:38 +01:00
|
|
|
get_roadmap_data
|
|
|
|
|
render 'static_pages/roadmap'
|
|
|
|
|
end
|
|
|
|
|
end
|
2019-08-26 14:29:56 +02:00
|
|
|
|
2023-02-05 11:55:38 +01:00
|
|
|
def roadmap
|
2024-01-26 17:35:00 +01:00
|
|
|
@page_title = t('roadmap.title')
|
2023-02-05 11:55:38 +01:00
|
|
|
get_roadmap_data
|
2019-08-19 17:41:47 +02:00
|
|
|
end
|
2022-07-18 10:47:54 +02:00
|
|
|
|
2024-09-11 19:27:13 +02:00
|
|
|
def embedded_roadmap
|
|
|
|
|
@page_title = t('roadmap.title')
|
|
|
|
|
get_roadmap_data
|
|
|
|
|
@is_embedded = true
|
|
|
|
|
|
|
|
|
|
render 'static_pages/roadmap', layout: 'embedded'
|
|
|
|
|
end
|
|
|
|
|
|
2022-07-18 10:47:54 +02:00
|
|
|
def showcase
|
|
|
|
|
render html: 'Showcase home page.'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def pending_tenant
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def blocked_tenant
|
|
|
|
|
end
|
2023-02-05 11:55:38 +01:00
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def get_roadmap_data
|
|
|
|
|
@post_statuses = PostStatus
|
|
|
|
|
.find_roadmap
|
|
|
|
|
.select(:id, :name, :color)
|
|
|
|
|
|
|
|
|
|
@posts = Post
|
|
|
|
|
.find_with_post_status_in(@post_statuses)
|
|
|
|
|
.select(:id, :title, :board_id, :post_status_id, :user_id, :created_at)
|
|
|
|
|
end
|
2024-09-11 19:27:13 +02:00
|
|
|
|
|
|
|
|
def allow_iframe_embedding
|
|
|
|
|
response.headers['X-Frame-Options'] = 'ALLOWALL'
|
|
|
|
|
end
|
2019-08-19 17:41:47 +02:00
|
|
|
end
|