Browse Source

Changing the default theme also works now.

sh4nks 11 years ago
parent
commit
ca2683966d
2 changed files with 16 additions and 4 deletions
  1. 6 0
      flaskbb/admin/views.py
  2. 10 4
      flaskbb/fixtures/settings.py

+ 6 - 0
flaskbb/admin/views.py

@@ -15,6 +15,7 @@ from flask import (Blueprint, current_app, request, redirect, url_for, flash,
                    __version__ as flask_version)
 from flask.ext.login import current_user
 from flask.ext.plugins import get_plugins_list, get_plugin
+from flask.ext.themes2 import get_themes_list
 
 from flaskbb import __version__ as flaskbb_version
 from flaskbb.forum.forms import UserSearchForm
@@ -66,6 +67,11 @@ def settings(slug=None):
 
     form = SettingsForm()
 
+    if active_group.key == "themes":
+        # get the list with all available themes
+        form.default_theme.choices = [(theme.identifier, theme.name)
+                                      for theme in get_themes_list()]
+
     if form.validate_on_submit():
         for key, value in old_settings.iteritems():
             try:

+ 10 - 4
flaskbb/fixtures/settings.py

@@ -87,10 +87,16 @@ fixture = (
     }),
     ('themes', {
         'name': "Theme Settings",
-        "description": "Change the appearance from your forum.",
+        "description": "Change the appearance for your forum.",
         "settings": (
-            # No settings for changing the theme because we are getting them
-            #  from the extension
-        )
+            ('default_theme', {
+                'value':        "bootstrap3",
+                'value_type':   "text",
+                'input_type':   "choice",
+                'extra':        {'choices': None},
+                'name':         "Default theme",
+                'description':  "Change the default theme for your forum."
+            }),
+        ),
     }),
 )