* First draft - all the big changes * Changing some more references to 'internal' * Relocate internal request tests to admin * Relocate internal system tests to admin * Fix trailing space * Test fix * Move queries from internal to admin * Docs updates * Rename internal stimuls controllers to admin (plus docs) * Rename admin layout * Fix routing after rebase * Fixes for latest added admin interfaces * Serviceworker ignore paths
36 lines
949 B
Ruby
36 lines
949 B
Ruby
module Admin
|
||
class WelcomeController < Admin::ApplicationController
|
||
layout "admin"
|
||
|
||
def index
|
||
@daily_threads = Article.where("title LIKE 'Welcome Thread - %'")
|
||
end
|
||
|
||
def create
|
||
welcome_thread = Article.create(
|
||
body_markdown: welcome_thread_content,
|
||
user: User.dev_account,
|
||
)
|
||
redirect_to URI.parse(welcome_thread.path).path + "/edit"
|
||
end
|
||
|
||
private
|
||
|
||
def welcome_thread_content
|
||
<<~HEREDOC
|
||
---
|
||
title: Welcome Thread - v0
|
||
published: false
|
||
description: Introduce yourself to the community!
|
||
tags: welcome
|
||
---
|
||
|
||
Hey there! Welcome to #{ApplicationConfig['COMMUNITY_NAME']}!
|
||
|
||

|
||
|
||
Leave a comment below to introduce yourself to the community!✌️
|
||
HEREDOC
|
||
end
|
||
end
|
||
end
|