* Remove obsolete SiteConfig values * Remove DUS * fixup! Remove obsolete SiteConfig values * fixup! Remove obsolete SiteConfig values * Add DUS for removing SiteConfig values * Fix specs * Fix specs * Clean up more DUS * Update DUS * Fix remaining spec * Remove leftover spec * Fix more specs * Fix spec * Remove deprecated spec * Rearrange specs * Temporarily disable specs
36 lines
948 B
Ruby
36 lines
948 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 #{Settings::Community.community_name}!
|
||
|
||

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