All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lightningkite.lightningserver.HtmlDefaults.kt Maven / Gradle / Ivy

The newest version!
package com.lightningkite.lightningserver

import com.lightningkite.lightningserver.settings.generalSettings


/**
 * HtmlDefaults Is a place to hold html templates. You can set certain styling and headers here as a template, then call it with content
 * all throughout the server.
 */
object HtmlDefaults {
    /**
     * The logo of the company as an HTML element string.
     */
    var logo: String? by SetOnce { null }
    /**
     * The primary color of the company as a CSS color.
     */
    var primaryColor: String by SetOnce { "red" }

    /**
     * Default HTML wrapper for an HTML page in the system
     */
    var basePage: (content: String) -> String by SetOnce {
        { content ->
            """
            
            
              
                
                ${generalSettings().projectName}
              
              
                $content
              
            
        """.trimIndent()
        }
    }

    /**
     * Default HTML wrapper for an email from the system
     */
    var baseEmail: (content: String) -> String by SetOnce {
        { content ->
            """
            
            
              
                
                
                
                
                
                
              
              
                $content
              
            
        """.trimIndent()
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy