a #ed @sddlZddlZddlmZddlmZddlmZddlm Z ddl m Z ddl m ZddlmZdd lmZdd lmZed ZGd d d ejZe ejeddddZddZdS)N)Path)signals)models) ColorField)receiver) gettext_lazy)cache)make_template_fragment_key)settingsz app.loggerc@seZdZejdddededdZedededd Zed ed ed d Z ed ededd Z edededd Z edededd Z edededd Z ed ededd Zed ededd Zedededd Zeded ed!d Zed"ed#ed$d Zed%ed&ed'd Zed(ed)ed*d Zejd+d,ed-d.Zejd+d,ed/d.Zejd+d,ed0d.Zejd+d,ed1d.Zejd+d,ed2d.Zd3d4ZGd5d6d6Zd7S)8ThemeFz Name of themeName) max_lengthblanknull help_text verbose_namez#2c3e50zMost text, icons, and borders.ZPrimary)defaultrrz#ffffffz:The main background color, and text color of some buttons.Z Secondaryz#3498dbzNavigation links.ZTertiaryzPrimary button color.zButton Primaryz#95a5a6zDefault button color.zButton Defaultz#e74c3czDelete button color.z Button Dangerz&Background color of the site's header.zHeader Backgroundz$Text and icons in the site's header.zHeader Primaryz#e7e7e7zThe color of most borders.ZBorderz#f7f7f7z0The background color of panels and some borders.Z Highlightz#f39c12z$The border color of warning dialogs.zDialog Warningz#ffcbcbz-The background color of failed notifications.ZFailedz#cbffcdz.The background color of success notifications.ZSuccessTZCSS)rrrzHTML (before header)zHTML (after header)zHTML (after body)z HTML (footer)cCs|jSN)name)selfr/webodm/app/models/theme.py__str__.sz Theme.__str__c@seZdZedZedZdS)z Theme.Metar N)__name__ __module__ __qualname___rverbose_name_pluralrrrrMeta1sr N)rrrr CharFieldrrrprimaryZ secondaryZtertiaryZbutton_primaryZbutton_defaultZ button_dangerZheader_backgroundZheader_primaryborderZ highlightZdialog_warningfailedsuccess TextFieldcssZhtml_before_headerZhtml_after_headerZhtml_after_bodyZ html_footerrr rrrrr s*r theme_post_save)sender dispatch_uidcKs tdSr)update_theme_css)r)instancecreatedkwargsrrrr(5scCstd}t|dS)NZ theme_css)r rdelete)keyrrrr+:sr+)loggingospathlibrdjango.db.modelsr django.dbrZcolorfield.fieldsrdjango.dispatchrdjango.utils.translationrrdjango.core.cacherZdjango.core.cache.utilsr Zwebodmr getLoggerloggerModelr post_saver(r+rrrrs          $