##// END OF EJS Templates
Add default for dashbord items and create default...
marcink -
r3909:e87298cc beta
parent child Browse files
Show More
@@ -637,56 +637,32 b' class DbManage(object):'
637 637
638 638 self.create_ui_settings()
639 639
640 #HG UI OPTIONS
641 web1 = RhodeCodeUi()
642 web1.ui_section = 'web'
643 web1.ui_key = 'push_ssl'
644 web1.ui_value = 'false'
645
646 web2 = RhodeCodeUi()
647 web2.ui_section = 'web'
648 web2.ui_key = 'allow_archive'
649 web2.ui_value = 'gz zip bz2'
650
651 web3 = RhodeCodeUi()
652 web3.ui_section = 'web'
653 web3.ui_key = 'allow_push'
654 web3.ui_value = '*'
655
656 web4 = RhodeCodeUi()
657 web4.ui_section = 'web'
658 web4.ui_key = 'baseurl'
659 web4.ui_value = '/'
640 ui_config = [
641 ('web', 'push_ssl', 'false'),
642 ('web', 'allow_archive', 'gz zip bz2'),
643 ('web', 'allow_push', '*'),
644 ('web', 'baseurl', '/'),
645 ('paths', '/', path),
646 #('phases', 'publish', 'false')
647 ]
648 for section,key,value in ui_config:
649 ui_conf = RhodeCodeUi()
650 setattr(ui_conf, 'ui_section', section)
651 setattr(ui_conf, 'ui_key', key)
652 setattr(ui_conf, 'ui_value', value)
660 653
661 paths = RhodeCodeUi()
662 paths.ui_section = 'paths'
663 paths.ui_key = '/'
664 paths.ui_value = path
665
666 phases = RhodeCodeUi()
667 phases.ui_section = 'phases'
668 phases.ui_key = 'publish'
669 phases.ui_value = False
670
671 sett1 = RhodeCodeSetting('realm', 'RhodeCode authentication')
672 sett2 = RhodeCodeSetting('title', 'RhodeCode')
673 sett3 = RhodeCodeSetting('ga_code', '')
674
675 sett4 = RhodeCodeSetting('show_public_icon', True)
676 sett5 = RhodeCodeSetting('show_private_icon', True)
677 sett6 = RhodeCodeSetting('stylify_metatags', False)
678
679 self.sa.add(web1)
680 self.sa.add(web2)
681 self.sa.add(web3)
682 self.sa.add(web4)
683 self.sa.add(paths)
684 self.sa.add(sett1)
685 self.sa.add(sett2)
686 self.sa.add(sett3)
687 self.sa.add(sett4)
688 self.sa.add(sett5)
689 self.sa.add(sett6)
654 settings = [
655 ('realm', 'RhodeCode authentication', unicode),
656 ('title', 'RhodeCode', unicode),
657 ('ga_code', '', unicode),
658 ('show_public_icon', True, bool),
659 ('show_private_icon', True, bool),
660 ('stylify_metatags', False, bool),
661 ('dashboard_items', 100, int),
662 ]
663 for key, val, type_ in settings:
664 sett = RhodeCodeSetting(key, val)
665 self.sa.add(sett)
690 666
691 667 self.create_ldap_options()
692 668 self.create_default_options()
@@ -270,6 +270,11 b' class RhodeCodeUi(Base, BaseModel):'
270 270 ui_value = Column("ui_value", String(255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
271 271 ui_active = Column("ui_active", Boolean(), nullable=True, unique=None, default=True)
272 272
273 # def __init__(self, section='', key='', value=''):
274 # self.ui_section = section
275 # self.ui_key = key
276 # self.ui_value = value
277
273 278 @classmethod
274 279 def get_by_key(cls, key):
275 280 return cls.query().filter(cls.ui_key == key).scalar()
General Comments 0
You need to be logged in to leave comments. Login now