Add setting to manage visibility of vote count, vote button and decide root page (#197)

This commit is contained in:
Riccardo Graziosi
2023-02-05 11:55:38 +01:00
committed by GitHub
parent d4242dd78e
commit e7335f5622
35 changed files with 246 additions and 48 deletions

View File

@@ -1,14 +1,19 @@
class StaticPagesController < ApplicationController
skip_before_action :load_tenant_data, only: [:showcase, :pending_tenant, :blocked_tenant]
def roadmap
@post_statuses = PostStatus
.find_roadmap
.select(:id, :name, :color)
def root
@board = Board.find_by(id: Current.tenant.tenant_setting.root_board_id)
@posts = Post
.find_with_post_status_in(@post_statuses)
.select(:id, :title, :board_id, :post_status_id, :user_id, :created_at)
if @board
render 'boards/show'
else
get_roadmap_data
render 'static_pages/roadmap'
end
end
def roadmap
get_roadmap_data
end
def showcase
@@ -20,4 +25,16 @@ class StaticPagesController < ApplicationController
def blocked_tenant
end
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
end