This commit is contained in:
2022-12-30 16:23:27 +00:00
parent 02776e8478
commit 20da343c54
1304 changed files with 870224 additions and 0 deletions

View File

@ -0,0 +1,25 @@
{#
Automatically increase textarea height to match content to facilitate editing
#}
{% extends 'admin/model/edit.html' %}
{% block head %}
{{ super() }}
<style>
body{
max-width: 80%;
margin: auto;
}
</style>
{% endblock %}
{% block tail %}
{{ super() }}
<script type="application/javascript">
$('textarea').each(function (index) {
this.style.height = "";
this.style.height = this.scrollHeight + "px";
});
</script>
{% endblock %}

View File

@ -0,0 +1,30 @@
{#
Add custom input form so admin can enter a user id to send a newsletter to
Based on https://github.com/flask-admin/flask-admin/issues/974#issuecomment-168215285
#}
{% extends 'admin/model/list.html' %}
{% block model_menu_bar_before_filters %}
<br>
<li id="here" class="form-row">
<input name="user_id"
class="form-control"
placeholder="User ID"
aria-describedby="userID"/>
<input name="to_address"
class="form-control"
placeholder="Specify an address to receive the newsletter for testing"
aria-describedby="Email address"/>
</li>
{% endblock %}
{% block tail %}
{{ super() }}
<script type="application/javascript">
$("input[name='user_id']").appendTo($("#action_form"))
$("input[name='to_address']").appendTo($("#action_form"))
$("#action_form").appendTo($("#here"))
$("#action_form").attr("style", "")
</script>
{% endblock %}