-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add admin interface for feature flags
Currently, the only way to change the values of feature flags is through the database. This is non-ideal. This commit adds a very basic web interface for modifying feature flag configuration.
- Loading branch information
1 parent
229f224
commit e112bb0
Showing
5 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{% extends "h:templates/layouts/admin.html.jinja2" %} | ||
|
||
{% set page_id = 'features' %} | ||
{% set page_title = 'Feature flags' %} | ||
|
||
{% block content %} | ||
<p> | ||
This page allows you to configure various feature flags that change the | ||
behaviour of the application. | ||
</p> | ||
<p> | ||
<strong>N.B.</strong> your changes will take effect immediately when you | ||
save. | ||
</p> | ||
<div class="table-responsive"> | ||
<form method="POST"> | ||
<input | ||
type="hidden" | ||
name="csrf_token" | ||
value="{{ request.session.get_csrf_token() }}"> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th></th> | ||
<th>Everyone</th> | ||
<th>Admins</th> | ||
<th>Staff</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for feat in features %} | ||
<tr> | ||
<td>{{ feat.name }}</td> | ||
<td> | ||
<input | ||
type="checkbox" | ||
name="{{ feat.name }}[everyone]" | ||
{% if feat.everyone %}checked{% endif %}> | ||
</td> | ||
<td> | ||
<input | ||
type="checkbox" | ||
name="{{ feat.name }}[admins]" | ||
{% if feat.admins %}checked{% endif %}> | ||
</td> | ||
<td> | ||
<input | ||
type="checkbox" | ||
name="{{ feat.name }}[staff]" | ||
{% if feat.staff %}checked{% endif %}> | ||
</td> | ||
<td> | ||
{{ feat.description }} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
<input class="btn btn-primary" type="submit" value="Save changes"> | ||
</form> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters