mirror of
				https://github.com/TheAnachronism/docspell.git
				synced 2025-11-03 18:00:11 +00:00 
			
		
		
		
	Control what tag categories to use for auto-tagging
This commit is contained in:
		
							
								
								
									
										50
									
								
								modules/webapp/src/main/elm/Data/ListType.elm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								modules/webapp/src/main/elm/Data/ListType.elm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
module Data.ListType exposing
 | 
			
		||||
    ( ListType(..)
 | 
			
		||||
    , all
 | 
			
		||||
    , fromString
 | 
			
		||||
    , label
 | 
			
		||||
    , toString
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
type ListType
 | 
			
		||||
    = Blacklist
 | 
			
		||||
    | Whitelist
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
all : List ListType
 | 
			
		||||
all =
 | 
			
		||||
    [ Blacklist, Whitelist ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
toString : ListType -> String
 | 
			
		||||
toString lt =
 | 
			
		||||
    case lt of
 | 
			
		||||
        Blacklist ->
 | 
			
		||||
            "blacklist"
 | 
			
		||||
 | 
			
		||||
        Whitelist ->
 | 
			
		||||
            "whitelist"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
label : ListType -> String
 | 
			
		||||
label lt =
 | 
			
		||||
    case lt of
 | 
			
		||||
        Blacklist ->
 | 
			
		||||
            "Blacklist"
 | 
			
		||||
 | 
			
		||||
        Whitelist ->
 | 
			
		||||
            "Whitelist"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
fromString : String -> Maybe ListType
 | 
			
		||||
fromString str =
 | 
			
		||||
    case String.toLower str of
 | 
			
		||||
        "blacklist" ->
 | 
			
		||||
            Just Blacklist
 | 
			
		||||
 | 
			
		||||
        "whitelist" ->
 | 
			
		||||
            Just Whitelist
 | 
			
		||||
 | 
			
		||||
        _ ->
 | 
			
		||||
            Nothing
 | 
			
		||||
		Reference in New Issue
	
	Block a user