Skip to content

Commit d76a54d

Browse files
committed
Add theme switcher. Because why not.
1 parent 6b3dd9d commit d76a54d

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

cloudbot/web/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def get_template_env():
1919
def get_application():
2020
app = Application([
2121
(r'/', TestHandler),
22-
(r'/factoids/', TestHandler),
23-
(r'/commands/', CommandsHandler),
22+
(r'/factoids/?', TestHandler),
23+
(r'/commands/?', CommandsHandler),
2424
(r"/s/(.*)", StaticFileHandler, {"path": "./cloudbot/web/static"}),
2525
], compress_response=True)
2626
return app

cloudbot/web/templates/commands.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ <h2 id="container">Command List</h2>
1212
<p class="lead">{{ bot_name }} has a large selection of commands that can do all kinds of useful tasks.
1313
Below is an automatically-generated list of every command the bot currently knows.</p>
1414

15-
<div class="alert alert-dismissible alert-warning">
16-
<button type="button" class="close" data-dismiss="alert">×</button>
17-
<h4>Under Construction!</h4>
18-
19-
<p>This page is still under construction, and may provide incorrect data.</p>
20-
</div>
2115
<table class="table table-striped sortable" id="commands">
2216
<thead>
2317
<tr>

cloudbot/web/templates/layout.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
<li class="dropdown">
6060
<a class="glyphicon glyphicon-option-vertical" class="dropdown-toggle" data-toggle="dropdown"
6161
role="button" aria-expanded="false"></a>
62-
<ul class="dropdown-menu" role="menu">
63-
<li><a href="#" class="active">Default Theme</a></li>
62+
<ul class="dropdown-menu" role="menu" id="theme-select">
6463
</ul>
6564
</li>
6665
<li>
@@ -122,11 +121,16 @@ <h4 class="modal-title">About {{ bot_name }}</h4>
122121
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
123122
<script src="/s/js/bootstrap.min.js"></script>
124123
<script src="/s/js/moment.min.js"></script>
124+
<script src="/s/js/jquery.cookie.js"></script>
125+
<script src="/s/js/jquery.bootstrap-theme.js"></script>
125126
<script src="/s/js/bootstrap-sortable.js"></script>
126127
<script>
127128
$(function () {
129+
$('#theme-select').bootstrapThemeSwitcher({'defaultCssFile': '/s/css/bootstrap.min.css', 'excludeBootswatch': 'Paper,Superhero,Simplex,Sandstone,Spacelab'});
130+
$().bootstrapThemeSwitcher('loadThemeFromCookie');
128131
$('[data-toggle="tooltip"]').tooltip();
129132
$('[data-toggle="popover"]').popover();
133+
130134
})
131135
</script>
132136
{% endblock %}

0 commit comments

Comments
 (0)