mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Allow for user specific themes (#5668)
* add migration and basic UI for changing a user's theme * update user themem * use right text on button * load theme based on users' selection * load theme based on users' selection in pwa too * update sample config * delete older theme loading * implement AfterLoad to set users' theme properly * set up default theme when creating a user. This uses the installation wide theme * use flash messages for error * set default theme when creating a user from the cli * fix @lunny review
This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							ea518681d9
						
					
				
				
					commit
					8d2c24f7f9
				
			@@ -42,7 +42,7 @@ import (
 | 
			
		||||
	"github.com/go-macaron/toolbox"
 | 
			
		||||
	"github.com/prometheus/client_golang/prometheus"
 | 
			
		||||
	"github.com/tstranex/u2f"
 | 
			
		||||
	"gopkg.in/macaron.v1"
 | 
			
		||||
	macaron "gopkg.in/macaron.v1"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// NewMacaron initializes Macaron instance.
 | 
			
		||||
@@ -243,6 +243,7 @@ func RegisterRoutes(m *macaron.Macaron) {
 | 
			
		||||
			m.Post("/email", bindIgnErr(auth.AddEmailForm{}), userSetting.EmailPost)
 | 
			
		||||
			m.Post("/email/delete", userSetting.DeleteEmail)
 | 
			
		||||
			m.Post("/delete", userSetting.DeleteAccount)
 | 
			
		||||
			m.Post("/theme", bindIgnErr(auth.UpdateThemeForm{}), userSetting.UpdateUIThemePost)
 | 
			
		||||
		})
 | 
			
		||||
		m.Group("/security", func() {
 | 
			
		||||
			m.Get("", userSetting.Security)
 | 
			
		||||
@@ -292,6 +293,7 @@ func RegisterRoutes(m *macaron.Macaron) {
 | 
			
		||||
		})
 | 
			
		||||
	}, reqSignIn, func(ctx *context.Context) {
 | 
			
		||||
		ctx.Data["PageIsUserSettings"] = true
 | 
			
		||||
		ctx.Data["AllThemes"] = setting.UI.Themes
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	m.Group("/user", func() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user