-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: create config page, add redirect option
- Loading branch information
Showing
8 changed files
with
214 additions
and
151 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends 'admin_panel/base.html' %} | ||
|
||
{% import 'macros/autoform.html' as autoform %} | ||
{% import 'macros/form.html' as form %} | ||
|
||
{% block breadcrumb_content %} | ||
<li>{% link_for _("Global settings"), named_route='mailcraft.config' %}</li> | ||
{% endblock breadcrumb_content %} | ||
|
||
{% block ap_content %} | ||
<h1>{{ _("Mailcraft configuration") }}</h1> | ||
|
||
<form method="POST"> | ||
{% for _, config in configs.items() %} | ||
{% if config.type == "select" %} | ||
{{ form.select(config.key, label=config.label, options=config.options, selected=data[config.key] | o if data else config.value, error=errors[config.key]) }} | ||
{% elif config.type in ("text", "number") %} | ||
{{ form.input(config.key, label=config.label, value=data[config.key] if data else config.value, error=errors[config.key], type=config.type) }} | ||
{% else %} | ||
{{ form.textarea(config.key, label=config.label, value=data[config.key] if data else config.value, error=errors[config.key]) }} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
<button type="submit" class="btn btn-primary">{{ _('Update') }}</button> | ||
</form> | ||
{% endblock ap_content %} |
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
Oops, something went wrong.