-
-
Notifications
You must be signed in to change notification settings - Fork 964
/
status.html
145 lines (142 loc) · 5.24 KB
/
status.html
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{% load i18n %}
{% load translations %}
{% load humanize %}
{% load icons %}
{% load permissions %}
{% perm 'billing.manage' object as user_can_manage_billing %}
{% with plan=billing.plan %}
<table class="table">
<tr>
<th>{% trans "Current plan" %}</th>
<td>
{{ plan.name }} ({{ billing.get_state_display }})
</td>
<td>
{% if payment_enabled and billing.can_be_paid %}
<a href="{% url 'create-billing' %}?billing={{ billing.pk }}&upgrade=1" class="btn btn-primary pull-right flip">
{% trans "Change plan" %}
</a>
{% endif %}
</td>
</tr>
{% if billing.expiry %}
<tr>
<th>{% trans "Trial expiry date" %}</th>
<td>{{ billing.expiry|naturaltime }}</td>
<td>
{% if user_can_manage_billing %}
<a href="" class="btn btn-primary pull-right flip link-post" data-href="{{ billing.get_absolute_url }}" data-params='{"extend": 1}'>{% trans "Extend trial" %}</a>
{% endif %}
</td>
</tr>
{% endif %}
{% if billing.removal %}
<tr>
<th>{% trans "Scheduled removal" %}</th>
<td>{{ billing.removal|naturaltime }}</td>
<td>
{% if user_can_manage_billing %}
<a href="" class="btn btn-primary pull-right flip link-post" data-href="{{ billing.get_absolute_url }}" data-params='{"extend": 1}'>{% trans "Extend trial" %}</a>
{% endif %}
</td>
</tr>
{% endif %}
<tr>
<th>{% trans "Monthly price" %}</th>
<td>
{{ plan.price|intcomma }} EUR
</td>
<td>
{% if payment_enabled and billing.can_be_paid and plan.price %}
<form class="form-inline" method="post" action="{% url 'create-billing' %}">
{% csrf_token %}
<input type="hidden" name="plan" value="{{ plan.id }}" />
<input type="hidden" name="billing" value="{{ billing.id }}" />
<input type="hidden" name="period" value="m" />
<input type="submit" value="{% trans "New payment" %}" class="btn btn-primary pull-right flip" />
</form>
{% endif %}
</td>
</tr>
<tr>
<th>{% trans "Yearly price" %}</th>
<td>{{ plan.yearly_price|intcomma }} EUR</td>
<td>
{% if payment_enabled and billing.can_be_paid and plan.yearly_price %}
<form class="form-inline" method="post" action="{% url 'create-billing' %}">
{% csrf_token %}
<input type="hidden" name="plan" value="{{ plan.id }}" />
<input type="hidden" name="billing" value="{{ billing.id }}" />
<input type="hidden" name="period" value="y" />
<input type="submit" value="{% trans "New payment" %}" class="btn btn-primary pull-right flip" />
</form>
{% endif %}
</td>
</tr>
{% if plan.display_limit_hosted_strings %}
<tr><th>{% trans "Hosted strings limit" %}</th>
{% include "billing/used.html" with max=plan.limit_hosted_strings total=plan.display_limit_hosted_strings used=billing.count_hosted_strings %}
</tr>
{% endif %}
{% if plan.display_limit_strings %}
<tr><th>{% trans "Strings limit" %}</th>
{% include "billing/used.html" with max=plan.limit_strings total=plan.display_limit_strings used=billing.count_strings %}
</tr>
{% endif %}
{% if plan.display_limit_languages %}
<tr><th>{% trans "Languages limit" %}</th>
{% include "billing/used.html" with max=plan.limit_languages total=plan.display_limit_languages used=billing.count_languages %}
</tr>
{% endif %}
{% if plan.display_limit_project %}
<tr><th>{% trans "Projects limit" %}</th>
{% include "billing/used.html" with max=plan.limit_projects total=plan.display_limit_projects used=billing.all_projects|length %}
</tr>
{% endif %}
<tr><th>{% trans "Last invoice" %}</th>
<td colspan="2">{{ billing.last_invoice }}</td></tr>
{% if billing.all_projects %}
<tr>
<td colspan="3">
{% include "snippets/list-objects.html" with objects=billing.all_projects hide_details=1 %}
</td>
</tr>
{% else %}
<tr>
<th>{% trans "Projects" %}</th>
<td><em>{% trans "No projects currently assigned!" %}</em></td>
<td>
{% if billing.is_active %}
<a class="btn btn-primary billing-add-project pull-right flip" href="{% url 'create-project' %}?billing={{ billing.pk }}">{% trans "Add new translation project" %}</a>
{% endif %}
</td>
</tr>
{% endif %}
{% if user_can_manage_billing %}
<tr>
<th>{% trans "Owners" %}</th>
<td colspan="2">
{% for owner in billing.owners.all %}
<p>
<span class="profile-icon">{% icon "account.svg" %}</span>
<span class="middle-dot-divider">
{{ owner }}
</span>
<span class="middle-dot-divider">
<a href="{{ owner.get_absolute_url }}">@{{ owner.username }}</a>
</span>
<span class="middle-dot-divider">
<a href="mailto:{{ owner.email }}">{{ owner.email }}</a>
</span>
{% if user_can_manage_billing %}
<span class="middle-dot-divider">
<a href="{% url "manage-users-check" %}?email={{ owner.email|urlencode }}">{% trans "Check user access" %}</a>
</span>
{% endif %}
</p>
{% endfor %}
</td>
</tr>
{% endif %}
</table>
{% endwith %}