Show More
@@ -637,56 +637,32 b' class DbManage(object):' | |||||
637 |
|
637 | |||
638 | self.create_ui_settings() |
|
638 | self.create_ui_settings() | |
639 |
|
639 | |||
640 | #HG UI OPTIONS |
|
640 | ui_config = [ | |
641 | web1 = RhodeCodeUi() |
|
641 | ('web', 'push_ssl', 'false'), | |
642 | web1.ui_section = 'web' |
|
642 | ('web', 'allow_archive', 'gz zip bz2'), | |
643 | web1.ui_key = 'push_ssl' |
|
643 | ('web', 'allow_push', '*'), | |
644 | web1.ui_value = 'false' |
|
644 | ('web', 'baseurl', '/'), | |
645 |
|
645 | ('paths', '/', path), | ||
646 | web2 = RhodeCodeUi() |
|
646 | #('phases', 'publish', 'false') | |
647 | web2.ui_section = 'web' |
|
647 | ] | |
648 | web2.ui_key = 'allow_archive' |
|
648 | for section,key,value in ui_config: | |
649 | web2.ui_value = 'gz zip bz2' |
|
649 | ui_conf = RhodeCodeUi() | |
650 |
|
650 | setattr(ui_conf, 'ui_section', section) | ||
651 | web3 = RhodeCodeUi() |
|
651 | setattr(ui_conf, 'ui_key', key) | |
652 | web3.ui_section = 'web' |
|
652 | setattr(ui_conf, 'ui_value', value) | |
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 = '/' |
|
|||
660 |
|
653 | |||
661 | paths = RhodeCodeUi() |
|
654 | settings = [ | |
662 | paths.ui_section = 'paths' |
|
655 | ('realm', 'RhodeCode authentication', unicode), | |
663 | paths.ui_key = '/' |
|
656 | ('title', 'RhodeCode', unicode), | |
664 | paths.ui_value = path |
|
657 | ('ga_code', '', unicode), | |
665 |
|
658 | ('show_public_icon', True, bool), | ||
666 | phases = RhodeCodeUi() |
|
659 | ('show_private_icon', True, bool), | |
667 | phases.ui_section = 'phases' |
|
660 | ('stylify_metatags', False, bool), | |
668 | phases.ui_key = 'publish' |
|
661 | ('dashboard_items', 100, int), | |
669 | phases.ui_value = False |
|
662 | ] | |
670 |
|
663 | for key, val, type_ in settings: | ||
671 |
sett |
|
664 | sett = RhodeCodeSetting(key, val) | |
672 | sett2 = RhodeCodeSetting('title', 'RhodeCode') |
|
665 | self.sa.add(sett) | |
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) |
|
|||
690 |
|
666 | |||
691 | self.create_ldap_options() |
|
667 | self.create_ldap_options() | |
692 | self.create_default_options() |
|
668 | self.create_default_options() |
@@ -270,6 +270,11 b' class RhodeCodeUi(Base, BaseModel):' | |||||
270 | ui_value = Column("ui_value", String(255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
270 | ui_value = Column("ui_value", String(255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
271 | ui_active = Column("ui_active", Boolean(), nullable=True, unique=None, default=True) |
|
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 | @classmethod |
|
278 | @classmethod | |
274 | def get_by_key(cls, key): |
|
279 | def get_by_key(cls, key): | |
275 | return cls.query().filter(cls.ui_key == key).scalar() |
|
280 | return cls.query().filter(cls.ui_key == key).scalar() |
General Comments 0
You need to be logged in to leave comments.
Login now