def show_settings(self, name='index'):
     from thememapper.core.model.navigation import _NavigationModel
     from thememapper.core.model.theme import _ThemeModel
     nav = _NavigationModel()
     themes = _ThemeModel(self.settings)
     return render_template('settings/' + name + '.html',
                            nav_items=nav.get_items('settings'),
                            settings=self.settings,
                            themes=themes.get_themes())
Beispiel #2
0
 def show_dashboard(self):
     from thememapper.core.model.theme import _ThemeModel
     themes = _ThemeModel(self.settings).get_themes()
     from thememapper.core.model.navigation import _NavigationModel
     nav_items = _NavigationModel().get_items()
     preview = False
     for theme in themes:
         if theme['active'] and 'preview' in theme:
             preview = theme['preview']
     return render_template('index.html',nav_items=nav_items,settings=self.settings,amount=len(themes),theme=self.settings['theme'],preview=preview)
Beispiel #3
0
 def show_editor(self,name):
     from thememapper.core.model.navigation import _NavigationModel
     nav_items = _NavigationModel().get_items('editor')
     from thememapper.core.model.theme import _ThemeModel
     theme_model = _ThemeModel(self.settings)
     rules = theme_model.get_rules()
     rule_files = theme_model.get_rule_files()
     templates = theme_model.get_templates()
     if name is None:
         return render_template('editor/index.html',nav_items=nav_items,settings=self.settings,rules=rules,rule_files=rule_files,templates=templates)
     return render_template('editor/' + name + '.html',nav_items=nav_items)
Beispiel #4
0
 def show_dashboard(self):
     from thememapper.core.model.theme import _ThemeModel
     themes = _ThemeModel(self.settings).get_themes()
     from thememapper.core.model.navigation import _NavigationModel
     nav_items = _NavigationModel().get_items()
     preview = False
     for theme in themes:
         if theme['active'] and 'preview' in theme:
             preview = theme['preview']
     return render_template('index.html',
                            nav_items=nav_items,
                            settings=self.settings,
                            amount=len(themes),
                            theme=self.settings['theme'],
                            preview=preview)
Beispiel #5
0
 def show_editor(self, name):
     from thememapper.core.model.navigation import _NavigationModel
     nav_items = _NavigationModel().get_items('editor')
     from thememapper.core.model.theme import _ThemeModel
     theme_model = _ThemeModel(self.settings)
     rules = theme_model.get_rules()
     rule_files = theme_model.get_rule_files()
     templates = theme_model.get_templates()
     if name is None:
         return render_template('editor/index.html',
                                nav_items=nav_items,
                                settings=self.settings,
                                rules=rules,
                                rule_files=rule_files,
                                templates=templates)
     return render_template('editor/' + name + '.html', nav_items=nav_items)
Beispiel #6
0
 def save_rules(self, _post):
     from thememapper.core.model.theme import _ThemeModel
     if _ThemeModel(self.settings).save_rules(_post['rules'],
                                              _post['path']):
         return 'Rules saved', 200
     abort(404)
Beispiel #7
0
 def get_rules(self, _post):
     from thememapper.core.model.theme import _ThemeModel
     rules = _ThemeModel(self.settings).get_rules(_post['path'])
     return Response(rules, mimetype='application/xml')
Beispiel #8
0
 def show_settings(self,name='index'):
     from thememapper.core.model.navigation import _NavigationModel
     from thememapper.core.model.theme import _ThemeModel
     nav = _NavigationModel()
     themes = _ThemeModel(self.settings)
     return render_template('settings/' + name + '.html',nav_items=nav.get_items('settings'),settings=self.settings,themes=themes.get_themes())
Beispiel #9
0
 def save_rules(self,_post):
     from thememapper.core.model.theme import _ThemeModel
     if _ThemeModel(self.settings).save_rules(_post['rules'],_post['path']):
         return 'Rules saved', 200
     abort(404)
Beispiel #10
0
 def get_rules(self,_post):
     from thememapper.core.model.theme import _ThemeModel
     rules = _ThemeModel(self.settings).get_rules(_post['path'])
     return Response(rules,mimetype='application/xml')