-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #665 from dadav/feature/plugins_web_page
Add plugins page
- Loading branch information
Showing
7 changed files
with
118 additions
and
13 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
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
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,39 @@ | ||
{% extends "base.html" %} | ||
{% set active_page = "plugins" %} | ||
|
||
{% block title %} | ||
Plugins | ||
{% endblock %} | ||
|
||
{% block script %} | ||
$(function(){ | ||
$("input[type=checkbox]").change(function(e) { | ||
var checkbox = $(this); | ||
var form = checkbox.closest("form"); | ||
var url = form.attr('action'); | ||
|
||
$.ajax({ | ||
type: "POST", | ||
url: url, | ||
data: form.serialize(), | ||
success: function(data) { | ||
if( data.indexOf('failed') != -1 ) { | ||
alert('Could not be toggled.'); | ||
} | ||
} | ||
}); | ||
}); | ||
}); | ||
{% endblock %} | ||
{% block content %} | ||
<div style="padding: 1em"> | ||
{% for name in database.keys() %} | ||
<h4>{{name}}</h4> | ||
<form method="POST" action="/plugins/toggle"> | ||
<input type="checkbox" data-role="flipswitch" name="enabled" id="flip-checkbox-{{name}}" data-on-text="Enabled" data-off-text="Disabled" data-wrapper-class="custom-size-flipswitch" {% if name in loaded %} checked {% endif %}> | ||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> | ||
<input type="hidden" name="plugin" value="{{ name }}"/> | ||
</form> | ||
{% endfor %} | ||
</div> | ||
{% endblock %} |