-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathimport.html
More file actions
110 lines (108 loc) · 4.63 KB
/
Copy pathimport.html
File metadata and controls
110 lines (108 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{% extends "saas/base_dashboard.html" %}
{% block saas_title %}{% trans %}Add offline transaction{% endtrans %}{% endblock %}
{% block saas_page_layout %}
<import-transaction id="import-transaction-container" inline-template>
<div class="offset-md-3 col-md-6">
<form class="form-horizontal" method="post" @submit.prevent="addPayment">
<input type="hidden" name="csrfmiddlewaretoken" value="{{csrf_token}}">
<fieldset>
<div class="form-group{% if form.subscription.errors %} has-error{% endif %}">
<label class="col-form-label" for="subscription">
{% trans %}Subscription{% endtrans %}
</label>
<subscription-typeahead inline-template ref="subscription"
data-url="{{urls.provider.api_subscribers_active}}"
v-on:selectitem="updateItemSelected">
<div>
<div class="input-group mb-3">
<!-- optional indicators -->
<span class="input-group-text">
<i class="fa-solid fa-spinner fa-spin" v-if="loading"></i>
<template v-else>
<i class="fa-solid fa-search" v-show="isEmpty"></i>
<i class="fa-solid fa-times" v-show="isDirty" @click="reset"></i>
</template>
</span>
<!-- the input field -->
<input class="form-control"
type="text"
placeholder="{% trans %}Subscriber name or email{% endtrans %}"
autocomplete="off"
v-model="query"
@keydown.down="down"
@keydown.up="up"
@keydown.enter.prevent="hit"
@blur="clear"
@input="update" />
<!-- the list -->
{# Implementation note: If we use `d-block` instead of #}
{# `style="display: block;"` the dropdown shows even when #}
{# `hasItems` is `False`. #}
<ul class="dropdown-menu nav-pills p-1"
style="display: block;"
v-show="hasItems">
<li v-for="(item, $item) in items" class="nav-item"
@mousedown="hit"
@mousemove="setActive($item)">
<a :class="'nav-link' + activeClass($item)" v-text="item.profile.printable_name + ' - ' + item.plan.title"></a>
</li>
</ul>
</div>
</div>
</subscription-typeahead>
{% for error in form.subscription.errors %}
<span class="form-text"><strong>{{error}}</strong></span>
{% endfor %}
</div>
<div class="form-group">
<label for="created_at" class="d-block">
{% trans %}Created At{% endtrans %}
</label>
{% include "_entry_created_at_field.html" %}
</div>
<div class="form-group{% if form.amount.errors %} has-error{% endif %}">
<label class="col-form-label" for="amount">
{% trans %}Amount{% endtrans %}
</label>
<div class="input-group">
<span class="input-group-text">
[[(itemSelected && itemSelected.plan) ? itemSelected.plan.unit : 'usd']]
</span>
<input class="form-control"
name="amount"
type="number"
min="0" step="any"
placeholder="{% trans %}Amount{% endtrans %}"
v-model="entry.amount">
</div>
{% for error in form.amount.errors %}
<span class="form-text"><strong>{{error}}</strong></span>
{% endfor %}
</div>
<div class="form-group mb-3{% if form.descr.errors %} has-error{% endif %}">
<label class="col-form-label" for="descr">
{% trans %}Description{% endtrans %}
</label>
<div>
<input class="form-control"
name="descr"
type="text"
placeholder="{% trans %}Description{% endtrans %}"
v-model="entry.descr">
{% for error in form.descr.errors %}
<span class="form-text"><strong>{{error}}</strong></span>
{% endfor %}
</div>
</div>
</fieldset>
<div class="form-action text-center">
<div class="d-grid gap-2">
<button class="btn btn-primary" type="submit">
{% trans %}Save{% endtrans %}
</button>
</div>
</div>
</form>
</div>
</import-transaction>
{% endblock %}