mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-25 03:22:36 +00:00 
			
		
		
		
	This is a PR for #3616 Currently added a new optional config `SLOGAN` in ini file. When this config is set title page is modified in APP_NAME [ - SLOGAN] Example in image below  Add the new config value in the admin settings page (readonly)  ## TODO * [x] Add the possibility to add the `SLOGAN` config from the installation form * [ ] Update https://forgejo.org/docs/next/admin/config-cheat-sheet Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3752 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: mirko <mirko.perillo@gmail.com> Co-committed-by: mirko <mirko.perillo@gmail.com>
		
			
				
	
	
		
			36 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright 2024 The Forgejo Authors. All rights reserved.
 | |
| // SPDX-License-Identifier: MIT
 | |
| 
 | |
| package setting
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	"code.gitea.io/gitea/modules/test"
 | |
| 
 | |
| 	"github.com/stretchr/testify/assert"
 | |
| )
 | |
| 
 | |
| func TestDisplayNameDefault(t *testing.T) {
 | |
| 	defer test.MockVariableValue(&AppName, "Forgejo")()
 | |
| 	defer test.MockVariableValue(&AppSlogan, "Beyond coding. We Forge.")()
 | |
| 	defer test.MockVariableValue(&AppDisplayNameFormat, "{APP_NAME}: {APP_SLOGAN}")()
 | |
| 	displayName := generateDisplayName()
 | |
| 	assert.Equal(t, "Forgejo: Beyond coding. We Forge.", displayName)
 | |
| }
 | |
| 
 | |
| func TestDisplayNameEmptySlogan(t *testing.T) {
 | |
| 	defer test.MockVariableValue(&AppName, "Forgejo")()
 | |
| 	defer test.MockVariableValue(&AppSlogan, "")()
 | |
| 	defer test.MockVariableValue(&AppDisplayNameFormat, "{APP_NAME}: {APP_SLOGAN}")()
 | |
| 	displayName := generateDisplayName()
 | |
| 	assert.Equal(t, "Forgejo", displayName)
 | |
| }
 | |
| 
 | |
| func TestDisplayNameCustomFormat(t *testing.T) {
 | |
| 	defer test.MockVariableValue(&AppName, "Forgejo")()
 | |
| 	defer test.MockVariableValue(&AppSlogan, "Beyond coding. We Forge.")()
 | |
| 	defer test.MockVariableValue(&AppDisplayNameFormat, "{APP_NAME} - {APP_SLOGAN}")()
 | |
| 	displayName := generateDisplayName()
 | |
| 	assert.Equal(t, "Forgejo - Beyond coding. We Forge.", displayName)
 | |
| }
 |